summaryrefslogtreecommitdiff
path: root/binfilter/bf_xmloff
diff options
context:
space:
mode:
Diffstat (limited to 'binfilter/bf_xmloff')
-rw-r--r--binfilter/bf_xmloff/source/chart/MultiPropertySetHandler.hxx297
-rw-r--r--binfilter/bf_xmloff/source/chart/PropertyMap.hxx225
-rw-r--r--binfilter/bf_xmloff/source/chart/SchXMLAutoStylePoolP.hxx58
-rw-r--r--binfilter/bf_xmloff/source/chart/SchXMLChartContext.hxx161
-rw-r--r--binfilter/bf_xmloff/source/chart/SchXMLParagraphContext.hxx67
-rw-r--r--binfilter/bf_xmloff/source/chart/SchXMLPlotAreaContext.hxx335
-rw-r--r--binfilter/bf_xmloff/source/chart/SchXMLTableContext.hxx205
-rw-r--r--binfilter/bf_xmloff/source/chart/XMLChartPropertyContext.hxx61
-rw-r--r--binfilter/bf_xmloff/source/chart/XMLErrorIndicatorPropertyHdl.hxx51
-rw-r--r--binfilter/bf_xmloff/source/chart/XMLSymbolImageContext.hxx64
-rw-r--r--binfilter/bf_xmloff/source/chart/XMLTextOrientationHdl.hxx51
-rw-r--r--binfilter/bf_xmloff/source/chart/contexts.hxx96
-rw-r--r--binfilter/bf_xmloff/source/chart/makefile.mk61
-rw-r--r--binfilter/bf_xmloff/source/chart/transporttypes.hxx112
-rw-r--r--binfilter/bf_xmloff/source/chart/xmloff_PropertyMaps.cxx515
-rw-r--r--binfilter/bf_xmloff/source/chart/xmloff_SchXMLAutoStylePoolP.cxx90
-rw-r--r--binfilter/bf_xmloff/source/chart/xmloff_SchXMLChartContext.cxx939
-rw-r--r--binfilter/bf_xmloff/source/chart/xmloff_SchXMLExport.cxx2636
-rw-r--r--binfilter/bf_xmloff/source/chart/xmloff_SchXMLImport.cxx556
-rw-r--r--binfilter/bf_xmloff/source/chart/xmloff_SchXMLParagraphContext.cxx80
-rw-r--r--binfilter/bf_xmloff/source/chart/xmloff_SchXMLPlotAreaContext.cxx1472
-rw-r--r--binfilter/bf_xmloff/source/chart/xmloff_SchXMLTableContext.cxx469
-rw-r--r--binfilter/bf_xmloff/source/chart/xmloff_XMLChartPropertyContext.cxx79
-rw-r--r--binfilter/bf_xmloff/source/chart/xmloff_XMLChartStyleContext.cxx123
-rw-r--r--binfilter/bf_xmloff/source/chart/xmloff_XMLErrorIndicatorPropertyHdl.cxx108
-rw-r--r--binfilter/bf_xmloff/source/chart/xmloff_XMLSymbolImageContext.cxx151
-rw-r--r--binfilter/bf_xmloff/source/chart/xmloff_XMLTextOrientationHdl.cxx82
-rw-r--r--binfilter/bf_xmloff/source/chart/xmloff_contexts.cxx150
-rw-r--r--binfilter/bf_xmloff/source/core/makefile.mk82
-rw-r--r--binfilter/bf_xmloff/source/core/xmlenums.hxx60
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_DocumentSettingsContext.cxx890
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_ProgressBarHelper.cxx131
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_PropertySetMerger.cxx265
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_SettingsExportHelper.cxx517
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_XMLBase64Export.cxx101
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_XMLBase64ImportContext.cxx95
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_XMLBasicExportFilter.cxx135
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_XMLEmbeddedObjectExportFilter.cxx180
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_XMLEmbeddedObjectImportContext.cxx347
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_attrlist.cxx241
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_facreg.cxx635
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_i18nmap.cxx132
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_nmspmap.cxx384
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_unoatrcn.cxx305
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_xmlcnitm.cxx221
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_xmlehelp.cxx529
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_xmlerror.cxx247
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_xmlexp.cxx1766
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_xmlictxt.cxx75
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_xmlimp.cxx1326
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_xmlkywd.cxx40
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_xmltkmap.cxx128
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_xmltoken.cxx2166
-rw-r--r--binfilter/bf_xmloff/source/core/xmloff_xmluconv.cxx1810
-rw-r--r--binfilter/bf_xmloff/source/draw/XMLNumberStylesExport.hxx58
-rw-r--r--binfilter/bf_xmloff/source/draw/eventimp.hxx62
-rw-r--r--binfilter/bf_xmloff/source/draw/layerexp.hxx44
-rw-r--r--binfilter/bf_xmloff/source/draw/layerimp.hxx63
-rw-r--r--binfilter/bf_xmloff/source/draw/makefile.mk79
-rw-r--r--binfilter/bf_xmloff/source/draw/numithdl.hxx58
-rw-r--r--binfilter/bf_xmloff/source/draw/propimp0.hxx65
-rw-r--r--binfilter/bf_xmloff/source/draw/sdpropls.hxx277
-rw-r--r--binfilter/bf_xmloff/source/draw/sdxmlexp_impl.hxx197
-rw-r--r--binfilter/bf_xmloff/source/draw/sdxmlimp_impl.hxx299
-rw-r--r--binfilter/bf_xmloff/source/draw/viewcontext.hxx60
-rw-r--r--binfilter/bf_xmloff/source/draw/ximp3dobject.hxx188
-rw-r--r--binfilter/bf_xmloff/source/draw/ximp3dscene.hxx91
-rw-r--r--binfilter/bf_xmloff/source/draw/ximpbody.hxx86
-rw-r--r--binfilter/bf_xmloff/source/draw/ximpgrp.hxx81
-rw-r--r--binfilter/bf_xmloff/source/draw/ximpnote.hxx66
-rw-r--r--binfilter/bf_xmloff/source/draw/ximppage.hxx95
-rw-r--r--binfilter/bf_xmloff/source/draw/ximpshap.hxx560
-rw-r--r--binfilter/bf_xmloff/source/draw/ximpshow.hxx62
-rw-r--r--binfilter/bf_xmloff/source/draw/ximpstyl.hxx286
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_XMLGraphicsDefaultStyle.cxx101
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_XMLImageMapContext.cxx726
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_XMLImageMapExport.cxx384
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_XMLNumberStyles.cxx647
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_XMLShapePropertySetContext.cxx116
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_XMLShapeStyleContext.cxx205
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_animexp.cxx552
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_animimp.cxx699
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_eventimp.cxx475
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_layerexp.cxx95
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_layerimp.cxx133
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_numithdl.cxx66
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_propimp0.cxx223
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_sdpropls.cxx1411
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_sdxmlexp.cxx2641
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_sdxmlimp.cxx1001
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_shapeexport.cxx1056
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_shapeexport2.cxx1584
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_shapeexport3.cxx504
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_shapeimport.cxx1092
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_viewcontext.cxx88
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_xexptran.cxx2943
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_ximp3dobject.cxx615
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_ximp3dscene.cxx498
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_ximpbody.cxx399
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_ximpgrp.cxx129
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_ximpnote.cxx122
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_ximppage.cxx257
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_ximpshap.cxx2813
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_ximpshow.cxx285
-rw-r--r--binfilter/bf_xmloff/source/draw/xmloff_ximpstyl.cxx1490
-rw-r--r--binfilter/bf_xmloff/source/forms/attriblistmerge.hxx88
-rw-r--r--binfilter/bf_xmloff/source/forms/callbacks.hxx167
-rw-r--r--binfilter/bf_xmloff/source/forms/controlelement.hxx96
-rw-r--r--binfilter/bf_xmloff/source/forms/controlpropertyhdl.hxx100
-rw-r--r--binfilter/bf_xmloff/source/forms/controlpropertymap.hxx72
-rw-r--r--binfilter/bf_xmloff/source/forms/elementexport.hxx290
-rw-r--r--binfilter/bf_xmloff/source/forms/elementimport.hxx659
-rw-r--r--binfilter/bf_xmloff/source/forms/elementimport_impl.hxx124
-rw-r--r--binfilter/bf_xmloff/source/forms/eventexport.hxx88
-rw-r--r--binfilter/bf_xmloff/source/forms/eventimport.hxx97
-rw-r--r--binfilter/bf_xmloff/source/forms/formattributes.hxx345
-rw-r--r--binfilter/bf_xmloff/source/forms/formcellbinding.hxx283
-rw-r--r--binfilter/bf_xmloff/source/forms/formenums.hxx79
-rw-r--r--binfilter/bf_xmloff/source/forms/formevents.hxx51
-rw-r--r--binfilter/bf_xmloff/source/forms/formstyles.hxx76
-rw-r--r--binfilter/bf_xmloff/source/forms/ifacecompare.hxx74
-rw-r--r--binfilter/bf_xmloff/source/forms/layerexport.hxx296
-rw-r--r--binfilter/bf_xmloff/source/forms/layerimport.hxx217
-rw-r--r--binfilter/bf_xmloff/source/forms/logging.hxx79
-rw-r--r--binfilter/bf_xmloff/source/forms/makefile.mk71
-rw-r--r--binfilter/bf_xmloff/source/forms/officeforms.hxx109
-rw-r--r--binfilter/bf_xmloff/source/forms/propertyexport.hxx389
-rw-r--r--binfilter/bf_xmloff/source/forms/propertyimport.hxx236
-rw-r--r--binfilter/bf_xmloff/source/forms/strings.hxx264
-rw-r--r--binfilter/bf_xmloff/source/forms/valueproperties.hxx88
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_attriblistmerge.cxx174
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_controlelement.cxx73
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_controlpropertyhdl.cxx329
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_controlpropertymap.cxx149
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_elementexport.cxx1659
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_elementimport.cxx1455
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_eventexport.cxx159
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_eventimport.cxx159
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_formattributes.cxx324
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_formcellbinding.cxx484
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_formenums.cxx274
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_formevents.cxx86
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_formlayerexport.cxx146
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_formlayerimport.cxx134
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_formstyles.cxx68
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_layerexport.cxx719
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_layerimport.cxx597
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_logging.cxx63
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_officeforms.cxx196
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_propertyexport.cxx739
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_propertyimport.cxx503
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_strings.cxx39
-rw-r--r--binfilter/bf_xmloff/source/forms/xmloff_valueproperties.cxx178
-rw-r--r--binfilter/bf_xmloff/source/meta/makefile.mk53
-rw-r--r--binfilter/bf_xmloff/source/meta/xmloff_MetaExportComponent.cxx113
-rw-r--r--binfilter/bf_xmloff/source/meta/xmloff_MetaImportComponent.cxx161
-rw-r--r--binfilter/bf_xmloff/source/meta/xmloff_xmlmetae.cxx496
-rw-r--r--binfilter/bf_xmloff/source/meta/xmloff_xmlmetai.cxx800
-rw-r--r--binfilter/bf_xmloff/source/script/makefile.mk57
-rw-r--r--binfilter/bf_xmloff/source/script/xmlbasici.hxx100
-rw-r--r--binfilter/bf_xmloff/source/script/xmloff_XMLEventExport.cxx310
-rw-r--r--binfilter/bf_xmloff/source/script/xmloff_XMLEventImportHelper.cxx170
-rw-r--r--binfilter/bf_xmloff/source/script/xmloff_XMLEventsImportContext.cxx240
-rw-r--r--binfilter/bf_xmloff/source/script/xmloff_XMLScriptContextFactory.cxx109
-rw-r--r--binfilter/bf_xmloff/source/script/xmloff_XMLScriptExportHandler.cxx82
-rw-r--r--binfilter/bf_xmloff/source/script/xmloff_XMLStarBasicContextFactory.cxx128
-rw-r--r--binfilter/bf_xmloff/source/script/xmloff_XMLStarBasicExportHandler.cxx95
-rw-r--r--binfilter/bf_xmloff/source/script/xmloff_xmlbasici.cxx208
-rw-r--r--binfilter/bf_xmloff/source/script/xmloff_xmlscripti.cxx344
-rw-r--r--binfilter/bf_xmloff/source/style/DrawAspectHdl.hxx50
-rw-r--r--binfilter/bf_xmloff/source/style/FillStyleContext.hxx174
-rw-r--r--binfilter/bf_xmloff/source/style/PageHeaderFooterContext.hxx67
-rw-r--r--binfilter/bf_xmloff/source/style/PageMasterExportPropMapper.hxx83
-rw-r--r--binfilter/bf_xmloff/source/style/PageMasterImportPropMapper.hxx67
-rw-r--r--binfilter/bf_xmloff/source/style/PageMasterPropHdl.hxx186
-rw-r--r--binfilter/bf_xmloff/source/style/PageMasterPropHdlFactory.hxx51
-rw-r--r--binfilter/bf_xmloff/source/style/PageMasterPropMapper.hxx51
-rw-r--r--binfilter/bf_xmloff/source/style/PagePropertySetContext.hxx69
-rw-r--r--binfilter/bf_xmloff/source/style/XMLFootnoteSeparatorExport.hxx65
-rw-r--r--binfilter/bf_xmloff/source/style/XMLFootnoteSeparatorImport.hxx84
-rw-r--r--binfilter/bf_xmloff/source/style/adjushdl.hxx62
-rw-r--r--binfilter/bf_xmloff/source/style/backhdl.hxx59
-rw-r--r--binfilter/bf_xmloff/source/style/bordrhdl.hxx59
-rw-r--r--binfilter/bf_xmloff/source/style/breakhdl.hxx62
-rw-r--r--binfilter/bf_xmloff/source/style/cdouthdl.hxx50
-rw-r--r--binfilter/bf_xmloff/source/style/chrhghdl.hxx68
-rw-r--r--binfilter/bf_xmloff/source/style/chrlohdl.hxx63
-rw-r--r--binfilter/bf_xmloff/source/style/csmaphdl.hxx59
-rw-r--r--binfilter/bf_xmloff/source/style/durationhdl.hxx50
-rw-r--r--binfilter/bf_xmloff/source/style/escphdl.hxx59
-rw-r--r--binfilter/bf_xmloff/source/style/fonthdl.hxx87
-rw-r--r--binfilter/bf_xmloff/source/style/impastpl.hxx217
-rw-r--r--binfilter/bf_xmloff/source/style/kernihdl.hxx50
-rw-r--r--binfilter/bf_xmloff/source/style/lspachdl.hxx68
-rw-r--r--binfilter/bf_xmloff/source/style/makefile.mk132
-rw-r--r--binfilter/bf_xmloff/source/style/opaquhdl.hxx50
-rw-r--r--binfilter/bf_xmloff/source/style/postuhdl.hxx50
-rw-r--r--binfilter/bf_xmloff/source/style/shadwhdl.hxx50
-rw-r--r--binfilter/bf_xmloff/source/style/shdwdhdl.hxx50
-rw-r--r--binfilter/bf_xmloff/source/style/splithdl.hxx50
-rw-r--r--binfilter/bf_xmloff/source/style/tabsthdl.hxx53
-rw-r--r--binfilter/bf_xmloff/source/style/undlihdl.hxx50
-rw-r--r--binfilter/bf_xmloff/source/style/weighhdl.hxx51
-rw-r--r--binfilter/bf_xmloff/source/style/xmlbahdl.hxx249
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_AttributeContainerHandler.cxx105
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_DashStyle.cxx320
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_DrawAspectHdl.cxx122
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_EnumPropertyHdl.cxx115
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_FillStyleContext.cxx366
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_GradientStyle.cxx329
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_HatchStyle.cxx247
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_ImageStyle.cxx207
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_MarkerStyle.cxx275
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_MultiPropertySetHelper.cxx200
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_NamedBoolPropertyHdl.cxx85
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_PageHeaderFooterContext.cxx99
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_PageMasterExportPropMapper.cxx416
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_PageMasterImportContext.cxx178
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_PageMasterImportPropMapper.cxx337
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_PageMasterPropHdl.cxx428
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_PageMasterPropHdlFactory.cxx148
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_PageMasterPropMapper.cxx61
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_PageMasterStyleMap.cxx178
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_PagePropertySetContext.cxx141
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_SinglePropertySetInfoCache.cxx90
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_TransGradientStyle.cxx315
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_VisAreaContext.cxx123
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_XMLBackgroundImageContext.cxx410
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_XMLBackgroundImageExport.cxx171
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_XMLBitmapLogicalSizePropertyHandler.cxx68
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_XMLBitmapRepeatOffsetPropertyHandler.cxx108
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_XMLClipPropertyHandler.cxx138
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_XMLConstantsPropertyHandler.cxx115
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_XMLElementPropertyContext.cxx63
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_XMLFillBitmapSizePropertyHandler.cxx102
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_XMLFontAutoStylePool.cxx289
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_XMLFontStylesContext.cxx279
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_XMLFootnoteSeparatorExport.cxx166
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_XMLFootnoteSeparatorImport.cxx202
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_XMLIsPercentagePropertyHandler.cxx65
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_XMLPageExport.cxx233
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_XMLPercentOrMeasurePropertyHandler.cxx101
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_XMLRectangleMembersHandler.cxx133
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_adjushdl.cxx142
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_backhdl.cxx295
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_bordrhdl.cxx458
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_breakhdl.cxx182
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_cdouthdl.cxx93
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_chrhghdl.cxx171
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_chrlohdl.cxx147
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_csmaphdl.cxx142
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_durationhdl.cxx85
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_escphdl.cxx173
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_fonthdl.cxx321
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_impastp1.cxx135
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_impastp2.cxx65
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_impastp3.cxx148
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_impastp4.cxx369
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_kernihdl.cxx92
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_lspachdl.cxx199
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_numehelp.cxx559
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_opaquhdl.cxx84
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_postuhdl.cxx100
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_prhdlfac.cxx392
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_prstylei.cxx327
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_shadwhdl.cxx178
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_shdwdhdl.cxx87
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_splithdl.cxx83
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_styleexp.cxx413
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_tabsthdl.cxx97
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_undlihdl.cxx108
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_uniref.cxx43
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_weighhdl.cxx182
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_xmlaustp.cxx365
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_xmlbahdl.cxx710
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_xmlexppr.cxx939
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_xmlimppr.cxx584
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_xmlnume.cxx684
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_xmlnumfe.cxx1785
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_xmlnumfi.cxx2274
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_xmlnumi.cxx1173
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_xmlprcon.cxx102
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_xmlprhdl.cxx45
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_xmlprmap.cxx233
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_xmlstyle.cxx1005
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_xmltabe.cxx138
-rw-r--r--binfilter/bf_xmloff/source/style/xmloff_xmltabi.cxx279
-rw-r--r--binfilter/bf_xmloff/source/text/XMLAnchorTypePropHdl.hxx59
-rw-r--r--binfilter/bf_xmloff/source/text/XMLAutoMarkFileContext.hxx69
-rw-r--r--binfilter/bf_xmloff/source/text/XMLCalculationSettingsContext.hxx54
-rw-r--r--binfilter/bf_xmloff/source/text/XMLChangeElementImportContext.hxx92
-rw-r--r--binfilter/bf_xmloff/source/text/XMLChangeImportContext.hxx91
-rw-r--r--binfilter/bf_xmloff/source/text/XMLChangeInfoContext.hxx95
-rw-r--r--binfilter/bf_xmloff/source/text/XMLChangedRegionImportContext.hxx104
-rw-r--r--binfilter/bf_xmloff/source/text/XMLFootnoteBodyImportContext.hxx74
-rw-r--r--binfilter/bf_xmloff/source/text/XMLFootnoteImportContext.hxx104
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx110
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexBibliographyEntryContext.hxx92
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexBibliographySourceContext.hxx82
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexBodyContext.hxx85
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx85
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexIllustrationSourceContext.hxx78
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexMarkExport.hxx121
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexObjectSourceContext.hxx93
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexSimpleEntryContext.hxx101
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexSourceBaseContext.hxx138
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexSpanEntryContext.hxx81
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexTOCContext.hxx115
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexTOCSourceContext.hxx92
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexTOCStylesContext.hxx103
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexTabStopEntryContext.hxx87
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexTableSourceContext.hxx92
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexTemplateContext.hxx165
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexTitleTemplateContext.hxx98
-rw-r--r--binfilter/bf_xmloff/source/text/XMLIndexUserSourceContext.hxx99
-rw-r--r--binfilter/bf_xmloff/source/text/XMLLineNumberingExport.hxx65
-rw-r--r--binfilter/bf_xmloff/source/text/XMLLineNumberingSeparatorImportContext.hxx80
-rw-r--r--binfilter/bf_xmloff/source/text/XMLPropertyBackpatcher.hxx147
-rw-r--r--binfilter/bf_xmloff/source/text/XMLRedlineExport.hxx216
-rw-r--r--binfilter/bf_xmloff/source/text/XMLSectionExport.hxx370
-rw-r--r--binfilter/bf_xmloff/source/text/XMLSectionFootnoteConfigExport.hxx64
-rw-r--r--binfilter/bf_xmloff/source/text/XMLSectionFootnoteConfigImport.hxx84
-rw-r--r--binfilter/bf_xmloff/source/text/XMLSectionImportContext.hxx124
-rw-r--r--binfilter/bf_xmloff/source/text/XMLSectionSourceDDEImportContext.hxx84
-rw-r--r--binfilter/bf_xmloff/source/text/XMLSectionSourceImportContext.hxx79
-rw-r--r--binfilter/bf_xmloff/source/text/XMLTextCharStyleNamesElementExport.hxx60
-rw-r--r--binfilter/bf_xmloff/source/text/XMLTextFrameContext.hxx177
-rw-r--r--binfilter/bf_xmloff/source/text/XMLTextFrameHyperlinkContext.hxx83
-rw-r--r--binfilter/bf_xmloff/source/text/XMLTextListBlockContext.hxx90
-rw-r--r--binfilter/bf_xmloff/source/text/XMLTextListItemContext.hxx73
-rw-r--r--binfilter/bf_xmloff/source/text/XMLTextMarkImportContext.hxx99
-rw-r--r--binfilter/bf_xmloff/source/text/XMLTextNumRuleInfo.hxx125
-rw-r--r--binfilter/bf_xmloff/source/text/XMLTextPropertySetContext.hxx65
-rw-r--r--binfilter/bf_xmloff/source/text/XMLTextShapeImportHelper.hxx60
-rw-r--r--binfilter/bf_xmloff/source/text/XMLTrackedChangesImportContext.hxx81
-rw-r--r--binfilter/bf_xmloff/source/text/makefile.mk127
-rw-r--r--binfilter/bf_xmloff/source/text/txtdrope.hxx56
-rw-r--r--binfilter/bf_xmloff/source/text/txtdropi.hxx71
-rw-r--r--binfilter/bf_xmloff/source/text/txtexppr.hxx101
-rw-r--r--binfilter/bf_xmloff/source/text/txtimppr.hxx85
-rw-r--r--binfilter/bf_xmloff/source/text/txtparai.hxx88
-rw-r--r--binfilter/bf_xmloff/source/text/txtprhdl.hxx53
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLAutoMarkFileContext.cxx101
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLCalculationSettingsContext.cxx94
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLChangeElementImportContext.cxx121
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLChangeImportContext.cxx107
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLChangeInfoContext.cxx132
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLChangedRegionImportContext.cxx197
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLFootnoteBodyImportContext.cxx76
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLFootnoteConfigurationImportContext.cxx449
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLFootnoteImportContext.cxx243
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexAlphabeticalSourceContext.cxx274
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexBibliographyConfigurationContext.cxx305
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexBibliographyEntryContext.cxx189
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexBibliographySourceContext.cxx115
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexBodyContext.cxx80
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexChapterInfoEntryContext.cxx152
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexIllustrationSourceContext.cxx96
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexMarkExport.cxx275
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexObjectSourceContext.cxx195
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexSimpleEntryContext.cxx143
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexSourceBaseContext.cxx285
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexSpanEntryContext.cxx81
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexTOCContext.cxx395
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexTOCSourceContext.cxx206
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexTOCStylesContext.cxx168
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexTabStopEntryContext.cxx168
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexTableSourceContext.cxx191
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexTemplateContext.cxx521
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexTitleTemplateContext.cxx118
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLIndexUserSourceContext.cxx236
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLLineNumberingExport.cxx220
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLLineNumberingImportContext.cxx336
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLLineNumberingSeparatorImportContext.cxx105
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLPropertyBackpatcher.cxx253
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLRedlineExport.cxx685
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLSectionExport.cxx1813
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLSectionFootnoteConfigExport.cxx200
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLSectionFootnoteConfigImport.cxx201
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLSectionImportContext.cxx409
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLSectionSourceDDEImportContext.cxx195
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLSectionSourceImportContext.cxx164
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLStringBufferImportContext.cxx88
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextCharStyleNamesElementExport.cxx90
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextColumnsContext.cxx499
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextColumnsExport.cxx188
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextFrameContext.cxx1174
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextFrameHyperlinkContext.cxx172
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextHeaderFooterContext.cxx194
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextListAutoStylePool.cxx307
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextListBlockContext.cxx239
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextListItemContext.cxx137
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextMarkImportContext.cxx244
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextMasterPageContext.cxx273
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextMasterPageExport.cxx188
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextMasterStylesContext.cxx97
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextNumRuleInfo.cxx147
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextPropertySetContext.cxx159
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextShapeImportHelper.cxx162
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextShapeStyleContext.cxx235
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTextTableContext.cxx51
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_XMLTrackedChangesImportContext.cxx137
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_txtdrope.cxx111
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_txtdropi.cxx154
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_txtexppr.cxx836
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_txtflde.cxx3394
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_txtfldi.cxx3993
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_txtftne.cxx380
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_txtimp.cxx1971
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_txtimppr.cxx684
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_txtparae.cxx2991
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_txtparai.cxx2006
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_txtprhdl.cxx1384
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_txtprmap.cxx792
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_txtsecte.cxx248
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_txtstyle.cxx156
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_txtstyli.cxx406
-rw-r--r--binfilter/bf_xmloff/source/text/xmloff_txtvfldi.cxx1453
-rw-r--r--binfilter/bf_xmloff/util/bf_xo.flt20
-rw-r--r--binfilter/bf_xmloff/util/exports.dxp3
-rw-r--r--binfilter/bf_xmloff/util/makefile.mk112
421 files changed, 0 insertions, 132934 deletions
diff --git a/binfilter/bf_xmloff/source/chart/MultiPropertySetHandler.hxx b/binfilter/bf_xmloff/source/chart/MultiPropertySetHandler.hxx
deleted file mode 100644
index 05c7373cbe5c..000000000000
--- a/binfilter/bf_xmloff/source/chart/MultiPropertySetHandler.hxx
+++ /dev/null
@@ -1,297 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _MULTI_PROPERTY_SET_HANDLER_HXX
-#define _MULTI_PROPERTY_SET_HANDLER_HXX
-
-#include <rtl/ustring.hxx>
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XMultiPropertySet.hpp>
-namespace binfilter {
-
-
-/** @descr MultiPropertySetHandler handles the two slightly different
- interfaces XPropertySet and XMultiPorpertySet for accessing
- properties of an object.
-
- It uses the classes PropertyWrapperBase and the template
- PropertyWrapper for a type safe access to single properties.
-
- The function class OUStringComparison is used by a STL map to
- sort the properties by names.
-*/
-
-/** @descr Base class for the templated property wrappers.
- Having a common base class allows to set a variable to the
- property's value without explicit knowledge of its type.
-*/
-class PropertyWrapperBase
-{
-public:
- /** @descr Create a class instance and store the given name.
- @param rName The name of the property.
- */
- PropertyWrapperBase (const ::rtl::OUString & rName)
- : msName (rName)
- {}
-
- /** @descr Abstract interface of a method for setting a variables
- value to that of the property.
- */
- virtual void SetValue (const ::com::sun::star::uno::Any & rValue) = 0;
-
- const ::rtl::OUString msName;
-};
-
-
-
-
-/** @descr For every property type there will be one instantiation of this
- template class with its own and type specific version of SetValue.
-*/
-template<class T> class PropertyWrapper : public PropertyWrapperBase
-{
-public:
- /** @descr Create a wrapper for a property of type T.
- */
- PropertyWrapper (const ::rtl::OUString & rName, T & rValue)
- : PropertyWrapperBase (rName),
- mrValue (rValue)
- {}
-
- /** descr Set the given value inside an Any to the variable referenced
- by the data member.
- */
- virtual void SetValue (const ::com::sun::star::uno::Any & rValue)
- {
- rValue >>= mrValue;
- }
-
-private:
- /// Reference to a variable. Its value can be modified by a call to SetValue.
- T & mrValue;
-};
-
-
-
-
-/** @descr Function object for comparing two OUStrings.
-*/
-class OUStringComparison
-{
-public:
- /// Compare two strings. Returns true if the first is before the second.
- inline bool operator() (const ::rtl::OUString & a, const ::rtl::OUString & b) const
- {
- return (a.compareTo (b) < 0);
- }
-};
-
-
-
-
-/** @descr This class lets you get the values from an object that either
- supports the interface XPropertySet or XMultiPropertySet. If it
- supports both interfaces then XMultiPropertySet is preferred.
-
- Using it works in three steps.
- 1. Create an instance and pass a reference to the object from which to
- get the property values.
- 2. Make all properties whose values you want to get known to the object
- by using the Add method. This creates instances of a template class
- that stores the properties name and a reference to the variable in
- which to store its value.
- 3. Finally call GetProperties to store the properties values into the
- variables specified in step 2. This uses either the XPropertySet or
- (preferred) the XMultiPropertySet interface.
-*/
-class MultiPropertySetHandler
-{
-public:
- /** @descr Create a handler of the property set of the given
- object.
- @param xObject A reference to any of the object's interfaces.
- not neccessarily XPropertySet or XMultiPropertySet. It
- is casted later to one of the two of them.
- */
- MultiPropertySetHandler (::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XInterface> xObject);
- ~MultiPropertySetHandler (void);
- /** @descr Add a property to handle. The type given implicitely by the
- reference to a variable is used to create an instance of
- the PropertyWrapper template class.
- @param sName Name of the property.
- @param rValue Reference to a variable whose value is set by the
- call to GetProperties to the property's value.
- */
- template<class T> void Add (const ::rtl::OUString & sName, T& rValue)
- {
- aPropertyList[sName] = new PropertyWrapper<T> (sName, rValue);
- }
-
- /** @descr Try to get the values for all properties added with the Add
- method. If possible it uses the XMultiPropertySet. If that fails
- (i.e. for an UnknownPropertyExcption) or if the interface is not
- supported it uses the XPropertySet interface.
- @return If none of the two interfaces is supported or using them both
- fails then FALSE is returned. Else True is returned.
- */
- inline BOOL GetProperties (void);
-
-private:
- /** @descr Try to use the XMultiPropertySet interface to get the property
- values.
- @param rNameList A precomputed and sorted sequence of OUStrings
- containing the properties names.
- @return True if values could be derived.
- */
- inline BOOL MultiGet (const ::com::sun::star::uno::Sequence<
- ::rtl::OUString> & rNameList);
-
- /** @descr Try to use the XPropertySet interface to get the property
- values.
- @param rNameList A precomputed and sorted sequence of OUStrings
- containing the properties names.
- @return True if values could be derived.
- */
- inline BOOL SingleGet (const ::com::sun::star::uno::Sequence<
- ::rtl::OUString> & rNameList);
-
- /** @descr STL map that maps from property names to polymorphic instances of
- PropertyWrapper. It uses OUStringComparison for sorting
- the property names.
- */
- ::std::map< ::rtl::OUString, PropertyWrapperBase*, OUStringComparison> aPropertyList;
-
- /// The object from which to get the property values.
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> mxObject;
-};
-
-
-
-//===== Inline implementation of the methods declared above ==========================
-
-MultiPropertySetHandler::MultiPropertySetHandler (::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XInterface> xObject)
- : mxObject (xObject)
-{
-}
-
-
-
-
-MultiPropertySetHandler::~MultiPropertySetHandler (void)
-{
- ::std::map< ::rtl::OUString, PropertyWrapperBase*, OUStringComparison>::iterator I;
- for (I=aPropertyList.begin(); I!=aPropertyList.end(); I++)
- delete I->second;
-}
-
-
-/*
-template<class T> void MultiPropertySetHandler::Add (const ::rtl::OUString & sName, T& pValue)
-{
- aPropertyList[sName] = new PropertyWrapper<T> (sName, pValue);
-}
-*/
-
-
-
-BOOL MultiPropertySetHandler::GetProperties (void)
-{
- ::std::map< ::rtl::OUString, PropertyWrapperBase*, OUStringComparison>::iterator I;
- ::com::sun::star::uno::Sequence< ::rtl::OUString> aNameList (aPropertyList.size());
- int i;
- for (I=aPropertyList.begin(),i=0; I!=aPropertyList.end(); I++)
- aNameList[i++] = I->second->msName;
- if ( ! MultiGet(aNameList))
- if ( ! SingleGet(aNameList))
- return FALSE;
- return TRUE;
-}
-
-
-
-
-BOOL MultiPropertySetHandler::MultiGet (const ::com::sun::star::uno::Sequence<
- ::rtl::OUString> & rNameList)
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XMultiPropertySet> xMultiSet (
- mxObject, ::com::sun::star::uno::UNO_QUERY);
- if (xMultiSet.is())
- try
- {
- ::std::map< ::rtl::OUString, PropertyWrapperBase*, OUStringComparison>::iterator I;
- int i;
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any> aValueList =
- xMultiSet->getPropertyValues (rNameList);
- for (I=aPropertyList.begin(),i=0; I!=aPropertyList.end(); I++)
- I->second->SetValue (aValueList[i++]);
- }
- catch (::com::sun::star::beans::UnknownPropertyException e)
- {
- return FALSE;
- }
- else
- return FALSE;
-
- return TRUE;
-}
-
-
-
-
-BOOL MultiPropertySetHandler::SingleGet (const ::com::sun::star::uno::Sequence<
- ::rtl::OUString> & rNameList)
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xSingleSet (
- mxObject, ::com::sun::star::uno::UNO_QUERY);
- if (xSingleSet.is())
- try
- {
- ::std::map< ::rtl::OUString, PropertyWrapperBase*, OUStringComparison>::iterator I;
- int i;
- for (I=aPropertyList.begin(),i=0; I!=aPropertyList.end(); I++)
- I->second->SetValue (xSingleSet->getPropertyValue (rNameList[i++]));
- }
- catch (::com::sun::star::beans::UnknownPropertyException e)
- {
- return FALSE;
- }
- else
- return FALSE;
-
- return TRUE;
-}
-
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/PropertyMap.hxx b/binfilter/bf_xmloff/source/chart/PropertyMap.hxx
deleted file mode 100644
index c4b0d6a589e7..000000000000
--- a/binfilter/bf_xmloff/source/chart/PropertyMap.hxx
+++ /dev/null
@@ -1,225 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _PROPERTYMAP_HXX_
-#define _PROPERTYMAP_HXX_
-
-#include "maptype.hxx"
-#include "xmlnmspe.hxx"
-#include "xmltoken.hxx"
-#include "xmltypes.hxx"
-#include "contextid.hxx"
-#include "xmlement.hxx"
-
-#include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp>
-#include <com/sun/star/chart/ChartErrorCategory.hpp>
-#include <com/sun/star/chart/ChartErrorIndicatorType.hpp>
-#include <com/sun/star/chart/ChartRegressionCurveType.hpp>
-#include <com/sun/star/chart/ChartSolidType.hpp>
-#include <com/sun/star/chart/ChartDataRowSource.hpp>
-namespace binfilter {
-
-// custom types
-#define XML_SCH_TYPE_AXIS_ARRANGEMENT ( XML_SCH_TYPES_START + 0 )
-#define XML_SCH_TYPE_ERROR_CATEGORY ( XML_SCH_TYPES_START + 1 )
-#define XML_SCH_TYPE_REGRESSION_TYPE ( XML_SCH_TYPES_START + 2 )
-#define XML_SCH_TYPE_SOLID_TYPE ( XML_SCH_TYPES_START + 3 )
-#define XML_SCH_TYPE_ERROR_INDICATOR_UPPER ( XML_SCH_TYPES_START + 4 )
-#define XML_SCH_TYPE_ERROR_INDICATOR_LOWER ( XML_SCH_TYPES_START + 5 )
-#define XML_SCH_TYPE_DATAROWSOURCE ( XML_SCH_TYPES_START + 6 )
-#define XML_SCH_TYPE_TEXT_ORIENTATION ( XML_SCH_TYPES_START + 7 )
-
-// context ids
-#define XML_SCH_CONTEXT_USER_SYMBOL ( XML_SCH_CTF_START + 0 )
-#define XML_SCH_CONTEXT_MIN ( XML_SCH_CTF_START + 1 )
-#define XML_SCH_CONTEXT_MAX ( XML_SCH_CTF_START + 2 )
-#define XML_SCH_CONTEXT_STEP_MAIN ( XML_SCH_CTF_START + 3 )
-#define XML_SCH_CONTEXT_STEP_HELP ( XML_SCH_CTF_START + 4 )
-#define XML_SCH_CONTEXT_ORIGIN ( XML_SCH_CTF_START + 5 )
-
-#define XML_SCH_CONTEXT_SPECIAL_TICKS_MAJ_INNER ( XML_SCH_CTF_START + 10 )
-#define XML_SCH_CONTEXT_SPECIAL_TICKS_MAJ_OUTER ( XML_SCH_CTF_START + 11 )
-#define XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_INNER ( XML_SCH_CTF_START + 12 )
-#define XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_OUTER ( XML_SCH_CTF_START + 13 )
-#define XML_SCH_CONTEXT_SPECIAL_TEXT_ROTATION ( XML_SCH_CTF_START + 14 )
-#define XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_NUMBER ( XML_SCH_CTF_START + 15 )
-#define XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_TEXT ( XML_SCH_CTF_START + 16 )
-#define XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_SYMBOL ( XML_SCH_CTF_START + 17 )
-#define XML_SCH_CONTEXT_SPECIAL_NUMBER_FORMAT ( XML_SCH_CTF_START + 18 )
-#define XML_SCH_CONTEXT_SPECIAL_DATA_ROW_SOURCE ( XML_SCH_CTF_START + 19 )
-#define XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH ( XML_SCH_CTF_START + 20 )
-#define XML_SCH_CONTEXT_SPECIAL_SYMBOL_HEIGHT ( XML_SCH_CTF_START + 21 )
-#define XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE_NAME ( XML_SCH_CTF_START + 22 )
-#define XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE ( XML_SCH_CTF_START + 23 )
-
-#define MAP_ENTRY( a, ns, nm, t ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t }
-#define MAP_CONTEXT( a, ns, nm, t, c ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t, XML_SCH_CONTEXT_##c }
-#define MAP_SPECIAL( a, ns, nm, t, c ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t | MID_FLAG_SPECIAL_ITEM, XML_SCH_CONTEXT_SPECIAL_##c }
-#define MAP_ENTRY_END { 0,0,0,xmloff::token::XML_TOKEN_INVALID,0 }
-
-// ---------------------------------------------------------
-// PropertyMap for Chart properties drawing- and
-// textproperties are added later using the chaining
-// mechanism
-// ---------------------------------------------------------
-
-// only create maps once!
-// this define is set in PropertyMaps.cxx
-
-#ifdef XML_SCH_CREATE_GLOBAL_MAPS
-
-const XMLPropertyMapEntry aXMLChartPropMap[] =
-{
- // chart subtypes
- MAP_ENTRY( "UpDown", CHART, XML_STOCK_UPDOWN_BARS, XML_TYPE_BOOL ),
- MAP_ENTRY( "Volume", CHART, XML_STOCK_WITH_VOLUME, XML_TYPE_BOOL ),
- MAP_ENTRY( "Dim3D", CHART, XML_THREE_DIMENSIONAL, XML_TYPE_BOOL ),
- MAP_ENTRY( "Deep", CHART, XML_DEEP, XML_TYPE_BOOL ),
- MAP_ENTRY( "Lines", CHART, XML_LINES, XML_TYPE_BOOL ),
- MAP_ENTRY( "Percent", CHART, XML_PERCENTAGE, XML_TYPE_BOOL ),
- MAP_ENTRY( "SolidType", CHART, XML_SOLID_TYPE, XML_SCH_TYPE_SOLID_TYPE ),
- MAP_ENTRY( "SplineType", CHART, XML_SPLINES, XML_TYPE_NUMBER ),
- MAP_ENTRY( "Stacked", CHART, XML_STACKED, XML_TYPE_BOOL ),
- MAP_ENTRY( "SymbolType", CHART, XML_SYMBOL, XML_TYPE_NUMBER ),
- MAP_SPECIAL( "SymbolSize", CHART, XML_SYMBOL_WIDTH, XML_TYPE_MEASURE | MID_FLAG_MERGE_PROPERTY, SYMBOL_WIDTH ),
- MAP_SPECIAL( "SymbolSize", CHART, XML_SYMBOL_HEIGHT, XML_TYPE_MEASURE | MID_FLAG_MERGE_PROPERTY, SYMBOL_HEIGHT ),
- MAP_SPECIAL( "SymbolBitmapURL", STYLE, XML_SYMBOL_IMAGE, XML_TYPE_STRING | MID_FLAG_ELEMENT_ITEM, SYMBOL_IMAGE ),
- MAP_ENTRY( "Vertical", CHART, XML_VERTICAL, XML_TYPE_BOOL ),
- MAP_ENTRY( "NumberOfLines", CHART, XML_LINES_USED, XML_TYPE_NUMBER ),
- MAP_ENTRY( "StackedBarsConnected", CHART, XML_CONNECT_BARS, XML_TYPE_BOOL ),
- // spline settings
- MAP_ENTRY( "SplineOrder", CHART, XML_SPLINE_ORDER, XML_TYPE_NUMBER ),
- MAP_ENTRY( "SplineResolution", CHART, XML_SPLINE_RESOLUTION, XML_TYPE_NUMBER ),
-
- // plot-area properties
- MAP_ENTRY( "DataRowSource", CHART, XML_SERIES_SOURCE, XML_SCH_TYPE_DATAROWSOURCE ),
-
- // axis properties
- MAP_ENTRY( "DisplayLabels", CHART, XML_DISPLAY_LABEL, XML_TYPE_BOOL ),
- MAP_SPECIAL( "Marks", CHART, XML_TICK_MARKS_MAJOR_INNER, XML_TYPE_NUMBER | MID_FLAG_MERGE_PROPERTY, TICKS_MAJ_INNER ), // convert one constant
- MAP_SPECIAL( "Marks", CHART, XML_TICK_MARKS_MAJOR_OUTER, XML_TYPE_NUMBER | MID_FLAG_MERGE_PROPERTY, TICKS_MAJ_OUTER ), // to two bools
- MAP_SPECIAL( "HelpMarks", CHART, XML_TICK_MARKS_MINOR_INNER, XML_TYPE_NUMBER | MID_FLAG_MERGE_PROPERTY, TICKS_MIN_INNER ), // see above
- MAP_SPECIAL( "HelpMarks", CHART, XML_TICK_MARKS_MINOR_OUTER, XML_TYPE_NUMBER | MID_FLAG_MERGE_PROPERTY, TICKS_MIN_OUTER ),
- MAP_ENTRY( "Logarithmic", CHART, XML_LOGARITHMIC, XML_TYPE_BOOL ),
- MAP_CONTEXT( "Min", CHART, XML_MINIMUM, XML_TYPE_DOUBLE, MIN ),
- MAP_CONTEXT( "Max", CHART, XML_MAXIMUM, XML_TYPE_DOUBLE, MAX ),
- MAP_CONTEXT( "Origin", CHART, XML_ORIGIN, XML_TYPE_DOUBLE, ORIGIN ),
- MAP_CONTEXT( "StepMain", CHART, XML_INTERVAL_MAJOR, XML_TYPE_DOUBLE, STEP_MAIN ),
- MAP_CONTEXT( "StepHelp", CHART, XML_INTERVAL_MINOR, XML_TYPE_DOUBLE, STEP_HELP ),
- MAP_ENTRY( "GapWidth", CHART, XML_GAP_WIDTH, XML_TYPE_NUMBER ),
- MAP_ENTRY( "Overlap", CHART, XML_OVERLAP, XML_TYPE_NUMBER ),
- MAP_ENTRY( "TextCanOverlap", CHART, XML_TEXT_OVERLAP, XML_TYPE_BOOL ),
- MAP_ENTRY( "TextBreak", TEXT, XML_LINE_BREAK, XML_TYPE_BOOL ),
- MAP_ENTRY( "ArrangeOrder", CHART, XML_LABEL_ARRANGEMENT, XML_SCH_TYPE_AXIS_ARRANGEMENT ),
- MAP_SPECIAL( "NumberFormat", STYLE, XML_DATA_STYLE_NAME, XML_TYPE_NUMBER, NUMBER_FORMAT ),
- MAP_ENTRY( "LinkNumberFormatToSource", CHART, XML_LINK_DATA_STYLE_TO_SOURCE, XML_TYPE_BOOL ),
- MAP_ENTRY( "Visible", CHART, XML_VISIBLE, XML_TYPE_BOOL ),
-
- // statistical properties
- MAP_ENTRY( "MeanValue", CHART, XML_MEAN_VALUE, XML_TYPE_BOOL ),
- MAP_ENTRY( "ErrorMargin", CHART, XML_ERROR_MARGIN, XML_TYPE_DOUBLE ),
- MAP_ENTRY( "ConstantErrorLow", CHART, XML_ERROR_LOWER_LIMIT, XML_TYPE_DOUBLE ),
- MAP_ENTRY( "ConstantErrorHigh", CHART, XML_ERROR_UPPER_LIMIT, XML_TYPE_DOUBLE ),
- MAP_ENTRY( "ErrorIndicator", CHART, XML_ERROR_UPPER_INDICATOR, XML_SCH_TYPE_ERROR_INDICATOR_UPPER | MID_FLAG_MERGE_PROPERTY ), // convert one constant
- MAP_ENTRY( "ErrorIndicator", CHART, XML_ERROR_LOWER_INDICATOR, XML_SCH_TYPE_ERROR_INDICATOR_LOWER | MID_FLAG_MERGE_PROPERTY ), // to two bools
- MAP_ENTRY( "ErrorCategory", CHART, XML_ERROR_CATEGORY, XML_SCH_TYPE_ERROR_CATEGORY ),
- MAP_ENTRY( "PercentageError", CHART, XML_ERROR_PERCENTAGE, XML_TYPE_DOUBLE ),
- MAP_ENTRY( "RegressionCurves", CHART, XML_REGRESSION_TYPE, XML_SCH_TYPE_REGRESSION_TYPE ),
-
- // series/data-point properties
- MAP_SPECIAL( "DataCaption", CHART, XML_DATA_LABEL_NUMBER, XML_TYPE_NUMBER | MID_FLAG_MERGE_PROPERTY, DATA_LABEL_NUMBER ), // convert one constant
- MAP_SPECIAL( "DataCaption", CHART, XML_DATA_LABEL_TEXT, XML_TYPE_NUMBER | MID_FLAG_MERGE_PROPERTY, DATA_LABEL_TEXT ), // to 'tristate' and two bools
- MAP_SPECIAL( "DataCaption", CHART, XML_DATA_LABEL_SYMBOL, XML_TYPE_NUMBER | MID_FLAG_MERGE_PROPERTY, DATA_LABEL_SYMBOL ),
- MAP_ENTRY( "SegmentOffset", CHART, XML_PIE_OFFSET, XML_TYPE_NUMBER ),
-
- // text properties for titles
- MAP_SPECIAL( "TextRotation", TEXT, XML_ROTATION_ANGLE, XML_TYPE_NUMBER, TEXT_ROTATION ), // convert 1/100th degrees to degrees
- MAP_ENTRY( "StackedText", FO, XML_DIRECTION, XML_SCH_TYPE_TEXT_ORIENTATION ),
-
- // for compatability to pre 6.0beta documents
- MAP_SPECIAL( "SymbolBitmapURL", CHART, XML_SYMBOL_IMAGE_NAME, XML_TYPE_STRING, SYMBOL_IMAGE_NAME ),
-
- MAP_ENTRY_END
-};
-
-// ----------------------------------------
-// maps for enums to XML attributes
-// ----------------------------------------
-
-SvXMLEnumMapEntry aXMLChartAxisArrangementEnumMap[] =
-{
- { ::binfilter::xmloff::token::XML_AUTOMATIC, ::com::sun::star::chart::ChartAxisArrangeOrderType_AUTO },
- { ::binfilter::xmloff::token::XML_SIDE_BY_SIDE, ::com::sun::star::chart::ChartAxisArrangeOrderType_SIDE_BY_SIDE },
- { ::binfilter::xmloff::token::XML_STAGGER_EVEN, ::com::sun::star::chart::ChartAxisArrangeOrderType_STAGGER_EVEN },
- { ::binfilter::xmloff::token::XML_STAGGER_ODD, ::com::sun::star::chart::ChartAxisArrangeOrderType_STAGGER_ODD },
- { ::binfilter::xmloff::token::XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXMLChartErrorCategoryEnumMap[] =
-{
- { ::binfilter::xmloff::token::XML_NONE, ::com::sun::star::chart::ChartErrorCategory_NONE },
- { ::binfilter::xmloff::token::XML_VARIANCE, ::com::sun::star::chart::ChartErrorCategory_VARIANCE },
- { ::binfilter::xmloff::token::XML_STANDARD_DEVIATION, ::com::sun::star::chart::ChartErrorCategory_STANDARD_DEVIATION },
- { ::binfilter::xmloff::token::XML_PERCENTAGE, ::com::sun::star::chart::ChartErrorCategory_PERCENT },
- { ::binfilter::xmloff::token::XML_ERROR_MARGIN, ::com::sun::star::chart::ChartErrorCategory_ERROR_MARGIN },
- { ::binfilter::xmloff::token::XML_CONSTANT, ::com::sun::star::chart::ChartErrorCategory_CONSTANT_VALUE },
- { ::binfilter::xmloff::token::XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXMLChartRegressionCurveTypeEnumMap[] =
-{
- { ::binfilter::xmloff::token::XML_NONE, ::com::sun::star::chart::ChartRegressionCurveType_NONE },
- { ::binfilter::xmloff::token::XML_LINEAR, ::com::sun::star::chart::ChartRegressionCurveType_LINEAR },
- { ::binfilter::xmloff::token::XML_LOGARITHMIC, ::com::sun::star::chart::ChartRegressionCurveType_LOGARITHM },
- { ::binfilter::xmloff::token::XML_EXPONENTIAL, ::com::sun::star::chart::ChartRegressionCurveType_EXPONENTIAL },
- { ::binfilter::xmloff::token::XML_POLYNOMIAL, ::com::sun::star::chart::ChartRegressionCurveType_POLYNOMIAL },
- { ::binfilter::xmloff::token::XML_POWER, ::com::sun::star::chart::ChartRegressionCurveType_POWER },
- { ::binfilter::xmloff::token::XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXMLChartSolidTypeEnumMap[] =
-{
- { ::binfilter::xmloff::token::XML_CUBOID, ::com::sun::star::chart::ChartSolidType::RECTANGULAR_SOLID },
- { ::binfilter::xmloff::token::XML_CYLINDER, ::com::sun::star::chart::ChartSolidType::CYLINDER },
- { ::binfilter::xmloff::token::XML_CONE, ::com::sun::star::chart::ChartSolidType::CONE },
- { ::binfilter::xmloff::token::XML_PYRAMID, ::com::sun::star::chart::ChartSolidType::PYRAMID },
- { ::binfilter::xmloff::token::XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXMLChartDataRowSourceTypeEnumMap[] =
-{
- { ::binfilter::xmloff::token::XML_COLUMNS, ::com::sun::star::chart::ChartDataRowSource_COLUMNS },
- { ::binfilter::xmloff::token::XML_ROWS, ::com::sun::star::chart::ChartDataRowSource_ROWS },
- { ::binfilter::xmloff::token::XML_TOKEN_INVALID, 0 }
-};
-
-#endif // XML_SCH_CREATE_GLOBAL_MAPS
-
-}//end of namespace binfilter
-#endif // _PROPERTYMAP_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/SchXMLAutoStylePoolP.hxx b/binfilter/bf_xmloff/source/chart/SchXMLAutoStylePoolP.hxx
deleted file mode 100644
index b6489b0263f1..000000000000
--- a/binfilter/bf_xmloff/source/chart/SchXMLAutoStylePoolP.hxx
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SCH_XMLAUTOSTYLEPOOLP_HXX_
-#define _SCH_XMLAUTOSTYLEPOOLP_HXX_
-
-#include "xmlaustp.hxx"
-namespace binfilter {
-
-class SchXMLExport;
-
-class SchXMLAutoStylePoolP : public SvXMLAutoStylePoolP
-{
-protected:
- SchXMLExport& mrSchXMLExport;
-
- virtual void exportStyleAttributes(
- SvXMLAttributeList& rAttrList,
- sal_Int32 nFamily,
- const ::std::vector< XMLPropertyState >& rProperties,
- const SvXMLExportPropertyMapper& rPropExp
- , const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap
- ) const;
-
-public:
- SchXMLAutoStylePoolP( SchXMLExport& rSchXMLExport );
- virtual ~SchXMLAutoStylePoolP();
-};
-
-}//end of namespace binfilter
-#endif // _SCH_XMLAUTOSTYLEPOOLP_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/SchXMLChartContext.hxx b/binfilter/bf_xmloff/source/chart/SchXMLChartContext.hxx
deleted file mode 100644
index 474e449e2821..000000000000
--- a/binfilter/bf_xmloff/source/chart/SchXMLChartContext.hxx
+++ /dev/null
@@ -1,161 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SCH_XMLCHARTCONTEXT_HXX_
-#define _SCH_XMLCHARTCONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/drawing/XShape.hpp>
-
-#include "transporttypes.hxx"
-namespace com { namespace sun { namespace star {
- namespace chart {
- class XChartDocument;
- class XDiagram;
- struct ChartSeriesAddress;
- }
- namespace util {
- class XStringMapping;
- }
- namespace xml { namespace sax {
- class XAttributeList;
- }}
- namespace drawing {
- class XShapes;
- }
-}}}
-namespace binfilter {
-
-class SchXMLImport;
-class SchXMLImportHelper;
-
-
-
-// ----------------------------------------
-
-class SchXMLChartContext : public SvXMLImportContext
-{
-private:
- SchXMLTable maTable;
- SchXMLImportHelper& mrImportHelper;
-
- ::rtl::OUString maMainTitle, maSubTitle;
- ::com::sun::star::awt::Point maMainTitlePos, maSubTitlePos, maLegendPos;
- sal_Bool mbHasOwnTable;
- sal_Bool mbHasLegend;
-
- ::com::sun::star::uno::Sequence< ::com::sun::star::chart::ChartSeriesAddress > maSeriesAddresses;
- ::rtl::OUString msCategoriesAddress;
- ::rtl::OUString msChartAddress;
- ::rtl::OUString msTableNumberList;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxDrawPage;
- ::rtl::OUString msColTrans;
- ::rtl::OUString msRowTrans;
-
- ::com::sun::star::uno::Sequence< sal_Int32 > GetNumberSequenceFromString( const ::rtl::OUString& rStr );
-
-public:
- SchXMLChartContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport, const ::rtl::OUString& rLocalName );
- virtual ~SchXMLChartContext();
-
- virtual void StartElement( const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual void EndElement();
- virtual SvXMLImportContext *CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
-private:
- /** @descr This method bundles some settings to the chart model and executes them with
- a locked controller. This includes setting the draw page size and setting
- the chart type.
- @param aChartSize The size the draw page will be set to.
- @param bDomainForDefaultDataNeeded This flag indicates wether the chart's data set
- has to contain a domain value.
- @param aServiceName The name of the service the diagram is initialized with.
- @param bSetWitchData Indicates wether the data set takes it's data series from
- rows or from columns.
- */
- void InitChart ( ::com::sun::star::awt::Size aChartSize,
- sal_Bool bDomainForDefaultDataNeeded,
- ::rtl::OUString aServiceName,
- sal_Bool bSetSwitchData);
-};
-
-// ----------------------------------------
-
-class SchXMLTitleContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
- ::rtl::OUString& mrTitle;
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxTitleShape;
- ::rtl::OUString msAutoStyleName;
- ::com::sun::star::awt::Point& mrPosition;
-
-public:
- SchXMLTitleContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport, const ::rtl::OUString& rLocalName,
- ::rtl::OUString& rTitle,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xTitleShape,
- ::com::sun::star::awt::Point& rPosition );
- virtual ~SchXMLTitleContext();
-
- virtual void StartElement( const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual SvXMLImportContext *CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-};
-
-// ----------------------------------------
-
-class SchXMLLegendContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
- ::com::sun::star::awt::Point& mrPosition;
-
-public:
- SchXMLLegendContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport, const ::rtl::OUString& rLocalName,
- ::com::sun::star::awt::Point& rPosition );
- virtual ~SchXMLLegendContext();
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-};
-
-}//end of namespace binfilter
-#endif // _SCH_XMLCHARTCONTEXT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/SchXMLParagraphContext.hxx b/binfilter/bf_xmloff/source/chart/SchXMLParagraphContext.hxx
deleted file mode 100644
index efaa4249777b..000000000000
--- a/binfilter/bf_xmloff/source/chart/SchXMLParagraphContext.hxx
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SCH_XMLPARAGRAPHCONTEXT_HXX_
-#define _SCH_XMLPARAGRAPHCONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-
-#include "rtl/ustring.hxx"
-#include "rtl/ustrbuf.hxx"
-namespace com { namespace sun { namespace star { namespace xml { namespace sax {
- class XAttributeList;
-}}}}}
-namespace binfilter {
-
-class SchXMLImport;
-
-
-class SchXMLParagraphContext : public SvXMLImportContext
-{
-private:
- ::rtl::OUString& mrText;
- ::rtl::OUStringBuffer maBuffer;
-
-public:
- SchXMLParagraphContext( SvXMLImport& rImport,
- const ::rtl::OUString& rLocalName,
- ::rtl::OUString& rText );
- virtual ~SchXMLParagraphContext();
- virtual void EndElement();
-
- virtual SvXMLImportContext* CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
- virtual void Characters( const ::rtl::OUString& rChars );
-};
-
-}//end of namespace binfilter
-#endif // _SCH_XMLPARAGRAPHCONTEXT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/SchXMLPlotAreaContext.hxx b/binfilter/bf_xmloff/source/chart/SchXMLPlotAreaContext.hxx
deleted file mode 100644
index 7222e7bd437c..000000000000
--- a/binfilter/bf_xmloff/source/chart/SchXMLPlotAreaContext.hxx
+++ /dev/null
@@ -1,335 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SCH_XMLPLOTAREACONTEXT_HXX_
-#define _SCH_XMLPLOTAREACONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-#include "shapeimport.hxx"
-
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/chart/ChartSeriesAddress.hpp>
-
-#include <list>
-
-#include "transporttypes.hxx"
-namespace com { namespace sun { namespace star {
- namespace chart {
- class XDiagram;
- class X3DDisplay;
- class XStatisticDisplay;
- }
- namespace xml { namespace sax {
- class XAttributeList;
-}}}}}
-namespace binfilter {
-
-class SvXMLImport;
-
-
-
-// ----------------------------------------
-
-namespace chartxml
-{
-
-struct DataRowPointStyle
-{
- enum StyleType
- {
- DATA_POINT,
- DATA_SERIES,
- MEAN_VALUE,
- REGRESSION,
- ERROR_INDICATOR
- };
-
- StyleType meType;
- sal_Int32 mnSeries;
- sal_Int32 mnIndex;
- sal_Int32 mnRepeat;
- ::rtl::OUString msStyleName;
- sal_Int32 mnAttachedAxis;
-
- DataRowPointStyle( StyleType eType,
- sal_Int32 nSeries, sal_Int32 nIndex, sal_Int32 nRepeat, ::rtl::OUString sStyleName,
- sal_Int32 nAttachedAxis = 0 ) :
- meType( eType ),
- mnSeries( nSeries ),
- mnIndex( nIndex ),
- mnRepeat( nRepeat ),
- msStyleName( sStyleName ),
- mnAttachedAxis( nAttachedAxis )
- {}
-};
-
-} // namespace
-
-
-// ----------------------------------------
-
-class SchXMLPlotAreaContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
- ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > mxDiagram;
- std::vector< SchXMLAxis > maAxes;
- ::com::sun::star::uno::Sequence< ::com::sun::star::chart::ChartSeriesAddress >& mrSeriesAddresses;
- ::rtl::OUString& mrCategoriesAddress;
- ::std::list< chartxml::DataRowPointStyle > maSeriesStyleList;
- sal_Int32 mnDomainOffset;
- sal_Int32 mnNumOfLines;
- sal_Bool mbStockHasVolume;
- sal_Int32 mnSeries;
- sal_Int32 mnMaxSeriesLength;
- SdXML3DSceneAttributesHelper maSceneImportHelper;
- ::com::sun::star::awt::Size maSize;
- ::com::sun::star::awt::Point maPosition;
- ::rtl::OUString msAutoStyleName;
- ::rtl::OUString& mrChartAddress;
- ::rtl::OUString& mrTableNumberList;
-
-public:
- SchXMLPlotAreaContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport, const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart::ChartSeriesAddress >& rSeriesAddresses,
- ::rtl::OUString& rCategoriesAddress,
- ::rtl::OUString& rChartAddress,
- ::rtl::OUString& rTableNumberList );
- virtual ~SchXMLPlotAreaContext();
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual SvXMLImportContext* CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual void EndElement();
-};
-
-// ----------------------------------------
-
-class SchXMLAxisContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
- ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > mxDiagram;
- SchXMLAxis maCurrentAxis;
- std::vector< SchXMLAxis >& maAxes;
- ::rtl::OUString msAutoStyleName;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getTitleShape();
- void CreateGrid( ::rtl::OUString sAutoStyleName, sal_Bool bIsMajor );
-
-public:
- SchXMLAxisContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport, const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > xDiagram,
- ::std::vector< SchXMLAxis >& aAxes );
- virtual ~SchXMLAxisContext();
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual void EndElement();
- virtual SvXMLImportContext* CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-};
-
-// ----------------------------------------
-
-class SchXMLSeriesContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
- ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > mxDiagram;
- std::vector< SchXMLAxis >& mrAxes;
- ::com::sun::star::chart::ChartSeriesAddress& mrSeriesAddress;
- ::std::list< chartxml::DataRowPointStyle >& mrStyleList;
- sal_Int32 mnSeriesIndex;
- sal_Int32 mnDataPointIndex;
- sal_Int32& mrMaxSeriesLength;
- sal_Int32& mrDomainOffset;
- sal_Int32& mrNumOfLines;
- sal_Bool& mrStockHasVolume;
- SchXMLAxis* mpAttachedAxis;
- sal_Int32 mnAttachedAxis;
- ::rtl::OUString msAutoStyleName;
-
-public:
- SchXMLSeriesContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport, const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram >& xDiagram,
- ::std::vector< SchXMLAxis >& rAxes,
- ::com::sun::star::chart::ChartSeriesAddress& rSeriesAddress,
- ::std::list< chartxml::DataRowPointStyle >& rStyleList,
- sal_Int32 nSeriesIndex,
- sal_Int32& rMaxSeriesLength,
- sal_Int32& rDomainOffset,
- sal_Int32& rNumOfLines,
- sal_Bool& rStockHasVolume );
- virtual ~SchXMLSeriesContext();
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual SvXMLImportContext* CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual void EndElement();
-};
-
-//----------------------------------------
-
-class SchXMLDataPointContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
- ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > mxDiagram;
- ::std::list< chartxml::DataRowPointStyle >& mrStyleList;
- sal_Int32 mnSeries;
- sal_Int32& mrIndex;
-
-public:
- SchXMLDataPointContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport, const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram >& xDiagram,
- ::std::list< chartxml::DataRowPointStyle >& rStyleList,
- sal_Int32 nSeries, sal_Int32& rIndex );
- virtual ~SchXMLDataPointContext();
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-};
-
-// ----------------------------------------
-
-class SchXMLCategoriesDomainContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
- ::rtl::OUString& mrAddress;
-
-public:
- SchXMLCategoriesDomainContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- ::rtl::OUString& rAddress );
- virtual ~SchXMLCategoriesDomainContext();
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-};
-
-// ----------------------------------------
-
-class SchXMLWallFloorContext : public SvXMLImportContext
-{
-public:
- enum ContextType
- {
- CONTEXT_TYPE_WALL,
- CONTEXT_TYPE_FLOOR
- };
-
-private:
- SchXMLImportHelper& mrImportHelper;
- ::com::sun::star::uno::Reference< ::com::sun::star::chart::X3DDisplay > mxWallFloorSupplier;
- ContextType meContextType;
-
-public:
- SchXMLWallFloorContext( SchXMLImportHelper& rImportHelper,
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram >& xDiagram,
- ContextType eContextType );
- virtual ~SchXMLWallFloorContext();
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-};
-
-// ----------------------------------------
-
-class SchXMLStockContext : public SvXMLImportContext
-{
-public:
- enum ContextType
- {
- CONTEXT_TYPE_GAIN,
- CONTEXT_TYPE_LOSS,
- CONTEXT_TYPE_RANGE
- };
-
-private:
- SchXMLImportHelper& mrImportHelper;
- ::com::sun::star::uno::Reference< ::com::sun::star::chart::XStatisticDisplay > mxStockPropProvider;
- ContextType meContextType;
-
-public:
- SchXMLStockContext( SchXMLImportHelper& rImportHelper,
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram >& xDiagram,
- ContextType eContextType );
- virtual ~SchXMLStockContext();
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-};
-
-// ----------------------------------------
-
-class SchXMLStatisticsObjectContext : public SvXMLImportContext
-{
-public:
- enum ContextType
- {
- CONTEXT_TYPE_MEAN_VALUE_LINE,
- CONTEXT_TYPE_REGRESSION_CURVE,
- CONTEXT_TYPE_ERROR_INDICATOR
- };
-
- SchXMLStatisticsObjectContext(
- SchXMLImportHelper& rImportHelper,
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- ::std::list< chartxml::DataRowPointStyle >& rStyleList,
- sal_Int32 nSeries,
- ContextType eContextType );
-
- virtual ~SchXMLStatisticsObjectContext();
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
-private:
- SchXMLImportHelper & mrImportHelper;
- ::std::list< chartxml::DataRowPointStyle > & mrStyleList;
- sal_Int32 mnSeriesIndex;
- ContextType meContextType;
-};
-
-}//end of namespace binfilter
-#endif // _SCH_XMLPLOTAREACONTEXT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/SchXMLTableContext.hxx b/binfilter/bf_xmloff/source/chart/SchXMLTableContext.hxx
deleted file mode 100644
index 6104972cb8e4..000000000000
--- a/binfilter/bf_xmloff/source/chart/SchXMLTableContext.hxx
+++ /dev/null
@@ -1,205 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SCH_XMLTABLECONTEXT_HXX_
-#define _SCH_XMLTABLECONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-#include "SchXMLImport.hxx"
-
-#include <com/sun/star/uno/Sequence.h>
-
-#include "transporttypes.hxx"
-
-namespace com { namespace sun { namespace star {
- namespace frame {
- class XModel;
- }
- namespace xml { namespace sax {
- class XAttributeList;
- }}
- namespace chart {
- class XChartDocument;
- struct ChartSeriesAddress;
-}}}}
-namespace binfilter {
-
-
-// ========================================
-
-class SchXMLTableContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
- SchXMLTable& mrTable;
-
-public:
- SchXMLTableContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- const ::rtl::OUString& rLocalName,
- SchXMLTable& aTable );
- virtual ~SchXMLTableContext();
-
- virtual SvXMLImportContext* CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-};
-
-// ----------------------------------------
-
-class SchXMLTableHelper
-{
-public:
- /// The data for the ChartDocument is applied linearly
- static void applyTableSimple(
- const SchXMLTable& rTable,
- ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDocument > xChartDoc );
-};
-
-// ========================================
-
-// ----------------------------------------
-// classes for columns
-// ----------------------------------------
-
-/** With this context all column elements are parsed to
- determine the index of the column containing
- the row descriptions and probably get an estimate
- for the altogether number of columns
- */
-class SchXMLTableColumnsContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
- SchXMLTable& mrTable;
-
-public:
- SchXMLTableColumnsContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- const ::rtl::OUString& rLocalName,
- SchXMLTable& aTable );
- virtual ~SchXMLTableColumnsContext();
-
- virtual SvXMLImportContext* CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-};
-
-// ----------------------------------------
-
-class SchXMLTableColumnContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
- SchXMLTable& mrTable;
-
-public:
- SchXMLTableColumnContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- const ::rtl::OUString& rLocalName,
- SchXMLTable& aTable );
- virtual ~SchXMLTableColumnContext();
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-};
-
-// ----------------------------------------
-// classes for rows
-// ----------------------------------------
-
-class SchXMLTableRowsContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
- SchXMLTable& mrTable;
-
-public:
- SchXMLTableRowsContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- const ::rtl::OUString& rLocalName,
- SchXMLTable& aTable );
- virtual ~SchXMLTableRowsContext();
-
- virtual SvXMLImportContext* CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-};
-
-// ----------------------------------------
-
-class SchXMLTableRowContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
- SchXMLTable& mrTable;
-
-public:
- SchXMLTableRowContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- const ::rtl::OUString& rLocalName,
- SchXMLTable& aTable );
- virtual ~SchXMLTableRowContext();
-
- virtual SvXMLImportContext* CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-};
-
-// ----------------------------------------
-// classes for cells and their content
-// ----------------------------------------
-
-class SchXMLTableCellContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
- SchXMLTable& mrTable;
- ::rtl::OUString maCellContent;
- sal_Bool mbReadPara;
-
-public:
- SchXMLTableCellContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- const ::rtl::OUString& rLocalName,
- SchXMLTable& aTable );
- virtual ~SchXMLTableCellContext();
-
- virtual SvXMLImportContext* CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual void EndElement();
-};
-
-}//end of namespace binfilter
-#endif // _SCH_XMLTABLECONTEXT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/XMLChartPropertyContext.hxx b/binfilter/bf_xmloff/source/chart/XMLChartPropertyContext.hxx
deleted file mode 100644
index 98ca721a1139..000000000000
--- a/binfilter/bf_xmloff/source/chart/XMLChartPropertyContext.hxx
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _XMLOFF_CHARTPROPERTYCONTEXT_HXX_
-#define _XMLOFF_CHARTPROPERTYCONTEXT_HXX_
-
-#include "xmlprcon.hxx"
-namespace binfilter {
-
-class XMLChartPropertyContext : public SvXMLPropertySetContext
-{
-public:
- TYPEINFO();
-
- XMLChartPropertyContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- ::std::vector< XMLPropertyState >& rProps,
- const UniReference< SvXMLImportPropertyMapper >& rMapper );
- virtual ~XMLChartPropertyContext();
-
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- ::std::vector< XMLPropertyState > &rProperties,
- const XMLPropertyState& rProp );
-
-private:
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_CHARTPROPERTYCONTEXT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/XMLErrorIndicatorPropertyHdl.hxx b/binfilter/bf_xmloff/source/chart/XMLErrorIndicatorPropertyHdl.hxx
deleted file mode 100644
index 00f151826ee2..000000000000
--- a/binfilter/bf_xmloff/source/chart/XMLErrorIndicatorPropertyHdl.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _XMLERRORINDICATORPROPERTYHDL_HXX_
-#define _XMLERRORINDICATORPROPERTYHDL_HXX_
-
-#include "xmlprhdl.hxx"
-namespace binfilter {
-
-class XMLErrorIndicatorPropertyHdl : public XMLPropertyHandler
-{
-private:
- sal_Bool mbUpperIndicator;
-
-public:
- XMLErrorIndicatorPropertyHdl( sal_Bool bUpper ) : mbUpperIndicator( bUpper )
- {}
- virtual ~XMLErrorIndicatorPropertyHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLERRORINDICATORPROPERTYHDL_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/XMLSymbolImageContext.hxx b/binfilter/bf_xmloff/source/chart/XMLSymbolImageContext.hxx
deleted file mode 100644
index d3f6ec2b2084..000000000000
--- a/binfilter/bf_xmloff/source/chart/XMLSymbolImageContext.hxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _XMLOFF_SYMBOLIMAGECONTEXT_HXX_
-#define _XMLOFF_SYMBOLIMAGECONTEXT_HXX_
-
-#include "XMLElementPropertyContext.hxx"
-
-namespace com { namespace sun { namespace star {
- namespace io { class XOutputStream; }
-} } }
-namespace binfilter {
-
-class XMLSymbolImageContext : public XMLElementPropertyContext
-{
-public:
- TYPEINFO();
-
- XMLSymbolImageContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const XMLPropertyState& rProp,
- ::std::vector< XMLPropertyState > &rProps );
- virtual ~XMLSymbolImageContext();
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual SvXMLImportContext *CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual void EndElement();
-
-private:
- ::rtl::OUString msURL;
- ::com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > mxBase64Stream;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_SYMBOLIMAGECONTEXT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/XMLTextOrientationHdl.hxx b/binfilter/bf_xmloff/source/chart/XMLTextOrientationHdl.hxx
deleted file mode 100644
index a13c7d652849..000000000000
--- a/binfilter/bf_xmloff/source/chart/XMLTextOrientationHdl.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _XMLTEXTORIENTATIONHDL_HXX_
-#define _XMLTEXTORIENTATIONHDL_HXX_
-
-#include "xmlprhdl.hxx"
-namespace binfilter {
-
-class XMLTextOrientationHdl : public XMLPropertyHandler
-{
-private:
-public:
- virtual ~XMLTextOrientationHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLTEXTORIENTATIONHDL_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/contexts.hxx b/binfilter/bf_xmloff/source/chart/contexts.hxx
deleted file mode 100644
index f891b6b5417b..000000000000
--- a/binfilter/bf_xmloff/source/chart/contexts.hxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SCH_XML_CONTEXTS_HXX_
-#define _SCH_XML_CONTEXTS_HXX_
-
-#include "SchXMLImport.hxx"
-#include "SchXMLTableContext.hxx"
-
-#include "xmlictxt.hxx"
-#include "xmltkmap.hxx"
-namespace com { namespace sun { namespace star { namespace xml { namespace sax {
- class XAttributeList;
-}}}}}
-namespace binfilter {
-
-
-/* ========================================
-
- These contexts are only nedded by
- SchXMLImport not by the SchXMLImportHelper
- that is also used by other applications
-
- ======================================== */
-
-class SchXMLDocContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
-
-public:
- SchXMLDocContext(
- SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLName );
- virtual ~SchXMLDocContext();
-
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-};
-
-// ========================================
-
-class SchXMLBodyContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
-
-public:
- SchXMLBodyContext(
- SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLName );
- virtual ~SchXMLBodyContext();
-
- virtual void EndElement();
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-};
-
-// ========================================
-
-}//end of namespace binfilter
-#endif // _SCH_XML_CONTEXTS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/makefile.mk b/binfilter/bf_xmloff/source/chart/makefile.mk
deleted file mode 100644
index 6b1722e19d6e..000000000000
--- a/binfilter/bf_xmloff/source/chart/makefile.mk
+++ /dev/null
@@ -1,61 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
-
-PRJ = ..$/..$/..
-PRJNAME = binfilter
-TARGET = xmloff_chart
-ENABLE_EXCEPTIONS = TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-INC+= -I$(PRJ)$/inc$/bf_xmloff
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = $(SLO)$/xmloff_SchXMLExport.obj \
- $(SLO)$/xmloff_SchXMLImport.obj \
- $(SLO)$/xmloff_contexts.obj \
- $(SLO)$/xmloff_SchXMLTableContext.obj \
- $(SLO)$/xmloff_SchXMLChartContext.obj \
- $(SLO)$/xmloff_SchXMLPlotAreaContext.obj \
- $(SLO)$/xmloff_SchXMLParagraphContext.obj \
- $(SLO)$/xmloff_PropertyMaps.obj \
- $(SLO)$/xmloff_XMLChartStyleContext.obj \
- $(SLO)$/xmloff_XMLErrorIndicatorPropertyHdl.obj \
- $(SLO)$/xmloff_SchXMLAutoStylePoolP.obj \
- $(SLO)$/xmloff_XMLChartPropertyContext.obj \
- $(SLO)$/xmloff_XMLSymbolImageContext.obj \
- $(SLO)$/xmloff_XMLTextOrientationHdl.obj
-
-# --- Targets --------------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/binfilter/bf_xmloff/source/chart/transporttypes.hxx b/binfilter/bf_xmloff/source/chart/transporttypes.hxx
deleted file mode 100644
index f2a5f8c72a42..000000000000
--- a/binfilter/bf_xmloff/source/chart/transporttypes.hxx
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef SCH_XML_TRANSPORTTYPES_HXX_
-#define SCH_XML_TRANSPORTTYPES_HXX_
-
-#ifndef __SGI_STL_VECTOR
-#include <vector>
-#endif
-namespace binfilter {
-
-enum SchXMLCellType
-{
- SCH_CELL_TYPE_UNKNOWN,
- SCH_CELL_TYPE_FLOAT,
- SCH_CELL_TYPE_STRING
-};
-
-struct SchXMLCell
-{
- ::rtl::OUString aString;
- double fValue;
- SchXMLCellType eType;
-
- SchXMLCell() : fValue( 0.0 ), eType( SCH_CELL_TYPE_UNKNOWN ) {}
-};
-
-struct SchXMLTable
-{
- std::vector< ::std::vector< SchXMLCell > > aData; /// an array of rows containing the table contents
-
- sal_Int32 nRowIndex; /// reflects the index of the row currently parsed
- sal_Int32 nColumnIndex; /// reflects the index of the column currently parsed
- sal_Int32 nMaxColumnIndex; /// the greatest number of columns detected
-
- sal_Int32 nNumberOfColsEstimate; /// parsing column-elements may yield an estimate
-
- SchXMLTable() : nRowIndex( -1 ),
- nColumnIndex( -1 ),
- nMaxColumnIndex( -1 ),
- nNumberOfColsEstimate( 0 ) {}
-};
-
-// ----------------------------------------
-
-struct SchNumericCellRangeAddress
-{
- sal_Int32 nRow1, nRow2;
- sal_Int32 nCol1, nCol2;
-
- SchNumericCellRangeAddress() :
- nRow1( -1 ), nRow2( -1 ),
- nCol1( -1 ), nCol2( -1 )
- {}
-
- SchNumericCellRangeAddress( const SchNumericCellRangeAddress& aOther )
- {
- nRow1 = aOther.nRow1; nRow2 = aOther.nRow2;
- nCol1 = aOther.nCol1; nCol2 = aOther.nCol2;
- }
-};
-
-// ----------------------------------------
-
-enum SchXMLAxisClass
-{
- SCH_XML_AXIS_CATEGORY,
- SCH_XML_AXIS_DOMAIN,
- SCH_XML_AXIS_VALUE,
- SCH_XML_AXIS_SERIES,
- SCH_XML_AXIS_UNDEF
-};
-
-struct SchXMLAxis
-{
- enum SchXMLAxisClass eClass;
- sal_Int8 nIndexInCategory;
- ::rtl::OUString aName;
- ::rtl::OUString aTitle;
- ::com::sun::star::awt::Point aPosition;
-
- SchXMLAxis() : eClass( SCH_XML_AXIS_UNDEF ), nIndexInCategory( 0 ) {}
-};
-
-}//end of namespace binfilter
-#endif // SCH_XML_TRANSPORTTYPES_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/xmloff_PropertyMaps.cxx b/binfilter/bf_xmloff/source/chart/xmloff_PropertyMaps.cxx
deleted file mode 100644
index 9339cc058334..000000000000
--- a/binfilter/bf_xmloff/source/chart/xmloff_PropertyMaps.cxx
+++ /dev/null
@@ -1,515 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// include PropertyMap.hxx with this define
-// to create the maps
-#ifndef _PROPERTYMAP_HXX_
-#define XML_SCH_CREATE_GLOBAL_MAPS
-#include "PropertyMap.hxx"
-#undef XML_SCH_CREATE_GLOBAL_MAPS
-#endif
-
-#include "XMLChartPropertySetMapper.hxx"
-
-#include "EnumPropertyHdl.hxx"
-#include "nmspmap.hxx"
-#include "xmluconv.hxx"
-#include "xmlexp.hxx"
-
-#include "XMLErrorIndicatorPropertyHdl.hxx"
-#include "XMLTextOrientationHdl.hxx"
-
-#include <com/sun/star/chart/ChartAxisMarks.hpp>
-#include <com/sun/star/chart/ChartDataCaption.hpp>
-
-// header for any2enum
-namespace binfilter {
-
-#define SCH_XML_SETFLAG( status, flag ) (status)|= (flag)
-#define SCH_XML_UNSETFLAG( status, flag ) (status) = ((status) | (flag)) - (flag)
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-// the following class implementations are in this file:
-//
-// * XMLChartPropHdlFactory
-// * XMLChartPropertySetMapper
-// * XMLChartExportPropertyMapper
-// * XMLChartImportPropertyMapper
-// * SchXMLStyleExport
-
-// ----------------------------------------
-
-XMLChartPropHdlFactory::~XMLChartPropHdlFactory()
-{
-}
-
-const XMLPropertyHandler* XMLChartPropHdlFactory::GetPropertyHandler( sal_Int32 nType ) const
-{
- const XMLPropertyHandler* pHdl = XMLPropertyHandlerFactory::GetPropertyHandler( nType );
- if( ! pHdl )
- {
- switch( nType )
- {
- case XML_SCH_TYPE_AXIS_ARRANGEMENT:
- pHdl = new XMLEnumPropertyHdl( aXMLChartAxisArrangementEnumMap,
- ::getCppuType((const chart::ChartAxisArrangeOrderType*)0) );
- break;
-
- case XML_SCH_TYPE_ERROR_CATEGORY:
- pHdl = new XMLEnumPropertyHdl( aXMLChartErrorCategoryEnumMap,
- ::getCppuType((const chart::ChartErrorCategory*)0) );
- break;
-
- case XML_SCH_TYPE_REGRESSION_TYPE:
- pHdl = new XMLEnumPropertyHdl( aXMLChartRegressionCurveTypeEnumMap,
- ::getCppuType((const chart::ChartRegressionCurveType*)0) );
- break;
-
- case XML_SCH_TYPE_ERROR_INDICATOR_LOWER:
- pHdl = new XMLErrorIndicatorPropertyHdl( sal_False );
- break;
- case XML_SCH_TYPE_ERROR_INDICATOR_UPPER:
- pHdl = new XMLErrorIndicatorPropertyHdl( sal_True );
- break;
-
- case XML_SCH_TYPE_SOLID_TYPE:
- // here we have a constant rather than an enum
- pHdl = new XMLEnumPropertyHdl( aXMLChartSolidTypeEnumMap,
- ::getCppuType((const sal_Int32*)0) );
- break;
- case XML_SCH_TYPE_DATAROWSOURCE:
- pHdl = new XMLEnumPropertyHdl( aXMLChartDataRowSourceTypeEnumMap,
- ::getCppuType((const chart::ChartDataRowSource*)0) );
- break;
- case XML_SCH_TYPE_TEXT_ORIENTATION:
- pHdl = new XMLTextOrientationHdl();
- break;
- }
- if( pHdl )
- PutHdlCache( nType, pHdl );
- }
-
- return pHdl;
-}
-
-// ----------------------------------------
-
-XMLChartPropertySetMapper::XMLChartPropertySetMapper() :
- XMLPropertySetMapper( aXMLChartPropMap, new XMLChartPropHdlFactory )
-{
-}
-
-XMLChartPropertySetMapper::~XMLChartPropertySetMapper()
-{
-}
-
-// ----------------------------------------
-
-XMLChartExportPropertyMapper::XMLChartExportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper,
- SvXMLExport& rExport) :
- SvXMLExportPropertyMapper( rMapper ),
- msTrue( GetXMLToken( XML_TRUE )),
- msFalse( GetXMLToken( XML_FALSE )),
- mrExport( rExport )
-{
- // chain draw properties
- ChainExportMapper( XMLShapeExport::CreateShapePropMapper( rExport ));
-
- // chain text properties
- ChainExportMapper( XMLTextParagraphExport::CreateParaExtPropMapper( rExport ));
-}
-
-XMLChartExportPropertyMapper::~XMLChartExportPropertyMapper()
-{
-}
-
-void XMLChartExportPropertyMapper::ContextFilter(
- std::vector< XMLPropertyState >& rProperties,
- uno::Reference< beans::XPropertySet > rPropSet ) const
-{
- ::rtl::OUString aAutoPropName;
- sal_Bool bCheckAuto = sal_False;
-
- // filter properties
- for( ::std::vector< XMLPropertyState >::iterator property = rProperties.begin();
- property != rProperties.end();
- property++ )
- {
- // find properties with context
- // to prevent writing this property set mnIndex member to -1
- switch( getPropertySetMapper()->GetEntryContextId( property->mnIndex ))
- {
- // if Auto... is set the corresponding properties mustn't be exported
- case XML_SCH_CONTEXT_MIN:
- bCheckAuto = sal_True;
- aAutoPropName = ::rtl::OUString::createFromAscii( "AutoMin" );
- break;
- case XML_SCH_CONTEXT_MAX:
- bCheckAuto = sal_True;
- aAutoPropName = ::rtl::OUString::createFromAscii( "AutoMax" );
- break;
- case XML_SCH_CONTEXT_STEP_MAIN:
- bCheckAuto = sal_True;
- aAutoPropName = ::rtl::OUString::createFromAscii( "AutoStepMain" );
- break;
- case XML_SCH_CONTEXT_STEP_HELP:
- bCheckAuto = sal_True;
- aAutoPropName = ::rtl::OUString::createFromAscii( "AutoStepHelp" );
- break;
- case XML_SCH_CONTEXT_ORIGIN:
- bCheckAuto = sal_True;
- aAutoPropName = ::rtl::OUString::createFromAscii( "AutoOrigin" );
- break;
-
- // the following property is deprecated
- // elemet-item symbol-image is used now
- case XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE_NAME:
- property->mnIndex = -1;
- }
-
- if( bCheckAuto )
- {
- if( rPropSet.is())
- {
- try
- {
- sal_Bool bAuto;
- uno::Any aAny = rPropSet->getPropertyValue( aAutoPropName );
- aAny >>= bAuto;
- if( bAuto )
- property->mnIndex = -1;
- }
- catch( beans::UnknownPropertyException )
- {
- }
- }
- bCheckAuto = sal_False;
- }
- }
-
- SvXMLExportPropertyMapper::ContextFilter(rProperties, rPropSet);
-}
-
-void XMLChartExportPropertyMapper::handleElementItem(
- SvXMLExport& rExport,
- const XMLPropertyState& rProperty, sal_uInt16 nFlags,
- const ::std::vector< XMLPropertyState > *pProperties,
- sal_uInt32 nIdx ) const
-{
- switch( getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ))
- {
- case XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE:
- {
- ::rtl::OUString aURLStr;
- rProperty.maValue >>= aURLStr;
-
- // export as XLink reference into the package
- // if embedding is off
- ::rtl::OUString sTempURL( mrExport.AddEmbeddedGraphicObject( aURLStr ));
- if( sTempURL.getLength() )
- {
- mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sTempURL );
- mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE,
- XML_SIMPLE );
- mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE,
- XML_ONLOAD );
- }
-
- {
- sal_uInt32 nPropIndex = rProperty.mnIndex;
- // this is the element that has to live until the next statement
- SvXMLElementExport aElem( mrExport,
- getPropertySetMapper()->GetEntryNameSpace( nPropIndex ),
- getPropertySetMapper()->GetEntryXMLName( nPropIndex ),
- sal_True, sal_True );
-
- // export as Base64 embedded graphic
- // if embedding is on
- if( aURLStr.getLength())
- mrExport.AddEmbeddedGraphicObjectAsBase64( aURLStr );
- }
- }
- break;
-
- default:
- // call parent
- SvXMLExportPropertyMapper::handleElementItem( rExport, rProperty,
- nFlags, pProperties, nIdx );
- break;
- }
-}
-
-void XMLChartExportPropertyMapper::handleSpecialItem(
- SvXMLAttributeList& rAttrList, const XMLPropertyState& rProperty,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap,
- const ::std::vector< XMLPropertyState > *pProperties,
- sal_uInt32 nIdx ) const
-{
- sal_Bool bHandled = sal_False;
-
- sal_Int32 nContextId = maPropMapper->GetEntryContextId( rProperty.mnIndex );
-
- if( nContextId )
- {
- bHandled = sal_True;
-
- ::rtl::OUString sAttrName = maPropMapper->GetEntryXMLName( rProperty.mnIndex );
- sal_uInt16 nNameSpace = maPropMapper->GetEntryNameSpace( rProperty.mnIndex );
- ::rtl::OUStringBuffer sValueBuffer;
- ::rtl::OUString sValue;
-
- sal_Int32 nValue = 0;
- sal_Bool bValue = sal_False;
-
- switch( nContextId )
- {
- case XML_SCH_CONTEXT_SPECIAL_TICKS_MAJ_INNER:
- case XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_INNER:
- rProperty.maValue >>= nValue;
- bValue = (( nValue & chart::ChartAxisMarks::INNER ) == chart::ChartAxisMarks::INNER );
- SvXMLUnitConverter::convertBool( sValueBuffer, bValue );
- break;
- case XML_SCH_CONTEXT_SPECIAL_TICKS_MAJ_OUTER:
- case XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_OUTER:
- rProperty.maValue >>= nValue;
- bValue = (( nValue & chart::ChartAxisMarks::OUTER ) == chart::ChartAxisMarks::OUTER );
- SvXMLUnitConverter::convertBool( sValueBuffer, bValue );
- break;
- case XML_SCH_CONTEXT_SPECIAL_TEXT_ROTATION:
- {
- // convert from 100th degrees to degrees (double)
- rProperty.maValue >>= nValue;
- double fVal = (double)(nValue) / 100.0;
- SvXMLUnitConverter::convertDouble( sValueBuffer, fVal );
- }
- break;
- case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_NUMBER:
- {
- rProperty.maValue >>= nValue;
- if((( nValue & chart::ChartDataCaption::VALUE ) == chart::ChartDataCaption::VALUE ))
- sValueBuffer.append( GetXMLToken( XML_VALUE ));
- else if(( nValue & chart::ChartDataCaption::PERCENT ) == chart::ChartDataCaption::PERCENT )
- sValueBuffer.append( GetXMLToken( XML_PERCENTAGE ));
- else
- sValueBuffer.append( GetXMLToken( XML_NONE ));
- }
- break;
- case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_TEXT:
- rProperty.maValue >>= nValue;
- bValue = (( nValue & chart::ChartDataCaption::TEXT ) == chart::ChartDataCaption::TEXT );
- SvXMLUnitConverter::convertBool( sValueBuffer, bValue );
- break;
- case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_SYMBOL:
- rProperty.maValue >>= nValue;
- bValue = (( nValue & chart::ChartDataCaption::SYMBOL ) == chart::ChartDataCaption::SYMBOL );
- SvXMLUnitConverter::convertBool( sValueBuffer, bValue );
- break;
-
- case XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH:
- case XML_SCH_CONTEXT_SPECIAL_SYMBOL_HEIGHT:
- {
- awt::Size aSize;
- rProperty.maValue >>= aSize;
- rUnitConverter.convertMeasure( sValueBuffer,
- nContextId == XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH
- ? aSize.Width
- : aSize.Height );
- }
- break;
-
- case XML_SCH_CONTEXT_SPECIAL_NUMBER_FORMAT:
- {
- // just for import
- break;
- }
- default:
- bHandled = sal_False;
- break;
- }
-
- if( sValueBuffer.getLength())
- {
- sValue = sValueBuffer.makeStringAndClear();
- sAttrName = rNamespaceMap.GetQNameByKey( nNameSpace, sAttrName );
- rAttrList.AddAttribute( sAttrName, sValue );
- }
- }
-
- if( !bHandled )
- {
- // call parent
- SvXMLExportPropertyMapper::handleSpecialItem( rAttrList, rProperty, rUnitConverter, rNamespaceMap, pProperties, nIdx );
- }
-}
-
-// ----------------------------------------
-
-XMLChartImportPropertyMapper::XMLChartImportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper,
- const SvXMLImport& rImport ) :
- SvXMLImportPropertyMapper( rMapper, const_cast< SvXMLImport & >( rImport )),
- mrImport( const_cast< SvXMLImport & > ( rImport ))
-{
- // 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, mrImport ));
-
- // do not chain text properties: on import this is done by shape mapper
- // to import old documents
-// ChainImportMapper( XMLTextImportHelper::CreateParaExtPropMapper());
-}
-
-XMLChartImportPropertyMapper::~XMLChartImportPropertyMapper()
-{
-}
-
-sal_Bool XMLChartImportPropertyMapper::handleSpecialItem(
- XMLPropertyState& rProperty,
- ::std::vector< XMLPropertyState >& rProperties,
- const ::rtl::OUString& rValue,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap ) const
-{
- static const ::rtl::OUString sPackageProtocol( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.Package:" ) );
- sal_Int32 nContextId = maPropMapper->GetEntryContextId( rProperty.mnIndex );
- sal_Bool bRet = (nContextId != 0);
-
- if( nContextId )
- {
- sal_Int32 nValue = 0;
- sal_Bool bValue = sal_False;
-
- switch( nContextId )
- {
- case XML_SCH_CONTEXT_SPECIAL_TICKS_MAJ_INNER:
- case XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_INNER:
- SvXMLUnitConverter::convertBool( bValue, rValue );
- // modify old value
- rProperty.maValue >>= nValue;
- if( bValue )
- SCH_XML_SETFLAG( nValue, chart::ChartAxisMarks::INNER );
- else
- SCH_XML_UNSETFLAG( nValue, chart::ChartAxisMarks::INNER );
- rProperty.maValue <<= nValue;
- break;
- case XML_SCH_CONTEXT_SPECIAL_TICKS_MAJ_OUTER:
- case XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_OUTER:
- SvXMLUnitConverter::convertBool( bValue, rValue );
- // modify old value
- rProperty.maValue >>= nValue;
- if( bValue )
- SCH_XML_SETFLAG( nValue, chart::ChartAxisMarks::OUTER );
- else
- SCH_XML_UNSETFLAG( nValue, chart::ChartAxisMarks::OUTER );
- rProperty.maValue <<= nValue;
- break;
- case XML_SCH_CONTEXT_SPECIAL_TEXT_ROTATION:
- {
- // convert from degrees (double) to 100th degrees (integer)
- double fVal;
- SvXMLUnitConverter::convertDouble( fVal, rValue );
- nValue = (sal_Int32)( fVal * 100.0 );
- rProperty.maValue <<= nValue;
- }
- break;
- case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_NUMBER:
- {
- // modify old value
- rProperty.maValue >>= nValue;
- if( IsXMLToken( rValue, XML_NONE ))
- SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::VALUE | chart::ChartDataCaption::PERCENT );
- else if( IsXMLToken( rValue, XML_VALUE ) )
- SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::VALUE );
- else // must be XML_PERCENTAGE
- SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::PERCENT );
- rProperty.maValue <<= nValue;
- }
- break;
- case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_TEXT:
- rProperty.maValue >>= nValue;
- SvXMLUnitConverter::convertBool( bValue, rValue );
- if( bValue )
- SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::TEXT );
- else
- SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::TEXT );
- rProperty.maValue <<= nValue;
- break;
- case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_SYMBOL:
- rProperty.maValue >>= nValue;
- SvXMLUnitConverter::convertBool( bValue, rValue );
- if( bValue )
- SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::SYMBOL );
- else
- SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::SYMBOL );
- rProperty.maValue <<= nValue;
- break;
- case XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH:
- case XML_SCH_CONTEXT_SPECIAL_SYMBOL_HEIGHT:
- {
- awt::Size aSize;
- rProperty.maValue >>= aSize;
- rUnitConverter.convertMeasure( nContextId == XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH
- ? aSize.Width
- : aSize.Height,
- rValue );
- rProperty.maValue <<= aSize;
- }
- break;
-
- // deprecated from 6.0 beta on
- case XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE_NAME:
- rProperty.maValue <<= mrImport.ResolveGraphicObjectURL( rValue, sal_False );
- break;
-
- default:
- bRet = sal_False;
- break;
- }
- }
-
-
- // if we didn't handle it, the parent should
- if( !bRet )
- {
- // call parent
- bRet = SvXMLImportPropertyMapper::handleSpecialItem( rProperty, rProperties, rValue, rUnitConverter, rNamespaceMap );
- }
-
- return bRet;
-}
-
-void XMLChartImportPropertyMapper::finished( ::std::vector< XMLPropertyState >& rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const
-{
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/xmloff_SchXMLAutoStylePoolP.cxx b/binfilter/bf_xmloff/source/chart/xmloff_SchXMLAutoStylePoolP.cxx
deleted file mode 100644
index 41078163927d..000000000000
--- a/binfilter/bf_xmloff/source/chart/xmloff_SchXMLAutoStylePoolP.cxx
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <xmlprmap.hxx>
-
-#include "SchXMLAutoStylePoolP.hxx"
-#include "PropertyMap.hxx"
-
-#include "SchXMLExport.hxx"
-namespace binfilter {
-
-using ::binfilter::xmloff::token::GetXMLToken;
-using ::binfilter::xmloff::token::XML_CDATA;
-
-SchXMLAutoStylePoolP::SchXMLAutoStylePoolP( SchXMLExport& rSchXMLExport ) :
- SvXMLAutoStylePoolP( rSchXMLExport ),
- mrSchXMLExport( rSchXMLExport )
-{}
-
-SchXMLAutoStylePoolP::~SchXMLAutoStylePoolP()
-{}
-
-void SchXMLAutoStylePoolP::exportStyleAttributes(
- SvXMLAttributeList& rAttrList,
- sal_Int32 nFamily,
- const ::std::vector< XMLPropertyState >& rProperties,
- const SvXMLExportPropertyMapper& rPropExp
- , const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap
- ) const
-{
- const ::rtl::OUString sCDATA( GetXMLToken( XML_CDATA ));
- SvXMLAutoStylePoolP::exportStyleAttributes( rAttrList, nFamily, rProperties,
- rPropExp, rUnitConverter, rNamespaceMap );
-
- if( nFamily == XML_STYLE_FAMILY_SCH_CHART_ID )
- {
- ::std::vector< XMLPropertyState >::const_iterator iter = rProperties.begin();
- for( iter; (iter != rProperties.end()); iter++ )
- {
- UniReference< XMLPropertySetMapper > aPropMapper =
- mrSchXMLExport.GetPropertySetMapper();
- sal_Int16 nContextID = aPropMapper->GetEntryContextId( iter->mnIndex );
- if( nContextID == XML_SCH_CONTEXT_SPECIAL_NUMBER_FORMAT )
- {
- sal_Int32 nNumberFormat = -1;
- if( ( iter->maValue >>= nNumberFormat ) &&
- ( nNumberFormat != -1 ))
- {
- ::rtl::OUString sAttrValue = mrSchXMLExport.getDataStyleName( nNumberFormat );
- if( sAttrValue.getLength() )
- {
- mrSchXMLExport.AddAttribute(
- aPropMapper->GetEntryNameSpace( iter->mnIndex ),
- aPropMapper->GetEntryXMLName( iter->mnIndex ),
- sAttrValue );
- }
- }
- }
- }
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/xmloff_SchXMLChartContext.cxx b/binfilter/bf_xmloff/source/chart/xmloff_SchXMLChartContext.cxx
deleted file mode 100644
index 6987dbee29cc..000000000000
--- a/binfilter/bf_xmloff/source/chart/xmloff_SchXMLChartContext.cxx
+++ /dev/null
@@ -1,939 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "SchXMLChartContext.hxx"
-#include "SchXMLPlotAreaContext.hxx"
-#include "SchXMLParagraphContext.hxx"
-#include "SchXMLTableContext.hxx"
-
-#include <tools/debug.hxx>
-
-#include "xmlnmspe.hxx"
-#include "nmspmap.hxx"
-#include "xmluconv.hxx"
-#include "prstylei.hxx"
-
-#include "vector"
-
-#include <com/sun/star/chart/ChartLegendPosition.hpp>
-#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
-#include <com/sun/star/chart/ChartDataRowSource.hpp>
-#include <com/sun/star/chart/XChartDataArray.hpp>
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-#define SCH_BUILDCHART(xDoc) if( xDoc->hasControllersLocked() ) {\
- xDoc->unlockControllers();\
- xDoc->lockControllers(); }
-
-enum SchXMLChartType
-{
- XML_CHART_CLASS_LINE,
- XML_CHART_CLASS_AREA,
- XML_CHART_CLASS_CIRCLE,
- XML_CHART_CLASS_RING,
- XML_CHART_CLASS_SCATTER,
- XML_CHART_CLASS_RADAR,
- XML_CHART_CLASS_BAR,
- XML_CHART_CLASS_STOCK,
- XML_CHART_CLASS_BUBBLE, // not yet implemented
- XML_CHART_CLASS_ADDIN
-};
-
-// ----------------------------------------
-
-static __FAR_DATA SvXMLEnumMapEntry aXMLChartClassMap[] =
-{
- { XML_LINE, XML_CHART_CLASS_LINE },
- { XML_AREA, XML_CHART_CLASS_AREA },
- { XML_CIRCLE, XML_CHART_CLASS_CIRCLE },
- { XML_RING, XML_CHART_CLASS_RING },
- { XML_SCATTER, XML_CHART_CLASS_SCATTER },
- { XML_RADAR, XML_CHART_CLASS_RADAR },
- { XML_BAR, XML_CHART_CLASS_BAR },
- { XML_STOCK, XML_CHART_CLASS_STOCK },
- { XML_BUBBLE, XML_CHART_CLASS_BUBBLE },
- { XML_ADD_IN, XML_CHART_CLASS_ADDIN },
- { XML_TOKEN_INVALID, 0 }
-};
-
-static __FAR_DATA SvXMLEnumMapEntry aXMLLegendAlignmentMap[] =
-{
- { XML_LEFT, chart::ChartLegendPosition_LEFT },
- { XML_TOP, chart::ChartLegendPosition_TOP },
- { XML_RIGHT, chart::ChartLegendPosition_RIGHT },
- { XML_BOTTOM, chart::ChartLegendPosition_BOTTOM },
- { XML_TOKEN_INVALID, 0 }
-};
-
-// ----------------------------------------
-
-SchXMLChartContext::SchXMLChartContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport, const ::rtl::OUString& rLocalName ) :
- SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ),
- mrImportHelper( rImpHelper ),
- mbHasOwnTable( sal_False ),
- mbHasLegend( sal_False )
-{
-}
-
-SchXMLChartContext::~SchXMLChartContext()
-{}
-
-void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- // parse attributes
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- ::rtl::OUString aValue;
- const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetChartAttrTokenMap();
- awt::Size aChartSize;
- // this flag is necessarry for pie charts in the core
- sal_Bool bSetSwitchData = sal_False;
- sal_Bool bDomainForDefaultDataNeeded = sal_False;
-
- ::rtl::OUString aServiceName;
- ::rtl::OUString sAutoStyleName;
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- ::rtl::OUString aValue = xAttrList->getValueByIndex( i );
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- switch( rAttrTokenMap.Get( nPrefix, aLocalName ))
- {
- case XML_TOK_CHART_CLASS:
- {
- USHORT nEnumVal;
- if( GetImport().GetMM100UnitConverter().convertEnum( nEnumVal, aValue, aXMLChartClassMap ))
- {
- switch( nEnumVal )
- {
- case XML_CHART_CLASS_LINE:
- aServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.chart.LineDiagram" ));
- break;
- case XML_CHART_CLASS_AREA:
- aServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.chart.AreaDiagram" ));
- break;
- case XML_CHART_CLASS_CIRCLE:
- aServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.chart.PieDiagram" ));
- bSetSwitchData = sal_True;
- break;
- case XML_CHART_CLASS_RING:
- aServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.chart.DonutDiagram" ));
- break;
- case XML_CHART_CLASS_SCATTER:
- aServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.chart.XYDiagram" ));
- bDomainForDefaultDataNeeded = sal_True;
- break;
- case XML_CHART_CLASS_RADAR:
- aServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.chart.NetDiagram" ));
- break;
- case XML_CHART_CLASS_BAR:
- aServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.chart.BarDiagram" ));
- break;
- case XML_CHART_CLASS_STOCK:
- aServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.chart.StockDiagram" ));
- break;
- case XML_CHART_CLASS_BUBBLE:
- DBG_ERROR( "Bubble chart not supported yet" );
- break;
- case XML_CHART_CLASS_ADDIN:
- // service is taken from add-in-name attribute
-
- // for service charts assume domain in base type
- // if base type doesn't use a domain this is ok,
- // the data just grows bigger
- bDomainForDefaultDataNeeded = sal_True;
- break;
- }
- }
- }
- break;
-
- case XML_TOK_CHART_WIDTH:
- GetImport().GetMM100UnitConverter().convertMeasure( aChartSize.Width, aValue );
- break;
-
- case XML_TOK_CHART_HEIGHT:
- GetImport().GetMM100UnitConverter().convertMeasure( aChartSize.Height, aValue );
- break;
-
- case XML_TOK_CHART_STYLE_NAME:
- sAutoStyleName = aValue;
- break;
-
- case XML_TOK_CHART_ADDIN_NAME:
- aServiceName = aValue;
- break;
-
- case XML_TOK_CHART_COL_MAPPING:
- msColTrans = aValue;
- break;
- case XML_TOK_CHART_ROW_MAPPING:
- msRowTrans = aValue;
- break;
- }
- }
-
- InitChart (aChartSize, bDomainForDefaultDataNeeded, aServiceName, bSetSwitchData);
-
- // set auto-styles for Area
- uno::Reference< beans::XPropertySet > xProp( mrImportHelper.GetChartDocument()->getArea(), uno::UNO_QUERY );
- if( xProp.is())
- {
- const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext();
- if( pStylesCtxt )
- {
- const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
- mrImportHelper.GetChartFamilyID(), sAutoStyleName );
-
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
- }
- }
-
- // prevent BuildChart from now on
- uno::Reference< frame::XModel > xModel( mrImportHelper.GetChartDocument(), uno::UNO_QUERY );
- if( xModel.is())
- xModel->lockControllers();
-}
-
-void SchXMLChartContext::EndElement()
-{
- uno::Reference< chart::XChartDocument > xDoc = mrImportHelper.GetChartDocument();
- uno::Reference< beans::XPropertySet > xProp( xDoc, uno::UNO_QUERY );
-
- if( xProp.is())
- {
- if( maMainTitle.getLength())
- {
- uno::Reference< beans::XPropertySet > xTitleProp( xDoc->getTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
- {
- try
- {
- uno::Any aAny;
- aAny <<= maMainTitle;
- xTitleProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), aAny );
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Property String for Title not available" );
- }
-/* uno::Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY );
- if( xShape.is())
- {
- // perform build chart with new title string
- // so that setting the position works correctly
- if( xDoc.is())
- {
- xDoc->unlockControllers();
- xDoc->lockControllers();
- }
- xShape->setPosition( maMainTitlePos );
- }
-*/ }
- }
- if( maSubTitle.getLength())
- {
- uno::Reference< beans::XPropertySet > xTitleProp( xDoc->getSubTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
- {
- try
- {
- uno::Any aAny;
- aAny <<= maSubTitle;
- xTitleProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), aAny );
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Property String for Title not available" );
- }
-/* uno::Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY );
- if( xShape.is())
- {
- // perform build chart with new title string
- // so that setting the position works correctly
- if( xDoc.is())
- {
- xDoc->unlockControllers();
- xDoc->lockControllers();
- }
- xShape->setPosition( maSubTitlePos );
- }
-*/ }
- }
- }
-
-
- if( mbHasOwnTable )
- {
- // apply data read in table sub-element to chart
- SchXMLTableHelper::applyTableSimple( maTable, xDoc );
- }
- else
- {
- // deprecated method
- // translate cell-address strings
- if( maSeriesAddresses.getLength() ||
- msCategoriesAddress.getLength())
- {
- uno::Reference< util::XStringMapping > xTableAddressMapper = mrImportHelper.GetTableAddressMapper();
- if( xTableAddressMapper.is())
- {
- // series
- sal_Int32 nLength = maSeriesAddresses.getLength();
- sal_Int32 nIdx;
- uno::Sequence< ::rtl::OUString > aStrSeq( nLength * 2 + 1 );
- sal_Bool bHasDomain = sal_False;
-
- for( nIdx = 0; nIdx < nLength; nIdx++ )
- {
- aStrSeq[ nIdx * 2 ] = maSeriesAddresses[ nIdx ].DataRangeAddress;
- aStrSeq[ nIdx * 2 + 1 ] = maSeriesAddresses[ nIdx ].LabelAddress;
-
- // domains
- if( maSeriesAddresses[ nIdx ].DomainRangeAddresses.getLength())
- {
- xTableAddressMapper->mapStrings( maSeriesAddresses[ nIdx ].DomainRangeAddresses );
- bHasDomain = sal_True;
- }
- }
- // categories
- aStrSeq[ nLength * 2 ] = msCategoriesAddress;
-
- // translate
- xTableAddressMapper->mapStrings( aStrSeq );
-
- // write back
- sal_Int32 nOffset = 0;
- for( nIdx = 0; nIdx < nLength; nIdx++ )
- {
- // #81525# convert addresses for xy charts
- // this should be done by calc in the future
- if( nIdx == 0 &&
- bHasDomain )
- {
- // enlarge the sequence
- maSeriesAddresses.realloc( maSeriesAddresses.getLength() + 1 );
-
- // copy the domain as first series
- if( maSeriesAddresses[ nIdx + nOffset ].DomainRangeAddresses.getLength() > 0 )
- maSeriesAddresses[ nIdx + nOffset ].DataRangeAddress =
- maSeriesAddresses[ nIdx + nOffset ].DomainRangeAddresses[ 0 ];
- // the current data range becomes the second series
- nOffset++;
- }
-
- maSeriesAddresses[ nIdx + nOffset ].DataRangeAddress = aStrSeq[ nIdx * 2 ];
- maSeriesAddresses[ nIdx + nOffset ].LabelAddress = aStrSeq[ nIdx * 2 + 1 ];
- }
- msCategoriesAddress = aStrSeq[ nLength * 2 ];
- }
- }
- }
-
- // set table references at document
- // even when having own table (Writer)
- if( xProp.is())
- {
- try
- {
- uno::Any aAny;
- if( msChartAddress.getLength())
- {
- aAny <<= msChartAddress;
- xProp->setPropertyValue( ::rtl::OUString::createFromAscii( "ChartRangeAddress" ), aAny );
-
- if( msTableNumberList.getLength())
- {
- aAny <<= msTableNumberList;
- xProp->setPropertyValue( ::rtl::OUString::createFromAscii( "TableNumberList" ), aAny );
- }
- }
- else
- {
- // deprecated
- if( msCategoriesAddress.getLength())
- {
- aAny <<= msCategoriesAddress;
- xProp->setPropertyValue( ::rtl::OUString::createFromAscii( "CategoriesRangeAddress" ), aAny );
- }
-
- // deprecated
- if( maSeriesAddresses.getLength())
- {
- aAny <<= maSeriesAddresses;
- xProp->setPropertyValue( ::rtl::OUString::createFromAscii( "SeriesAddresses" ), aAny );
- }
- }
-
- // row / col translations
- bool bHasColTrans = (msColTrans.getLength() > 0);
- bool bHasRowTrans = (msRowTrans.getLength() > 0);
- if( bHasColTrans )
- {
- uno::Sequence< sal_Int32 > aSeq = GetNumberSequenceFromString( msColTrans );
- aAny <<= aSeq;
- xProp->setPropertyValue( ::rtl::OUString::createFromAscii( "TranslatedColumns" ), aAny );
- }
- else if( bHasRowTrans )
- {
- uno::Sequence< sal_Int32 > aSeq = GetNumberSequenceFromString( msRowTrans );
- aAny <<= aSeq;
- xProp->setPropertyValue( ::rtl::OUString::createFromAscii( "TranslatedRows" ), aAny );
- }
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_WARNING( "Required property not found in ChartDocument" );
- }
- }
-
- // allow BuildChart again
-/* uno::Reference< frame::XModel > xModel( xDoc, uno::UNO_QUERY );
- if( xModel.is())
- xModel->unlockControllers();
-*/
- // Set the main title's and subtitle's positions.
- if( maMainTitle.getLength() > 0)
- {
- uno::Reference<drawing::XShape> xMainTitleShape(xDoc->getTitle(), uno::UNO_QUERY);
- if( xMainTitleShape.is())
- xMainTitleShape->setPosition( maMainTitlePos );
- }
- if( maSubTitle.getLength() > 0)
- {
- uno::Reference<drawing::XShape> xSubTitleShape(xDoc->getSubTitle(), uno::UNO_QUERY);
- if( xSubTitleShape.is())
- xSubTitleShape->setPosition( maSubTitlePos );
- }
-
- // set absolute legend position after (BuildChart!)
- if( mbHasLegend )
- {
- uno::Reference< drawing::XShape > xLegendShape( xDoc->getLegend(), uno::UNO_QUERY );
- if( xLegendShape.is())
- xLegendShape->setPosition( maLegendPos );
- }
-
- // #102413# BuildChart to manifest legend position
- if( xDoc->hasControllersLocked())
- xDoc->unlockControllers();
-
- // AF: No more BuildCharts until Initialize is called (by Draw or SaveAs).
-
- // BM: There should be no further BuildCharts, and it is very dangerous to
- // leave the lock status on hoping that it is changed in Draw or SaveAs
- // (OLE-Clone?). At least it isn't for the writer flat XML filter. So,
- // leave Controllers unlocked from now on, as this is the last line of code
- // that the Chart XML import routine will call
-}
-
-SvXMLImportContext* SchXMLChartContext::CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- static const sal_Bool bTrue = sal_True;
- static const uno::Any aTrueBool( &bTrue, ::getBooleanCppuType());
-
- SvXMLImportContext* pContext = 0;
- const SvXMLTokenMap& rTokenMap = mrImportHelper.GetChartElemTokenMap();
- uno::Reference< chart::XChartDocument > xDoc = mrImportHelper.GetChartDocument();
- uno::Reference< beans::XPropertySet > xProp( xDoc, uno::UNO_QUERY );
-
- switch( rTokenMap.Get( nPrefix, rLocalName ))
- {
- case XML_TOK_CHART_PLOT_AREA:
- pContext = new SchXMLPlotAreaContext( mrImportHelper, GetImport(), rLocalName,
- maSeriesAddresses, msCategoriesAddress,
- msChartAddress, msTableNumberList );
- break;
-
- case XML_TOK_CHART_TITLE:
- if( xDoc.is())
- {
- if( xProp.is())
- {
- uno::Any aTrueBool;
- aTrueBool <<= (sal_Bool)(sal_True);
- xProp->setPropertyValue( ::rtl::OUString::createFromAscii( "HasMainTitle" ), aTrueBool );
-
- SCH_BUILDCHART( xDoc );
- }
- uno::Reference< drawing::XShape > xTitleShape( xDoc->getTitle(), uno::UNO_QUERY );
- pContext = new SchXMLTitleContext( mrImportHelper, GetImport(),
- rLocalName, maMainTitle, xTitleShape, maMainTitlePos );
- }
- break;
-
- case XML_TOK_CHART_SUBTITLE:
- if( xDoc.is())
- {
- if( xProp.is())
- {
- xProp->setPropertyValue( ::rtl::OUString::createFromAscii( "HasSubTitle" ), aTrueBool );
- SCH_BUILDCHART( xDoc );
- }
- uno::Reference< drawing::XShape > xTitleShape( xDoc->getSubTitle(), uno::UNO_QUERY );
- pContext = new SchXMLTitleContext( mrImportHelper, GetImport(),
- rLocalName, maSubTitle, xTitleShape, maSubTitlePos );
- }
- break;
-
- case XML_TOK_CHART_LEGEND:
- pContext = new SchXMLLegendContext( mrImportHelper, GetImport(), rLocalName, maLegendPos );
- mbHasLegend =sal_True;
- break;
-
- case XML_TOK_CHART_TABLE:
- pContext = new SchXMLTableContext( mrImportHelper, GetImport(), rLocalName, maTable );
- if( pContext )
- {
- mbHasOwnTable = sal_True;
- if( xProp.is())
- try
- {
- xProp->setPropertyValue( ::rtl::OUString::createFromAscii( "ExportData" ), aTrueBool );
- }
- catch( uno::Exception )
- {
- DBG_ERRORFILE( "Property missing" );
- }
- }
- break;
-
- default:
- // try importing as an additional shape
- if( ! mxDrawPage.is())
- {
- uno::Reference< drawing::XDrawPageSupplier > xSupp( xDoc, uno::UNO_QUERY );
- if( xSupp.is())
- mxDrawPage = uno::Reference< drawing::XShapes >( xSupp->getDrawPage(), uno::UNO_QUERY );
-
- DBG_ASSERT( mxDrawPage.is(), "Invalid Chart Page" );
- }
- if( mxDrawPage.is())
- pContext = GetImport().GetShapeImport()->CreateGroupChildContext(
- GetImport(), nPrefix, rLocalName, xAttrList, mxDrawPage );
- break;
- }
-
- if( ! pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
- return pContext;
-}
-
-
-/*
- With a locked controller the following is done here:
- 1. Hide title, subtitle, and legend.
- 2. Set the size of the draw page.
- 3. Set a (logically) empty data set.
- 4. Set the chart type.
-*/
-void SchXMLChartContext::InitChart (awt::Size aChartSize,
- sal_Bool bDomainForDefaultDataNeeded,
- ::rtl::OUString aServiceName,
- sal_Bool bSetSwitchData)
-{
- uno::Reference< chart::XChartDocument > xDoc = mrImportHelper.GetChartDocument();
- DBG_ASSERT( xDoc.is(), "No valid document!" );
- uno::Reference< frame::XModel > xModel (xDoc, uno::UNO_QUERY );
- if( xModel.is())
- xModel->lockControllers();
-
- // Hide title, subtitle, and legend
- uno::Reference< beans::XPropertySet > xProp( mrImportHelper.GetChartDocument(), uno::UNO_QUERY );
- if( xProp.is())
- {
- uno::Any aFalseBool;
- aFalseBool <<= (sal_Bool)(sal_False);
- try
- {
- xProp->setPropertyValue( ::rtl::OUString::createFromAscii( "HasMainTitle" ), aFalseBool );
- xProp->setPropertyValue( ::rtl::OUString::createFromAscii( "HasSubTitle" ), aFalseBool );
- xProp->setPropertyValue( ::rtl::OUString::createFromAscii( "HasLegend" ), aFalseBool );
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "XML-Chart Import: Property not found" );
- }
- }
-
- // Set the size of the draw page.
- uno::Reference< drawing::XDrawPageSupplier > xPageSupp( mrImportHelper.GetChartDocument(), uno::UNO_QUERY );
- if( xPageSupp.is())
- {
- uno::Reference< beans::XPropertySet > xPageProp( xPageSupp->getDrawPage(), uno::UNO_QUERY );
- if( xPageProp.is())
- {
- try
- {
- uno::Any aAny;
- aAny <<= (sal_Int32)( aChartSize.Width );
- xPageProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" )), aAny );
-
- aAny <<= (sal_Int32)( aChartSize.Height );
- xPageProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Height" )), aAny );
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Cannot set page size" );
- }
- }
- }
-
- // We have to unlock the controllers and execute an implicit BuildChart because
- // the following call to setData needs data structures created in a BuildChart.
- if( xModel.is())
- xModel->unlockControllers();
-
- // Set a (logically) empty data set. It will later be filled with the
- // actual data.
- // Because the chart does not work with a really empty data set a dummy data point
- // and, if necessary, a dummy domain value (Not a number) are set.
- uno::Reference< chart::XChartDataArray > xArray( xDoc->getData(), uno::UNO_QUERY );
- if( xArray.is())
- {
- double fNan = 0.0;
-
- uno::Reference< chart::XChartData > xData( xDoc->getData(), uno::UNO_QUERY );
- if( xData.is())
- fNan = xData->getNotANumber();
-
- // attention: the data must at least be 1 x 1,
- // (or 2 x 2 for scatter charts)
- // otherwise BuildChart doesn't perform much.
- if( bDomainForDefaultDataNeeded )
- {
- uno::Sequence< uno::Sequence< double > > aAlmostEmptySeq( 2 );
- aAlmostEmptySeq[ 0 ].realloc( 2 );
- aAlmostEmptySeq[ 0 ][ 0 ] = 0.0;
- aAlmostEmptySeq[ 0 ][ 1 ] = fNan;
-
- aAlmostEmptySeq[ 1 ].realloc( 2 );
- aAlmostEmptySeq[ 1 ][ 0 ] = 0.0;
- aAlmostEmptySeq[ 1 ][ 1 ] = fNan;
-
- xArray->setData( aAlmostEmptySeq );
- }
- else
- {
- uno::Sequence< uno::Sequence< double > > aAlmostEmptySeq( 1 );
- aAlmostEmptySeq[ 0 ].realloc( 1 );
- aAlmostEmptySeq[ 0 ][ 0 ] = 0.0;
-
- xArray->setData( aAlmostEmptySeq );
- }
- }
-
- if( xModel.is())
- xModel->lockControllers();
-
- // Set the chart type via setting the diagram.
- if( aServiceName.getLength() &&
- xDoc.is())
- {
- uno::Reference< lang::XMultiServiceFactory > xFact( xDoc, uno::UNO_QUERY );
- if( xFact.is())
- {
- uno::Reference< chart::XDiagram > xDia( xFact->createInstance( aServiceName ), uno::UNO_QUERY );
- if( xDia.is())
- {
- xDoc->setDiagram( xDia );
-
- // set data row source for pie charts to ROWS
- if( bSetSwitchData )
- {
- uno::Reference< beans::XPropertySet > xDiaProp( xDia, uno::UNO_QUERY );
- if( xDiaProp.is())
- {
- uno::Any aAny;
- aAny <<= chart::ChartDataRowSource( chart::ChartDataRowSource_ROWS );
- xDiaProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataRowSource" )), aAny );
- }
- }
- }
- }
- }
-
- if( xModel.is())
- xModel->unlockControllers();
-}
-
-uno::Sequence< sal_Int32 > SchXMLChartContext::GetNumberSequenceFromString( const ::rtl::OUString& rStr )
-{
- const sal_Unicode aSpace( ' ' );
-
- // count number of entries
- ::std::vector< sal_Int32 > aVec;
- sal_Int32 nLastPos = 0;
- sal_Int32 nPos = 0;
- const sal_Int32 nSize = rStr.getLength();
- while( nPos != -1 )
- {
- nPos = rStr.indexOf( aSpace, nLastPos );
- if( nPos > nLastPos )
- {
- aVec.push_back( rStr.copy( nLastPos, (nPos - nLastPos) ).toInt32() );
- }
- if( nPos != -1 )
- nLastPos = nPos + 1;
- }
- // last entry
- if( nLastPos != 0 &&
- rStr.getLength() > nLastPos )
- {
- aVec.push_back( rStr.copy( nLastPos, (rStr.getLength() - nLastPos) ).toInt32() );
- }
-
- const sal_Int32 nVecSize = aVec.size();
- uno::Sequence< sal_Int32 > aSeq( nVecSize );
- sal_Int32* pSeqArr = aSeq.getArray();
- for( nPos = 0; nPos < nVecSize; ++nPos )
- {
- pSeqArr[ nPos ] = aVec[ nPos ];
- }
- return aSeq;
-}
-
-// ----------------------------------------
-
-SchXMLTitleContext::SchXMLTitleContext( SchXMLImportHelper& rImpHelper, SvXMLImport& rImport,
- const ::rtl::OUString& rLocalName,
- ::rtl::OUString& rTitle,
- uno::Reference< drawing::XShape >& xTitleShape,
- awt::Point& rPosition ) :
- SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ),
- mrImportHelper( rImpHelper ),
- mrTitle( rTitle ),
- mxTitleShape( xTitleShape ),
- mrPosition( rPosition )
-{
-}
-
-SchXMLTitleContext::~SchXMLTitleContext()
-{}
-
-void SchXMLTitleContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- ::rtl::OUString aValue;
-
- if( mxTitleShape.is())
- mrPosition = mxTitleShape->getPosition();
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- ::rtl::OUString aValue = xAttrList->getValueByIndex( i );
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- if( nPrefix == XML_NAMESPACE_SVG )
- {
- if( IsXMLToken( aLocalName, XML_X ) )
- GetImport().GetMM100UnitConverter().convertMeasure( mrPosition.X, aValue );
- else if( IsXMLToken( aLocalName, XML_Y ) )
- GetImport().GetMM100UnitConverter().convertMeasure( mrPosition.Y, aValue );
- }
- else if( nPrefix == XML_NAMESPACE_CHART )
- {
- if( IsXMLToken( aLocalName, XML_STYLE_NAME ) )
- msAutoStyleName = aValue;
- }
- }
-
- if( mxTitleShape.is())
- {
- uno::Reference< beans::XPropertySet > xProp( mxTitleShape, uno::UNO_QUERY );
- if( xProp.is())
- {
- const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext();
- if( pStylesCtxt )
- {
- const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
- mrImportHelper.GetChartFamilyID(), msAutoStyleName );
-
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
- }
- }
- }
-}
-
-SvXMLImportContext* SchXMLTitleContext::CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = 0;
-
- if( nPrefix == XML_NAMESPACE_TEXT &&
- IsXMLToken( rLocalName, XML_P ) )
- {
- pContext = new SchXMLParagraphContext( GetImport(), rLocalName, mrTitle );
- }
- else
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
- return pContext;
-}
-
-// ----------------------------------------
-
-SchXMLLegendContext::SchXMLLegendContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport, const ::rtl::OUString& rLocalName,
- ::com::sun::star::awt::Point& rPosition ) :
- SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ),
- mrImportHelper( rImpHelper ),
- mrPosition( rPosition )
-{
-}
-
-void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- uno::Reference< chart::XChartDocument > xDoc = mrImportHelper.GetChartDocument();
- if( ! xDoc.is())
- return;
-
- // turn on legend
- uno::Reference< beans::XPropertySet > xDocProp( xDoc, uno::UNO_QUERY );
- if( xDocProp.is())
- {
- uno::Any aTrueBool;
- aTrueBool <<= (sal_Bool)(sal_True);
- try
- {
- xDocProp->setPropertyValue( ::rtl::OUString::createFromAscii( "HasLegend" ), aTrueBool );
- SCH_BUILDCHART( xDoc );
-
- // initialize position
- uno::Reference< drawing::XShape > xLegendShape( xDoc->getLegend(), uno::UNO_QUERY );
- if( xLegendShape.is())
- mrPosition = xLegendShape->getPosition();
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Property HasLegend not found" );
- }
- }
-
- // parse attributes
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- ::rtl::OUString aValue;
- const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetLegendAttrTokenMap();
-
- awt::Point aPosition;
- uno::Reference< drawing::XShape > xLegendShape( xDoc->getLegend(), uno::UNO_QUERY );
- if( xLegendShape.is())
- aPosition = xLegendShape->getPosition();
-
- ::rtl::OUString sAutoStyleName;
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- ::rtl::OUString aValue = xAttrList->getValueByIndex( i );
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- switch( rAttrTokenMap.Get( nPrefix, aLocalName ))
- {
- case XML_TOK_LEGEND_POSITION:
- {
- // set anchor position
- uno::Reference< beans::XPropertySet > xProp( xDoc->getLegend(), uno::UNO_QUERY );
- if( xProp.is())
- {
- try
- {
- USHORT nEnumVal;
- if( GetImport().GetMM100UnitConverter().convertEnum( nEnumVal, aValue, aXMLLegendAlignmentMap ))
- {
- uno::Any aAny;
- aAny <<= (chart::ChartLegendPosition)(nEnumVal);
- xProp->setPropertyValue( ::rtl::OUString::createFromAscii( "Alignment" ), aAny );
- }
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Property Alignment (legend) not found" );
- }
- }
- }
- break;
-
- case XML_TOK_LEGEND_X:
- GetImport().GetMM100UnitConverter().convertMeasure( mrPosition.X, aValue );
- break;
- case XML_TOK_LEGEND_Y:
- GetImport().GetMM100UnitConverter().convertMeasure( mrPosition.Y, aValue );
- break;
- case XML_TOK_LEGEND_STYLE_NAME:
- sAutoStyleName = aValue;
- }
- }
-
- // set auto-styles for Area
- uno::Reference< beans::XPropertySet > xProp( xDoc->getLegend(), uno::UNO_QUERY );
- if( xProp.is())
- {
- const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext();
- if( pStylesCtxt )
- {
- const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
- mrImportHelper.GetChartFamilyID(), sAutoStyleName );
-
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
- }
- }
-}
-
-SchXMLLegendContext::~SchXMLLegendContext()
-{
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/xmloff_SchXMLExport.cxx b/binfilter/bf_xmloff/source/chart/xmloff_SchXMLExport.cxx
deleted file mode 100644
index 528134534e90..000000000000
--- a/binfilter/bf_xmloff/source/chart/xmloff_SchXMLExport.cxx
+++ /dev/null
@@ -1,2636 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <xmlprmap.hxx>
-
-#include "SchXMLExport.hxx"
-#include "XMLChartPropertySetMapper.hxx"
-
-#include <tools/debug.hxx>
-#include <rtl/logfile.hxx>
-
-#include <tools/globname.hxx>
-#include <sot/clsids.hxx>
-
-#include "xmluconv.hxx"
-#include <rtl/math.hxx>
-// header for any2enum
-#include <comphelper/extract.hxx>
-
-#include <list>
-
-// when Issue #i75865# is fixed the following line must be uncommented
-// #define ISSUE_75865_IS_FIXED
-
-#include <com/sun/star/chart/ChartLegendPosition.hpp>
-#include <com/sun/star/chart/XTwoAxisXSupplier.hpp>
-#include <com/sun/star/chart/XTwoAxisYSupplier.hpp>
-#include <com/sun/star/chart/XAxisZSupplier.hpp>
-#include <com/sun/star/chart/XChartDataArray.hpp>
-#include <com/sun/star/chart/ChartAxisAssign.hpp>
-#include <com/sun/star/chart/X3DDisplay.hpp>
-#include <com/sun/star/chart/XStatisticDisplay.hpp>
-
-#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
-
-#include "MultiPropertySetHandler.hxx"
-#include "PropertyMap.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-using namespace ::com::sun::star::uno;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-using ::rtl::OUString;
-
-struct SchXMLDataPointStruct
-{
- ::rtl::OUString maStyleName;
- sal_Int32 mnRepeat;
-
- SchXMLDataPointStruct() : mnRepeat( 1 ) {}
-};
-
-// ========================================
-// class SchXMLExportHelper
-// ========================================
-
-SchXMLExportHelper::SchXMLExportHelper(
- SvXMLExport& rExport,
- SvXMLAutoStylePoolP& rASPool ) :
- mrExport( rExport ),
- mrAutoStylePool( rASPool ),
- mnSeriesCount( 0 ),
- mnSeriesLength( 0 ),
- mnDomainAxes( 0 ),
- mbHasSeriesLabels( sal_False ),
- mbHasCategoryLabels( sal_False ),
- mbRowSourceColumns( sal_True )
- // #110680#
- // this id depends on the ServiceManager used due to the binary filter stripping.
- // ,msCLSID( ::rtl::OUString( SvGlobalName( SO3_SCH_CLASSID ).GetHexName()))
-{
- // #110680#
- // changed initialisation for msCLSID. Compare the ServiceInfo name with
- // the known name of the LegacyServiceManager.
- Reference<lang::XServiceInfo> xServiceInfo( mrExport.getServiceFactory(), UNO_QUERY );
- DBG_ASSERT( xServiceInfo.is(), "XMultiServiceFactory without xServiceInfo (!)" );
- OUString rdbURL = xServiceInfo->getImplementationName();
- OUString implLegacyServiceManagerName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.office.LegacyServiceManager" ) );
-
- if( rdbURL.equals( implLegacyServiceManagerName ))
- {
- msCLSID = ::rtl::OUString( SvGlobalName( BF_SO3_SCH_CLASSID ).GetHexName());
- }
- else
- {
- msCLSID = ::rtl::OUString( SvGlobalName( SO3_SCH_CLASSID ).GetHexName());
- }
-
- msTableName = ::rtl::OUString::createFromAscii( "local-table" );
-
- // create factory
- mxPropertyHandlerFactory = new XMLChartPropHdlFactory;
-
- if( mxPropertyHandlerFactory.is() )
- {
- // create property set mapper
- mxPropertySetMapper = new XMLChartPropertySetMapper;
-
- }
-
- mxExpPropMapper = new XMLChartExportPropertyMapper( mxPropertySetMapper, rExport );
-
- // register chart auto-style family
- mrAutoStylePool.AddFamily(
- XML_STYLE_FAMILY_SCH_CHART_ID,
- ::rtl::OUString::createFromAscii( XML_STYLE_FAMILY_SCH_CHART_NAME ),
- mxExpPropMapper.get(),
- ::rtl::OUString::createFromAscii( XML_STYLE_FAMILY_SCH_CHART_PREFIX ));
-
- // register shape family
- mrAutoStylePool.AddFamily(
- XML_STYLE_FAMILY_SD_GRAPHICS_ID,
- ::rtl::OUString::createFromAscii( XML_STYLE_FAMILY_SD_GRAPHICS_NAME ),
- mxExpPropMapper.get(),
- ::rtl::OUString::createFromAscii( XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX ));
- // register paragraph family also for shapes
- mrAutoStylePool.AddFamily(
- XML_STYLE_FAMILY_TEXT_PARAGRAPH,
- GetXMLToken( XML_PARAGRAPH ),
- mxExpPropMapper.get(),
- ::rtl::OUString( sal_Unicode( 'P' )));
- // register text family also for shapes
- mrAutoStylePool.AddFamily(
- XML_STYLE_FAMILY_TEXT_TEXT,
- GetXMLToken( XML_TEXT ),
- mxExpPropMapper.get(),
- ::rtl::OUString( sal_Unicode( 'T' )));
-}
-
-const ::rtl::OUString& SchXMLExportHelper::getChartCLSID()
-{
- return msCLSID;
-}
-
-void SchXMLExportHelper::exportAutoStyles()
-{
- if( mxExpPropMapper.is())
- {
- //ToDo: when embedded in calc/writer this is not necessary because the
- // numberformatter is shared between both documents
- mrExport.exportAutoDataStyles();
-
- // export chart auto styles
- mrAutoStylePool.exportXML(
- XML_STYLE_FAMILY_SCH_CHART_ID
- , mrExport.GetDocHandler(),
- mrExport.GetMM100UnitConverter(),
- mrExport.GetNamespaceMap()
- );
-
- // export auto styles for additional shapes
- mrExport.GetShapeExport()->exportAutoStyles();
- // and for text in additional shapes
- mrExport.GetTextParagraphExport()->exportTextAutoStyles();
- }
-}
-
-void SchXMLExportHelper::collectAutoStyles( uno::Reference< chart::XChartDocument > rChartDoc )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogContext, "xmloff", "bm93744", "::SchXMLExportHelper::collectAutoStyles" );
-
- parseDocument( rChartDoc, sal_False );
-}
-
-void SchXMLExportHelper::exportChart( uno::Reference< chart::XChartDocument > rChartDoc,
- sal_Bool bIncludeTable )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogContext, "xmloff", "bm93744", "::SchXMLExportHelper::exportChart" );
-
- parseDocument( rChartDoc, sal_True, bIncludeTable );
- DBG_ASSERT( maAutoStyleNameQueue.empty(), "There are still remaining autostyle names in the queue" );
-}
-
-
-// private methods
-// ---------------
-
-/// if bExportContent is false the auto-styles are collected
-void SchXMLExportHelper::parseDocument( uno::Reference< chart::XChartDocument >& rChartDoc,
- sal_Bool bExportContent,
- sal_Bool bIncludeTable )
-{
- uno::Reference< chart::XDiagram > xDiagram = rChartDoc->getDiagram();
-
- // determine if data is in rows
- sal_Bool bSwitchData = sal_False;
- uno::Reference< beans::XPropertySet > xDiaProp( xDiagram, uno::UNO_QUERY );
- ::rtl::OUString sChartType ( xDiagram->getDiagramType());
- if( xDiaProp.is())
- {
- try
- {
- chart::ChartDataRowSource eRowSource;
- uno::Any aAny =
- xDiaProp->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataRowSource" )));
-
- cppu::any2enum< chart::ChartDataRowSource >( eRowSource, aAny );
- mbRowSourceColumns = ( eRowSource == chart::ChartDataRowSource_COLUMNS );
-
- // the chart core treats donut chart with interchanged rows/columns
- if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.DonutDiagram" )))
- {
- mbRowSourceColumns = ! mbRowSourceColumns;
- }
- }
- catch( uno::Exception )
- {
- DBG_ERROR( "exportChart: Error getting Property \"DataRowSource\"" );
- }
- }
-
- if( ! rChartDoc.is())
- {
- DBG_ERROR( "No XChartDocument was given for export." );
- return;
- }
-
- // get Properties of ChartDocument
- sal_Bool bHasMainTitle = sal_False;
- sal_Bool bHasSubTitle = sal_False;
- sal_Bool bHasLegend = sal_False;
-
- ::std::vector< XMLPropertyState > aPropertyStates;
-
- uno::Reference< beans::XPropertySet > xDocPropSet( rChartDoc, uno::UNO_QUERY );
- if( xDocPropSet.is())
- {
- try
- {
- uno::Any aAny( xDocPropSet->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasMainTitle" ))));
- aAny >>= bHasMainTitle;
- aAny = xDocPropSet->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasSubTitle" )));
- aAny >>= bHasSubTitle;
- aAny = xDocPropSet->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasLegend" )));
- aAny >>= bHasLegend;
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_WARNING( "Required property not found in ChartDocument" );
- }
- }
-
- // get some values of general interest
-
- // reset
- mbHasSeriesLabels = mbHasCategoryLabels = sal_False;
- mnSeriesCount = mnSeriesLength = 0;
-
- // set
- uno::Reference< chart::XChartDataArray > xData( rChartDoc->getData(), uno::UNO_QUERY );
- if( xData.is())
- {
- uno::Sequence< uno::Sequence< double > > xValues = xData->getData();
-
- if( xValues.getLength())
- {
- // determine size of data
- const uno::Sequence< double >* pSequence = xValues.getConstArray();
- uno::Sequence< ::rtl::OUString > xSeriesLabels;
- uno::Sequence< ::rtl::OUString > xCategoryLabels;
-
- if( mbRowSourceColumns )
- {
- mnSeriesCount = pSequence->getLength();
- mnSeriesLength = xValues.getLength();
- xSeriesLabels = xData->getColumnDescriptions();
- xCategoryLabels = xData->getRowDescriptions();
- }
- else
- {
- mnSeriesCount = xValues.getLength();
- mnSeriesLength = pSequence->getLength();
- xSeriesLabels = xData->getRowDescriptions();
- xCategoryLabels = xData->getColumnDescriptions();
- }
-
- // determine existence of headers
- mbHasCategoryLabels = ( xCategoryLabels.getLength() > 0 );
- mbHasSeriesLabels = ( xSeriesLabels.getLength() > 0 );
- }
- }
-
- // chart element
- // -------------
-
- SvXMLElementExport* pElChart = 0;
- // get property states for autostyles
- if( mxExpPropMapper.is())
- {
- uno::Reference< beans::XPropertySet > xPropSet( rChartDoc->getArea(), uno::UNO_QUERY );
- if( xPropSet.is())
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- }
-
- // attributes
- // determine class
- // domain axes are also needed for auto-styles
- if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.XYDiagram" )))
- mnDomainAxes = 1;
- else
- mnDomainAxes = 0;
-
- if( bExportContent )
- {
- // attributes
- // determine class
- if( sChartType.getLength())
- {
- enum XMLTokenEnum eXMLChartType = XML_TOKEN_INVALID;
- ::rtl::OUString sAddInName;
-
- if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.LineDiagram" )))
- eXMLChartType = XML_LINE;
- else if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.AreaDiagram" )))
- eXMLChartType = XML_AREA;
- else if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.BarDiagram" )))
- eXMLChartType = XML_BAR;
- else if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.PieDiagram" )))
- eXMLChartType = XML_CIRCLE;
- else if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.DonutDiagram" )))
- eXMLChartType = XML_RING;
- else if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.XYDiagram" )))
- {
- eXMLChartType = XML_SCATTER;
- mnDomainAxes = 1;
- }
- else if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.NetDiagram" )))
- eXMLChartType = XML_RADAR;
- else if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.StockDiagram" )))
- eXMLChartType = XML_STOCK;
- else // servie-name of add-in
- {
- eXMLChartType = XML_ADD_IN;
- sAddInName = sChartType;
- }
-
- if( eXMLChartType != XML_TOKEN_INVALID )
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, eXMLChartType );
-
- if( sAddInName.getLength())
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_ADD_IN_NAME, sAddInName );
-
- // translated rows/columns
- if( xDocPropSet.is())
- {
- sal_Bool bTranslate = sal_False;
- ::rtl::OUString aTransPropName;
- enum XMLTokenEnum eTransToken;
-
- uno::Any aAny = xDocPropSet->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasTranslatedColumns" )));
- aAny >>= bTranslate;
- if( bTranslate )
- {
- aTransPropName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TranslatedColumns" ));
- eTransToken = ::binfilter::xmloff::token::XML_COLUMN_MAPPING;
- }
- else
- {
- aAny = xDocPropSet->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasTranslatedRows" )));
- aAny >>= bTranslate;
- if( bTranslate )
- {
- aTransPropName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TranslatedRows" ));
- eTransToken = ::binfilter::xmloff::token::XML_ROW_MAPPING;
- }
- }
-
- if( bTranslate )
- {
- uno::Sequence< sal_Int32 > aSeq;
- aAny = xDocPropSet->getPropertyValue( aTransPropName );
- if( aAny >>= aSeq )
- {
- const sal_Int32* pArray = aSeq.getConstArray();
- const sal_Int32 nSize = aSeq.getLength();
- sal_Int32 i = 0;
- ::rtl::OUStringBuffer aBuf;
- for( i = 0; i < nSize; ++i )
- {
- aBuf.append( pArray[ i ], 10 );
- if( i != (nSize - 1))
- aBuf.append( static_cast< sal_Unicode >( ' ' ));
- }
-
- mrExport.AddAttribute( XML_NAMESPACE_CHART,
- ::binfilter::xmloff::token::GetXMLToken( eTransToken ),
- aBuf.makeStringAndClear() );
- }
- }
- }
- }
- // write style name
- AddAutoStyleAttribute( aPropertyStates );
-
- //element
- pElChart = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_CHART, sal_True, sal_True );
- }
- else // autostyles
- {
- CollectAutoStyle( aPropertyStates );
- }
- // remove property states for autostyles
- aPropertyStates.clear();
-
- // title element
- // -------------
-
- if( bHasMainTitle )
- {
- // get property states for autostyles
- if( mxExpPropMapper.is())
- {
- uno::Reference< beans::XPropertySet > xPropSet( rChartDoc->getTitle(), uno::UNO_QUERY );
- if( xPropSet.is())
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- }
- if( bExportContent )
- {
- uno::Reference< drawing::XShape > xShape = rChartDoc->getTitle();
- if( xShape.is()) // && "hasTitleBeenMoved"
- addPosition( xShape );
-
- // write style name
- AddAutoStyleAttribute( aPropertyStates );
-
- // element
- SvXMLElementExport aElTitle( mrExport, XML_NAMESPACE_CHART, XML_TITLE, sal_True, sal_True );
-
- // content (text:p)
- uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY );
- if( xPropSet.is())
- {
- uno::Any aAny( xPropSet->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" ))));
- ::rtl::OUString aText;
- aAny >>= aText;
- exportText( aText );
- }
- }
- else // autostyles
- {
- CollectAutoStyle( aPropertyStates );
- }
- // remove property states for autostyles
- aPropertyStates.clear();
- }
-
- // subtitle element
- // ----------------
-
- if( bHasSubTitle )
- {
- // get property states for autostyles
- if( mxExpPropMapper.is())
- {
- uno::Reference< beans::XPropertySet > xPropSet( rChartDoc->getSubTitle(), uno::UNO_QUERY );
- if( xPropSet.is())
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- }
-
- if( bExportContent )
- {
- uno::Reference< drawing::XShape > xShape = rChartDoc->getSubTitle();
- if( xShape.is())
- addPosition( xShape );
-
- // write style name
- AddAutoStyleAttribute( aPropertyStates );
-
- // element (has no subelements)
- SvXMLElementExport aElSubTitle( mrExport, XML_NAMESPACE_CHART, XML_SUBTITLE, sal_True, sal_True );
-
- // content (text:p)
- uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY );
- if( xPropSet.is())
- {
- uno::Any aAny( xPropSet->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" ))));
- ::rtl::OUString aText;
- aAny >>= aText;
- exportText( aText );
- }
- }
- else // autostyles
- {
- CollectAutoStyle( aPropertyStates );
- }
- // remove property states for autostyles
- aPropertyStates.clear();
- }
-
- // legend element
- // --------------
- if( bHasLegend )
- {
- // get property states for autostyles
- if( mxExpPropMapper.is())
- {
- uno::Reference< beans::XPropertySet > xPropSet( rChartDoc->getLegend(), uno::UNO_QUERY );
- if( xPropSet.is())
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- }
-
- if( bExportContent )
- {
- uno::Reference< beans::XPropertySet > xProp( rChartDoc->getLegend(), uno::UNO_QUERY );
- if( xProp.is())
- {
- chart::ChartLegendPosition aLegendPos = chart::ChartLegendPosition_NONE;
- try
- {
- uno::Any aAny( xProp->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Alignment" ))));
- aAny >>= aLegendPos;
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_WARNING( "Property Align not found in ChartLegend" );
- }
-
- switch( aLegendPos )
- {
- case chart::ChartLegendPosition_LEFT:
- msString = GetXMLToken(XML_LEFT);
- break;
- case chart::ChartLegendPosition_RIGHT:
- msString = GetXMLToken(XML_RIGHT);
- break;
- case chart::ChartLegendPosition_TOP:
- msString = GetXMLToken(XML_TOP);
- break;
- case chart::ChartLegendPosition_BOTTOM:
- msString = GetXMLToken(XML_BOTTOM);
- break;
- }
-
- // export anchor position
- if( msString.getLength())
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_LEGEND_POSITION, msString );
-
- // export absolute position
- msString = ::rtl::OUString();
- uno::Reference< drawing::XShape > xShape( xProp, uno::UNO_QUERY );
- if( xShape.is())
- addPosition( xShape );
- }
-
- // write style name
- AddAutoStyleAttribute( aPropertyStates );
-
- // element
- SvXMLElementExport aLegend( mrExport, XML_NAMESPACE_CHART, XML_LEGEND, sal_True, sal_True );
- }
- else // autostyles
- {
- CollectAutoStyle( aPropertyStates );
- }
- // remove property states for autostyles
- aPropertyStates.clear();
- }
-
- // plot-area element
- // -----------------
- if( xDiagram.is())
- exportPlotArea( xDiagram, bExportContent, bIncludeTable );
-
- // export additional shapes
- // ------------------------
- if( xDocPropSet.is() )
- {
- if( bExportContent )
- {
- if( mxAdditionalShapes.is())
- {
- // can't call exportShapes with all shapes because the
- // initialisation happend with the complete draw page and not
- // the XShapes object used here. Thus the shapes have to be
- // exported one by one
- UniReference< XMLShapeExport > rShapeExport = mrExport.GetShapeExport();
- uno::Reference< drawing::XShape > xShape;
- const sal_Int32 nShapeCount( mxAdditionalShapes->getCount());
- for( sal_Int32 nShapeId = 0; nShapeId < nShapeCount; nShapeId++ )
- {
- mxAdditionalShapes->getByIndex( nShapeId ) >>= xShape;
- DBG_ASSERT( xShape.is(), "Shape without an XShape?" );
- if( ! xShape.is())
- continue;
-
- rShapeExport->exportShape( xShape );
- }
- // this would be the easier way if it worked:
- //mrExport.GetShapeExport()->exportShapes( mxAdditionalShapes );
- }
- }
- else
- {
- // get a sequence of non-chart shapes (inserted via clipboard)
- uno::Any aShapesAny = xDocPropSet->getPropertyValue( ::rtl::OUString::createFromAscii( "AdditionalShapes" ));
- aShapesAny >>= mxAdditionalShapes;
-
- if( mxAdditionalShapes.is())
- {
- // seek shapes has to be called for the whole page because in
- // the shape export the vector of shapes is accessed via the
- // ZOrder which might be (actually is) larger than the number of
- // shapes in mxAdditionalShapes
- uno::Reference< drawing::XDrawPageSupplier > xSupplier( rChartDoc, uno::UNO_QUERY );
- DBG_ASSERT( xSupplier.is(), "Cannot retrieve draw page to initialize shape export" );
- if( xSupplier.is() )
- {
- uno::Reference< drawing::XShapes > xDrawPage( xSupplier->getDrawPage(), uno::UNO_QUERY );
- DBG_ASSERT( xDrawPage.is(), "Invalid draw page for initializing shape export" );
- if( xDrawPage.is())
- mrExport.GetShapeExport()->seekShapes( xDrawPage );
- }
-
- // can't call collectShapesAutoStyles with all shapes because
- // the initialisation happend with the complete draw page and
- // not the XShapes object used here. Thus the shapes have to be
- // exported one by one
- UniReference< XMLShapeExport > rShapeExport = mrExport.GetShapeExport();
- uno::Reference< drawing::XShape > xShape;
- const sal_Int32 nShapeCount( mxAdditionalShapes->getCount());
- for( sal_Int32 nShapeId = 0; nShapeId < nShapeCount; nShapeId++ )
- {
- mxAdditionalShapes->getByIndex( nShapeId ) >>= xShape;
- DBG_ASSERT( xShape.is(), "Shape without an XShape?" );
- if( ! xShape.is())
- continue;
-
- rShapeExport->collectShapeAutoStyles( xShape );
- }
- // this would be the easier way if it worked:
- // mrExport.GetShapeExport()->collectShapesAutoStyles( mxAdditionalShapes );
- }
- }
- }
-
- // table element
- // (is included as subelement of chart)
- // ------------------------------------
- if( bExportContent )
- {
- // #85929# always export table, otherwise clipboard may loose data
-// sal_Bool bExportTable = bIncludeTable;
-// // check for clipboard flag on document => export Table
-// if( xDocPropSet.is() &&
-// ! bExportTable )
-// {
-// uno::Any aAny;
-// try
-// {
-// aAny = xDocPropSet->getPropertyValue( ::rtl::OUString::createFromAscii( "ExportData" ));
-// aAny >>= bExportTable;
-// }
-// catch( uno::Exception )
-// {
-// DBG_ERROR( "Property ExportData not found" );
-// }
-// }
-
- // export of table element
-// if( bExportTable )
-
- exportTable( xData );
- }
-
- // close <chart:chart> element
- if( pElChart )
- delete pElChart;
-}
-
-void SchXMLExportHelper::exportTable( uno::Reference< chart::XChartDataArray >& rData )
-{
- // table element
- // -------------
- mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_NAME, msTableName );
- SvXMLElementExport aTable( mrExport, XML_NAMESPACE_TABLE, XML_TABLE, sal_True, sal_True );
-
- if( rData.is())
- {
- double fData;
-
- // get NaN
- double fSolarNaN;
- ::rtl::math::setNan( &fSolarNaN );
- double fNaN = fSolarNaN;
- sal_Bool bConvertNaN = sal_False;
- uno::Reference< chart::XChartData > xChartData( rData, uno::UNO_QUERY );
- if( xChartData.is())
- {
- fNaN = xChartData->getNotANumber();
- bConvertNaN = ( ! ::rtl::math::isNan( fNaN ));
- }
-
- uno::Sequence< uno::Sequence< double > > xValues = rData->getData();
- if( xValues.getLength())
- {
- const uno::Sequence< double >* pSequence = xValues.getConstArray();
- const double* pData = 0;
-
- sal_Int32 nSeries, nDataPoint;
-
- // export column headers
- uno::Sequence< ::rtl::OUString > xSeriesLabels = rData->getColumnDescriptions();
- uno::Sequence< ::rtl::OUString > xCategoryLabels = rData->getRowDescriptions();
- sal_Int32 nSeriesCount, nSeriesLength;
- if( mbRowSourceColumns )
- {
- nSeriesLength = mnSeriesLength;
- nSeriesCount = mnSeriesCount;
- }
- else
- {
- nSeriesLength = mnSeriesCount;
- nSeriesCount = mnSeriesLength;
- }
- sal_Int32 nSeriesLablesLength = xSeriesLabels.getLength();
- sal_Int32 nCategoryLabelsLength = xCategoryLabels.getLength();
-
- // columns
- if( mbHasCategoryLabels )
- {
- // row description are put in the first column
- SvXMLElementExport aHeaderColumns( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_HEADER_COLUMNS, sal_True, sal_True );
- SvXMLElementExport aHeaderColumn( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, sal_True, sal_True );
- }
- // non-header columns
- if( mnSeriesCount )
- {
- SvXMLElementExport aColumns( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_COLUMNS, sal_True, sal_True );
- mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED,
- ::rtl::OUString::valueOf( (sal_Int64) mnSeriesCount ));
- SvXMLElementExport aColumn( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, sal_True, sal_True );
- }
-
- // rows
- if( mbHasSeriesLabels )
- {
- SvXMLElementExport aHeaderRows( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_HEADER_ROWS, sal_True, sal_True );
- SvXMLElementExport aRow( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True, sal_True );
- // write one empty cell (the cell A1 is never used)
- {
- SvXMLElementExport aEmptyCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True );
- SvXMLElementExport aEmptyParagraph( mrExport, XML_NAMESPACE_TEXT, XML_P, sal_True, sal_True );
- }
- for( nSeries = 0; nSeries < nSeriesLablesLength; nSeries++ )
- {
- mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_VALUE_TYPE, XML_STRING );
- SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True );
- exportText( xSeriesLabels[ nSeries ] );
- }
- }
-
- // export data
- SvXMLElementExport aRows( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_ROWS, sal_True, sal_True );
- for( nDataPoint = 0; nDataPoint < nSeriesLength; nDataPoint++ )
- {
- // <table:table-row>
- SvXMLElementExport aRow( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True, sal_True );
- pData = pSequence[ nDataPoint ].getConstArray();
-
- if( mbHasCategoryLabels )
- {
- // cells containing row descriptions (in the first column)
- mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_VALUE_TYPE, XML_STRING );
- SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True );
- if( nDataPoint < nCategoryLabelsLength )
- exportText( xCategoryLabels[ nDataPoint ] );
- }
-
- for( nSeries = 0; nSeries < nSeriesCount; nSeries++ )
- {
- // get string by value
- fData = pData[ nSeries ];
-
- // convert NaN
- if( bConvertNaN && // implies xChartData.is()
- xChartData->isNotANumber( fData ))
- fData = fSolarNaN;
-
- SvXMLUnitConverter::convertDouble( msStringBuffer, fData );
- msString = msStringBuffer.makeStringAndClear();
-
- // <table:table-cell>
- mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_VALUE_TYPE, XML_FLOAT );
- mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_VALUE, msString );
- SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True );
-
- // <text:p>
- exportText( msString, false ); // do not convert tabs and lfs
- }
- }
- }
- }
-}
-
-void SchXMLExportHelper::exportPlotArea( uno::Reference< chart::XDiagram > xDiagram,
- sal_Bool bExportContent,
- sal_Bool bIncludeTable )
-{
- DBG_ASSERT( xDiagram.is(), "Invalid XDiagram as parameter" );
- if( ! xDiagram.is())
- return;
-
- // variables for autostyles
- uno::Reference< beans::XPropertySet > xPropSet;
- std::vector< XMLPropertyState > aPropertyStates;
- sal_Int32 nStyleFamily = XML_STYLE_FAMILY_SCH_CHART_ID;
- ::rtl::OUString aASName;
- sal_Bool bHasTwoYAxes = sal_False;
- sal_Bool bIs3DChart = sal_False;
- drawing::HomogenMatrix aTransMatrix;
-
- msStringBuffer.setLength( 0 );
-
- // plot-area element
- // -----------------
-
- SvXMLElementExport* pElPlotArea = 0;
- // get property states for autostyles
- xPropSet = uno::Reference< beans::XPropertySet >( xDiagram, uno::UNO_QUERY );
- if( xPropSet.is())
- {
- if( mxExpPropMapper.is())
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- }
- if( bExportContent )
- {
- UniReference< XMLShapeExport > rShapeExport;
-
- // write style name
- AddAutoStyleAttribute( aPropertyStates );
-
- if( msChartAddress.getLength())
- {
- mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, msChartAddress );
-
- uno::Reference< chart::XChartDocument > xDoc( mrExport.GetModel(), uno::UNO_QUERY );
- if( xDoc.is() )
- {
- uno::Reference< beans::XPropertySet > xDocProp( xDoc, uno::UNO_QUERY );
- if( xDocProp.is())
- {
- uno::Any aAny;
- sal_Bool bFirstCol, bFirstRow;
-
- try
- {
- aAny = xDocProp->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataSourceLabelsInFirstColumn" )));
- aAny >>= bFirstCol;
- aAny = xDocProp->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataSourceLabelsInFirstRow" )));
- aAny >>= bFirstRow;
-
- if( bFirstCol || bFirstRow )
- {
- mrExport.AddAttribute( XML_NAMESPACE_CHART,
- ::binfilter::xmloff::token::GetXMLToken( ::binfilter::xmloff::token::XML_DATA_SOURCE_HAS_LABELS ),
- ( bFirstCol
- ? ( bFirstRow
- ? ::binfilter::xmloff::token::GetXMLToken( ::binfilter::xmloff::token::XML_BOTH )
- : ::binfilter::xmloff::token::GetXMLToken( ::binfilter::xmloff::token::XML_COLUMN ))
- : ::binfilter::xmloff::token::GetXMLToken( ::binfilter::xmloff::token::XML_ROW )));
- }
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERRORFILE( "Properties missing" );
- }
- }
- }
- }
-
- if( msTableNumberList.getLength())
- {
- // this attribute is for charts embedded in calc documents only.
- // With this you are able to store a file again in 5.0 binary format
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_TABLE_NUMBER_LIST, msTableNumberList );
- }
-
- // attributes
- uno::Reference< drawing::XShape > xShape ( xDiagram, uno::UNO_QUERY );
- if( xShape.is())
- {
- addPosition( xShape );
- addSize( xShape );
- }
-
- if( xPropSet.is())
- {
- uno::Any aAny;
- try
- {
- aAny = xPropSet->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HasSecondaryYAxis" )));
- aAny >>= bHasTwoYAxes;
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Property HasSecondaryYAxis not found in Diagram" );
- }
-
- // 3d attributes
- try
- {
- aAny = xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Dim3D" )));
- aAny >>= bIs3DChart;
-
- if( bIs3DChart )
- {
- rShapeExport = mrExport.GetShapeExport();
- if( rShapeExport.is())
- rShapeExport->export3DSceneAttributes( xPropSet );
- }
- }
- catch( uno::Exception aEx )
- {
-#ifdef DBG_UTIL
- String aStr( aEx.Message );
- ByteString aBStr( aStr, RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR1( "chart:exportPlotAreaException caught: %s", aBStr.GetBuffer());
-#endif
- }
- }
-
- // element
- pElPlotArea = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_PLOT_AREA, sal_True, sal_True );
-
- // light sources (inside plot area element)
- if( bIs3DChart &&
- rShapeExport.is())
- rShapeExport->export3DLamps( xPropSet );
- }
- else // autostyles
- {
- CollectAutoStyle( aPropertyStates );
- }
- // remove property states for autostyles
- aPropertyStates.clear();
-
- // axis elements
- // -------------
- exportAxes( xDiagram, bExportContent );
-
- // categories element
- // ------------------
- sal_Int32 nDataPointOffset = mbHasSeriesLabels? 1 : 0;
- sal_Int32 nSeriesOffset = mbHasCategoryLabels ? 1 : 0;
-
- if( bExportContent &&
- mbHasCategoryLabels )
- {
- // fill msString with cell-range-address of categories
- if( bIncludeTable )
- {
- // export own table references
- msStringBuffer.append( msTableName );
-
- getCellAddress( 0, nDataPointOffset );
- msStringBuffer.append( (sal_Unicode) ':' );
- getCellAddress( 0, mnSeriesLength + nDataPointOffset - 1 );
- }
- else
- {
- // deprecated
-// msString = msCategoriesAddress;
- }
-
- if( msStringBuffer.getLength())
- {
- msString = msStringBuffer.makeStringAndClear();
- mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, msString );
- SvXMLElementExport aCategories( mrExport, XML_NAMESPACE_CHART, XML_CATEGORIES, sal_True, sal_True );
- }
- }
-
- // series elements
- // ---------------
- msStringBuffer.setLength( 0 );
- SvXMLElementExport* pSeries = NULL;
- ::rtl::OUString aSeriesASName;
- sal_Bool bWrite = sal_False;
- sal_Int32 nAttachedAxis;
-
- sal_Int32 nNumberOfLinesInBarChart = 0;
- sal_Bool bStockHasVolume = sal_False;
- if( bExportContent )
- {
- if( 0 == xDiagram->getDiagramType().reverseCompareToAsciiL(
- RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.BarDiagram" )))
- {
- try
- {
- uno::Reference< beans::XPropertySet > xDiaProp( xDiagram, uno::UNO_QUERY_THROW );
- xDiaProp->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NumberOfLines" )))
- >>= nNumberOfLinesInBarChart;
- }
- catch( uno::Exception & aEx )
- {
- String aStr( aEx.Message );
- ByteString aBStr( aStr, RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR1( "Exception caught for property NumberOfLines: %s", aBStr.GetBuffer());
- }
- }
- else if( 0 == xDiagram->getDiagramType().reverseCompareToAsciiL(
- RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.StockDiagram" )))
- {
- try
- {
- uno::Reference< beans::XPropertySet > xDiaProp( xDiagram, uno::UNO_QUERY_THROW );
- xDiaProp->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Volume" )))
- >>= bStockHasVolume;
- }
- catch( uno::Exception & aEx )
- {
- String aStr( aEx.Message );
- ByteString aBStr( aStr, RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR1( "Exception caught for property Volume: %s", aBStr.GetBuffer());
- }
- }
- }
-
- uno::Sequence< uno::Sequence< sal_Int32 > > aDataPointSeq;
- if( xPropSet.is())
- {
- uno::Any aAny = xPropSet->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AttributedDataPoints" )));
- aAny >>= aDataPointSeq;
- DBG_ASSERT( mnSeriesCount == aDataPointSeq.getLength(), "DataPointSequence has wrong size" );
- }
-
- for( sal_Int32 nSeries = mnDomainAxes; nSeries < mnSeriesCount; nSeries++ )
- {
- nAttachedAxis = chart::ChartAxisAssign::PRIMARY_Y;
- sal_Bool bHasMeanValueLine = false;
- chart::ChartRegressionCurveType eRegressionType( chart::ChartRegressionCurveType_NONE );
- chart::ChartErrorIndicatorType eErrorType( chart::ChartErrorIndicatorType_NONE );
-
- // get property states for autostyles
- xPropSet = xDiagram->getDataRowProperties( nSeries );
- if( xPropSet.is())
- {
- // determine attached axis
- try
- {
- uno::Any aAny( xPropSet->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "Axis" ))));
- aAny >>= nAttachedAxis;
-
- aAny = xPropSet->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM ( "MeanValue" )));
- aAny >>= bHasMeanValueLine;
-
- aAny = xPropSet->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "RegressionCurves" )));
- aAny >>= eRegressionType;
-
- aAny = xPropSet->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "ErrorIndicator" )));
- aAny >>= eErrorType;
- }
- catch( beans::UnknownPropertyException aEx )
- {
- OSL_TRACE(
- OUStringToOString(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Required property not found in DataRowProperties: " )) +
- aEx.Message,
- RTL_TEXTENCODING_ASCII_US ).getStr());
- }
-
- if( mxExpPropMapper.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- }
- }
-
- if( bExportContent )
- {
- if( bIncludeTable )
- {
- // export own table references
- msStringBuffer.append( msTableName );
-
- getCellAddress( nSeries + nDataPointOffset, nSeriesOffset );
- msStringBuffer.append( (sal_Unicode) ':' );
- getCellAddress( nSeries + nDataPointOffset, nSeriesOffset + mnSeriesLength - 1 );
-
- msString = msStringBuffer.makeStringAndClear();
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_VALUES_CELL_RANGE_ADDRESS, msString );
-
- // reference to label
- if( mbHasSeriesLabels )
- {
- msStringBuffer.append( msTableName );
- getCellAddress( nSeries + nDataPointOffset, 0 );
- msString = msStringBuffer.makeStringAndClear();
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_LABEL_CELL_ADDRESS, msString );
- }
- }
- else
- {
- // #81525# convert addresses for xy charts
- // this should be done by calc in the future
-
- // deprecated
-// if( maSeriesAddresses.getLength() > nSeries )
-// {
-// mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_VALUES_CELL_RANGE_ADDRESS,
-// maSeriesAddresses[ nSeries ].DataRangeAddress );
-// if( maSeriesAddresses[ nSeries ].LabelAddress.getLength())
-// mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_LABEL_CELL_ADDRESS,
-// maSeriesAddresses[ nSeries ].LabelAddress );
-// }
- }
-
- if( bHasTwoYAxes )
- {
- if( nAttachedAxis == chart::ChartAxisAssign::SECONDARY_Y )
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_ATTACHED_AXIS, XML_SECONDARY_Y );
- else
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_ATTACHED_AXIS, XML_PRIMARY_Y );
- }
-
- // write style name
-// AddAutoStyleAttribute( aPropertyStates ); // can't be used here because we need the name
- if( aPropertyStates.size())
- {
- DBG_ASSERT( ! maAutoStyleNameQueue.empty(), "Autostyle queue empty!" );
- if( maAutoStyleNameQueue.empty())
- {
- aSeriesASName = OUString();
- }
- else
- {
- aSeriesASName = maAutoStyleNameQueue.front();
- maAutoStyleNameQueue.pop();
- }
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_STYLE_NAME, aSeriesASName );
- }
-
- // chart-type for mixed types
- if( nNumberOfLinesInBarChart > 0 &&
- nSeries >= (mnSeriesCount - mnDomainAxes - nNumberOfLinesInBarChart))
- {
-#ifdef ISSUE_75865_IS_FIXED
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_LINE );
-#else
- OUString aNameSpacedToken( RTL_CONSTASCII_USTRINGPARAM( "chart:" ));
- aNameSpacedToken += xmloff::token::GetXMLToken( XML_LINE );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, aNameSpacedToken );
-#endif
- }
-
- // #i32366# first series gets type "bar" for stock with volume charts
- if( bStockHasVolume && (nSeries - mnDomainAxes) == 0 )
- {
-#ifdef ISSUE_75865_IS_FIXED
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_BAR );
-#else
- OUString aNameSpacedToken( RTL_CONSTASCII_USTRINGPARAM( "chart:" ));
- aNameSpacedToken += xmloff::token::GetXMLToken( XML_BAR );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, aNameSpacedToken );
-#endif
- }
-
- // open series element until end of for loop
- pSeries = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_SERIES, sal_True, sal_True );
- }
- else // autostyles
- {
- CollectAutoStyle( aPropertyStates );
- }
- // remove property states for autostyles
- aPropertyStates.clear();
-
- // domain element if necessary
- // ---------------------------
- if( bExportContent &&
- mnDomainAxes > 0 &&
- nSeries == mnDomainAxes )
- {
- msStringBuffer.setLength( 0 );
- for( sal_Int32 nDomain = 0; nDomain < mnDomainAxes; nDomain++ )
- {
- if( bIncludeTable )
- {
- // first series has a domain, that is the first table row (column)
- msStringBuffer.append( msTableName );
-
- getCellAddress( nDomain + nSeriesOffset, nDataPointOffset );
- msStringBuffer.append( (sal_Unicode) ':' );
- getCellAddress( nDomain + nSeriesOffset, nDataPointOffset + mnSeriesLength - 1 );
- }
- else
- {
- // #81525# convert addresses for xy charts
- // this should be done by calc in the future
-
- // deprecated
-// if( maSeriesAddresses.getLength() > 0 )
-// {
-// msStringBuffer.append( maSeriesAddresses[ 0 ].DataRangeAddress );
-// }
- }
-
- msString = msStringBuffer.makeStringAndClear();
- if( msString.getLength())
- {
- mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, msString );
- }
- SvXMLElementExport aDomain( mrExport, XML_NAMESPACE_CHART, XML_DOMAIN, sal_True, sal_True );
- }
- }
-
- // statistical objects:
- // regression curves and mean value lines
- if( bHasMeanValueLine &&
- xPropSet.is() &&
- mxExpPropMapper.is() )
- {
- uno::Reference< beans::XPropertySet > xStatProp;
- uno::Any aPropAny( xPropSet->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "DataMeanValueProperties" ))));
- aPropAny >>= xStatProp;
-
- if( xStatProp.is() )
- {
- aPropertyStates = mxExpPropMapper->Filter( xStatProp );
-
- if( aPropertyStates.size() > 0 )
- {
- // write element
- if( bExportContent )
- {
- // add style name attribute
- AddAutoStyleAttribute( aPropertyStates );
-
- SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_MEAN_VALUE, sal_True, sal_True );
- }
- else // autostyles
- {
- CollectAutoStyle( aPropertyStates );
- }
- }
- }
- }
-
- if( eRegressionType != chart::ChartRegressionCurveType_NONE &&
- xPropSet.is() &&
- mxExpPropMapper.is() )
- {
- uno::Reference< beans::XPropertySet > xStatProp;
- uno::Any aPropAny( xPropSet->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "DataRegressionProperties" ))));
- aPropAny >>= xStatProp;
-
- if( xStatProp.is() )
- {
- aPropertyStates = mxExpPropMapper->Filter( xStatProp );
-
- if( aPropertyStates.size() > 0 )
- {
- // write element
- if( bExportContent )
- {
- // add style name attribute
- AddAutoStyleAttribute( aPropertyStates );
- SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_REGRESSION_CURVE, sal_True, sal_True );
- }
- else // autostyles
- {
- CollectAutoStyle( aPropertyStates );
- }
- }
- }
- }
-
- if( eErrorType != chart::ChartErrorIndicatorType_NONE &&
- xPropSet.is() &&
- mxExpPropMapper.is() )
- {
- uno::Reference< beans::XPropertySet > xStatProp;
- uno::Any aPropAny( xPropSet->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "DataErrorProperties" ))));
- aPropAny >>= xStatProp;
-
- if( xStatProp.is() )
- {
- aPropertyStates = mxExpPropMapper->Filter( xStatProp );
-
- if( aPropertyStates.size() > 0 )
- {
- // write element
- if( bExportContent )
- {
- // add style name attribute
- AddAutoStyleAttribute( aPropertyStates );
- SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_ERROR_INDICATOR, sal_True, sal_True );
- }
- else // autostyles
- {
- CollectAutoStyle( aPropertyStates );
- }
- }
- }
- }
-
- // data-points
- // -----------
- // write data-points only if they contain autostyles
- // objects with equal autostyles are grouped using the attribute
- // repeat="number"
-
- // Note: if only the nth data-point has autostyles there is an element
- // without style and repeat="n-1" attribute written in advance.
-
- // the sequence aDataPointSeq contains indices of data-points that
- // do have own attributes. This increases the performance substantially.
-
-#if 0
- sal_Int32 nRepeated = 1;
- if( mxExpPropMapper.is())
- {
- sal_Bool bIsEmpty = sal_False;
- ::rtl::OUString aLastASName;
- aASName = ::rtl::OUString();
-
- for( sal_Int32 nElement = 0; nElement < mnSeriesLength; nElement++ )
- {
- // get property states for autostyles
- try
- {
- xPropSet = xDiagram->getDataPointProperties( nElement, nSeries );
- }
- catch( uno::Exception aEx )
- {
- String aStr( aEx.Message );
- ByteString aBStr( aStr, RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR1( "Exception caught during Export of data point: %s", aBStr.GetBuffer());
- }
- if( xPropSet.is())
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- bIsEmpty = ( aPropertyStates.size() == 0 );
-
- if( bExportContent )
- {
- if( bIsEmpty )
- aASName = ::rtl::OUString();
- else
- {
-// AddAutoStyleAttribute( aPropertyStates ); // can't be used here because we need the name
- DBG_ASSERT( ! maAutoStyleNameQueue.empty(), "Autostyle queue empty!" );
- if( ! maAutoStyleNameQueue.empty())
- {
- aASName = maAutoStyleNameQueue.front();
- maAutoStyleNameQueue.pop();
- }
- }
-
-
- // The following conditional realizes a run-length compression. For every run of data
- // points with the same style only one point is written together with a repeat count.
- // The style of the current data point is compared with that of the last data point.
- // If they differ, then the _last_ data point and, if greater than 1, the repreat count
- // are written, else the repeat count is increased but no output takes place.
- // This has two consequences: 1. the first data point is skipped,
- // because it can not be compared to a predecessor and 2. the last data point (or series
- // of data points with the same style) is written outside and after the enclosing loop.
- if( nElement )
- {
- if( aASName.equals( aLastASName ))
- {
- nRepeated++;
- }
- else
- {
- // Write the style of the last data point(s).
-
- // Write reapeat counter (if data point run contains more than one point).
- if( nRepeated > 1 )
- {
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_REPEATED,
- ::rtl::OUString::valueOf( (sal_Int64)( nRepeated ) ));
- }
-
- // Write style if it is present and is not the same as that of the data series.
- if( aLastASName.getLength() &&
- ! aLastASName.equals( aSeriesASName ))
- {
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_STYLE_NAME, aLastASName );
- }
-
- // Write the actual point data.
- SvXMLElementExport aPoint( mrExport, XML_NAMESPACE_CHART, XML_DATA_POINT, sal_True, sal_True );
-
- // Reset repeat counter for the new style.
- nRepeated = 1;
- aLastASName = aASName;
- }
- }
- else
- // Remember the name of the first data point's style as that of the next point's
- // predecessor.
- aLastASName = aASName;
- }
- else
- {
- if( ! bIsEmpty )
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- } // End of loop over data points.
-
- // Now write the style for the last data point(s).
- if( bExportContent )
- {
- if( nRepeated > 1 )
- {
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_REPEATED,
- ::rtl::OUString::valueOf( (sal_Int64)( nRepeated ) ));
- }
-
- if( ! bIsEmpty &&
- aLastASName.getLength() &&
- ! aLastASName.equals( aSeriesASName ))
- {
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_STYLE_NAME, aLastASName );
- }
-
- SvXMLElementExport aPoint( mrExport, XML_NAMESPACE_CHART, XML_DATA_POINT, sal_True, sal_True );
- }
- }
-#else
- // more performant version for #93600#
- if( mxExpPropMapper.is())
- {
- uno::Sequence< sal_Int32 > aPtSeq = aDataPointSeq[ nSeries ];
- sal_Int32 nSize = aPtSeq.getLength();
- DBG_ASSERT( nSize <= mnSeriesLength, "Too many point attributes" );
-
- const sal_Int32 * pPoints = aPtSeq.getConstArray();
- sal_Int32 nElement;
- sal_Int32 nRepeat;
-
- if( bExportContent )
- {
- ::std::list< SchXMLDataPointStruct > aDataPointList;
-
- sal_Int32 nLastIndex = -1;
- sal_Int32 nCurrIndex;
-
- // collect elements
- for( nElement = 0; nElement < nSize; ++nElement )
- {
- aPropertyStates.clear();
- nCurrIndex = pPoints[ nElement ];
-
- // write leading empty data points
- if( nCurrIndex - nLastIndex > 1 )
- {
- SchXMLDataPointStruct aPoint;
- aPoint.mnRepeat = nCurrIndex - nLastIndex - 1;
- aDataPointList.push_back( aPoint );
- }
-
- // get property states
- try
- {
- xPropSet = xDiagram->getDataPointProperties( nCurrIndex, nSeries );
- }
- catch( uno::Exception aEx )
- {
- DBG_ERROR1( "Exception caught during Export of data point: %s",
- OUStringToOString( aEx.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
- }
- if( xPropSet.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- if( aPropertyStates.size() > 0 )
- {
- // write data-point with style
- DBG_ASSERT( ! maAutoStyleNameQueue.empty(), "Autostyle queue empty!" );
-
- SchXMLDataPointStruct aPoint;
- if( ! maAutoStyleNameQueue.empty())
- {
- aPoint.maStyleName = maAutoStyleNameQueue.front();
- maAutoStyleNameQueue.pop();
- }
-
- aDataPointList.push_back( aPoint );
- nLastIndex = nCurrIndex;
- continue;
- }
- }
-
- // if we get here the property states are empty
- SchXMLDataPointStruct aPoint;
- aDataPointList.push_back( aPoint );
-
- nLastIndex = nCurrIndex;
- }
- // final empty elements
- nRepeat = mnSeriesLength - nLastIndex - 1;
- if( nRepeat > 0 )
- {
- SchXMLDataPointStruct aPoint;
- aPoint.mnRepeat = nRepeat;
- aDataPointList.push_back( aPoint );
- }
-
- // write elements (merge equal ones)
- ::std::list< SchXMLDataPointStruct >::iterator aIter = aDataPointList.begin();
- SchXMLDataPointStruct aPoint;
- SchXMLDataPointStruct aLastPoint;
-
- // initialize so that it doesn't matter if
- // the element is counted in the first iteration
- aLastPoint.mnRepeat = 0;
-
- for( ; aIter != aDataPointList.end(); ++aIter )
- {
- aPoint = (*aIter);
-
- if( aPoint.maStyleName == aLastPoint.maStyleName )
- aPoint.mnRepeat += aLastPoint.mnRepeat;
- else if( aLastPoint.mnRepeat > 0 )
- {
- // write last element
- if( aLastPoint.maStyleName.getLength() )
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_STYLE_NAME, aLastPoint.maStyleName );
-
- if( aLastPoint.mnRepeat > 1 )
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_REPEATED,
- ::rtl::OUString::valueOf( (sal_Int64)( aLastPoint.mnRepeat ) ));
-
- SvXMLElementExport aPointElem( mrExport, XML_NAMESPACE_CHART, XML_DATA_POINT, sal_True, sal_True );
- }
- aLastPoint = aPoint;
- }
- // write last element if it hasn't been written in last iteration
- if( aPoint.maStyleName == aLastPoint.maStyleName )
- {
- if( aLastPoint.maStyleName.getLength() )
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_STYLE_NAME, aLastPoint.maStyleName );
-
- if( aLastPoint.mnRepeat > 1 )
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_REPEATED,
- ::rtl::OUString::valueOf( (sal_Int64)( aLastPoint.mnRepeat ) ));
-
- SvXMLElementExport aPointElem( mrExport, XML_NAMESPACE_CHART, XML_DATA_POINT, sal_True, sal_True );
- }
- }
- else
- {
- // collect autostyles
- for( nElement = 0; nElement < nSize; ++nElement )
- {
- try
- {
- xPropSet = xDiagram->getDataPointProperties( pPoints[ nElement ], nSeries );
- }
- catch( uno::Exception aEx )
- {
- DBG_ERROR1( "Exception caught during Export of data point: %s",
- OUStringToOString( aEx.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
- }
- if( xPropSet.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- if( aPropertyStates.size() > 0 )
- CollectAutoStyle( aPropertyStates );
- }
- }
- }
- }
-#endif
-
- // close series element
- if( pSeries )
- delete pSeries;
- }
-
- // stock-chart elements
- ::rtl::OUString sChartType ( xDiagram->getDiagramType());
- if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.StockDiagram" )))
- {
- uno::Reference< chart::XStatisticDisplay > xStockPropProvider( xDiagram, uno::UNO_QUERY );
- if( xStockPropProvider.is())
- {
- // stock-gain-marker
- uno::Reference< beans::XPropertySet > xStockPropSet = xStockPropProvider->getUpBar();
- if( xStockPropSet.is())
- {
- aPropertyStates.clear();
- aPropertyStates = mxExpPropMapper->Filter( xStockPropSet );
-
- if( aPropertyStates.size() > 0 )
- {
- if( bExportContent )
- {
- AddAutoStyleAttribute( aPropertyStates );
-
- SvXMLElementExport aGain( mrExport, XML_NAMESPACE_CHART, XML_STOCK_GAIN_MARKER, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- }
- }
-
- // stock-loss-marker
- xStockPropSet = xStockPropProvider->getDownBar();
- if( xStockPropSet.is())
- {
- aPropertyStates.clear();
- aPropertyStates = mxExpPropMapper->Filter( xStockPropSet );
-
- if( aPropertyStates.size() > 0 )
- {
- if( bExportContent )
- {
- AddAutoStyleAttribute( aPropertyStates );
-
- SvXMLElementExport aGain( mrExport, XML_NAMESPACE_CHART, XML_STOCK_LOSS_MARKER, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- }
- }
-
- // stock-range-line
- xStockPropSet = xStockPropProvider->getMinMaxLine();
- if( xStockPropSet.is())
- {
- aPropertyStates.clear();
- aPropertyStates = mxExpPropMapper->Filter( xStockPropSet );
-
- if( aPropertyStates.size() > 0 )
- {
- if( bExportContent )
- {
- AddAutoStyleAttribute( aPropertyStates );
-
- SvXMLElementExport aGain( mrExport, XML_NAMESPACE_CHART, XML_STOCK_RANGE_LINE, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- }
- }
- }
- }
-
- // wall and floor element
- // ----------------------
-
- uno::Reference< chart::X3DDisplay > xWallFloorSupplier( xDiagram, uno::UNO_QUERY );
- if( mxExpPropMapper.is() &&
- xWallFloorSupplier.is())
- {
- // remove property states for autostyles
- aPropertyStates.clear();
-
- uno::Reference< beans::XPropertySet > xWallPropSet( xWallFloorSupplier->getWall(), uno::UNO_QUERY );
- if( xWallPropSet.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xWallPropSet );
-
- if( aPropertyStates.size() > 0 )
- {
- // write element
- if( bExportContent )
- {
- // add style name attribute
- AddAutoStyleAttribute( aPropertyStates );
-
- SvXMLElementExport aWall( mrExport, XML_NAMESPACE_CHART, XML_WALL, sal_True, sal_True );
- }
- else // autostyles
- {
- CollectAutoStyle( aPropertyStates );
- }
- }
- }
-
- // floor element
- // -------------
-
- // remove property states for autostyles
- aPropertyStates.clear();
-
- uno::Reference< beans::XPropertySet > xFloorPropSet( xWallFloorSupplier->getFloor(), uno::UNO_QUERY );
- if( xFloorPropSet.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xFloorPropSet );
-
- if( aPropertyStates.size() > 0 )
- {
- // write element
- if( bExportContent )
- {
- // add style name attribute
- AddAutoStyleAttribute( aPropertyStates );
-
- SvXMLElementExport aFloor( mrExport, XML_NAMESPACE_CHART, XML_FLOOR, sal_True, sal_True );
- }
- else // autostyles
- {
- CollectAutoStyle( aPropertyStates );
- }
- }
- }
- }
-
- if( pElPlotArea )
- delete pElPlotArea;
-}
-
-void SchXMLExportHelper::exportAxes( uno::Reference< chart::XDiagram > xDiagram, sal_Bool bExportContent )
-{
- DBG_ASSERT( xDiagram.is(), "Invalid XDiagram as parameter" );
- if( ! xDiagram.is())
- return;
-
- // variables for autostyles
- const ::rtl::OUString sNumFormat( ::rtl::OUString::createFromAscii( "NumberFormat" ));
- sal_Int32 nNumberFormat;
- uno::Reference< beans::XPropertySet > xPropSet;
- std::vector< XMLPropertyState > aPropertyStates;
- sal_Int32 nStyleFamily = XML_STYLE_FAMILY_SCH_CHART_ID;
- ::rtl::OUString aASName;
-
- // get some properties from document first
- sal_Bool bHasXAxis = sal_False,
- bHasYAxis = sal_False,
- bHasZAxis = sal_False,
- bHasSecondaryXAxis = sal_False,
- bHasSecondaryYAxis = sal_False;
- sal_Bool bHasXAxisTitle = sal_False,
- bHasYAxisTitle = sal_False,
- bHasZAxisTitle = sal_False;
- sal_Bool bHasXAxisMajorGrid = sal_False,
- bHasXAxisMinorGrid = sal_False,
- bHasYAxisMajorGrid = sal_False,
- bHasYAxisMinorGrid = sal_False,
- bHasZAxisMajorGrid = sal_False,
- bHasZAxisMinorGrid = sal_False;
- sal_Bool bIs3DChart = sal_False;
-
- // get multiple properties using XMultiPropertySet
- MultiPropertySetHandler aDiagramProperties (xDiagram);
-
- // Check for supported services and then the properties provided by this service.
- Reference<lang::XServiceInfo> xServiceInfo (xDiagram, UNO_QUERY);
- if (xServiceInfo.is())
- {
- if (xServiceInfo->supportsService(
- ::rtl::OUString::createFromAscii ("com.sun.star.chart.ChartAxisXSupplier")))
- {
- aDiagramProperties.Add (
- OUString(RTL_CONSTASCII_USTRINGPARAM("HasXAxis")), bHasXAxis);
- }
- if (xServiceInfo->supportsService(
- ::rtl::OUString::createFromAscii ("com.sun.star.chart.ChartAxisYSupplier")))
- {
- aDiagramProperties.Add (
- OUString(RTL_CONSTASCII_USTRINGPARAM("HasYAxis")), bHasYAxis);
- }
- if (xServiceInfo->supportsService(
- ::rtl::OUString::createFromAscii ("com.sun.star.chart.ChartAxisZSupplier")))
- {
- aDiagramProperties.Add (
- OUString(RTL_CONSTASCII_USTRINGPARAM("HasZAxis")), bHasZAxis);
- }
- if (xServiceInfo->supportsService(
- ::rtl::OUString::createFromAscii ("com.sun.star.chart.ChartTwoAxisXSupplier")))
- {
- aDiagramProperties.Add (
- OUString(RTL_CONSTASCII_USTRINGPARAM("HasSecondaryXAxis")), bHasSecondaryXAxis);
- }
- if (xServiceInfo->supportsService(
- ::rtl::OUString::createFromAscii ("com.sun.star.chart.ChartTwoAxisYSupplier")))
- {
- aDiagramProperties.Add (
- OUString(RTL_CONSTASCII_USTRINGPARAM("HasSecondaryYAxis")), bHasSecondaryYAxis);
- }
- }
-
- aDiagramProperties.Add (
- OUString (RTL_CONSTASCII_USTRINGPARAM ("HasXAxisTitle")), bHasXAxisTitle);
- aDiagramProperties.Add (
- OUString (RTL_CONSTASCII_USTRINGPARAM ("HasYAxisTitle")), bHasYAxisTitle);
- aDiagramProperties.Add (
- OUString (RTL_CONSTASCII_USTRINGPARAM ("HasZAxisTitle")), bHasZAxisTitle);
-
- aDiagramProperties.Add (
- OUString (RTL_CONSTASCII_USTRINGPARAM ("HasXAxisGrid")), bHasXAxisMajorGrid);
- aDiagramProperties.Add (
- OUString (RTL_CONSTASCII_USTRINGPARAM ("HasYAxisGrid")), bHasYAxisMajorGrid);
- aDiagramProperties.Add (
- OUString (RTL_CONSTASCII_USTRINGPARAM ("HasZAxisGrid")), bHasZAxisMajorGrid);
-
- aDiagramProperties.Add (
- OUString (RTL_CONSTASCII_USTRINGPARAM ("HasXAxisHelpGrid")), bHasXAxisMinorGrid);
- aDiagramProperties.Add (
- OUString (RTL_CONSTASCII_USTRINGPARAM ("HasYAxisHelpGrid")), bHasYAxisMinorGrid);
- aDiagramProperties.Add (
- OUString (RTL_CONSTASCII_USTRINGPARAM ("HasZAxisHelpGrid")), bHasZAxisMinorGrid);
-
- aDiagramProperties.Add(
- OUString (RTL_CONSTASCII_USTRINGPARAM ("Dim3D")), bIs3DChart);
-
- if ( ! aDiagramProperties.GetProperties ())
- {
- DBG_WARNING ("Required properties not found in Chart diagram");
- }
-
- SvXMLElementExport* pAxis = NULL;
-
- // x axis
- // -------
-
- // write axis element also if the axis itself is not visible, but a grid or
- // title
- if( bHasXAxis ||
- bHasXAxisTitle || bHasXAxisMajorGrid || bHasXAxisMinorGrid )
- {
- uno::Reference< chart::XAxisXSupplier > xAxisSupp( xDiagram, uno::UNO_QUERY );
- if( xAxisSupp.is())
- {
- // get property states for autostyles
- if( mxExpPropMapper.is())
- {
- xPropSet = xAxisSupp->getXAxis();
- if( xPropSet.is())
- {
- uno::Any aNumAny = xPropSet->getPropertyValue( sNumFormat );
- aNumAny >>= nNumberFormat;
- if( nNumberFormat != -1 )
- mrExport.addDataStyle( nNumberFormat );
-
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- }
- }
- if( bExportContent )
- {
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, (mnDomainAxes > 0)
- ? XML_DOMAIN // scatter (or bubble) chart
- : XML_CATEGORY );
-
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, XML_PRIMARY_X );
-
-
- // write style name
- AddAutoStyleAttribute( aPropertyStates );
-
- // element
- pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, sal_True, sal_True );
- }
- else // autostyles
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
-
- // axis-title
- if( bHasXAxisTitle )
- {
- uno::Reference< beans::XPropertySet > xTitleProp( xAxisSupp->getXAxisTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xTitleProp );
- if( bExportContent )
- {
- ::rtl::OUString aText;
- uno::Any aAny( xTitleProp->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" ))));
- aAny >>= aText;
-
- uno::Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY );
- if( xShape.is())
- addPosition( xShape );
-
- AddAutoStyleAttribute( aPropertyStates );
- SvXMLElementExport aTitle( mrExport, XML_NAMESPACE_CHART, XML_TITLE, sal_True, sal_True );
-
- // paragraph containing title
- exportText( aText );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
- }
-
- // grid
- uno::Reference< beans::XPropertySet > xMajorGrid( xAxisSupp->getXMainGrid(), uno::UNO_QUERY );
- if( bHasXAxisMajorGrid && xMajorGrid.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xMajorGrid );
- if( bExportContent )
- {
- AddAutoStyleAttribute( aPropertyStates );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MAJOR );
- SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
- uno::Reference< beans::XPropertySet > xMinorGrid( xAxisSupp->getXHelpGrid(), uno::UNO_QUERY );
- if( bHasXAxisMinorGrid && xMinorGrid.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xMinorGrid );
- if( bExportContent )
- {
- AddAutoStyleAttribute( aPropertyStates );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MINOR );
- SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
- if( pAxis )
- {
- delete pAxis;
- pAxis = NULL;
- }
- }
- }
-
- // secondary x axis
- if( bHasSecondaryXAxis )
- {
- uno::Reference< chart::XTwoAxisXSupplier > xAxisSupp( xDiagram, uno::UNO_QUERY );
- if( xAxisSupp.is())
- {
- // get property states for autostyles
- if( mxExpPropMapper.is())
- {
- xPropSet = xAxisSupp->getSecondaryXAxis();
- if( xPropSet.is())
- {
- uno::Any aNumAny = xPropSet->getPropertyValue( sNumFormat );
- aNumAny >>= nNumberFormat;
- if( nNumberFormat != -1 )
- mrExport.addDataStyle( nNumberFormat );
-
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- }
- }
- if( bExportContent )
- {
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, (mnDomainAxes > 0)
- ? XML_DOMAIN // scatter (or bubble) chart
- : XML_CATEGORY );
-
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, XML_SECONDARY_X );
- AddAutoStyleAttribute( aPropertyStates );
- pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, sal_True, sal_True );
- }
- else // autostyles
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
-
- if( pAxis )
- {
- delete pAxis;
- pAxis = NULL;
- }
- }
- }
-
- // y axis
- // -------
-
- // write axis element also if the axis itself is not visible, but a grid or
- // title
- if( bHasYAxis ||
- bHasYAxisTitle || bHasYAxisMajorGrid || bHasYAxisMinorGrid )
- {
- uno::Reference< chart::XAxisYSupplier > xAxisSupp( xDiagram, uno::UNO_QUERY );
- if( xAxisSupp.is())
- {
- // get property states for autostyles
- if( mxExpPropMapper.is())
- {
- xPropSet = xAxisSupp->getYAxis();
- if( xPropSet.is())
- {
- uno::Any aNumAny = xPropSet->getPropertyValue( sNumFormat );
- aNumAny >>= nNumberFormat;
- if( nNumberFormat != -1 )
- mrExport.addDataStyle( nNumberFormat );
-
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- }
- }
- if( bExportContent )
- {
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_VALUE );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, XML_PRIMARY_Y );
- AddAutoStyleAttribute( aPropertyStates );
- pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
-
- // axis-title
- if( bHasYAxisTitle )
- {
- uno::Reference< beans::XPropertySet > xTitleProp( xAxisSupp->getYAxisTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xTitleProp );
- if( bExportContent )
- {
- ::rtl::OUString aText;
- uno::Any aAny( xTitleProp->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" ))));
- aAny >>= aText;
-
- uno::Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY );
- if( xShape.is())
- addPosition( xShape );
-
- AddAutoStyleAttribute( aPropertyStates );
- SvXMLElementExport aTitle( mrExport, XML_NAMESPACE_CHART, XML_TITLE, sal_True, sal_True );
-
- // paragraph containing title
- exportText( aText );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
- }
-
- // grid
- uno::Reference< beans::XPropertySet > xMajorGrid( xAxisSupp->getYMainGrid(), uno::UNO_QUERY );
- if( bHasYAxisMajorGrid && xMajorGrid.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xMajorGrid );
-
- if( bExportContent )
- {
- AddAutoStyleAttribute( aPropertyStates );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MAJOR );
- SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
- // minor grid
- uno::Reference< beans::XPropertySet > xMinorGrid( xAxisSupp->getYHelpGrid(), uno::UNO_QUERY );
- if( bHasYAxisMinorGrid && xMinorGrid.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xMinorGrid );
-
- if( bExportContent )
- {
- AddAutoStyleAttribute( aPropertyStates );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MINOR );
- SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
- if( pAxis )
- {
- delete pAxis;
- pAxis = NULL;
- }
- }
- }
- if( bHasSecondaryYAxis )
- {
- uno::Reference< chart::XTwoAxisYSupplier > xAxisSupp( xDiagram, uno::UNO_QUERY );
- if( xAxisSupp.is())
- {
- // get property states for autostyles
- if( mxExpPropMapper.is())
- {
- xPropSet = xAxisSupp->getSecondaryYAxis();
- if( xPropSet.is())
- {
- uno::Any aNumAny = xPropSet->getPropertyValue( sNumFormat );
- aNumAny >>= nNumberFormat;
- if( nNumberFormat != -1 )
- mrExport.addDataStyle( nNumberFormat );
-
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- }
- }
- if( bExportContent )
- {
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_VALUE );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, XML_SECONDARY_Y );
- AddAutoStyleAttribute( aPropertyStates );
- pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, sal_True, sal_True );
- }
- else // autostyles
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- if( pAxis )
- {
- delete pAxis;
- pAxis = NULL;
- }
- }
- }
-
- // z axis
- // -------
-
- if( bHasZAxis &&
- bIs3DChart )
- {
- uno::Reference< chart::XAxisZSupplier > xAxisSupp( xDiagram, uno::UNO_QUERY );
- if( xAxisSupp.is())
- {
- // get property states for autostyles
- if( mxExpPropMapper.is())
- {
- xPropSet = xAxisSupp->getZAxis();
- if( xPropSet.is())
- {
- uno::Any aNumAny = xPropSet->getPropertyValue( sNumFormat );
- aNumAny >>= nNumberFormat;
- if( nNumberFormat != -1 )
- mrExport.addDataStyle( nNumberFormat );
-
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- }
- }
- if( bExportContent )
- {
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_SERIES );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, XML_PRIMARY_Z );
-
- AddAutoStyleAttribute( aPropertyStates );
- pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
-
- // axis-title
- if( bHasZAxisTitle )
- {
- uno::Reference< beans::XPropertySet > xTitleProp( xAxisSupp->getZAxisTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xTitleProp );
- if( bExportContent )
- {
- ::rtl::OUString aText;
- uno::Any aAny( xTitleProp->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" ))));
- aAny >>= aText;
-
- uno::Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY );
- if( xShape.is())
- addPosition( xShape );
-
- AddAutoStyleAttribute( aPropertyStates );
- SvXMLElementExport aTitle( mrExport, XML_NAMESPACE_CHART, XML_TITLE, sal_True, sal_True );
-
- // paragraph containing title
- exportText( aText );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
- }
-
- // grid
- uno::Reference< beans::XPropertySet > xMajorGrid( xAxisSupp->getZMainGrid(), uno::UNO_QUERY );
- if( bHasZAxisMajorGrid && xMajorGrid.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xMajorGrid );
-
- if( bExportContent )
- {
- AddAutoStyleAttribute( aPropertyStates );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MAJOR );
- SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
- // minor grid
- uno::Reference< beans::XPropertySet > xMinorGrid( xAxisSupp->getZHelpGrid(), uno::UNO_QUERY );
- if( bHasZAxisMinorGrid && xMinorGrid.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xMinorGrid );
-
- if( bExportContent )
- {
- AddAutoStyleAttribute( aPropertyStates );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MINOR );
- SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
- }
- if( pAxis )
- {
- delete pAxis;
- pAxis = NULL;
- }
- }
-}
-
-void SchXMLExportHelper::getCellAddress( sal_Int32 nCol, sal_Int32 nRow )
-{
- msStringBuffer.append( (sal_Unicode)'.' );
- if( nCol < 26 )
- msStringBuffer.append( (sal_Unicode)('A' + nCol) );
- else if( nCol < 702 )
- {
- msStringBuffer.append( (sal_Unicode)('A' + nCol / 26 - 1 ));
- msStringBuffer.append( (sal_Unicode)('A' + nCol % 26) );
- }
- else
- {
- msStringBuffer.append( (sal_Unicode)('A' + nCol / 702 - 1 ));
- msStringBuffer.append( (sal_Unicode)('A' + (nCol % 702) / 26 ));
- msStringBuffer.append( (sal_Unicode)('A' + nCol % 26) );
- }
-
- msStringBuffer.append( nRow + (sal_Int32)1 );
-}
-
-void SchXMLExportHelper::addPosition( uno::Reference< drawing::XShape > xShape )
-{
- if( xShape.is())
- {
- awt::Point aPos = xShape->getPosition();
-
- mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, aPos.X );
- msString = msStringBuffer.makeStringAndClear();
- mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_X, msString );
-
- mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, aPos.Y );
- msString = msStringBuffer.makeStringAndClear();
- mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_Y, msString );
- }
-}
-
-void SchXMLExportHelper::addSize( uno::Reference< drawing::XShape > xShape )
-{
- if( xShape.is())
- {
- awt::Size aSize = xShape->getSize();
-
- mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, aSize.Width );
- msString = msStringBuffer.makeStringAndClear();
- mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_WIDTH, msString );
-
- mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, aSize.Height );
- msString = msStringBuffer.makeStringAndClear();
- mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT, msString );
- }
-}
-
-void SchXMLExportHelper::CollectAutoStyle( const ::std::vector< XMLPropertyState >& aStates )
-{
- if( aStates.size())
- maAutoStyleNameQueue.push( GetAutoStylePoolP().Add( XML_STYLE_FAMILY_SCH_CHART_ID, aStates ));
-}
-
-void SchXMLExportHelper::AddAutoStyleAttribute( const ::std::vector< XMLPropertyState >& aStates )
-{
- if( aStates.size())
- {
- DBG_ASSERT( ! maAutoStyleNameQueue.empty(), "Autostyle queue empty!" );
-
- if( ! maAutoStyleNameQueue.empty())
- {
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_STYLE_NAME, maAutoStyleNameQueue.front());
- maAutoStyleNameQueue.pop();
- }
- }
-}
-
-void SchXMLExportHelper::exportText( const ::rtl::OUString& rText, bool bConvertTabsLFs )
-{
- SvXMLElementExport aPara( mrExport, XML_NAMESPACE_TEXT,
- ::binfilter::xmloff::token::GetXMLToken( ::binfilter::xmloff::token::XML_P ),
- sal_True, sal_False );
-
- if( bConvertTabsLFs )
- {
- sal_Int32 nStartPos = 0;
- sal_Int32 nEndPos = rText.getLength();
- sal_Unicode cChar;
-
- for( sal_Int32 nPos = 0; nPos < nEndPos; nPos++ )
- {
- cChar = rText[ nPos ];
- switch( cChar )
- {
- case 0x0009: // tabulator
- {
- if( nPos > nStartPos )
- mrExport.GetDocHandler()->characters( rText.copy( nStartPos, (nPos - nStartPos)) );
- nStartPos = nPos + 1;
-
- SvXMLElementExport aElem( mrExport, XML_NAMESPACE_TEXT,
- ::binfilter::xmloff::token::GetXMLToken( ::binfilter::xmloff::token::XML_TAB_STOP ),
- sal_False, sal_False );
- }
- break;
-
- case 0x000A: // linefeed
- {
- if( nPos > nStartPos )
- mrExport.GetDocHandler()->characters( rText.copy( nStartPos, (nPos - nStartPos)) );
- nStartPos = nPos + 1;
-
- SvXMLElementExport aElem( mrExport, XML_NAMESPACE_TEXT,
- ::binfilter::xmloff::token::GetXMLToken( ::binfilter::xmloff::token::XML_LINE_BREAK ),
- sal_False, sal_False );
- }
- break;
- }
- }
- if( nEndPos > nStartPos )
- {
- if( nStartPos == 0 )
- mrExport.GetDocHandler()->characters( rText );
- else
- mrExport.GetDocHandler()->characters( rText.copy( nStartPos, (nEndPos - nStartPos)) );
- }
- }
- else // do not convert tabs and linefeeds (eg for numbers coming from unit converter)
- {
- mrExport.GetDocHandler()->characters( rText );
- }
-}
-
-// ========================================
-// class SchXMLExport
-// ========================================
-
-// #110680#
-SchXMLExport::SchXMLExport(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- sal_uInt16 nExportFlags )
-: SvXMLExport( xServiceFactory, MAP_CM, ::binfilter::xmloff::token::XML_CHART, nExportFlags ),
- maAutoStylePool( *this ),
- maExportHelper( *this, maAutoStylePool )
-{
-}
-
-
-SchXMLExport::~SchXMLExport()
-{
- // stop progress view
- if( mxStatusIndicator.is())
- {
- mxStatusIndicator->end();
- mxStatusIndicator->reset();
- }
-}
-
-void SchXMLExport::_ExportStyles( sal_Bool bUsed )
-{
- SvXMLExport::_ExportStyles( bUsed );
-}
-
-void SchXMLExport::_ExportMasterStyles()
-{
- // not available in chart
- DBG_WARNING( "Master Style Export requested. Not available for Chart" );
-}
-
-void SchXMLExport::_ExportAutoStyles()
-{
- // there are no styles that require their own autostyles
- if( getExportFlags() & EXPORT_CONTENT )
- {
- uno::Reference< chart::XChartDocument > xChartDoc( GetModel(), uno::UNO_QUERY );
- if( xChartDoc.is())
- {
- maExportHelper.collectAutoStyles( xChartDoc );
- maExportHelper.exportAutoStyles();
- }
- else
- {
- DBG_ERROR( "Couldn't export chart due to wrong XModel (must be XChartDocument)" );
- }
- }
-}
-
-void SchXMLExport::_ExportContent()
-{
- uno::Reference< chart::XChartDocument > xChartDoc( GetModel(), uno::UNO_QUERY );
- if( xChartDoc.is())
- {
- // add size for chart element in standalone case
- uno::Reference< drawing::XShape > xShape ( xChartDoc->getArea(), uno::UNO_QUERY );
- if( xShape.is())
- {
- awt::Size aSize = xShape->getSize();
- ::rtl::OUStringBuffer sStringBuffer;
- ::rtl::OUString sString;
-
- GetMM100UnitConverter().convertMeasure( sStringBuffer, aSize.Width );
- sString = sStringBuffer.makeStringAndClear();
- AddAttribute( XML_NAMESPACE_SVG, XML_WIDTH, sString );
-
- GetMM100UnitConverter().convertMeasure( sStringBuffer, aSize.Height );
- sString = sStringBuffer.makeStringAndClear();
- AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT, sString );
- }
-
- // determine if data comes from the outside
- sal_Bool bIncludeTable = sal_True;
- uno::Reference< lang::XServiceInfo > xServ( xChartDoc, uno::UNO_QUERY );
- if( xServ.is())
- {
- if( xServ->supportsService(
- ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartTableAddressSupplier" )))
- {
- uno::Reference< beans::XPropertySet > xProp( xServ, uno::UNO_QUERY );
- if( xProp.is())
- {
- uno::Any aAny;
- try
- {
- ::rtl::OUString sChartAddress;
- aAny = xProp->getPropertyValue(
- ::rtl::OUString::createFromAscii( "ChartRangeAddress" ));
- aAny >>= sChartAddress;
- maExportHelper.SetChartRangeAddress( sChartAddress );
-
- ::rtl::OUString sTableNumberList;
- aAny = xProp->getPropertyValue(
- ::rtl::OUString::createFromAscii( "TableNumberList" ));
- aAny >>= sTableNumberList;
- maExportHelper.SetTableNumberList( sTableNumberList );
-
- // do not include own table if there are external addresses
- bIncludeTable = (sChartAddress.getLength() == 0);
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Property ChartRangeAddress not supported by ChartDocument" );
- }
- }
- }
- }
- maExportHelper.exportChart( xChartDoc, bIncludeTable );
- }
- else
- {
- DBG_ERROR( "Couldn't export chart due to wrong XModel" );
- }
-}
-
-// export components ========================================
-
-// first version: everything goes in one storage
-
-uno::Sequence< OUString > SAL_CALL SchXMLExport_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Chart.XMLExporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SchXMLExport_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SchXMLExport.Compact" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SchXMLExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // #103997# removed some flags from EXPORT_ALL
- // return (cppu::OWeakObject*)new SchXMLExport( EXPORT_ALL ^ ( EXPORT_SETTINGS | EXPORT_MASTERSTYLES | EXPORT_SCRIPTS ));
- return (cppu::OWeakObject*)new SchXMLExport( rSMgr, EXPORT_ALL ^ ( EXPORT_SETTINGS | EXPORT_MASTERSTYLES | EXPORT_SCRIPTS ));
-}
-
-// ============================================================
-
-// multiple storage version: one for content / styles / meta
-
-uno::Sequence< OUString > SAL_CALL SchXMLExport_Styles_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Chart.XMLStylesExporter" ));
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SchXMLExport_Styles_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SchXMLExport.Styles" ));
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SchXMLExport_Styles_createInstance(const uno::Reference< lang::XMultiServiceFactory >& rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SchXMLExport( EXPORT_STYLES );
- return (cppu::OWeakObject*)new SchXMLExport( rSMgr, EXPORT_STYLES );
-}
-
-// ------------------------------------------------------------
-
-uno::Sequence< OUString > SAL_CALL SchXMLExport_Content_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Chart.XMLContentExporter" ));
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SchXMLExport_Content_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SchXMLExport.Content" ));
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SchXMLExport_Content_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SchXMLExport( EXPORT_AUTOSTYLES | EXPORT_CONTENT | EXPORT_FONTDECLS );
- return (cppu::OWeakObject*)new SchXMLExport( rSMgr, EXPORT_AUTOSTYLES | EXPORT_CONTENT | EXPORT_FONTDECLS );
-}
-
-// ------------------------------------------------------------
-
-OUString SAL_CALL SchXMLExport_Meta_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SchXMLExport.Meta" ));
-}
-
-// XServiceInfo
-OUString SAL_CALL SchXMLExport::getImplementationName() throw( uno::RuntimeException )
-{
- switch( getExportFlags())
- {
- case EXPORT_ALL:
- return SchXMLExport_getImplementationName();
- case EXPORT_STYLES:
- return SchXMLExport_Styles_getImplementationName();
- case ( EXPORT_AUTOSTYLES | EXPORT_CONTENT | EXPORT_FONTDECLS ):
- return SchXMLExport_Content_getImplementationName();
- case EXPORT_META:
- return SchXMLExport_Meta_getImplementationName();
-
- case EXPORT_SETTINGS:
- // there is no settings component in chart
- default:
- return OUString::createFromAscii( "SchXMLExport" );
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/xmloff_SchXMLImport.cxx b/binfilter/bf_xmloff/source/chart/xmloff_SchXMLImport.cxx
deleted file mode 100644
index 3440007caba2..000000000000
--- a/binfilter/bf_xmloff/source/chart/xmloff_SchXMLImport.cxx
+++ /dev/null
@@ -1,556 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "SchXMLChartContext.hxx"
-#include "contexts.hxx"
-
-#include <tools/debug.hxx>
-
-#include "xmlnmspe.hxx"
-#include "xmlstyle.hxx"
-
-#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
-#include <com/sun/star/chart/XChartDataArray.hpp>
-#include <com/sun/star/chart/ChartDataRowSource.hpp>
-namespace binfilter {
-
-using namespace rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-/* ----------------------------------------
- TokenMaps for distinguishing different
- tokens in different contexts
- ----------------------------------------*/
-
-// ----------------------------------------
-// element maps
-// ----------------------------------------
-
-static __FAR_DATA SvXMLTokenMapEntry aDocElemTokenMap[] =
-{
- { XML_NAMESPACE_OFFICE, XML_AUTOMATIC_STYLES, XML_TOK_DOC_AUTOSTYLES },
- { XML_NAMESPACE_OFFICE, XML_STYLES, XML_TOK_DOC_STYLES },
- { XML_NAMESPACE_OFFICE, XML_META, XML_TOK_DOC_META },
- { XML_NAMESPACE_OFFICE, XML_BODY, XML_TOK_DOC_BODY },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aTableElemTokenMap[] =
-{
- { XML_NAMESPACE_TABLE, XML_TABLE_HEADER_COLUMNS, XML_TOK_TABLE_HEADER_COLS },
- { XML_NAMESPACE_TABLE, XML_TABLE_COLUMNS, XML_TOK_TABLE_COLUMNS },
- { XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, XML_TOK_TABLE_COLUMN },
- { XML_NAMESPACE_TABLE, XML_TABLE_HEADER_ROWS, XML_TOK_TABLE_HEADER_ROWS },
- { XML_NAMESPACE_TABLE, XML_TABLE_ROWS, XML_TOK_TABLE_ROWS },
- { XML_NAMESPACE_TABLE, XML_TABLE_ROW, XML_TOK_TABLE_ROW },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aChartElemTokenMap[] =
-{
- { XML_NAMESPACE_CHART, XML_PLOT_AREA, XML_TOK_CHART_PLOT_AREA },
- { XML_NAMESPACE_CHART, XML_TITLE, XML_TOK_CHART_TITLE },
- { XML_NAMESPACE_CHART, XML_SUBTITLE, XML_TOK_CHART_SUBTITLE },
- { XML_NAMESPACE_CHART, XML_LEGEND, XML_TOK_CHART_LEGEND },
- { XML_NAMESPACE_TABLE, XML_TABLE, XML_TOK_CHART_TABLE },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aPlotAreaElemTokenMap[] =
-{
- { XML_NAMESPACE_CHART, XML_AXIS, XML_TOK_PA_AXIS },
- { XML_NAMESPACE_CHART, XML_SERIES, XML_TOK_PA_SERIES },
- { XML_NAMESPACE_CHART, XML_CATEGORIES, XML_TOK_PA_CATEGORIES },
- { XML_NAMESPACE_CHART, XML_WALL, XML_TOK_PA_WALL },
- { XML_NAMESPACE_CHART, XML_FLOOR, XML_TOK_PA_FLOOR },
- { XML_NAMESPACE_DR3D, XML_LIGHT, XML_TOK_PA_LIGHT_SOURCE },
- { XML_NAMESPACE_CHART, XML_STOCK_GAIN_MARKER, XML_TOK_PA_STOCK_GAIN },
- { XML_NAMESPACE_CHART, XML_STOCK_LOSS_MARKER, XML_TOK_PA_STOCK_LOSS },
- { XML_NAMESPACE_CHART, XML_STOCK_RANGE_LINE, XML_TOK_PA_STOCK_RANGE },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aSeriesElemTokenMap[] =
-{
- { XML_NAMESPACE_CHART, XML_DATA_POINT, XML_TOK_SERIES_DATA_POINT },
- { XML_NAMESPACE_CHART, XML_DOMAIN, XML_TOK_SERIES_DOMAIN },
- { XML_NAMESPACE_CHART, XML_MEAN_VALUE, XML_TOK_SERIES_MEAN_VALUE_LINE },
- { XML_NAMESPACE_CHART, XML_REGRESSION_CURVE, XML_TOK_SERIES_REGRESSION_CURVE },
- { XML_NAMESPACE_CHART, XML_ERROR_INDICATOR, XML_TOK_SERIES_ERROR_INDICATOR },
- XML_TOKEN_MAP_END
-};
-
-// ----------------------------------------
-// attribute maps
-// ----------------------------------------
-
-static __FAR_DATA SvXMLTokenMapEntry aChartAttrTokenMap[] =
-{
- { XML_NAMESPACE_CHART, XML_CLASS, XML_TOK_CHART_CLASS },
- { XML_NAMESPACE_SVG, XML_WIDTH, XML_TOK_CHART_WIDTH },
- { XML_NAMESPACE_SVG, XML_HEIGHT, XML_TOK_CHART_HEIGHT },
- { XML_NAMESPACE_CHART, XML_STYLE_NAME, XML_TOK_CHART_STYLE_NAME },
- { XML_NAMESPACE_CHART, XML_ADD_IN_NAME, XML_TOK_CHART_ADDIN_NAME },
- { XML_NAMESPACE_CHART, XML_COLUMN_MAPPING, XML_TOK_CHART_COL_MAPPING },
- { XML_NAMESPACE_CHART, XML_ROW_MAPPING, XML_TOK_CHART_ROW_MAPPING },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aPlotAreaAttrTokenMap[] =
-{
- { XML_NAMESPACE_SVG, XML_X, XML_TOK_PA_X },
- { XML_NAMESPACE_SVG, XML_Y, XML_TOK_PA_Y },
- { XML_NAMESPACE_SVG, XML_WIDTH, XML_TOK_PA_WIDTH },
- { XML_NAMESPACE_SVG, XML_HEIGHT, XML_TOK_PA_HEIGHT },
- { XML_NAMESPACE_CHART, XML_STYLE_NAME, XML_TOK_PA_STYLE_NAME },
- { XML_NAMESPACE_DR3D, XML_TRANSFORM, XML_TOK_PA_TRANSFORM },
- { XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, XML_TOK_PA_CHART_ADDRESS },
- { XML_NAMESPACE_CHART, XML_TABLE_NUMBER_LIST, XML_TOK_PA_TABLE_NUMBER_LIST },
- { XML_NAMESPACE_CHART, XML_DATA_SOURCE_HAS_LABELS,XML_TOK_PA_DS_HAS_LABELS },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aAxisAttrTokenMap[] =
-{
- { XML_NAMESPACE_CHART, XML_CLASS, XML_TOK_AXIS_CLASS },
- { XML_NAMESPACE_CHART, XML_NAME, XML_TOK_AXIS_NAME },
- { XML_NAMESPACE_CHART, XML_STYLE_NAME, XML_TOK_AXIS_STYLE_NAME },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aLegendAttrTokenMap[] =
-{
- { XML_NAMESPACE_CHART, XML_LEGEND_POSITION, XML_TOK_LEGEND_POSITION },
- { XML_NAMESPACE_SVG, XML_X, XML_TOK_LEGEND_X },
- { XML_NAMESPACE_SVG, XML_Y, XML_TOK_LEGEND_Y },
- { XML_NAMESPACE_CHART, XML_STYLE_NAME, XML_TOK_LEGEND_STYLE_NAME },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aCellAttrTokenMap[] =
-{
- { XML_NAMESPACE_TABLE, XML_VALUE_TYPE, XML_TOK_CELL_VAL_TYPE },
- { XML_NAMESPACE_TABLE, XML_VALUE, XML_TOK_CELL_VALUE },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aSeriesAttrTokenMap[] =
-{
- { XML_NAMESPACE_CHART, XML_VALUES_CELL_RANGE_ADDRESS, XML_TOK_SERIES_CELL_RANGE },
- { XML_NAMESPACE_CHART, XML_LABEL_CELL_ADDRESS, XML_TOK_SERIES_LABEL_ADDRESS },
- { XML_NAMESPACE_CHART, XML_ATTACHED_AXIS, XML_TOK_SERIES_ATTACHED_AXIS },
- { XML_NAMESPACE_CHART, XML_STYLE_NAME, XML_TOK_SERIES_STYLE_NAME },
- { XML_NAMESPACE_CHART, XML_CLASS, XML_TOK_SERIES_CHART_CLASS },
- XML_TOKEN_MAP_END
-};
-
-// ========================================
-
-SchXMLImportHelper::SchXMLImportHelper() :
- mpAutoStyles( 0 ),
-
- mpDocElemTokenMap( 0 ),
- mpTableElemTokenMap( 0 ),
- mpChartElemTokenMap( 0 ),
- mpPlotAreaElemTokenMap( 0 ),
- mpSeriesElemTokenMap( 0 ),
-
- mpChartAttrTokenMap( 0 ),
- mpPlotAreaAttrTokenMap( 0 ),
- mpAxisAttrTokenMap( 0 ),
- mpLegendAttrTokenMap( 0 ),
- mpAutoStyleAttrTokenMap( 0 ),
- mpCellAttrTokenMap( 0 ),
- mpSeriesAttrTokenMap( 0 )
-{
-}
-
-SchXMLImportHelper::~SchXMLImportHelper()
-{
- // delete token maps
- if( mpDocElemTokenMap )
- delete mpDocElemTokenMap;
- if( mpTableElemTokenMap )
- delete mpTableElemTokenMap;
- if( mpChartElemTokenMap )
- delete mpChartElemTokenMap;
- if( mpPlotAreaElemTokenMap )
- delete mpPlotAreaElemTokenMap;
- if( mpSeriesElemTokenMap )
- delete mpSeriesElemTokenMap;
-
- if( mpChartAttrTokenMap )
- delete mpChartAttrTokenMap;
- if( mpPlotAreaAttrTokenMap )
- delete mpPlotAreaAttrTokenMap;
- if( mpAxisAttrTokenMap )
- delete mpAxisAttrTokenMap;
- if( mpLegendAttrTokenMap )
- delete mpLegendAttrTokenMap;
- if( mpAutoStyleAttrTokenMap )
- delete mpAutoStyleAttrTokenMap;
- if( mpCellAttrTokenMap )
- delete mpCellAttrTokenMap;
- if( mpSeriesAttrTokenMap )
- delete mpSeriesAttrTokenMap;
-}
-
-SvXMLImportContext* SchXMLImportHelper::CreateChartContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
- const uno::Reference< frame::XModel > xChartModel,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = 0;
-
- uno::Reference< chart::XChartDocument > xDoc( xChartModel, uno::UNO_QUERY );
- if( xDoc.is())
- {
- mxChartDoc = xDoc;
- pContext = new SchXMLChartContext( *this, rImport, rLocalName );
- }
- else
- {
- DBG_ERROR( "No valid XChartDocument given as XModel" );
- pContext = new SvXMLImportContext( rImport, nPrefix, rLocalName );
- }
-
- return pContext;
-}
-
-/* ----------------------------------------
- get various token maps
- ----------------------------------------*/
-
-const SvXMLTokenMap& SchXMLImportHelper::GetDocElemTokenMap()
-{
- if( ! mpDocElemTokenMap )
- mpDocElemTokenMap = new SvXMLTokenMap( aDocElemTokenMap );
- return *mpDocElemTokenMap;
-}
-
-const SvXMLTokenMap& SchXMLImportHelper::GetTableElemTokenMap()
-{
- if( ! mpTableElemTokenMap )
- mpTableElemTokenMap = new SvXMLTokenMap( aTableElemTokenMap );
- return *mpTableElemTokenMap;
-}
-
-const SvXMLTokenMap& SchXMLImportHelper::GetChartElemTokenMap()
-{
- if( ! mpChartElemTokenMap )
- mpChartElemTokenMap = new SvXMLTokenMap( aChartElemTokenMap );
- return *mpChartElemTokenMap;
-}
-
-const SvXMLTokenMap& SchXMLImportHelper::GetPlotAreaElemTokenMap()
-{
- if( ! mpPlotAreaElemTokenMap )
- mpPlotAreaElemTokenMap = new SvXMLTokenMap( aPlotAreaElemTokenMap );
- return *mpPlotAreaElemTokenMap;
-}
-
-const SvXMLTokenMap& SchXMLImportHelper::GetSeriesElemTokenMap()
-{
- if( ! mpSeriesElemTokenMap )
- mpSeriesElemTokenMap = new SvXMLTokenMap( aSeriesElemTokenMap );
- return *mpSeriesElemTokenMap;
-}
-
-// ----------------------------------------
-
-const SvXMLTokenMap& SchXMLImportHelper::GetChartAttrTokenMap()
-{
- if( ! mpChartAttrTokenMap )
- mpChartAttrTokenMap = new SvXMLTokenMap( aChartAttrTokenMap );
- return *mpChartAttrTokenMap;
-}
-
-const SvXMLTokenMap& SchXMLImportHelper::GetPlotAreaAttrTokenMap()
-{
- if( ! mpPlotAreaAttrTokenMap )
- mpPlotAreaAttrTokenMap = new SvXMLTokenMap( aPlotAreaAttrTokenMap );
- return *mpPlotAreaAttrTokenMap;
-}
-
-const SvXMLTokenMap& SchXMLImportHelper::GetAxisAttrTokenMap()
-{
- if( ! mpAxisAttrTokenMap )
- mpAxisAttrTokenMap = new SvXMLTokenMap( aAxisAttrTokenMap );
- return *mpAxisAttrTokenMap;
-}
-
-const SvXMLTokenMap& SchXMLImportHelper::GetLegendAttrTokenMap()
-{
- if( ! mpLegendAttrTokenMap )
- mpLegendAttrTokenMap = new SvXMLTokenMap( aLegendAttrTokenMap );
- return *mpLegendAttrTokenMap;
-}
-
-const SvXMLTokenMap& SchXMLImportHelper::GetCellAttrTokenMap()
-{
- if( ! mpCellAttrTokenMap )
- mpCellAttrTokenMap = new SvXMLTokenMap( aCellAttrTokenMap );
- return *mpCellAttrTokenMap;
-}
-
-const SvXMLTokenMap& SchXMLImportHelper::GetSeriesAttrTokenMap()
-{
- if( ! mpSeriesAttrTokenMap )
- mpSeriesAttrTokenMap = new SvXMLTokenMap( aSeriesAttrTokenMap );
- return *mpSeriesAttrTokenMap;
-}
-
-// -1 means don't change
-void SchXMLImportHelper::ResizeChartData( sal_Int32 nSeries, sal_Int32 nDataPoints )
-{
- if( mxChartDoc.is())
- {
- sal_Bool bWasChanged = sal_False;
-
- sal_Bool bDataInColumns = sal_True;
- uno::Reference< beans::XPropertySet > xDiaProp( mxChartDoc->getDiagram(), uno::UNO_QUERY );
- if( xDiaProp.is())
- {
- chart::ChartDataRowSource eRowSource;
- xDiaProp->getPropertyValue( ::rtl::OUString::createFromAscii( "DataRowSource" )) >>= eRowSource;
- bDataInColumns = ( eRowSource == chart::ChartDataRowSource_COLUMNS );
-
- // the chart core treats donut chart with interchanged rows/columns
- uno::Reference< chart::XDiagram > xDiagram( xDiaProp, uno::UNO_QUERY );
- if( xDiagram.is())
- {
- ::rtl::OUString sChartType = xDiagram->getDiagramType();
- if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.DonutDiagram" )))
- {
- bDataInColumns = ! bDataInColumns;
- }
- }
- }
- sal_Int32 nColCount = bDataInColumns ? nSeries : nDataPoints;
- sal_Int32 nRowCount = bDataInColumns ? nDataPoints : nSeries;
-
- uno::Reference< chart::XChartDataArray > xData( mxChartDoc->getData(), uno::UNO_QUERY );
- if( xData.is())
- {
- uno::Sequence< uno::Sequence< double > > xArray = xData->getData();
-
- // increase number of rows
- if( xArray.getLength() < nRowCount )
- {
- sal_Int32 nOldLen = xArray.getLength();
- xArray.realloc( nRowCount );
- if( nColCount == -1 )
- {
- sal_Int32 nSize = xArray[ 0 ].getLength();
- for( sal_Int32 i = nOldLen; i < nRowCount; i++ )
- xArray[ i ].realloc( nSize );
- }
- bWasChanged = sal_True;
- }
-
- if( nSeries == -1 &&
- nRowCount > 0 )
- nColCount = xArray[ 0 ].getLength();
-
- // columns
- if( nColCount > 0 &&
- xArray[ 0 ].getLength() < nColCount )
- {
- if( nDataPoints == -1 )
- nRowCount = xArray.getLength();
-
- for( sal_Int32 i = 0; i < nRowCount; i++ )
- xArray[ i ].realloc( nColCount );
- bWasChanged = sal_True;
- }
-
- if( bWasChanged )
- {
- xData->setData( xArray );
- }
- }
- }
-}
-
-// ========================================
-
-// #110680#
-SchXMLImport::SchXMLImport(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- sal_uInt16 nImportFlags )
-: SvXMLImport( xServiceFactory, nImportFlags )
-{
-}
-
-SchXMLImport::~SchXMLImport() throw ()
-{
- // stop progress view
- if( mxStatusIndicator.is())
- {
- mxStatusIndicator->end();
- mxStatusIndicator->reset();
- }
-}
-
-// create the main context (subcontexts are created
-// by the one created here)
-SvXMLImportContext *SchXMLImport::CreateContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = 0;
-
- // accept <office:document>
- if( XML_NAMESPACE_OFFICE == nPrefix &&
- ( IsXMLToken( rLocalName, XML_DOCUMENT ) ||
- IsXMLToken( rLocalName, XML_DOCUMENT_META) ||
- IsXMLToken( rLocalName, XML_DOCUMENT_STYLES) ||
- IsXMLToken( rLocalName, XML_DOCUMENT_CONTENT) ))
- {
- pContext = new SchXMLDocContext( maImportHelper, *this, nPrefix, rLocalName );
- }
- else
- {
- pContext = SvXMLImport::CreateContext( nPrefix, rLocalName, xAttrList );
- }
-
- return pContext;
-}
-
-SvXMLImportContext* SchXMLImport::CreateStylesContext(
- const ::rtl::OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLStylesContext* pStylesCtxt =
- new SvXMLStylesContext( *(this), XML_NAMESPACE_OFFICE, rLocalName, xAttrList );
-
- // set context at base class, so that all auto-style classes are imported
- SetAutoStyles( pStylesCtxt );
- maImportHelper.SetAutoStylesContext( pStylesCtxt );
-
- return pStylesCtxt;
-}
-
-// export components ========================================
-
-// first version: everything comes from one storage
-
-uno::Sequence< OUString > SAL_CALL SchXMLImport_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Chart.XMLImporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SchXMLImport_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SchXMLImport" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SchXMLImport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SchXMLImport();
- return (cppu::OWeakObject*)new SchXMLImport(rSMgr);
-}
-
-// ============================================================
-
-// multiple storage version: one for content / styles / meta
-
-uno::Sequence< OUString > SAL_CALL SchXMLImport_Styles_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Chart.XMLStylesImporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SchXMLImport_Styles_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SchXMLImport.Styles" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SchXMLImport_Styles_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SchXMLImport( IMPORT_STYLES );
- return (cppu::OWeakObject*)new SchXMLImport( rSMgr, IMPORT_STYLES );
-}
-
-// ------------------------------------------------------------
-
-uno::Sequence< OUString > SAL_CALL SchXMLImport_Content_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Chart.XMLContentImporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SchXMLImport_Content_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SchXMLImport.Content" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SchXMLImport_Content_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SchXMLImport( IMPORT_CONTENT | IMPORT_AUTOSTYLES | IMPORT_FONTDECLS );
- return (cppu::OWeakObject*)new SchXMLImport( rSMgr, IMPORT_CONTENT | IMPORT_AUTOSTYLES | IMPORT_FONTDECLS );
-}
-
-// ------------------------------------------------------------
-
-OUString SAL_CALL SchXMLImport_Meta_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SchXMLImport.Meta" ) );
-}
-
-// XServiceInfo
-OUString SAL_CALL SchXMLImport::getImplementationName() throw( uno::RuntimeException )
-{
- switch( getImportFlags())
- {
- case IMPORT_ALL:
- return SchXMLImport_getImplementationName();
- case IMPORT_STYLES:
- return SchXMLImport_Styles_getImplementationName();
- case ( IMPORT_CONTENT | IMPORT_AUTOSTYLES | IMPORT_FONTDECLS ):
- return SchXMLImport_Content_getImplementationName();
- case IMPORT_META:
- return SchXMLImport_Meta_getImplementationName();
-
- case IMPORT_SETTINGS:
- // there is no settings component in chart
- default:
- return OUString::createFromAscii( "SchXMLImport" );
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/xmloff_SchXMLParagraphContext.cxx b/binfilter/bf_xmloff/source/chart/xmloff_SchXMLParagraphContext.cxx
deleted file mode 100644
index 8bd6eea7f82a..000000000000
--- a/binfilter/bf_xmloff/source/chart/xmloff_SchXMLParagraphContext.cxx
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "SchXMLParagraphContext.hxx"
-
-#include "xmlnmspe.hxx"
-#include "xmltoken.hxx"
-namespace binfilter {
-
-using namespace rtl;
-using namespace ::com::sun::star;
-
-SchXMLParagraphContext::SchXMLParagraphContext( SvXMLImport& rImport,
- const OUString& rLocalName,
- OUString& rText ) :
- SvXMLImportContext( rImport, XML_NAMESPACE_TEXT, rLocalName ),
- mrText( rText )
-{
-}
-
-SchXMLParagraphContext::~SchXMLParagraphContext()
-{}
-
-void SchXMLParagraphContext::EndElement()
-{
- mrText = maBuffer.makeStringAndClear();
-}
-
-SvXMLImportContext* SchXMLParagraphContext::CreateChildContext(
- USHORT nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- if( nPrefix == XML_NAMESPACE_TEXT )
- {
- if( rLocalName.equals( ::binfilter::xmloff::token::GetXMLToken( ::binfilter::xmloff::token::XML_TAB_STOP )))
- {
- maBuffer.append( sal_Unicode( 0x0009 )); // tabulator
- }
- else if( rLocalName.equals( ::binfilter::xmloff::token::GetXMLToken( ::binfilter::xmloff::token::XML_LINE_BREAK )))
- {
- maBuffer.append( sal_Unicode( 0x000A )); // linefeed
- }
- }
-
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-}
-
-void SchXMLParagraphContext::Characters( const OUString& rChars )
-{
- maBuffer.append( rChars );
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/xmloff_SchXMLPlotAreaContext.cxx b/binfilter/bf_xmloff/source/chart/xmloff_SchXMLPlotAreaContext.cxx
deleted file mode 100644
index 6248992e6c07..000000000000
--- a/binfilter/bf_xmloff/source/chart/xmloff_SchXMLPlotAreaContext.cxx
+++ /dev/null
@@ -1,1472 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "SchXMLChartContext.hxx"
-#include "SchXMLPlotAreaContext.hxx"
-#include "SchXMLImport.hxx"
-
-#include <tools/debug.hxx>
-
-#include "xmlnmspe.hxx"
-#include "nmspmap.hxx"
-#include "xmluconv.hxx"
-#include "prstylei.hxx"
-#include "xexptran.hxx"
-
-#include <com/sun/star/chart/XTwoAxisXSupplier.hpp>
-#include <com/sun/star/chart/XTwoAxisYSupplier.hpp>
-#include <com/sun/star/chart/XAxisZSupplier.hpp>
-#include <com/sun/star/chart/ChartDataRowSource.hpp>
-#include <com/sun/star/chart/ChartAxisAssign.hpp>
-#include <com/sun/star/chart/X3DDisplay.hpp>
-#include <com/sun/star/chart/XStatisticDisplay.hpp>
-
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-
-static __FAR_DATA SvXMLEnumMapEntry aXMLAxisClassMap[] =
-{
- { XML_CATEGORY, SCH_XML_AXIS_CATEGORY },
- { XML_DOMAIN, SCH_XML_AXIS_DOMAIN },
- { XML_VALUE, SCH_XML_AXIS_VALUE },
- { XML_SERIES, SCH_XML_AXIS_SERIES },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SchXMLPlotAreaContext::SchXMLPlotAreaContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport, const ::rtl::OUString& rLocalName,
- uno::Sequence< chart::ChartSeriesAddress >& rSeriesAddresses,
- ::rtl::OUString& rCategoriesAddress,
- ::rtl::OUString& rChartAddress,
- ::rtl::OUString& rTableNumberList) :
- SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ),
- mrImportHelper( rImpHelper ),
- mrSeriesAddresses( rSeriesAddresses ),
- mrCategoriesAddress( rCategoriesAddress ),
- mrChartAddress( rChartAddress ),
- mrTableNumberList( rTableNumberList ),
- mnDomainOffset( 0 ),
- mnNumOfLines( 0 ),
- mbStockHasVolume( sal_False ),
- mnSeries( 0 ),
- mnMaxSeriesLength( 0 ),
- maSceneImportHelper( rImport )
-{
- // get Diagram
- uno::Reference< chart::XChartDocument > xDoc( rImpHelper.GetChartDocument(), uno::UNO_QUERY );
- if( xDoc.is())
- {
- mxDiagram = xDoc->getDiagram();
- }
- DBG_ASSERT( mxDiagram.is(), "Couldn't get XDiagram" );
-
- // turn off all axes initially
- uno::Any aFalseBool;
- aFalseBool <<= (sal_Bool)(sal_False);
-
- uno::Reference< lang::XServiceInfo > xInfo( mxDiagram, uno::UNO_QUERY );
- uno::Reference< beans::XPropertySet > xProp( mxDiagram, uno::UNO_QUERY );
- if( xInfo.is() &&
- xProp.is())
- {
- try
- {
- if( xInfo->supportsService( ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartAxisXSupplier" )))
- {
- xProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "HasXAxis" ), aFalseBool );
- xProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "HasXAxisGrid" ), aFalseBool );
- xProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "HasXAxisDescription" ), aFalseBool );
- }
- if( xInfo->supportsService( ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartTwoAxisXSupplier" )))
- {
- xProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "HasSecondaryXAxis" ), aFalseBool );
- xProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "HasSecondaryXAxisDescription" ), aFalseBool );
- }
-
- if( xInfo->supportsService( ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartAxisYSupplier" )))
- {
- xProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "HasYAxis" ), aFalseBool );
- xProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "HasYAxisGrid" ), aFalseBool );
- xProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "HasYAxisDescription" ), aFalseBool );
- }
- if( xInfo->supportsService( ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartTwoAxisYSupplier" )))
- {
- xProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "HasSecondaryYAxis" ), aFalseBool );
- xProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "HasSecondaryYAxisDescription" ), aFalseBool );
- }
-
- if( xInfo->supportsService( ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartAxisZSupplier" )))
- {
- xProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "HasZAxis" ), aFalseBool );
- xProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "HasZAxisDescription" ), aFalseBool );
- }
- uno::Any aAny;
- chart::ChartDataRowSource eSource = chart::ChartDataRowSource_COLUMNS;
- aAny <<= eSource;
- xProp->setPropertyValue( ::rtl::OUString::createFromAscii( "DataRowSource" ), aAny );
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Property required by service not supported" );
- }
- }
-}
-
-SchXMLPlotAreaContext::~SchXMLPlotAreaContext()
-{}
-
-SvXMLImportContext* SchXMLPlotAreaContext::CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = 0;
- const SvXMLTokenMap& rTokenMap = mrImportHelper.GetPlotAreaElemTokenMap();
-
- switch( rTokenMap.Get( nPrefix, rLocalName ))
- {
- case XML_TOK_PA_AXIS:
- pContext = new SchXMLAxisContext( mrImportHelper, GetImport(), rLocalName, mxDiagram, maAxes );
- break;
-
- case XML_TOK_PA_SERIES:
- {
- mrSeriesAddresses.realloc( mnSeries + 1 );
- pContext = new SchXMLSeriesContext( mrImportHelper, GetImport(), rLocalName,
- mxDiagram, maAxes, mrSeriesAddresses[ mnSeries ],
- maSeriesStyleList,
- mnSeries, mnMaxSeriesLength, mnDomainOffset,
- mnNumOfLines, mbStockHasVolume );
- mnSeries++;
- }
- break;
-
- case XML_TOK_PA_CATEGORIES:
- pContext = new SchXMLCategoriesDomainContext( mrImportHelper, GetImport(),
- nPrefix, rLocalName,
- mrCategoriesAddress );
- break;
-
- case XML_TOK_PA_WALL:
- pContext = new SchXMLWallFloorContext( mrImportHelper, GetImport(), nPrefix, rLocalName, mxDiagram,
- SchXMLWallFloorContext::CONTEXT_TYPE_WALL );
- break;
- case XML_TOK_PA_FLOOR:
- pContext = new SchXMLWallFloorContext( mrImportHelper, GetImport(), nPrefix, rLocalName, mxDiagram,
- SchXMLWallFloorContext::CONTEXT_TYPE_FLOOR );
- break;
-
- case XML_TOK_PA_LIGHT_SOURCE:
- pContext = maSceneImportHelper.create3DLightContext( nPrefix, rLocalName, xAttrList );
- break;
-
- // elements for stock charts
- case XML_TOK_PA_STOCK_GAIN:
- pContext = new SchXMLStockContext( mrImportHelper, GetImport(), nPrefix, rLocalName, mxDiagram,
- SchXMLStockContext::CONTEXT_TYPE_GAIN );
- break;
- case XML_TOK_PA_STOCK_LOSS:
- pContext = new SchXMLStockContext( mrImportHelper, GetImport(), nPrefix, rLocalName, mxDiagram,
- SchXMLStockContext::CONTEXT_TYPE_LOSS );
- break;
- case XML_TOK_PA_STOCK_RANGE:
- pContext = new SchXMLStockContext( mrImportHelper, GetImport(), nPrefix, rLocalName, mxDiagram,
- SchXMLStockContext::CONTEXT_TYPE_RANGE );
- break;
-
- default:
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
-
- return pContext;
-}
-
-void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- uno::Any aTransMatrixAny;
-
- // initialize size and position
- uno::Reference< drawing::XShape > xDiaShape( mxDiagram, uno::UNO_QUERY );
- if( xDiaShape.is())
- {
- maSize = xDiaShape->getSize();
- maPosition = xDiaShape->getPosition();
- }
-
- // parse attributes
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- ::rtl::OUString aValue;
- const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetPlotAreaAttrTokenMap();
-
- sal_Bool bColHasLabels = sal_False;
- sal_Bool bRowHasLabels = sal_False;
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- ::rtl::OUString aValue = xAttrList->getValueByIndex( i );
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- switch( rAttrTokenMap.Get( nPrefix, aLocalName ))
- {
- case XML_TOK_PA_X:
- GetImport().GetMM100UnitConverter().convertMeasure( maPosition.X, aValue );
- break;
- case XML_TOK_PA_Y:
- GetImport().GetMM100UnitConverter().convertMeasure( maPosition.Y, aValue );
- break;
- case XML_TOK_PA_WIDTH:
- GetImport().GetMM100UnitConverter().convertMeasure( maSize.Width, aValue );
- break;
- case XML_TOK_PA_HEIGHT:
- GetImport().GetMM100UnitConverter().convertMeasure( maSize.Height, aValue );
- break;
- case XML_TOK_PA_STYLE_NAME:
- msAutoStyleName = aValue;
- break;
- case XML_TOK_PA_CHART_ADDRESS:
- mrChartAddress = aValue;
- break;
- case XML_TOK_PA_TABLE_NUMBER_LIST:
- mrTableNumberList = aValue;
- break;
- case XML_TOK_PA_DS_HAS_LABELS:
- {
- if( aValue.equals( ::binfilter::xmloff::token::GetXMLToken( ::binfilter::xmloff::token::XML_BOTH )))
- bColHasLabels = bRowHasLabels = sal_True;
- else if( aValue.equals( ::binfilter::xmloff::token::GetXMLToken( ::binfilter::xmloff::token::XML_ROW )))
- bRowHasLabels = sal_True;
- else if( aValue.equals( ::binfilter::xmloff::token::GetXMLToken( ::binfilter::xmloff::token::XML_COLUMN )))
- bColHasLabels = sal_True;
- }
- break;
- default:
- maSceneImportHelper.processSceneAttribute( nPrefix, aLocalName, aValue );
- break;
- }
- }
-
- uno::Reference< beans::XPropertySet > xDocProp( mrImportHelper.GetChartDocument(), uno::UNO_QUERY );
- if( xDocProp.is())
- {
- try
- {
- uno::Any aAny;
- aAny <<= (sal_Bool)(bColHasLabels);
- xDocProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "DataSourceLabelsInFirstColumn" ),
- aAny );
-
- aAny <<= (sal_Bool)(bRowHasLabels);
- xDocProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "DataSourceLabelsInFirstRow" ),
- aAny );
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERRORFILE( "Properties missing" );
- }
- }
-
- // set properties
- uno::Reference< beans::XPropertySet > xProp( mxDiagram, uno::UNO_QUERY );
- if( msAutoStyleName.getLength())
- {
- if( xProp.is())
- {
- const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext();
- if( pStylesCtxt )
- {
- const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
- mrImportHelper.GetChartFamilyID(), msAutoStyleName );
-
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
- }
-
- // perform BuildChart to make scene etc. available
- uno::Reference< chart::XChartDocument > xDoc( mrImportHelper.GetChartDocument(), uno::UNO_QUERY );
- if( xDoc.is() &&
- xDoc->hasControllersLocked())
- {
- xDoc->unlockControllers();
- xDoc->lockControllers();
- }
- }
- }
-}
-
-void SchXMLPlotAreaContext::EndElement()
-{
- sal_Int32 i;
-
- uno::Reference< beans::XPropertySet > xProp( mxDiagram, uno::UNO_QUERY );
- if( xProp.is())
- {
- sal_Bool bIsThreeDim = sal_False;
- uno::Any aAny = xProp->getPropertyValue( ::rtl::OUString::createFromAscii( "Dim3D" ));
- aAny >>= bIsThreeDim;
-
- // set 3d scene attributes
- if( bIsThreeDim )
- {
- // set scene attributes at diagram
- maSceneImportHelper.setSceneAttributes( xProp );
- }
-
- if( mnNumOfLines > 0 &&
- 0 == mxDiagram->getDiagramType().reverseCompareToAsciiL(
- RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.BarDiagram" )))
- {
- try
- {
- xProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NumberOfLines" )),
- uno::makeAny( mnNumOfLines ));
- }
- catch( uno::Exception & aEx )
- {
- String aStr( aEx.Message );
- ByteString aBStr( aStr, RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR1( "Exception caught for property NumberOfLines: %s", aBStr.GetBuffer());
- }
- }
-
- // #i32366# stock has volume
- if( 0 == mxDiagram->getDiagramType().reverseCompareToAsciiL(
- RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.StockDiagram" )))
- {
- try
- {
- xProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Volume" )),
- uno::makeAny( mbStockHasVolume ));
- }
- catch( uno::Exception & aEx )
- {
- String aStr( aEx.Message );
- ByteString aBStr( aStr, RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR1( "Exception caught for property NumberOfLines: %s", aBStr.GetBuffer());
- }
- }
- }
-
- // set changed size and position after properties (esp. 3d)
- uno::Reference< drawing::XShape > xDiaShape( mxDiagram, uno::UNO_QUERY );
- if( xDiaShape.is())
- {
- xDiaShape->setSize( maSize );
- xDiaShape->setPosition( maPosition );
- }
-
- // resize data so that all series and data point properties can be set
- mrImportHelper.ResizeChartData( mnSeries + mnDomainOffset, mnMaxSeriesLength );
-
- // set autostyles for series and data points
- const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext();
- const SvXMLStyleContext* pStyle = NULL;
- ::rtl::OUString sCurrStyleName;
-
- if( pStylesCtxt )
- {
- ::std::list< chartxml::DataRowPointStyle >::iterator iStyle;
- // iterate over series attributes first ...
- for( iStyle = maSeriesStyleList.begin(); iStyle != maSeriesStyleList.end(); iStyle++ )
- {
- if( iStyle->meType != chartxml::DataRowPointStyle::DATA_POINT )
- {
- // data row style
- for( i = 0; i < iStyle->mnRepeat; i++ )
- {
- try
- {
- xProp = mxDiagram->getDataRowProperties( iStyle->mnSeries + i );
-
- if( iStyle->meType != chartxml::DataRowPointStyle::DATA_SERIES &&
- xProp.is() )
- {
- // we have a statistical proertyset
- uno::Any aAny;
- switch( iStyle->meType )
- {
- case chartxml::DataRowPointStyle::MEAN_VALUE:
- aAny = xProp->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "DataMeanValueProperties" )));
- break;
- case chartxml::DataRowPointStyle::REGRESSION:
- aAny = xProp->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "DataRegressionProperties" )));
- break;
- case chartxml::DataRowPointStyle::ERROR_INDICATOR:
- aAny = xProp->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "DataErrorProperties" )));
- break;
- }
- aAny >>= xProp;
- }
-
- if( xProp.is())
- {
- if( (iStyle->msStyleName).getLength())
- {
- if( ! sCurrStyleName.equals( iStyle->msStyleName ))
- {
- sCurrStyleName = iStyle->msStyleName;
- pStyle = pStylesCtxt->FindStyleChildContext(
- mrImportHelper.GetChartFamilyID(), sCurrStyleName );
- }
-
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
- }
-
- if( iStyle->meType == chartxml::DataRowPointStyle::DATA_SERIES &&
- iStyle->mnAttachedAxis != 1 )
- {
- uno::Any aAny;
- aAny <<= chart::ChartAxisAssign::SECONDARY_Y;
-
- xProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Axis" )), aAny );
- }
- }
- }
- catch( uno::Exception aEx )
- {
-#ifdef DBG_UTIL
- String aStr( aEx.Message );
- ByteString aBStr( aStr, RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR1( "PlotAreaContext:EndElement(): Exception caught: %s", aBStr.GetBuffer());
-#endif
- }
- }
- }
- }
-
- // ... then iterate over data-point attributes, so the latter are not overwritten
- for( iStyle = maSeriesStyleList.begin(); iStyle != maSeriesStyleList.end(); iStyle++ )
- {
- if( iStyle->mnIndex != -1 )
- {
- // data point style
- for( i = 0; i < iStyle->mnRepeat; i++ )
- {
- try
- {
- xProp = mxDiagram->getDataPointProperties( iStyle->mnIndex + i, iStyle->mnSeries );
-
- if( xProp.is())
- {
- if( ! sCurrStyleName.equals( iStyle->msStyleName ))
- {
- sCurrStyleName = iStyle->msStyleName;
- pStyle = pStylesCtxt->FindStyleChildContext(
- mrImportHelper.GetChartFamilyID(), sCurrStyleName );
- }
-
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
- }
- }
- catch( uno::Exception aEx )
- {
-#ifdef DBG_UTIL
- String aStr( aEx.Message );
- ByteString aBStr( aStr, RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR1( "PlotAreaContext:EndElement(): Exception caught: %s", aBStr.GetBuffer());
-#endif
- }
- }
- }
- } // styles iterator
- }
-}
-
-// ========================================
-
-SchXMLAxisContext::SchXMLAxisContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport, const ::rtl::OUString& rLocalName,
- uno::Reference< chart::XDiagram > xDiagram,
- ::std::vector< SchXMLAxis >& aAxes ) :
- SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ),
- mrImportHelper( rImpHelper ),
- mxDiagram( xDiagram ),
- maAxes( aAxes )
-{
-}
-
-SchXMLAxisContext::~SchXMLAxisContext()
-{}
-
-/* returns a shape for the current axis's title. The property
- "Has...AxisTitle" is set to "True" to get the shape
- */
-uno::Reference< drawing::XShape > SchXMLAxisContext::getTitleShape()
-{
- uno::Reference< drawing::XShape > xResult;
- uno::Any aTrueBool;
- aTrueBool <<= (sal_Bool)(sal_True);
- uno::Reference< beans::XPropertySet > xDiaProp( mxDiagram, uno::UNO_QUERY );
-
- uno::Reference< chart::XChartDocument > xDoc( mrImportHelper.GetChartDocument(), uno::UNO_QUERY );
- sal_Bool bHasControllersLocked = sal_False;
- if( xDoc.is() &&
- (bHasControllersLocked = xDoc->hasControllersLocked()) == sal_True )
- xDoc->unlockControllers();
-
- switch( maCurrentAxis.eClass )
- {
- case SCH_XML_AXIS_CATEGORY:
- case SCH_XML_AXIS_DOMAIN:
- if( maCurrentAxis.nIndexInCategory == 0 )
- {
- uno::Reference< chart::XAxisXSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is())
- {
- if( xDiaProp.is())
- xDiaProp->setPropertyValue( ::rtl::OUString::createFromAscii( "HasXAxisTitle" ), aTrueBool );
- xResult = uno::Reference< drawing::XShape >( xSuppl->getXAxisTitle(), uno::UNO_QUERY );
- }
- }
- break;
- case SCH_XML_AXIS_VALUE:
- if( maCurrentAxis.nIndexInCategory == 0 )
- {
- uno::Reference< chart::XAxisYSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is())
- {
- if( xDiaProp.is())
- xDiaProp->setPropertyValue( ::rtl::OUString::createFromAscii( "HasYAxisTitle" ), aTrueBool );
- xResult = uno::Reference< drawing::XShape >( xSuppl->getYAxisTitle(), uno::UNO_QUERY );
- }
- }
- break;
- case SCH_XML_AXIS_SERIES:
- uno::Reference< chart::XAxisZSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is())
- {
- if( xDiaProp.is())
- xDiaProp->setPropertyValue( ::rtl::OUString::createFromAscii( "HasZAxisTitle" ), aTrueBool );
- xResult = uno::Reference< drawing::XShape >( xSuppl->getZAxisTitle(), uno::UNO_QUERY );
- }
- break;
- }
-
- if( bHasControllersLocked && xDoc.is())
- xDoc->lockControllers();
-
- return xResult;
-}
-
-void SchXMLAxisContext::CreateGrid( ::rtl::OUString sAutoStyleName,
- sal_Bool bIsMajor )
-{
- uno::Reference< chart::XDiagram > xDia = mrImportHelper.GetChartDocument()->getDiagram();
- uno::Reference< beans::XPropertySet > xGridProp;
- ::rtl::OUString sPropertyName;
- DBG_ASSERT( xDia.is(), "diagram object is invalid!" );
-
- switch( maCurrentAxis.eClass )
- {
- case SCH_XML_AXIS_CATEGORY:
- case SCH_XML_AXIS_DOMAIN:
- {
- uno::Reference< chart::XAxisXSupplier > xSuppl( xDia, uno::UNO_QUERY );
- if( xSuppl.is())
- {
- if( bIsMajor )
- {
- xGridProp = xSuppl->getXMainGrid();
- sPropertyName = ::rtl::OUString::createFromAscii( "HasXAxisGrid" );
- }
- else
- {
- xGridProp = xSuppl->getXHelpGrid();
- sPropertyName = ::rtl::OUString::createFromAscii( "HasXAxisHelpGrid" );
- }
- }
- }
- break;
- case SCH_XML_AXIS_VALUE:
- {
- uno::Reference< chart::XAxisYSupplier > xSuppl( xDia, uno::UNO_QUERY );
- if( xSuppl.is())
- {
- if( bIsMajor )
- {
- xGridProp = xSuppl->getYMainGrid();
- sPropertyName = ::rtl::OUString::createFromAscii( "HasYAxisGrid" );
- }
- else
- {
- xGridProp = xSuppl->getYHelpGrid();
- sPropertyName = ::rtl::OUString::createFromAscii( "HasYAxisHelpGrid" );
- }
- }
- }
- break;
- case SCH_XML_AXIS_SERIES:
- {
- uno::Reference< chart::XAxisZSupplier > xSuppl( xDia, uno::UNO_QUERY );
- if( xSuppl.is())
- {
- if( bIsMajor )
- {
- xGridProp = xSuppl->getZMainGrid();
- sPropertyName = ::rtl::OUString::createFromAscii( "HasZAxisGrid" );
- }
- else
- {
- xGridProp = xSuppl->getZHelpGrid();
- sPropertyName = ::rtl::OUString::createFromAscii( "HasZAxisHelpGrid" );
- }
- }
- }
- break;
- }
-
- // enable grid
- if( sPropertyName.getLength())
- {
- uno::Reference< beans::XPropertySet > xDiaProp( xDia, uno::UNO_QUERY );
- uno::Any aTrueBool;
- aTrueBool <<= (sal_Bool)(sal_True);
- if( xDiaProp.is())
- {
- try
- {
- xDiaProp->setPropertyValue( sPropertyName, aTrueBool );
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Cannot enable grid due to missing property" );
- }
- }
- }
-
- // set properties
- if( sAutoStyleName.getLength() &&
- xGridProp.is())
- {
- const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext();
- if( pStylesCtxt )
- {
- const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
- mrImportHelper.GetChartFamilyID(), sAutoStyleName );
-
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xGridProp );
- }
- }
-}
-
-void SchXMLAxisContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- // parse attributes
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- ::rtl::OUString aValue;
- SchXMLImport& rImport = ( SchXMLImport& )GetImport();
- const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetAxisAttrTokenMap();
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- ::rtl::OUString aValue = xAttrList->getValueByIndex( i );
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- switch( rAttrTokenMap.Get( nPrefix, aLocalName ))
- {
- case XML_TOK_AXIS_CLASS:
- {
- USHORT nEnumVal;
- if( rImport.GetMM100UnitConverter().convertEnum( nEnumVal, aValue, aXMLAxisClassMap ))
- maCurrentAxis.eClass = ( SchXMLAxisClass )nEnumVal;
- }
- break;
- case XML_TOK_AXIS_NAME:
- maCurrentAxis.aName = aValue;
- break;
- case XML_TOK_AXIS_STYLE_NAME:
- msAutoStyleName = aValue;
- break;
- }
- }
-
- // check for number of axes with same category
- maCurrentAxis.nIndexInCategory = 0;
- sal_Int32 nNumOfAxes = maAxes.size();
- for( sal_Int32 nCurrent = 0; nCurrent < nNumOfAxes; nCurrent++ )
- {
- if( maAxes[ nCurrent ].eClass == maCurrentAxis.eClass )
- maCurrentAxis.nIndexInCategory++;
- }
-}
-
-void SchXMLAxisContext::EndElement()
-{
- // add new Axis to list
- maAxes.push_back( maCurrentAxis );
-
- // set axis at chart
- uno::Reference< beans::XPropertySet > xDiaProp( mxDiagram, uno::UNO_QUERY );
- uno::Reference< beans::XPropertySet > xProp;
- uno::Any aTrueBool;
- aTrueBool <<= (sal_Bool)(sal_True);
- sal_Bool bHasTitle = ( maCurrentAxis.aTitle.getLength() > 0 );
- uno::Reference< frame::XModel > xDoc( mrImportHelper.GetChartDocument(), uno::UNO_QUERY );
-
- switch( maCurrentAxis.eClass )
- {
- case SCH_XML_AXIS_CATEGORY:
- case SCH_XML_AXIS_DOMAIN:
- if( maCurrentAxis.nIndexInCategory == 0 )
- {
- try
- {
- xDiaProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "HasXAxis" ), aTrueBool );
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Couldn't turn on x axis" );
- }
- uno::Reference< chart::XAxisXSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is())
- {
- xProp = xSuppl->getXAxis();
- if( bHasTitle )
- {
- uno::Reference< beans::XPropertySet > xTitleProp( xSuppl->getXAxisTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
- {
- try
- {
- uno::Any aAny;
- aAny <<= maCurrentAxis.aTitle;
- xTitleProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), aAny );
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Property String for Title not available" );
- }
- uno::Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY );
- if( xShape.is())
- {
- // perform build chart with new title string
- // so that setting the position works correctly
- if( xDoc.is())
- {
- xDoc->unlockControllers();
- xDoc->lockControllers();
- }
- xShape->setPosition( maCurrentAxis.aPosition );
- }
- }
- }
- }
- }
- else
- {
- try
- {
- xDiaProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "HasSecondaryXAxis" ), aTrueBool );
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Couldn't turn on second x axis" );
- }
- uno::Reference< chart::XTwoAxisXSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is())
- xProp = xSuppl->getSecondaryXAxis();
- }
- break;
-
- case SCH_XML_AXIS_VALUE:
- if( maCurrentAxis.nIndexInCategory == 0 )
- {
- try
- {
- xDiaProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "HasYAxis" ), aTrueBool );
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Couldn't turn on y axis" );
- }
- uno::Reference< chart::XAxisYSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is())
- {
- xProp = xSuppl->getYAxis();
- if( bHasTitle )
- {
- uno::Reference< beans::XPropertySet > xTitleProp( xSuppl->getYAxisTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
- {
- try
- {
- uno::Any aAny;
- aAny <<= maCurrentAxis.aTitle;
- xTitleProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), aAny );
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Property String for Title not available" );
- }
- uno::Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY );
- if( xShape.is())
- {
- // perform build chart with new title string
- // so that setting the position works correctly
- if( xDoc.is())
- {
- xDoc->unlockControllers();
- xDoc->lockControllers();
- }
- xShape->setPosition( maCurrentAxis.aPosition );
- }
- }
- }
- }
- }
- else
- {
- try
- {
- xDiaProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "HasSecondaryYAxis" ), aTrueBool );
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Couldn't turn on second y axis" );
- }
- uno::Reference< chart::XTwoAxisYSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is())
- xProp = xSuppl->getSecondaryYAxis();
- }
- break;
-
- case SCH_XML_AXIS_SERIES:
- {
- try
- {
- xDiaProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( "HasZAxis" ), aTrueBool );
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Couldn't turn on z axis" );
- }
- uno::Reference< chart::XAxisZSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is())
- {
- xProp = xSuppl->getZAxis();
- if( bHasTitle )
- {
- uno::Reference< beans::XPropertySet > xTitleProp( xSuppl->getZAxisTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
- {
- try
- {
- uno::Any aAny;
- aAny <<= maCurrentAxis.aTitle;
- xTitleProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), aAny );
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Property String for Title not available" );
- }
- uno::Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY );
- if( xShape.is())
- {
- // perform build chart with new title string
- // so that setting the position works correctly
- if( xDoc.is())
- {
- xDoc->unlockControllers();
- xDoc->lockControllers();
- }
- xShape->setPosition( maCurrentAxis.aPosition );
- }
- }
- }
- }
- }
- break;
- }
-
- // set properties
- if( msAutoStyleName.getLength() &&
- xProp.is())
- {
- // #88077# AutoOrigin 'on' is default
- xProp->setPropertyValue( ::rtl::OUString::createFromAscii( "AutoOrigin" ), aTrueBool );
-
- const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext();
- if( pStylesCtxt )
- {
- const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
- mrImportHelper.GetChartFamilyID(), msAutoStyleName );
-
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
- }
- }
-}
-
-SvXMLImportContext* SchXMLAxisContext::CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = 0;
- SchXMLImport& rImport = ( SchXMLImport& )GetImport();
-
- if( nPrefix == XML_NAMESPACE_CHART )
- {
- if( IsXMLToken( rLocalName, XML_TITLE ) )
- {
- uno::Reference< drawing::XShape > xTitleShape = getTitleShape();
- pContext = new SchXMLTitleContext( mrImportHelper, rImport, rLocalName,
- maCurrentAxis.aTitle,
- xTitleShape,
- maCurrentAxis.aPosition );
- }
- else if( IsXMLToken( rLocalName, XML_GRID ) )
- {
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- sal_Bool bIsMajor = sal_True; // default value for class is "major"
- ::rtl::OUString sAutoStyleName;
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- if( nPrefix == XML_NAMESPACE_CHART )
- {
- if( IsXMLToken( aLocalName, XML_CLASS ) )
- {
- if( IsXMLToken( xAttrList->getValueByIndex( i ), XML_MINOR ) )
- bIsMajor = sal_False;
- }
- else if( IsXMLToken( aLocalName, XML_STYLE_NAME ) )
- sAutoStyleName = xAttrList->getValueByIndex( i );
- }
- }
-
- CreateGrid( sAutoStyleName, bIsMajor );
-
- // don't create a context => use default context. grid elements are empty
- }
- }
-
- if( ! pContext )
- pContext = new SvXMLImportContext( rImport, nPrefix, rLocalName );
-
- return pContext;
-}
-
-// ========================================
-
-SchXMLSeriesContext::SchXMLSeriesContext(
- SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport, const ::rtl::OUString& rLocalName,
- uno::Reference< chart::XDiagram >& xDiagram,
- std::vector< SchXMLAxis >& rAxes,
- ::com::sun::star::chart::ChartSeriesAddress& rSeriesAddress,
- ::std::list< chartxml::DataRowPointStyle >& rStyleList,
- sal_Int32 nSeriesIndex,
- sal_Int32& rMaxSeriesLength,
- sal_Int32& rDomainOffset,
- sal_Int32& rNumOfLines,
- sal_Bool& rStockHasVolume ) :
- SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ),
- mxDiagram( xDiagram ),
- mrAxes( rAxes ),
- mrImportHelper( rImpHelper ),
- mrSeriesAddress( rSeriesAddress ),
- mrStyleList( rStyleList ),
- mnSeriesIndex( nSeriesIndex ),
- mnDataPointIndex( 0 ),
- mrDomainOffset( rDomainOffset ),
- mrMaxSeriesLength( rMaxSeriesLength ),
- mrNumOfLines( rNumOfLines ),
- mrStockHasVolume( rStockHasVolume ),
- mpAttachedAxis( NULL )
-{
-}
-
-SchXMLSeriesContext::~SchXMLSeriesContext()
-{
-}
-
-void SchXMLSeriesContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- // parse attributes
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- ::rtl::OUString aValue;
- const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetSeriesAttrTokenMap();
- mnAttachedAxis = 1;
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- ::rtl::OUString aValue = xAttrList->getValueByIndex( i );
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- switch( rAttrTokenMap.Get( nPrefix, aLocalName ))
- {
- case XML_TOK_SERIES_CELL_RANGE:
- mrSeriesAddress.DataRangeAddress = aValue;
- break;
- case XML_TOK_SERIES_LABEL_ADDRESS:
- mrSeriesAddress.LabelAddress = aValue;
- break;
- case XML_TOK_SERIES_ATTACHED_AXIS:
- {
- sal_Int32 nNumOfAxes = mrAxes.size();
- for( sal_Int32 nCurrent = 0; nCurrent < nNumOfAxes; nCurrent++ )
- {
- if( aValue.equals( mrAxes[ nCurrent ].aName ) &&
- mrAxes[ nCurrent ].eClass == SCH_XML_AXIS_VALUE )
- {
- mpAttachedAxis = &( mrAxes[ nCurrent ] );
- }
- }
- }
- break;
- case XML_TOK_SERIES_STYLE_NAME:
- msAutoStyleName = aValue;
- break;
- case XML_TOK_SERIES_CHART_CLASS:
- {
- // used for bar-line combi chart
- OUString aStrippedValue( aValue );
- sal_Int32 nColonPos( aValue.indexOf( sal_Unicode(':')));
- if( nColonPos != -1 )
- aStrippedValue = aValue.copy( nColonPos + 1 );
- if( IsXMLToken( aStrippedValue, XML_LINE ))
- ++mrNumOfLines;
- if( IsXMLToken( aStrippedValue, XML_BAR ))
- mrStockHasVolume = sal_True;
- }
- break;
- }
- }
-
- if( mpAttachedAxis )
- {
- if( mpAttachedAxis->nIndexInCategory > 0 )
- {
- // secondary axis => property has to be set (primary is default)
- mnAttachedAxis = 2;
- }
- }
-}
-
-void SchXMLSeriesContext::EndElement()
-{
- if( mrMaxSeriesLength < mnDataPointIndex )
- mrMaxSeriesLength = mnDataPointIndex;
-
- if( msAutoStyleName.getLength() ||
- mnAttachedAxis != 1 )
- {
- chartxml::DataRowPointStyle aStyle(
- chartxml::DataRowPointStyle::DATA_SERIES,
- mnSeriesIndex + mrDomainOffset, -1, 1,
- msAutoStyleName, mnAttachedAxis );
- mrStyleList.push_back( aStyle );
- }
-}
-
-SvXMLImportContext* SchXMLSeriesContext::CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = 0;
- const SvXMLTokenMap& rTokenMap = mrImportHelper.GetSeriesElemTokenMap();
-
- switch( rTokenMap.Get( nPrefix, rLocalName ))
- {
- case XML_TOK_SERIES_DOMAIN:
- {
- sal_Int32 nIndex = mrSeriesAddress.DomainRangeAddresses.getLength();
- mrSeriesAddress.DomainRangeAddresses.realloc( nIndex + 1 );
- mrDomainOffset++;
- pContext = new SchXMLCategoriesDomainContext(
- mrImportHelper, GetImport(),
- nPrefix, rLocalName,
- mrSeriesAddress.DomainRangeAddresses[ nIndex ] );
- }
- break;
-
- case XML_TOK_SERIES_MEAN_VALUE_LINE:
- pContext = new SchXMLStatisticsObjectContext(
- mrImportHelper, GetImport(),
- nPrefix, rLocalName,
- mrStyleList, mnSeriesIndex + mrDomainOffset,
- SchXMLStatisticsObjectContext::CONTEXT_TYPE_MEAN_VALUE_LINE );
- break;
- case XML_TOK_SERIES_REGRESSION_CURVE:
- pContext = new SchXMLStatisticsObjectContext(
- mrImportHelper, GetImport(),
- nPrefix, rLocalName,
- mrStyleList, mnSeriesIndex + mrDomainOffset,
- SchXMLStatisticsObjectContext::CONTEXT_TYPE_REGRESSION_CURVE );
- break;
- case XML_TOK_SERIES_ERROR_INDICATOR:
- pContext = new SchXMLStatisticsObjectContext(
- mrImportHelper, GetImport(),
- nPrefix, rLocalName,
- mrStyleList, mnSeriesIndex + mrDomainOffset,
- SchXMLStatisticsObjectContext::CONTEXT_TYPE_ERROR_INDICATOR );
- break;
-
- case XML_TOK_SERIES_DATA_POINT:
- pContext = new SchXMLDataPointContext( mrImportHelper, GetImport(), rLocalName, mxDiagram,
- mrStyleList, mnSeriesIndex + mrDomainOffset, mnDataPointIndex );
- break;
-
- default:
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
-
- return pContext;
-}
-
-// ========================================
-
-SchXMLDataPointContext::SchXMLDataPointContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport, const ::rtl::OUString& rLocalName,
- uno::Reference< chart::XDiagram >& xDiagram,
- ::std::list< chartxml::DataRowPointStyle >& rStyleList,
- sal_Int32 nSeries, sal_Int32& rIndex ) :
- SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ),
- mrImportHelper( rImpHelper ),
- mxDiagram( xDiagram ),
- mrStyleList( rStyleList ),
- mnSeries( nSeries ),
- mrIndex( rIndex )
-{
-}
-
-SchXMLDataPointContext::~SchXMLDataPointContext()
-{
-}
-
-void SchXMLDataPointContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- ::rtl::OUString aValue;
- ::rtl::OUString sAutoStyleName;
- sal_Int32 nRepeat = 1;
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- if( nPrefix == XML_NAMESPACE_CHART )
- {
- if( IsXMLToken( aLocalName, XML_STYLE_NAME ) )
- sAutoStyleName = xAttrList->getValueByIndex( i );
- else if( IsXMLToken( aLocalName, XML_REPEATED ) )
- nRepeat = xAttrList->getValueByIndex( i ).toInt32();
- }
- }
-
- if( sAutoStyleName.getLength())
- {
- chartxml::DataRowPointStyle aStyle(
- chartxml::DataRowPointStyle::DATA_POINT,
- mnSeries, mrIndex, nRepeat, sAutoStyleName );
- mrStyleList.push_back( aStyle );
- }
- mrIndex += nRepeat;
-}
-
-// ========================================
-
-SchXMLCategoriesDomainContext::SchXMLCategoriesDomainContext(
- SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- ::rtl::OUString& rAddress ) :
- SvXMLImportContext( rImport, nPrefix, rLocalName ),
- mrImportHelper( rImpHelper ),
- mrAddress( rAddress )
-{
-}
-
-SchXMLCategoriesDomainContext::~SchXMLCategoriesDomainContext()
-{
-}
-
-void SchXMLCategoriesDomainContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- if( nPrefix == XML_NAMESPACE_TABLE &&
- IsXMLToken( aLocalName, XML_CELL_RANGE_ADDRESS ) )
- {
- mrAddress = xAttrList->getValueByIndex( i );
- }
- }
-}
-
-// ========================================
-
-SchXMLWallFloorContext::SchXMLWallFloorContext(
- SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- uno::Reference< chart::XDiagram >& xDiagram,
- ContextType eContextType ) :
- SvXMLImportContext( rImport, nPrefix, rLocalName ),
- mrImportHelper( rImpHelper ),
- mxWallFloorSupplier( xDiagram, uno::UNO_QUERY ),
- meContextType( eContextType )
-{
-}
-
-SchXMLWallFloorContext::~SchXMLWallFloorContext()
-{
-}
-
-void SchXMLWallFloorContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- if( mxWallFloorSupplier.is())
- {
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- ::rtl::OUString sAutoStyleName;
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- if( nPrefix == XML_NAMESPACE_CHART &&
- IsXMLToken( aLocalName, XML_STYLE_NAME ) )
- {
- sAutoStyleName = xAttrList->getValueByIndex( i );
- }
- }
-
- if( sAutoStyleName.getLength())
- {
- // set properties
- uno::Reference< beans::XPropertySet > xProp( ( meContextType == CONTEXT_TYPE_WALL )
- ? mxWallFloorSupplier->getWall()
- : mxWallFloorSupplier->getFloor(),
- uno::UNO_QUERY );
- if( xProp.is())
- {
- const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext();
- if( pStylesCtxt )
- {
- const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
- mrImportHelper.GetChartFamilyID(), sAutoStyleName );
-
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
- }
- }
- }
- }
-}
-
-// ========================================
-
-SchXMLStockContext::SchXMLStockContext(
- SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- uno::Reference< chart::XDiagram >& xDiagram,
- ContextType eContextType ) :
- SvXMLImportContext( rImport, nPrefix, rLocalName ),
- mrImportHelper( rImpHelper ),
- mxStockPropProvider( xDiagram, uno::UNO_QUERY ),
- meContextType( eContextType )
-{
-}
-
-SchXMLStockContext::~SchXMLStockContext()
-{
-}
-
-void SchXMLStockContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- if( mxStockPropProvider.is())
- {
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- ::rtl::OUString sAutoStyleName;
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- if( nPrefix == XML_NAMESPACE_CHART &&
- IsXMLToken( aLocalName, XML_STYLE_NAME ) )
- {
- sAutoStyleName = xAttrList->getValueByIndex( i );
- }
- }
-
- if( sAutoStyleName.getLength())
- {
- // set properties
- uno::Reference< beans::XPropertySet > xProp;
- switch( meContextType )
- {
- case CONTEXT_TYPE_GAIN:
- xProp = mxStockPropProvider->getUpBar();
- break;
- case CONTEXT_TYPE_LOSS:
- xProp = mxStockPropProvider->getDownBar();
- break;
- case CONTEXT_TYPE_RANGE:
- xProp = mxStockPropProvider->getMinMaxLine();
- break;
- }
- if( xProp.is())
- {
- const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext();
- if( pStylesCtxt )
- {
- const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
- mrImportHelper.GetChartFamilyID(), sAutoStyleName );
-
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
- }
- }
- }
- }
-}
-
-// ========================================
-
-SchXMLStatisticsObjectContext::SchXMLStatisticsObjectContext(
-
- SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- ::std::list< chartxml::DataRowPointStyle >& rStyleList,
- sal_Int32 nSeries, ContextType eContextType ) :
-
- SvXMLImportContext( rImport, nPrefix, rLocalName ),
- mrImportHelper( rImpHelper ),
- mnSeriesIndex( nSeries ),
- mrStyleList( rStyleList ),
- meContextType( eContextType )
-{}
-
-SchXMLStatisticsObjectContext::~SchXMLStatisticsObjectContext()
-{
-}
-
-void SchXMLStatisticsObjectContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- ::rtl::OUString aValue;
- ::rtl::OUString sAutoStyleName;
- sal_Int32 nRepeat = 1;
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- if( nPrefix == XML_NAMESPACE_CHART )
- {
- if( IsXMLToken( aLocalName, XML_STYLE_NAME ) )
- sAutoStyleName = xAttrList->getValueByIndex( i );
- }
- }
-
- if( sAutoStyleName.getLength())
- {
- chartxml::DataRowPointStyle::StyleType eType = chartxml::DataRowPointStyle::MEAN_VALUE;
- switch( meContextType )
- {
- case CONTEXT_TYPE_MEAN_VALUE_LINE:
- eType = chartxml::DataRowPointStyle::MEAN_VALUE;
- break;
- case CONTEXT_TYPE_REGRESSION_CURVE:
- eType = chartxml::DataRowPointStyle::REGRESSION;
- break;
- case CONTEXT_TYPE_ERROR_INDICATOR:
- eType = chartxml::DataRowPointStyle::ERROR_INDICATOR;
- break;
- }
- chartxml::DataRowPointStyle aStyle(
- eType, mnSeriesIndex, -1, 1, sAutoStyleName );
- mrStyleList.push_back( aStyle );
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/xmloff_SchXMLTableContext.cxx b/binfilter/bf_xmloff/source/chart/xmloff_SchXMLTableContext.cxx
deleted file mode 100644
index 03d11141a7a8..000000000000
--- a/binfilter/bf_xmloff/source/chart/xmloff_SchXMLTableContext.cxx
+++ /dev/null
@@ -1,469 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "SchXMLTableContext.hxx"
-#include "SchXMLParagraphContext.hxx"
-
-#include <tools/debug.hxx>
-#include <rtl/math.hxx>
-
-#include "xmlnmspe.hxx"
-#include "nmspmap.hxx"
-#include "xmluconv.hxx"
-
-#include <com/sun/star/chart/XChartDataArray.hpp>
-#include <com/sun/star/chart/ChartSeriesAddress.hpp>
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-// ----------------------------------------
-// class SchXMLTableContext
-// ----------------------------------------
-
-SchXMLTableContext::SchXMLTableContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- const ::rtl::OUString& rLName,
- SchXMLTable& aTable ) :
- SvXMLImportContext( rImport, XML_NAMESPACE_TABLE, rLName ),
- mrImportHelper( rImpHelper ),
- mrTable( aTable )
-{
- mrTable.nColumnIndex = -1;
- mrTable.nMaxColumnIndex = -1;
- mrTable.nRowIndex = -1;
- mrTable.aData.clear();
-}
-
-SchXMLTableContext::~SchXMLTableContext()
-{
-}
-
-SvXMLImportContext *SchXMLTableContext::CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = 0;
- const SvXMLTokenMap& rTokenMap = mrImportHelper.GetTableElemTokenMap();
-
- switch( rTokenMap.Get( nPrefix, rLocalName ))
- {
- case XML_TOK_TABLE_HEADER_COLS:
- case XML_TOK_TABLE_COLUMNS:
- pContext = new SchXMLTableColumnsContext( mrImportHelper, GetImport(), rLocalName, mrTable );
- break;
-
- case XML_TOK_TABLE_COLUMN:
- pContext = new SchXMLTableColumnContext( mrImportHelper, GetImport(), rLocalName, mrTable );
- break;
-
- case XML_TOK_TABLE_HEADER_ROWS:
- case XML_TOK_TABLE_ROWS:
- pContext = new SchXMLTableRowsContext( mrImportHelper, GetImport(), rLocalName, mrTable );
- break;
-
- case XML_TOK_TABLE_ROW:
- pContext = new SchXMLTableRowContext( mrImportHelper, GetImport(), rLocalName, mrTable );
- break;
-
- default:
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
-
- return pContext;
-}
-
-// ========================================
-// classes for columns
-// ========================================
-
-// ----------------------------------------
-// class SchXMLTableColumnsContext
-// ----------------------------------------
-
-SchXMLTableColumnsContext::SchXMLTableColumnsContext(
- SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- const ::rtl::OUString& rLocalName,
- SchXMLTable& aTable ) :
- SvXMLImportContext( rImport, XML_NAMESPACE_TABLE, rLocalName ),
- mrImportHelper( rImpHelper ),
- mrTable( aTable )
-{
-}
-
-SchXMLTableColumnsContext::~SchXMLTableColumnsContext()
-{
-}
-
-SvXMLImportContext* SchXMLTableColumnsContext::CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = 0;
-
- if( nPrefix == XML_NAMESPACE_TABLE &&
- IsXMLToken( rLocalName, XML_TABLE_COLUMN ) )
- {
- pContext = new SchXMLTableColumnContext( mrImportHelper, GetImport(), rLocalName, mrTable );
- }
- else
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
- return pContext;
-}
-
-// ----------------------------------------
-// class SchXMLTableColumnContext
-// ----------------------------------------
-
-SchXMLTableColumnContext::SchXMLTableColumnContext(
- SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- const ::rtl::OUString& rLocalName,
- SchXMLTable& aTable ) :
- SvXMLImportContext( rImport, XML_NAMESPACE_TABLE, rLocalName ),
- mrImportHelper( rImpHelper ),
- mrTable( aTable )
-{
-}
-
-void SchXMLTableColumnContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- // get number-columns-repeated attribute
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- ::rtl::OUString aValue;
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- if( nPrefix == XML_NAMESPACE_TABLE &&
- IsXMLToken( aLocalName, XML_NUMBER_COLUMNS_REPEATED ) )
- {
- aValue = xAttrList->getValueByIndex( i );
- break; // we only need this attribute
- }
- }
-
- if( aValue.getLength())
- {
- sal_Int32 nRepeated = aValue.toInt32();
- mrTable.nNumberOfColsEstimate += nRepeated;
- }
- else
- {
- mrTable.nNumberOfColsEstimate++;
- }
-}
-
-SchXMLTableColumnContext::~SchXMLTableColumnContext()
-{
-}
-
-// ========================================
-// classes for rows
-// ========================================
-
-// ----------------------------------------
-// class SchXMLTableRowsContext
-// ----------------------------------------
-
-SchXMLTableRowsContext::SchXMLTableRowsContext(
- SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- const ::rtl::OUString& rLocalName,
- SchXMLTable& aTable ) :
- SvXMLImportContext( rImport, XML_NAMESPACE_TABLE, rLocalName ),
- mrImportHelper( rImpHelper ),
- mrTable( aTable )
-{
-}
-
-SchXMLTableRowsContext::~SchXMLTableRowsContext()
-{
-}
-
-SvXMLImportContext* SchXMLTableRowsContext::CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = 0;
-
- if( nPrefix == XML_NAMESPACE_TABLE &&
- IsXMLToken( rLocalName, XML_TABLE_ROW ) )
- {
- pContext = new SchXMLTableRowContext( mrImportHelper, GetImport(), rLocalName, mrTable );
- }
- else
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
-
- return pContext;
-}
-
-// ----------------------------------------
-// class SchXMLTableRowContext
-// ----------------------------------------
-
-SchXMLTableRowContext::SchXMLTableRowContext(
- SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- const ::rtl::OUString& rLocalName,
- SchXMLTable& aTable ) :
- SvXMLImportContext( rImport, XML_NAMESPACE_TABLE, rLocalName ),
- mrImportHelper( rImpHelper ),
- mrTable( aTable )
-{
- mrTable.nColumnIndex = -1;
- mrTable.nRowIndex++;
-
- std::vector< SchXMLCell > aNewRow;
- aNewRow.reserve( mrTable.nNumberOfColsEstimate );
- while( mrTable.aData.size() <= (unsigned long)mrTable.nRowIndex )
- mrTable.aData.push_back( aNewRow );
-}
-
-SchXMLTableRowContext::~SchXMLTableRowContext()
-{
-}
-
-SvXMLImportContext* SchXMLTableRowContext::CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = 0;
-
- // <table:table-cell> element
- if( nPrefix == XML_NAMESPACE_TABLE &&
- IsXMLToken(rLocalName, XML_TABLE_CELL ) )
- {
- pContext = new SchXMLTableCellContext( mrImportHelper, GetImport(), rLocalName, mrTable );
- }
- else
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
-
- return pContext;
-}
-
-
-// ========================================
-// classes for cells and their content
-// ========================================
-
-// ----------------------------------------
-// class SchXMLTableCellContext
-// ----------------------------------------
-
-SchXMLTableCellContext::SchXMLTableCellContext(
- SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- const ::rtl::OUString& rLocalName,
- SchXMLTable& aTable ) :
- SvXMLImportContext( rImport, XML_NAMESPACE_TABLE, rLocalName ),
- mrImportHelper( rImpHelper ),
- mrTable( aTable )
-{
-}
-
-SchXMLTableCellContext::~SchXMLTableCellContext()
-{
-}
-
-void SchXMLTableCellContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- ::rtl::OUString aValue;
- ::rtl::OUString aLocalName;
- ::rtl::OUString aCellContent;
- SchXMLCellType eValueType = SCH_CELL_TYPE_UNKNOWN;
- const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetCellAttrTokenMap();
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- switch( rAttrTokenMap.Get( nPrefix, aLocalName ))
- {
- case XML_TOK_CELL_VAL_TYPE:
- aValue = xAttrList->getValueByIndex( i );
- if( IsXMLToken( aValue, XML_FLOAT ) )
- eValueType = SCH_CELL_TYPE_FLOAT;
- else if( IsXMLToken( aValue, XML_STRING ) )
- eValueType = SCH_CELL_TYPE_STRING;
- break;
-
- case XML_TOK_CELL_VALUE:
- aCellContent = xAttrList->getValueByIndex( i );
- break;
- }
- }
-
- mbReadPara = sal_True;
- SchXMLCell aCell;
- aCell.eType = eValueType;
-
- if( eValueType == SCH_CELL_TYPE_FLOAT )
- {
- double fData;
- // the result may be false if a NaN is read, but that's ok
- SvXMLUnitConverter::convertDouble( fData, aCellContent );
-
- aCell.fValue = fData;
- // dont read following <text:p> element
- mbReadPara = sal_False;
- }
-
- mrTable.aData[ mrTable.nRowIndex ].push_back( aCell );
- mrTable.nColumnIndex++;
- if( mrTable.nMaxColumnIndex < mrTable.nColumnIndex )
- mrTable.nMaxColumnIndex = mrTable.nColumnIndex;
-}
-
-SvXMLImportContext* SchXMLTableCellContext::CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = 0;
-
- // <text:p> element
- if( mbReadPara &&
- nPrefix == XML_NAMESPACE_TEXT &&
- IsXMLToken( rLocalName, XML_P ) )
- {
- // we have to read a string here (not a float)
- pContext = new SchXMLParagraphContext( GetImport(), rLocalName, maCellContent );
- }
- else
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
-
- return pContext;
-}
-
-void SchXMLTableCellContext::EndElement()
-{
- if( mbReadPara && maCellContent.getLength())
- mrTable.aData[ mrTable.nRowIndex ][ mrTable.nColumnIndex ].aString = maCellContent;
-}
-
-// ========================================
-
-// just interpret the table in a linear way with no references used
-// (this is just a workaround for clipboard handling in EA2)
-void SchXMLTableHelper::applyTableSimple(
- const SchXMLTable& rTable,
- uno::Reference< chart::XChartDocument > xChartDoc )
-{
- // interpret table like this:
- //
- // series ----+---\
- // | |
- // categories | |
- // | | |
- // V V V
- // A B C ...
- // 1 x x <--- labels
- // 2 x 0 0
- // 3 x 0 0
- // ...
- if( xChartDoc.is())
- {
- uno::Reference< chart::XChartDataArray > xData( xChartDoc->getData(), uno::UNO_QUERY );
- if( xData.is())
- {
- // get NaN
- double fSolarNaN;
- ::rtl::math::setNan( &fSolarNaN );
- double fNaN = fSolarNaN;
- sal_Bool bConvertNaN = sal_False;
-
- uno::Reference< chart::XChartData > xChartData( xData, uno::UNO_QUERY );
- if( xChartData.is())
- {
- fNaN = xChartData->getNotANumber();
- bConvertNaN = ( ! ::rtl::math::isNan( fNaN ));
- }
-
- sal_Int32 nRowCount = rTable.aData.size();
- sal_Int32 nColumnCount = 0;
- sal_Int32 nCol = 0, nRow = 0;
- if( nRowCount )
- nColumnCount = rTable.aData[ 0 ].size();
-
- uno::Sequence< ::rtl::OUString > aCategories( nRowCount - 1 );
- uno::Sequence< ::rtl::OUString > aLabels( nColumnCount - 1 );
- uno::Sequence< uno::Sequence< double > > aData( nRowCount - 1 );
- for( nRow = 0; nRow < nRowCount - 1; nRow++ )
- aData[ nRow ].realloc( nColumnCount - 1 );
-
- // set labels
- ::std::vector< ::std::vector< SchXMLCell > >::const_iterator iRow = rTable.aData.begin();
- for( nCol = 1; nCol < nColumnCount; nCol++ )
- {
- aLabels[ nCol - 1 ] = (*iRow)[ nCol ].aString;
- }
- xData->setColumnDescriptions( aLabels );
-
- double fVal;
- const sal_Bool bConstConvertNan = bConvertNaN;
- for( ++iRow, nRow = 0; iRow != rTable.aData.end(); iRow++, nRow++ )
- {
- aCategories[ nRow ] = (*iRow)[ 0 ].aString;
- for( nCol = 1; nCol < nColumnCount; nCol++ )
- {
- fVal = (*iRow)[ nCol ].fValue;
- if( bConstConvertNan &&
- ::rtl::math::isNan( fVal ))
- aData[ nRow ][ nCol - 1 ] = fNaN;
- else
- aData[ nRow ][ nCol - 1 ] = fVal;
- }
- }
- xData->setRowDescriptions( aCategories );
- xData->setData( aData );
- }
- }
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/xmloff_XMLChartPropertyContext.cxx b/binfilter/bf_xmloff/source/chart/xmloff_XMLChartPropertyContext.cxx
deleted file mode 100644
index f0aa85b0f8e7..000000000000
--- a/binfilter/bf_xmloff/source/chart/xmloff_XMLChartPropertyContext.cxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "XMLChartPropertyContext.hxx"
-#include "PropertyMap.hxx"
-
-#include "XMLSymbolImageContext.hxx"
-namespace binfilter {
-
-TYPEINIT1( XMLChartPropertyContext, SvXMLImportContext );
-
-using namespace ::com::sun::star;
-
-XMLChartPropertyContext::XMLChartPropertyContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList,
- ::std::vector< XMLPropertyState >& rProps,
- const UniReference< SvXMLImportPropertyMapper >& rMapper ) :
- SvXMLPropertySetContext( rImport, nPrfx, rLName, xAttrList, rProps, rMapper )
-{
-}
-
-XMLChartPropertyContext::~XMLChartPropertyContext()
-{}
-
-SvXMLImportContext* XMLChartPropertyContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList,
- ::std::vector< XMLPropertyState > &rProperties,
- const XMLPropertyState& rProp )
-{
- SvXMLImportContext *pContext = 0;
-
- switch( xMapper->getPropertySetMapper()->GetEntryContextId( rProp.mnIndex ) )
- {
- case XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE:
- pContext = new XMLSymbolImageContext( GetImport(), nPrefix, rLocalName, rProp, rProperties );
- break;
- }
-
- // default / no context yet: create child context by base class
- if( !pContext )
- {
- pContext = SvXMLPropertySetContext::CreateChildContext(
- nPrefix, rLocalName, xAttrList, rProperties, rProp );
- }
-
- return pContext;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/xmloff_XMLChartStyleContext.cxx b/binfilter/bf_xmloff/source/chart/xmloff_XMLChartStyleContext.cxx
deleted file mode 100644
index 5997a28a71e1..000000000000
--- a/binfilter/bf_xmloff/source/chart/xmloff_XMLChartStyleContext.cxx
+++ /dev/null
@@ -1,123 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "XMLChartStyleContext.hxx"
-
-#include "xmlnmspe.hxx"
-#include "xmlnumfi.hxx"
-#include "families.hxx"
-
-#include "XMLChartPropertyContext.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_DATA_STYLE_NAME;
-
-
-TYPEINIT1( XMLChartStyleContext, XMLPropStyleContext );
-
-// protected
-
-void XMLChartStyleContext::SetAttribute(
- sal_uInt16 nPrefixKey,
- const ::rtl::OUString& rLocalName,
- const ::rtl::OUString& rValue )
-{
- if( IsXMLToken( rLocalName, XML_DATA_STYLE_NAME ) )
- {
- msDataStyleName = rValue;
- }
- else
- {
- XMLPropStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue );
- }
-}
-
-//public
-
-// CTOR
-XMLChartStyleContext::XMLChartStyleContext(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList,
- SvXMLStylesContext& rStyles, sal_uInt16 nFamily ) :
-
- XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, nFamily ),
- mrStyles( rStyles )
-{}
-
-// DTOR
-XMLChartStyleContext::~XMLChartStyleContext()
-{}
-
-void XMLChartStyleContext::FillPropertySet(
- const uno::Reference< beans::XPropertySet > & rPropSet )
-{
- XMLPropStyleContext::FillPropertySet( rPropSet );
- if( msDataStyleName.getLength())
- {
- SvXMLNumFormatContext* pStyle = (SvXMLNumFormatContext *)mrStyles.FindStyleChildContext(
- XML_STYLE_FAMILY_DATA_STYLE, msDataStyleName, sal_True );
- if( pStyle )
- {
- uno::Any aNumberFormat;
- sal_Int32 nNumberFormat = pStyle->GetKey();
- aNumberFormat <<= nNumberFormat;
- rPropSet->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NumberFormat" )),
- aNumberFormat );
- }
- }
-}
-
-SvXMLImportContext *XMLChartStyleContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
-
- if( XML_NAMESPACE_STYLE == nPrefix &&
- IsXMLToken( rLocalName, ::binfilter::xmloff::token::XML_PROPERTIES ) )
- {
- UniReference < SvXMLImportPropertyMapper > xImpPrMap =
- GetStyles()->GetImportPropertyMapper( GetFamily() );
- if( xImpPrMap.is() )
- pContext = new XMLChartPropertyContext(
- GetImport(), nPrefix, rLocalName, xAttrList,
- GetProperties(), xImpPrMap );
- }
-
- if( !pContext )
- pContext = XMLPropStyleContext::CreateChildContext( nPrefix, rLocalName,
- xAttrList );
-
- return pContext;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/xmloff_XMLErrorIndicatorPropertyHdl.cxx b/binfilter/bf_xmloff/source/chart/xmloff_XMLErrorIndicatorPropertyHdl.cxx
deleted file mode 100644
index 3a58080e9b71..000000000000
--- a/binfilter/bf_xmloff/source/chart/xmloff_XMLErrorIndicatorPropertyHdl.cxx
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "XMLErrorIndicatorPropertyHdl.hxx"
-
-#include "xmluconv.hxx"
-#include <com/sun/star/chart/ChartErrorIndicatorType.hpp>
-#include <rtl/ustrbuf.hxx>
-namespace binfilter {
-
-using namespace ::com::sun::star;
-
-XMLErrorIndicatorPropertyHdl::~XMLErrorIndicatorPropertyHdl()
-{}
-
-sal_Bool XMLErrorIndicatorPropertyHdl::importXML( const ::rtl::OUString& rStrImpValue,
- uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bValue;
- SvXMLUnitConverter::convertBool( bValue, rStrImpValue );
-
- // modify existing value
- chart::ChartErrorIndicatorType eType = chart::ChartErrorIndicatorType_NONE;
- if( rValue.hasValue())
- rValue >>= eType;
-
- if( bValue ) // enable flag
- {
- if( eType != chart::ChartErrorIndicatorType_TOP_AND_BOTTOM )
- {
- if( mbUpperIndicator )
- eType = ( eType == chart::ChartErrorIndicatorType_LOWER )
- ? chart::ChartErrorIndicatorType_TOP_AND_BOTTOM
- : chart::ChartErrorIndicatorType_UPPER;
- else
- eType = ( eType == chart::ChartErrorIndicatorType_UPPER )
- ? chart::ChartErrorIndicatorType_TOP_AND_BOTTOM
- : chart::ChartErrorIndicatorType_LOWER;
- }
- }
- else // disable flag
- {
- if( eType != chart::ChartErrorIndicatorType_NONE )
- {
- if( mbUpperIndicator )
- eType = ( eType == chart::ChartErrorIndicatorType_UPPER )
- ? chart::ChartErrorIndicatorType_NONE
- : chart::ChartErrorIndicatorType_LOWER;
- else
- eType = ( eType == chart::ChartErrorIndicatorType_LOWER )
- ? chart::ChartErrorIndicatorType_NONE
- : chart::ChartErrorIndicatorType_UPPER;
- }
- }
-
- rValue <<= eType;
-
- return sal_True;
-}
-
-sal_Bool XMLErrorIndicatorPropertyHdl::exportXML( ::rtl::OUString& rStrExpValue,
- const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- ::rtl::OUStringBuffer aBuffer;
- chart::ChartErrorIndicatorType eType;
-
- rValue >>= eType;
- sal_Bool bValue = ( eType == chart::ChartErrorIndicatorType_TOP_AND_BOTTOM ||
- ( mbUpperIndicator
- ? ( eType == chart::ChartErrorIndicatorType_UPPER )
- : ( eType == chart::ChartErrorIndicatorType_LOWER )));
-
- if( bValue )
- {
- SvXMLUnitConverter::convertBool( aBuffer, bValue );
- rStrExpValue = aBuffer.makeStringAndClear();
- }
-
- // only export if set to true
- return bValue;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/xmloff_XMLSymbolImageContext.cxx b/binfilter/bf_xmloff/source/chart/xmloff_XMLSymbolImageContext.cxx
deleted file mode 100644
index 60dbcb0bf7b8..000000000000
--- a/binfilter/bf_xmloff/source/chart/xmloff_XMLSymbolImageContext.cxx
+++ /dev/null
@@ -1,151 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "XMLSymbolImageContext.hxx"
-
-#include "xmlnmspe.hxx"
-#include "xmlimp.hxx"
-#include "nmspmap.hxx"
-#include "XMLBase64ImportContext.hxx"
-
-namespace binfilter {
-
-TYPEINIT1( XMLSymbolImageContext, XMLElementPropertyContext );
-
-using namespace ::com::sun::star;
-
-enum SvXMLTokenMapAttrs
-{
- XML_TOK_SYMBOL_IMAGE_HREF,
- XML_TOK_SYMBOL_IMAGE_TYPE,
- XML_TOK_SYMBOL_IMAGE_ACTUATE,
- XML_TOK_SYMBOL_IMAGE_SHOW,
- XML_TOK_SYMBOL_IMAGE_END = XML_TOK_UNKNOWN
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aSymbolImageAttrTokenMap[] =
-{
- { XML_NAMESPACE_XLINK, ::binfilter::xmloff::token::XML_HREF, XML_TOK_SYMBOL_IMAGE_HREF },
- { XML_NAMESPACE_XLINK, ::binfilter::xmloff::token::XML_TYPE, XML_TOK_SYMBOL_IMAGE_TYPE },
- { XML_NAMESPACE_XLINK, ::binfilter::xmloff::token::XML_ACTUATE, XML_TOK_SYMBOL_IMAGE_ACTUATE },
- { XML_NAMESPACE_XLINK, ::binfilter::xmloff::token::XML_SHOW, XML_TOK_SYMBOL_IMAGE_SHOW },
- XML_TOKEN_MAP_END
-};
-
-XMLSymbolImageContext::XMLSymbolImageContext(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const XMLPropertyState& rProp,
- ::std::vector< XMLPropertyState > &rProps ) :
- XMLElementPropertyContext(
- rImport, nPrfx, rLName, rProp, rProps )
-{
-}
-
-XMLSymbolImageContext::~XMLSymbolImageContext()
-{}
-
-void XMLSymbolImageContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLTokenMap aTokenMap( aSymbolImageAttrTokenMap );
- ::rtl::OUString aLocalName;
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- const ::rtl::OUString& rAttrName = xAttrList->getNameByIndex( i );
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- const ::rtl::OUString& rValue = xAttrList->getValueByIndex( i );
-
- switch( aTokenMap.Get( nPrefix, aLocalName ) )
- {
- case XML_TOK_SYMBOL_IMAGE_HREF:
- msURL = rValue;
- break;
- case XML_TOK_SYMBOL_IMAGE_ACTUATE:
- case XML_TOK_SYMBOL_IMAGE_TYPE:
- case XML_TOK_SYMBOL_IMAGE_SHOW:
- // these values are currently not interpreted
- // it is always assumed 'actuate=onLoad', 'type=simple', 'show=embed'
- break;
- }
- }
-}
-
-SvXMLImportContext* XMLSymbolImageContext::CreateChildContext(
- sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
- if( xmloff::token::IsXMLToken( rLocalName,
- xmloff::token::XML_BINARY_DATA ) )
- {
- if( ! msURL.getLength() && ! mxBase64Stream.is() )
- {
- mxBase64Stream = GetImport().GetStreamForGraphicObjectURLFromBase64();
- if( mxBase64Stream.is() )
- pContext = new XMLBase64ImportContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- mxBase64Stream );
- }
- }
- if( ! pContext )
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
-
- return pContext;
-}
-
-void XMLSymbolImageContext::EndElement()
-{
- ::rtl::OUString sResolvedURL;
-
- if( msURL.getLength() )
- {
- sResolvedURL = GetImport().ResolveGraphicObjectURL( msURL, sal_False );
- }
- else if( mxBase64Stream.is() )
- {
- sResolvedURL = GetImport().ResolveGraphicObjectURLFromBase64( mxBase64Stream );
- mxBase64Stream = 0;
- }
-
- if( sResolvedURL.getLength())
- {
- // aProp is a member of XMLElementPropertyContext
- aProp.maValue <<= sResolvedURL;
- SetInsert( sal_True );
- }
-
- XMLElementPropertyContext::EndElement();
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/xmloff_XMLTextOrientationHdl.cxx b/binfilter/bf_xmloff/source/chart/xmloff_XMLTextOrientationHdl.cxx
deleted file mode 100644
index 94c8885b0fec..000000000000
--- a/binfilter/bf_xmloff/source/chart/xmloff_XMLTextOrientationHdl.cxx
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "XMLTextOrientationHdl.hxx"
-
-#include "xmluconv.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-XMLTextOrientationHdl::~XMLTextOrientationHdl()
-{
-}
-
-sal_Bool XMLTextOrientationHdl::importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRetval( sal_False );
-
- if( IsXMLToken( rStrImpValue, XML_LTR ))
- {
- rValue <<= static_cast< sal_Bool >( sal_False );
- bRetval = sal_True;
- }
- else if( IsXMLToken( rStrImpValue, XML_TTB ))
- {
- rValue <<= static_cast< sal_Bool >( sal_True );
- bRetval = sal_True;
- }
-
- return bRetval;
-}
-
-sal_Bool XMLTextOrientationHdl::exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bVal;
- sal_Bool bRetval( sal_False );
-
- if( rValue >>= bVal )
- {
- if( bVal )
- rStrExpValue = GetXMLToken( XML_TTB );
- else
- rStrExpValue = GetXMLToken( XML_LTR );
- bRetval = sal_True;
- }
-
- return bRetval;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/chart/xmloff_contexts.cxx b/binfilter/bf_xmloff/source/chart/xmloff_contexts.cxx
deleted file mode 100644
index 6c8d6bf18efa..000000000000
--- a/binfilter/bf_xmloff/source/chart/xmloff_contexts.cxx
+++ /dev/null
@@ -1,150 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include "xmlnmspe.hxx"
-#include "xmlmetai.hxx"
-#include "xmlstyle.hxx"
-
-#include "contexts.hxx"
-
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-// ==================================================
-
-SchXMLDocContext::SchXMLDocContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- USHORT nPrefix,
- const ::rtl::OUString& rLName ) :
- SvXMLImportContext( rImport, nPrefix, rLName ),
- mrImportHelper( rImpHelper )
-{
- DBG_ASSERT( XML_NAMESPACE_OFFICE == nPrefix &&
- ( IsXMLToken( rLName, XML_DOCUMENT ) ||
- IsXMLToken( rLName, XML_DOCUMENT_META) ||
- IsXMLToken( rLName, XML_DOCUMENT_STYLES) ||
- IsXMLToken( rLName, XML_DOCUMENT_CONTENT) ),
- "SchXMLDocContext instanciated with no <office:document> element" );
-}
-
-SchXMLDocContext::~SchXMLDocContext()
-{}
-
-SvXMLImportContext* SchXMLDocContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = 0;
- const SvXMLTokenMap& rTokenMap = mrImportHelper.GetDocElemTokenMap();
- sal_uInt16 nFlags = GetImport().getImportFlags();
-
- switch( rTokenMap.Get( nPrefix, rLocalName ))
- {
- case XML_TOK_DOC_AUTOSTYLES:
- if( nFlags & IMPORT_AUTOSTYLES )
- // not nice, but this is safe, as the SchXMLDocContext class can only by
- // instantiated by the chart import class SchXMLImport (header is not exported)
- pContext =
- static_cast< SchXMLImport& >( GetImport() ).CreateStylesContext( rLocalName, xAttrList );
- break;
- case XML_TOK_DOC_STYLES:
- // for draw styles containing gradients/hatches/markers and dashes
- if( nFlags & IMPORT_STYLES )
- pContext = new SvXMLStylesContext( GetImport(), nPrefix, rLocalName, xAttrList );
- break;
- case XML_TOK_DOC_META:
- if( nFlags & IMPORT_META )
- pContext = new SfxXMLMetaContext( GetImport(), nPrefix, rLocalName, GetImport().GetModel());
- break;
- case XML_TOK_DOC_BODY:
- if( nFlags & IMPORT_CONTENT )
- pContext = new SchXMLBodyContext( mrImportHelper, GetImport(), nPrefix, rLocalName );
- break;
- }
-
- // call parent when no own context was created
- if( ! pContext )
- pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList );
-
- return pContext;
-}
-
-// ----------------------------------------
-
-SchXMLBodyContext::SchXMLBodyContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- USHORT nPrefix,
- const ::rtl::OUString& rLName ) :
- SvXMLImportContext( rImport, nPrefix, rLName ),
- mrImportHelper( rImpHelper )
-{
- DBG_ASSERT( XML_NAMESPACE_OFFICE == nPrefix &&
- IsXMLToken( rLName, XML_BODY ),
- "SchXMLBodyContext instanciated with no <office:body> element" );
-}
-
-SchXMLBodyContext::~SchXMLBodyContext()
-{}
-
-void SchXMLBodyContext::EndElement()
-{
-}
-
-SvXMLImportContext* SchXMLBodyContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = 0;
-
- // <chart:chart> element
- if( nPrefix == XML_NAMESPACE_CHART &&
- IsXMLToken( rLocalName, XML_CHART ) )
- {
- pContext = mrImportHelper.CreateChartContext( GetImport(),
- nPrefix, rLocalName,
- GetImport().GetModel(),
- xAttrList );
- }
- else
- {
- pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList );
- }
-
- return pContext;
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/makefile.mk b/binfilter/bf_xmloff/source/core/makefile.mk
deleted file mode 100644
index ba8abdd3a133..000000000000
--- a/binfilter/bf_xmloff/source/core/makefile.mk
+++ /dev/null
@@ -1,82 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
-
-PRJ=..$/..$/..
-
-PRJNAME=binfilter
-TARGET=xmloff_core
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-CDEFS+=-DCONV_STAR_FONTS
-
-INC+= -I$(PRJ)$/inc$/bf_xmloff
-
-# --- to build xmlkywd.obj in obj, too -----------------------------
-
-OBJFILES = $(OBJ)$/xmloff_xmlkywd.obj
-LIB2TARGET =$(LB)$/xmloff_xmlkywd.lib
-LIB2OBJFILES =$(OBJFILES)
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/xmloff_facreg.obj \
- $(SLO)$/xmloff_xmlcnitm.obj \
- $(SLO)$/xmloff_attrlist.obj \
- $(SLO)$/xmloff_i18nmap.obj \
- $(SLO)$/xmloff_nmspmap.obj \
- $(SLO)$/xmloff_unoatrcn.obj \
- $(SLO)$/xmloff_xmlehelp.obj \
- $(SLO)$/xmloff_xmlerror.obj \
- $(SLO)$/xmloff_xmlexp.obj \
- $(SLO)$/xmloff_xmlictxt.obj \
- $(SLO)$/xmloff_xmlimp.obj \
- $(SLO)$/xmloff_xmlkywd.obj \
- $(SLO)$/xmloff_xmltkmap.obj \
- $(SLO)$/xmloff_xmltoken.obj \
- $(SLO)$/xmloff_xmluconv.obj \
- $(SLO)$/xmloff_ProgressBarHelper.obj \
- $(SLO)$/xmloff_PropertySetMerger.obj \
- $(SLO)$/xmloff_SettingsExportHelper.obj \
- $(SLO)$/xmloff_DocumentSettingsContext.obj \
- $(SLO)$/xmloff_XMLEmbeddedObjectExportFilter.obj \
- $(SLO)$/xmloff_XMLEmbeddedObjectImportContext.obj \
- $(SLO)$/xmloff_XMLBase64Export.obj \
- $(SLO)$/xmloff_XMLBase64ImportContext.obj \
- $(SLO)$/xmloff_XMLBasicExportFilter.obj
-
-CPPUMAKERFLAGS=
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/binfilter/bf_xmloff/source/core/xmlenums.hxx b/binfilter/bf_xmloff/source/core/xmlenums.hxx
deleted file mode 100644
index bb9ce9ca4632..000000000000
--- a/binfilter/bf_xmloff/source/core/xmlenums.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-namespace binfilter {
-
-#ifndef _XMLENUMS_HXX_
-#define _XMLENUMS_HXX_
-
-enum XMLForbiddenCharactersEnum
-{
- XML_FORBIDDEN_CHARACTER_LANGUAGE,
- XML_FORBIDDEN_CHARACTER_COUNTRY,
- XML_FORBIDDEN_CHARACTER_VARIANT,
- XML_FORBIDDEN_CHARACTER_BEGIN_LINE,
- XML_FORBIDDEN_CHARACTER_END_LINE,
- XML_FORBIDDEN_CHARACTER_MAX
-};
-
-enum XMLSymbolDescriptorsEnum
-{
- XML_SYMBOL_DESCRIPTOR_NAME,
- XML_SYMBOL_DESCRIPTOR_EXPORT_NAME,
- XML_SYMBOL_DESCRIPTOR_SYMBOL_SET,
- XML_SYMBOL_DESCRIPTOR_CHARACTER,
- XML_SYMBOL_DESCRIPTOR_FONT_NAME,
- XML_SYMBOL_DESCRIPTOR_CHAR_SET,
- XML_SYMBOL_DESCRIPTOR_FAMILY,
- XML_SYMBOL_DESCRIPTOR_PITCH,
- XML_SYMBOL_DESCRIPTOR_WEIGHT,
- XML_SYMBOL_DESCRIPTOR_ITALIC,
- XML_SYMBOL_DESCRIPTOR_MAX
-};
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_DocumentSettingsContext.cxx b/binfilter/bf_xmloff/source/core/xmloff_DocumentSettingsContext.cxx
deleted file mode 100644
index 2c8a70d89738..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_DocumentSettingsContext.cxx
+++ /dev/null
@@ -1,890 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include "DocumentSettingsContext.hxx"
-#include "xmlimp.hxx"
-#include "xmlnmspe.hxx"
-#include "nmspmap.hxx"
-#include "xmluconv.hxx"
-#include <tools/debug.hxx>
-
-#ifndef __SGI_STL_LIST
-#include <list>
-#endif
-
-#include <com/sun/star/i18n/XForbiddenCharacters.hpp>
-#include <com/sun/star/container/XIndexContainer.hpp>
-#include <com/sun/star/formula/SymbolDescriptor.hpp>
-
-#include <com/sun/star/util/DateTime.hpp>
-#include <com/sun/star/document/XViewDataSupplier.hpp>
-#include <com/sun/star/document/PrinterIndependentLayout.hpp>
-#include <xmlenums.hxx>
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-
-//------------------------------------------------------------------
-
-class XMLMyList
-{
- std::list<beans::PropertyValue> aProps;
- sal_uInt32 nCount;
-
- // #110680#
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory;
-
-public:
- // #110680#
- XMLMyList(const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory);
- ~XMLMyList();
-
- void push_back(beans::PropertyValue& aProp) { aProps.push_back(aProp); nCount++; }
- uno::Sequence<beans::PropertyValue> GetSequence();
- uno::Reference<container::XNameContainer> GetNameContainer();
- uno::Reference<container::XIndexContainer> GetIndexContainer();
-};
-
-// #110680#
-XMLMyList::XMLMyList(const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory)
-: nCount(0),
- mxServiceFactory(xServiceFactory)
-{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
-}
-
-// #110680#
-XMLMyList::~XMLMyList()
-{
-}
-
-uno::Sequence<beans::PropertyValue> XMLMyList::GetSequence()
-{
- uno::Sequence<beans::PropertyValue> aSeq;
- if(nCount)
- {
- DBG_ASSERT(nCount == aProps.size(), "wrong count of PropertyValue");
- aSeq.realloc(nCount);
- beans::PropertyValue* pProps = aSeq.getArray();
- std::list<beans::PropertyValue>::iterator aItr = aProps.begin();
- while (aItr != aProps.end())
- {
- *pProps = *aItr;
- pProps++;
- aItr++;
- }
- }
- return aSeq;
-}
-
-uno::Reference<container::XNameContainer> XMLMyList::GetNameContainer()
-{
- uno::Reference<container::XNameContainer> xNameContainer;
-
- // #110680#
- // uno::Reference<lang::XMultiServiceFactory> xServiceFactory = comphelper::getProcessServiceFactory();
- // DBG_ASSERT( xServiceFactory.is(), "got no service manager" );
-
- if( mxServiceFactory.is() )
- {
- ::rtl::OUString sName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.NamedPropertyValues"));
- xNameContainer = uno::Reference<container::XNameContainer>(mxServiceFactory->createInstance(sName), uno::UNO_QUERY);
- if (xNameContainer.is())
- {
- std::list<beans::PropertyValue>::iterator aItr = aProps.begin();
- while (aItr != aProps.end())
- {
- xNameContainer->insertByName(aItr->Name, aItr->Value);
- aItr++;
- }
- }
- }
- return xNameContainer;
-}
-
-uno::Reference<container::XIndexContainer> XMLMyList::GetIndexContainer()
-{
- uno::Reference<container::XIndexContainer> xIndexContainer;
- // #110680#
- // uno::Reference<lang::XMultiServiceFactory> xServiceFactory = comphelper::getProcessServiceFactory();
- // DBG_ASSERT( xServiceFactory.is(), "got no service manager" );
-
- if( mxServiceFactory.is() )
- {
- ::rtl::OUString sName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.IndexedPropertyValues"));
- xIndexContainer = uno::Reference<container::XIndexContainer>(mxServiceFactory->createInstance(sName), uno::UNO_QUERY);
- if (xIndexContainer.is())
- {
- std::list<beans::PropertyValue>::iterator aItr = aProps.begin();
- sal_uInt32 i(0);
- while (aItr != aProps.end())
- {
- xIndexContainer->insertByIndex(i, aItr->Value);
- aItr++;
- i++;
- }
- }
- }
- return xIndexContainer;
-}
-
-//=============================================================================
-
-class XMLConfigBaseContext : public SvXMLImportContext
-{
-protected:
- XMLMyList aProps;
- beans::PropertyValue aProp;
- ::com::sun::star::uno::Any& rAny;
- XMLConfigBaseContext* pBaseContext;
-public:
- XMLConfigBaseContext(SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName,
- ::com::sun::star::uno::Any& rAny,
- XMLConfigBaseContext* pBaseContext);
- virtual ~XMLConfigBaseContext();
-
- void AddPropertyValue() { aProps.push_back(aProp); }
-};
-
-//=============================================================================
-
-class XMLConfigItemContext : public SvXMLImportContext
-{
- ::rtl::OUString sType;
- ::rtl::OUString sValue;
- uno::Sequence<sal_Int8> aDecoded;
- ::com::sun::star::uno::Any& rAny;
- const ::rtl::OUString rItemName;
- XMLConfigBaseContext* pBaseContext;
-
-public:
- XMLConfigItemContext(SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Any& rAny,
- const ::rtl::OUString& rItemName,
- XMLConfigBaseContext* pBaseContext);
- virtual ~XMLConfigItemContext();
-
- virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
- virtual void Characters( const ::rtl::OUString& rChars );
-
- virtual void EndElement();
-
- virtual void ManipulateConfigItem();
-};
-
-//=============================================================================
-
-class XMLConfigItemSetContext : public XMLConfigBaseContext
-{
-public:
- XMLConfigItemSetContext(SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Any& rAny,
- XMLConfigBaseContext* pBaseContext);
- virtual ~XMLConfigItemSetContext();
-
- virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
-
- virtual void EndElement();
-};
-
-//=============================================================================
-
-class XMLConfigItemMapNamedContext : public XMLConfigBaseContext
-{
-public:
- XMLConfigItemMapNamedContext(SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Any& rAny,
- XMLConfigBaseContext* pBaseContext);
- virtual ~XMLConfigItemMapNamedContext();
-
- virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
-
- virtual void EndElement();
-};
-
-//=============================================================================
-
-class XMLConfigItemMapIndexedContext : public XMLConfigBaseContext
-{
-private:
- ::rtl::OUString maConfigItemName;
-
-public:
- XMLConfigItemMapIndexedContext(SvXMLImport& rImport, USHORT nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Any& rAny,
- const ::rtl::OUString& rConfigItemName,
- XMLConfigBaseContext* pBaseContext);
- virtual ~XMLConfigItemMapIndexedContext();
-
- virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
-
- virtual void EndElement();
-};
-
-//=============================================================================
-
-SvXMLImportContext *CreateSettingsContext(SvXMLImport& rImport, USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList,
- beans::PropertyValue& rProp, XMLConfigBaseContext* pBaseContext)
-{
- SvXMLImportContext *pContext = 0;
-
- rProp.Name = ::rtl::OUString();
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- USHORT nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName(
- sAttrName, &aLocalName );
- ::rtl::OUString sValue = xAttrList->getValueByIndex( i );
-
- if (nPrefix == XML_NAMESPACE_CONFIG)
- {
- if (IsXMLToken(aLocalName, XML_NAME))
- rProp.Name = sValue;
- }
- }
-
- if (nPrefix == XML_NAMESPACE_CONFIG)
- {
- if (IsXMLToken(rLocalName, XML_CONFIG_ITEM))
- pContext = new XMLConfigItemContext(rImport, nPrefix, rLocalName, xAttrList, rProp.Value, rProp.Name, pBaseContext);
- else if((IsXMLToken(rLocalName, XML_CONFIG_ITEM_SET)) ||
- (IsXMLToken(rLocalName, XML_CONFIG_ITEM_MAP_ENTRY)) )
- pContext = new XMLConfigItemSetContext(rImport, nPrefix, rLocalName, xAttrList, rProp.Value, pBaseContext);
- else if(IsXMLToken(rLocalName, XML_CONFIG_ITEM_MAP_NAMED))
- pContext = new XMLConfigItemMapNamedContext(rImport, nPrefix, rLocalName, xAttrList, rProp.Value, pBaseContext);
- else if(IsXMLToken(rLocalName, XML_CONFIG_ITEM_MAP_INDEXED))
- pContext = new XMLConfigItemMapIndexedContext(rImport, nPrefix, rLocalName, xAttrList, rProp.Value, rProp.Name, pBaseContext);
- }
-
- if( !pContext )
- pContext = new SvXMLImportContext( rImport, nPrefix, rLocalName );
-
- return pContext;
-}
-
-//=============================================================================
-
-XMLDocumentSettingsContext::XMLDocumentSettingsContext(SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList )
- : SvXMLImportContext( rImport, nPrfx, rLName )
-{
- // here are no attributes
-}
-
-XMLDocumentSettingsContext::~XMLDocumentSettingsContext()
-{
-}
-
-SvXMLImportContext *XMLDocumentSettingsContext::CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext *pContext = 0;
- ::rtl::OUString sName;
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName(
- sAttrName, &aLocalName );
- ::rtl::OUString sValue = xAttrList->getValueByIndex( i );
-
- if (nPrefix == XML_NAMESPACE_CONFIG)
- {
- if (IsXMLToken(aLocalName, XML_NAME))
- sName = sValue;
- }
- }
-
- if (nPrefix == XML_NAMESPACE_CONFIG)
- {
- if (IsXMLToken(rLocalName, XML_CONFIG_ITEM_SET))
- {
- if (IsXMLToken(sName, XML_VIEW_SETTINGS))
- pContext = new XMLConfigItemSetContext(GetImport(), nPrefix, rLocalName, xAttrList, aViewProps, NULL);
- else if (IsXMLToken(sName, XML_CONFIGURATION_SETTINGS))
- pContext = new XMLConfigItemSetContext(GetImport(), nPrefix, rLocalName, xAttrList, aConfigProps, NULL);
- }
- }
-
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
- return pContext;
-}
-
-void XMLDocumentSettingsContext::EndElement()
-{
- uno::Sequence<beans::PropertyValue> aSeqViewProps;
- if (aViewProps >>= aSeqViewProps)
- {
- GetImport().SetViewSettings(aSeqViewProps);
- sal_Int32 i(aSeqViewProps.getLength() - 1);
- sal_Bool bFound(sal_False);
- while((i >= 0) && !bFound)
- {
- if (aSeqViewProps[i].Name.compareToAscii("Views") == 0)
- {
- bFound = sal_True;
- uno::Reference<container::XIndexAccess> xIndexAccess;
- if (aSeqViewProps[i].Value >>= xIndexAccess)
- {
- uno::Reference<document::XViewDataSupplier> xViewDataSupplier(GetImport().GetModel(), uno::UNO_QUERY);
- if (xViewDataSupplier.is())
- xViewDataSupplier->setViewData(xIndexAccess);
- }
- }
- else
- i--;
- }
- }
- uno::Sequence<beans::PropertyValue> aSeqConfigProps;
- if (aConfigProps >>= aSeqConfigProps)
- GetImport().SetConfigurationSettings(aSeqConfigProps);
-}
-
-//=============================================================================
-
-XMLConfigBaseContext::XMLConfigBaseContext(SvXMLImport& rImport, USHORT nPrfx,
- const ::rtl::OUString& rLName, ::com::sun::star::uno::Any& rTempAny,
- XMLConfigBaseContext* pTempBaseContext)
- : SvXMLImportContext( rImport, nPrfx, rLName ),
- rAny(rTempAny),
- // #110680#
- //aProps(),
- aProps(rImport.getServiceFactory()),
- aProp(),
- pBaseContext(pTempBaseContext)
-{
-}
-
-XMLConfigBaseContext::~XMLConfigBaseContext()
-{
-}
-
-//=============================================================================
-
-XMLConfigItemSetContext::XMLConfigItemSetContext(SvXMLImport& rImport, USHORT nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Any& rAny,
- XMLConfigBaseContext* pBaseContext)
- : XMLConfigBaseContext( rImport, nPrfx, rLName, rAny, pBaseContext )
-{
- // here are no attributes
-}
-
-XMLConfigItemSetContext::~XMLConfigItemSetContext()
-{
-}
-
-SvXMLImportContext *XMLConfigItemSetContext::CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
-{
- return CreateSettingsContext(GetImport(), nPrefix, rLocalName, xAttrList, aProp, this);
-}
-
-void XMLConfigItemSetContext::EndElement()
-{
- rAny <<= aProps.GetSequence();
- if (pBaseContext)
- pBaseContext->AddPropertyValue();
-}
-
-//=============================================================================
-
-XMLConfigItemContext::XMLConfigItemContext(SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Any& rTempAny,
- const ::rtl::OUString& rTempItemName,
- XMLConfigBaseContext* pTempBaseContext)
- : SvXMLImportContext(rImport, nPrfx, rLName),
- rAny(rTempAny),
- pBaseContext(pTempBaseContext),
- sType(),
- sValue(),
- rItemName(rTempItemName)
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName(
- sAttrName, &aLocalName );
- ::rtl::OUString sValue = xAttrList->getValueByIndex( i );
-
- if (nPrefix == XML_NAMESPACE_CONFIG)
- {
- if (IsXMLToken(aLocalName, XML_TYPE))
- sType = sValue;
- }
- }
-}
-
-XMLConfigItemContext::~XMLConfigItemContext()
-{
-}
-
-SvXMLImportContext *XMLConfigItemContext::CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext* pContext = new SvXMLImportContext(GetImport(), nPrefix, rLocalName);
- return pContext;
-}
-
-void XMLConfigItemContext::Characters( const ::rtl::OUString& rChars )
-{
- if (IsXMLToken(sType, XML_BASE64BINARY))
- {
- ::rtl::OUString sTrimmedChars( rChars.trim() );
- if( sTrimmedChars.getLength() )
- {
- ::rtl::OUString sChars;
- if( sValue )
- {
- sChars = sValue;
- sChars += sTrimmedChars;
- sValue = ::rtl::OUString();
- }
- else
- {
- sChars = sTrimmedChars;
- }
- uno::Sequence<sal_Int8> aBuffer((sChars.getLength() / 4) * 3 );
- sal_Int32 nCharsDecoded =
- GetImport().GetMM100UnitConverter().
- decodeBase64SomeChars( aBuffer, sChars );
- sal_uInt32 nStartPos(aDecoded.getLength());
- sal_uInt32 nCount(aBuffer.getLength());
- aDecoded.realloc(nStartPos + nCount);
- sal_Int8* pDecoded = aDecoded.getArray();
- sal_Int8* pBuffer = aBuffer.getArray();
- for (sal_uInt32 i = 0; i < nCount; i++, pBuffer++)
- pDecoded[nStartPos + i] = *pBuffer;
- if( nCharsDecoded != sChars.getLength() )
- sValue = sChars.copy( nCharsDecoded );
- }
- }
- else
- sValue += rChars;
-}
-
-
-void XMLConfigItemContext::EndElement()
-{
- if (pBaseContext)
- {
- if (IsXMLToken(sType, XML_BOOLEAN))
- {
- sal_Bool bValue(sal_False);
- if (IsXMLToken(sValue, XML_TRUE))
- bValue = sal_True;
- rAny <<= bValue;
- }
- else if (IsXMLToken(sType, XML_BYTE))
- {
- sal_Int32 nValue(0);
- SvXMLUnitConverter::convertNumber(nValue, sValue);
- rAny <<= static_cast<sal_Int8>(nValue);
- }
- else if (IsXMLToken(sType, XML_SHORT))
- {
- sal_Int32 nValue(0);
- SvXMLUnitConverter::convertNumber(nValue, sValue);
- rAny <<= static_cast<sal_Int16>(nValue);
- }
- else if (IsXMLToken(sType, XML_INT))
- {
- sal_Int32 nValue(0);
- SvXMLUnitConverter::convertNumber(nValue, sValue);
- rAny <<= nValue;
- }
- else if (IsXMLToken(sType, XML_LONG))
- {
- sal_Int64 nValue(sValue.toInt64());
- rAny <<= nValue;
- }
- else if (IsXMLToken(sType, XML_DOUBLE))
- {
- double fValue(0.0);
- SvXMLUnitConverter::convertDouble(fValue, sValue);
- rAny <<= fValue;
- }
- else if (IsXMLToken(sType, XML_STRING))
- {
- rAny <<= sValue;
- }
- else if (IsXMLToken(sType, XML_DATETIME))
- {
- util::DateTime aDateTime;
- SvXMLUnitConverter::convertDateTime(aDateTime, sValue);
- rAny <<= aDateTime;
- }
- else if (IsXMLToken(sType, XML_BASE64BINARY))
- {
- rAny <<= aDecoded;
- }
- else
- DBG_ERROR("wrong type");
-
- ManipulateConfigItem();
-
- pBaseContext->AddPropertyValue();
- }
- else
- DBG_ERROR("no BaseContext");
-}
-
-/** There are some instances where there is a mismatch between API and
- * XML mapping of a setting. In this case, this method allows us to
- * manipulate the values accordingly. */
-void XMLConfigItemContext::ManipulateConfigItem()
-{
- if( rItemName.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM( "PrinterIndependentLayout" ) ) )
- {
- ::rtl::OUString sValue;
- rAny >>= sValue;
-
- sal_Int16 nTmp = document::PrinterIndependentLayout::HIGH_RESOLUTION;
-
- if( sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("enabled")) ||
- sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("low-resolution")) )
- {
- nTmp = document::PrinterIndependentLayout::LOW_RESOLUTION;
- }
- else if( sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("disabled")) )
- {
- nTmp = document::PrinterIndependentLayout::DISABLED;
- }
- // else: default to high_resolution
-
- rAny <<= nTmp;
- }
-}
-
-
-//=============================================================================
-
-XMLConfigItemMapNamedContext::XMLConfigItemMapNamedContext(SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Any& rAny,
- XMLConfigBaseContext* pBaseContext)
- : XMLConfigBaseContext(rImport, nPrfx, rLName, rAny, pBaseContext)
-{
-}
-
-XMLConfigItemMapNamedContext::~XMLConfigItemMapNamedContext()
-{
-}
-
-SvXMLImportContext *XMLConfigItemMapNamedContext::CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
-{
- return CreateSettingsContext(GetImport(), nPrefix, rLocalName, xAttrList, aProp, this);
-}
-
-void XMLConfigItemMapNamedContext::EndElement()
-{
- if (pBaseContext)
- {
- rAny <<= aProps.GetNameContainer();
- pBaseContext->AddPropertyValue();
- }
- else
- DBG_ERROR("no BaseContext");
-}
-
-//=============================================================================
-
-XMLConfigItemMapIndexedContext::XMLConfigItemMapIndexedContext(SvXMLImport& rImport, USHORT nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Any& rAny,
- const ::rtl::OUString& rConfigItemName,
- XMLConfigBaseContext* pBaseContext)
- : XMLConfigBaseContext(rImport, nPrfx, rLName, rAny, pBaseContext),
- maConfigItemName( rConfigItemName )
-{
-}
-
-XMLConfigItemMapIndexedContext::~XMLConfigItemMapIndexedContext()
-{
-}
-
-SvXMLImportContext *XMLConfigItemMapIndexedContext::CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
-{
- return CreateSettingsContext(GetImport(), nPrefix, rLocalName, xAttrList, aProp, this);
-}
-
-void XMLConfigItemMapIndexedContext::EndElement()
-{
- if (pBaseContext)
- {
- if( maConfigItemName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ForbiddenCharacters" ) ) )
- {
- uno::Reference< i18n::XForbiddenCharacters > xForbChars;
-
- // get the forbidden characters from the document
- uno::Reference< lang::XMultiServiceFactory > xFac( GetImport().GetModel(), uno::UNO_QUERY );
- if( xFac.is() )
- {
- uno::Reference< beans::XPropertySet > xProps( xFac->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.Settings" ) ) ), uno::UNO_QUERY );
- if( xProps.is() && xProps->getPropertySetInfo()->hasPropertyByName( maConfigItemName ) )
- {
- xProps->getPropertyValue( maConfigItemName ) >>= xForbChars;
- }
- }
-
- if( xForbChars.is() )
- {
-
- uno::Reference< container::XIndexAccess > xIndex( aProps.GetIndexContainer(), uno::UNO_QUERY );
-
- const sal_Int32 nCount = xIndex->getCount();
- uno::Sequence < beans::PropertyValue > aProps;
- for (sal_Int32 i = 0; i < nCount; i++)
- {
- if ((xIndex->getByIndex( i ) >>= aProps) && (aProps.getLength() == XML_FORBIDDEN_CHARACTER_MAX ) )
- {
- beans::PropertyValue *pForChar = aProps.getArray();
- i18n::ForbiddenCharacters aForbid;
- lang::Locale aLocale;
- const ::rtl::OUString sLanguage ( RTL_CONSTASCII_USTRINGPARAM ( "Language" ) );
- const ::rtl::OUString sCountry ( RTL_CONSTASCII_USTRINGPARAM ( "Country" ) );
- const ::rtl::OUString sVariant ( RTL_CONSTASCII_USTRINGPARAM ( "Variant" ) );
- const ::rtl::OUString sBeginLine ( RTL_CONSTASCII_USTRINGPARAM ( "BeginLine" ) );
- const ::rtl::OUString sEndLine ( RTL_CONSTASCII_USTRINGPARAM ( "EndLine" ) );
- sal_Bool bHaveLanguage = sal_False, bHaveCountry = sal_False, bHaveVariant = sal_False,
- bHaveBegin = sal_False, bHaveEnd = sal_False;
-
- for ( sal_Int32 j = 0 ; j < XML_FORBIDDEN_CHARACTER_MAX ; j++ )
- {
- if (pForChar->Name.equals (sLanguage ) )
- {
- pForChar->Value >>= aLocale.Language;
- bHaveLanguage = sal_True;
- }
- else if (pForChar->Name.equals (sCountry ) )
- {
- pForChar->Value >>= aLocale.Country;
- bHaveCountry = sal_True;
- }
- else if (pForChar->Name.equals (sVariant ) )
- {
- pForChar->Value >>= aLocale.Variant;
- bHaveVariant = sal_True;
- }
- else if (pForChar->Name.equals (sBeginLine ) )
- {
- pForChar->Value >>= aForbid.beginLine;
- bHaveBegin = sal_True;
- }
- else if (pForChar->Name.equals (sEndLine ) )
- {
- pForChar->Value >>= aForbid.endLine;
- bHaveEnd = sal_True;
- }
- pForChar++;
- }
-
- if ( bHaveLanguage && bHaveCountry && bHaveVariant && bHaveBegin && bHaveEnd )
- {
- try
- {
- xForbChars->setForbiddenCharacters( aLocale, aForbid );
- }
- catch( uno::Exception& )
- {
-// DBG_ERROR( "Exception while importing forbidden characters" );
- }
- }
- }
- }
- }
- else
- {
- DBG_ERROR( "could not get the XForbiddenCharacters from document!" );
- rAny <<= aProps.GetIndexContainer();
- }
- }
- else if( maConfigItemName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Symbols" ) ) )
- {
- uno::Reference< container::XIndexAccess > xIndex( aProps.GetIndexContainer(), uno::UNO_QUERY );
-
- const sal_Int32 nCount = xIndex->getCount();
- uno::Sequence < beans::PropertyValue > aProps;
- uno::Sequence < formula::SymbolDescriptor > aSymbolList ( nCount );
-
- formula::SymbolDescriptor *pDescriptor = aSymbolList.getArray();
-
- const ::rtl::OUString sName ( RTL_CONSTASCII_USTRINGPARAM ( "Name" ) );
- const ::rtl::OUString sExportName ( RTL_CONSTASCII_USTRINGPARAM ( "ExportName" ) );
- const ::rtl::OUString sFontName ( RTL_CONSTASCII_USTRINGPARAM ( "FontName" ) );
- const ::rtl::OUString sSymbolSet ( RTL_CONSTASCII_USTRINGPARAM ( "SymbolSet" ) );
- const ::rtl::OUString sCharacter ( RTL_CONSTASCII_USTRINGPARAM ( "Character" ) );
- const ::rtl::OUString sCharSet ( RTL_CONSTASCII_USTRINGPARAM ( "CharSet" ) );
- const ::rtl::OUString sFamily ( RTL_CONSTASCII_USTRINGPARAM ( "Family" ) );
- const ::rtl::OUString sPitch ( RTL_CONSTASCII_USTRINGPARAM ( "Pitch" ) );
- const ::rtl::OUString sWeight ( RTL_CONSTASCII_USTRINGPARAM ( "Weight" ) );
- const ::rtl::OUString sItalic ( RTL_CONSTASCII_USTRINGPARAM ( "Italic" ) );
- sal_Int16 nNumFullEntries = 0;
-
- for ( sal_Int32 i = 0; i < nCount; i++ )
- {
- if ((xIndex->getByIndex( i ) >>= aProps) && (aProps.getLength() == XML_SYMBOL_DESCRIPTOR_MAX ) )
- {
- sal_Bool bHaveName = sal_False, bHaveExportName = sal_False, bHaveCharSet = sal_False,
- bHaveFontName = sal_False, bHaveFamily = sal_False, bHavePitch = sal_False,
- bHaveWeight = sal_False, bHaveItalic = sal_False, bHaveSymbolSet = sal_False,
- bHaveCharacter = sal_False;
- beans::PropertyValue *pSymbol = aProps.getArray();
-
- for ( sal_Int32 j = 0 ; j < XML_SYMBOL_DESCRIPTOR_MAX ; j++ )
- {
- if (pSymbol->Name.equals ( sName ) )
- {
- pSymbol->Value >>= pDescriptor[nNumFullEntries].sName;
- bHaveName = sal_True;
- }
- else if (pSymbol->Name.equals (sExportName ) )
- {
- pSymbol->Value >>= pDescriptor[nNumFullEntries].sExportName;
- bHaveExportName = sal_True;
- }
- else if (pSymbol->Name.equals (sFontName ) )
- {
- pSymbol->Value >>= pDescriptor[nNumFullEntries].sFontName;
- bHaveFontName = sal_True;
- }
- else if (pSymbol->Name.equals (sCharSet ) )
- {
- pSymbol->Value >>= pDescriptor[nNumFullEntries].nCharSet;
- bHaveCharSet = sal_True;
- }
- else if (pSymbol->Name.equals (sFamily ) )
- {
- pSymbol->Value >>= pDescriptor[nNumFullEntries].nFamily;
- bHaveFamily = sal_True;
- }
- else if (pSymbol->Name.equals (sPitch ) )
- {
- pSymbol->Value >>= pDescriptor[nNumFullEntries].nPitch;
- bHavePitch = sal_True;
- }
- else if (pSymbol->Name.equals (sWeight ) )
- {
- pSymbol->Value >>= pDescriptor[nNumFullEntries].nWeight;
- bHaveWeight = sal_True;
- }
- else if (pSymbol->Name.equals (sItalic ) )
- {
- pSymbol->Value >>= pDescriptor[nNumFullEntries].nItalic;
- bHaveItalic = sal_True;
- }
- else if (pSymbol->Name.equals (sSymbolSet ) )
- {
- pSymbol->Value >>= pDescriptor[nNumFullEntries].sSymbolSet;
- bHaveSymbolSet = sal_True;
- }
- else if (pSymbol->Name.equals (sCharacter ) )
- {
- pSymbol->Value >>= pDescriptor[nNumFullEntries].nCharacter;
- bHaveCharacter = sal_True;
- }
- pSymbol++;
- }
- if ( bHaveName && bHaveExportName && bHaveCharSet && bHaveFontName && bHaveCharacter
- && bHaveFamily && bHavePitch && bHaveWeight && bHaveItalic && bHaveSymbolSet)
- nNumFullEntries++;
- }
- }
- aSymbolList.realloc (nNumFullEntries);
- rAny <<= aSymbolList;
- }
- else
- {
- rAny <<= aProps.GetIndexContainer();
- }
- pBaseContext->AddPropertyValue();
- }
- else
- DBG_ERROR("no BaseContext");
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_ProgressBarHelper.cxx b/binfilter/bf_xmloff/source/core/xmloff_ProgressBarHelper.cxx
deleted file mode 100644
index bce1bc58ceae..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_ProgressBarHelper.cxx
+++ /dev/null
@@ -1,131 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-
-//___________________________________________________________________
-
-#include "ProgressBarHelper.hxx"
-
-#include <tools/debug.hxx>
-namespace binfilter {
-
-using namespace ::com::sun::star;
-
-const sal_Int32 nDefaultProgressBarRange = 1000000;
-const float fProgressStep = 0.5;
-
-ProgressBarHelper::ProgressBarHelper(const ::com::sun::star::uno::Reference < ::com::sun::star::task::XStatusIndicator>& xTempStatusIndicator,
- const sal_Bool bTempStrict)
- : fOldPercent(0.0),
- nRange(nDefaultProgressBarRange),
- xStatusIndicator(xTempStatusIndicator),
- nReference(100),
- nValue(0),
-#ifdef DBG_UTIL
- bFailure(sal_False),
-#endif
- bStrict(bTempStrict),
- bRepeat(sal_True)
-{
-}
-
-ProgressBarHelper::~ProgressBarHelper()
-{
-}
-
-sal_Int32 ProgressBarHelper::ChangeReference(sal_Int32 nNewReference)
-{
- if((nNewReference > 0) && (nNewReference != nReference))
- {
- if (nReference)
- {
- double fPercent(nNewReference / nReference);
- double fValue(nValue * fPercent);
- nValue = sal_Int32(nValue);
- nReference = nNewReference;
- }
- else
- {
- nReference = nNewReference;
- nValue = 0;
- }
- }
- return nValue;
-}
-
-void ProgressBarHelper::SetValue(sal_Int32 nTempValue)
-{
- if (xStatusIndicator.is() && (nReference > 0))
- {
- if ((nTempValue >= nValue) && (!bStrict || (bStrict && (nTempValue <= nReference))))
- {
- // #91317# no progress bar with values > 100%
- if (nTempValue > nReference)
- {
- if (!bRepeat)
- nValue = nReference;
- else
- {
-// xStatusIndicator->end();
-// xStatusIndicator->start();
- xStatusIndicator->reset();
- nValue = 0;
- }
- }
- else
- nValue = nTempValue;
-
- double fValue(nValue);
- double fNewValue ((fValue * nRange) / nReference);
- xStatusIndicator->setValue((sal_Int32)fNewValue);
-
- // #95181# disabled, because we want to call setValue very often to enable a good reschedule
-// double fPercent ((fNewValue * 100) / nRange);
-// if (fPercent >= (fOldPercent + fProgressStep))
-// {
-// xStatusIndicator->setValue((sal_Int32)fNewValue);
-// fOldPercent = fPercent;
-// }
- }
-#ifdef DBG_UTIL
- else if (!bFailure)
- {
- DBG_ERROR("tried to set a wrong value on the progressbar");
- bFailure = sal_True;
- }
-#endif
- }
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_PropertySetMerger.cxx b/binfilter/bf_xmloff/source/core/xmloff_PropertySetMerger.cxx
deleted file mode 100644
index cfc42bfb0fc1..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_PropertySetMerger.cxx
+++ /dev/null
@@ -1,265 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/beans/XPropertyState.hpp>
-
-#include "PropertySetMerger.hxx"
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-
-#include <cppuhelper/implbase3.hxx>
-namespace binfilter {
-
-class SvXMLAttrContainerItem_Impl;
-
-class PropertySetMergerImpl : public ::cppu::WeakAggImplHelper3< XPropertySet, XPropertyState, XPropertySetInfo >
-{
-private:
- Reference< XPropertySet > mxPropSet1;
- Reference< XPropertyState > mxPropSet1State;
- Reference< XPropertySetInfo > mxPropSet1Info;
-
- Reference< XPropertySet > mxPropSet2;
- Reference< XPropertyState > mxPropSet2State;
- Reference< XPropertySetInfo > mxPropSet2Info;
-
-public:
- PropertySetMergerImpl( const Reference< XPropertySet > rPropSet1, const Reference< XPropertySet > rPropSet2 );
- virtual ~PropertySetMergerImpl();
-
- // XPropertySet
- virtual Reference< XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(RuntimeException);
- virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const Any& aValue ) throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException);
- virtual Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException);
- virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const Reference< XPropertyChangeListener >& xListener ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException);
- virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const Reference< XPropertyChangeListener >& aListener ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException);
- virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const Reference< XVetoableChangeListener >& aListener ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException);
- virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const Reference< XVetoableChangeListener >& aListener ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException);
-
- // XPropertyState
- virtual PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) throw(UnknownPropertyException, RuntimeException);
- virtual Sequence< PropertyState > SAL_CALL getPropertyStates( const Sequence< OUString >& aPropertyName ) throw(UnknownPropertyException, RuntimeException);
- virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) throw(UnknownPropertyException, RuntimeException);
- virtual Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException);
-
- // XPropertySetInfo
- virtual Sequence< Property > SAL_CALL getProperties( ) throw(RuntimeException);
- virtual Property SAL_CALL getPropertyByName( const OUString& aName ) throw(UnknownPropertyException, RuntimeException);
- virtual sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) throw(RuntimeException);
-};
-
-// --------------------------------------------------------------------
-// Interface implementation
-// --------------------------------------------------------------------
-
-PropertySetMergerImpl::PropertySetMergerImpl( Reference< XPropertySet > rPropSet1, Reference< XPropertySet > rPropSet2 )
-: mxPropSet1( rPropSet1 ), mxPropSet2( rPropSet2 ),
- mxPropSet1State( rPropSet1, UNO_QUERY ), mxPropSet2State( rPropSet2, UNO_QUERY ),
- mxPropSet1Info( rPropSet1->getPropertySetInfo() ), mxPropSet2Info( rPropSet2->getPropertySetInfo() )
-{
-}
-
-PropertySetMergerImpl::~PropertySetMergerImpl()
-{
-}
-
-// XPropertySet
-Reference< XPropertySetInfo > SAL_CALL PropertySetMergerImpl::getPropertySetInfo( ) throw(RuntimeException)
-{
- return this;
-}
-
-void SAL_CALL PropertySetMergerImpl::setPropertyValue( const OUString& aPropertyName, const Any& aValue ) throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
-{
- if( mxPropSet1Info->hasPropertyByName( aPropertyName ) )
- {
- mxPropSet1->setPropertyValue( aPropertyName, aValue );
- }
- else
- {
- mxPropSet2->setPropertyValue( aPropertyName, aValue );
- }
-}
-
-Any SAL_CALL PropertySetMergerImpl::getPropertyValue( const OUString& PropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
-{
- if( mxPropSet1Info->hasPropertyByName( PropertyName ) )
- {
- return mxPropSet1->getPropertyValue( PropertyName );
- }
- else
- {
- return mxPropSet2->getPropertyValue( PropertyName );
- }
-}
-
-void SAL_CALL PropertySetMergerImpl::addPropertyChangeListener( const OUString& aPropertyName, const Reference< XPropertyChangeListener >& xListener ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
-{
-}
-
-void SAL_CALL PropertySetMergerImpl::removePropertyChangeListener( const OUString& aPropertyName, const Reference< XPropertyChangeListener >& aListener ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
-{
-}
-
-void SAL_CALL PropertySetMergerImpl::addVetoableChangeListener( const OUString& PropertyName, const Reference< XVetoableChangeListener >& aListener ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
-{
-}
-
-void SAL_CALL PropertySetMergerImpl::removeVetoableChangeListener( const OUString& PropertyName, const Reference< XVetoableChangeListener >& aListener ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
-{
-}
-
-// XPropertyState
-PropertyState SAL_CALL PropertySetMergerImpl::getPropertyState( const OUString& PropertyName ) throw(UnknownPropertyException, RuntimeException)
-{
- if( mxPropSet1Info->hasPropertyByName( PropertyName ) )
- {
- if( mxPropSet1State.is() )
- {
- return mxPropSet1State->getPropertyState( PropertyName );
- }
- else
- {
- return PropertyState_DIRECT_VALUE;
- }
- }
- else
- {
- if( mxPropSet2State.is() )
- {
- return mxPropSet2State->getPropertyState( PropertyName );
- }
- else
- {
- return PropertyState_DIRECT_VALUE;
- }
- }
-}
-
-Sequence< PropertyState > SAL_CALL PropertySetMergerImpl::getPropertyStates( const Sequence< OUString >& aPropertyName ) throw(UnknownPropertyException, RuntimeException)
-{
- const sal_Int32 nCount = aPropertyName.getLength();
- Sequence< PropertyState > aPropStates( nCount );
- PropertyState* pPropStates = aPropStates.getArray();
- const OUString* pPropNames = aPropertyName.getConstArray();
-
- sal_Int32 nIndex;
- for( nIndex = 0; nIndex < nCount; nIndex++ )
- *pPropStates++ = getPropertyState( *pPropNames++ );
-
- return aPropStates;
-}
-
-void SAL_CALL PropertySetMergerImpl::setPropertyToDefault( const OUString& PropertyName ) throw(UnknownPropertyException, RuntimeException)
-{
- if( mxPropSet1State.is() && mxPropSet1Info->hasPropertyByName( PropertyName ) )
- {
- mxPropSet1State->setPropertyToDefault( PropertyName );
- }
- else
- {
- if( mxPropSet2State.is() )
- {
- mxPropSet2State->setPropertyToDefault( PropertyName );
- }
- }
-}
-
-Any SAL_CALL PropertySetMergerImpl::getPropertyDefault( const OUString& aPropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
-{
- if( mxPropSet1State.is() && mxPropSet1Info->hasPropertyByName( aPropertyName ) )
- {
- return mxPropSet1State->getPropertyDefault( aPropertyName );
- }
- else
- {
- if( mxPropSet2State.is() )
- {
- return mxPropSet2State->getPropertyDefault( aPropertyName );
- }
- else
- {
- Any aAny;
- return aAny;
- }
- }
-}
-
-// XPropertySetInfo
-Sequence< Property > SAL_CALL PropertySetMergerImpl::getProperties() throw(RuntimeException)
-{
- Sequence< Property > aProps1( mxPropSet1Info->getProperties() );
- const Property* pProps1 = aProps1.getArray();
- const sal_Int32 nCount1 = aProps1.getLength();
-
- Sequence< Property > aProps2( mxPropSet1Info->getProperties() );
- const Property* pProps2 = aProps2.getArray();
- const sal_Int32 nCount2 = aProps2.getLength();
-
- Sequence< Property > aProperties( nCount1 + nCount2 );
-
- sal_Int32 nIndex;
-
- Property* pProperties = aProperties.getArray();
-
- for( nIndex = 0; nIndex < nCount1; nIndex++ )
- *pProperties++ = *pProps1++;
-
- for( nIndex = 0; nIndex < nCount2; nIndex++ )
- *pProperties++ = *pProps2++;
-
- return aProperties;
-}
-
-Property SAL_CALL PropertySetMergerImpl::getPropertyByName( const OUString& aName ) throw(UnknownPropertyException, RuntimeException)
-{
- if( mxPropSet1Info->hasPropertyByName( aName ) )
- return mxPropSet1Info->getPropertyByName( aName );
-
- return mxPropSet2Info->getPropertyByName( aName );
-}
-
-sal_Bool SAL_CALL PropertySetMergerImpl::hasPropertyByName( const OUString& Name ) throw(RuntimeException)
-{
- if(mxPropSet1Info->hasPropertyByName( Name ) )
- return sal_True;
-
- return mxPropSet2Info->hasPropertyByName( Name );
-}
-
-Reference< XPropertySet > PropertySetMerger_CreateInstance( Reference< XPropertySet > rPropSet1, Reference< XPropertySet > rPropSet2 ) throw()
-{
- return new PropertySetMergerImpl( rPropSet1, rPropSet2 );
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_SettingsExportHelper.cxx b/binfilter/bf_xmloff/source/core/xmloff_SettingsExportHelper.cxx
deleted file mode 100644
index 5f1affb42921..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_SettingsExportHelper.cxx
+++ /dev/null
@@ -1,517 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "SettingsExportHelper.hxx"
-
-#include "xmlnmspe.hxx"
-#include "xmluconv.hxx"
-#include <tools/debug.hxx>
-#include <comphelper/extract.hxx>
-
-#include <com/sun/star/linguistic2/XSupportedLocales.hpp>
-#include <com/sun/star/i18n/XForbiddenCharacters.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/util/DateTime.hpp>
-#include <com/sun/star/container/XIndexContainer.hpp>
-#include <com/sun/star/document/PrinterIndependentLayout.hpp>
-#include <xmlenums.hxx>
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-XMLSettingsExportHelper::XMLSettingsExportHelper(SvXMLExport& rTempExport)
- : rExport(rTempExport)
-{
-}
-
-XMLSettingsExportHelper::~XMLSettingsExportHelper()
-{
-}
-
-
-/** function to allow changing the API and XML representation;
- implementation below */
-void lcl_manipulateSetting( uno::Any&, const ::rtl::OUString& );
-
-
-void XMLSettingsExportHelper::CallTypeFunction(const uno::Any& rAny,
- const ::rtl::OUString& rName) const
-{
- uno::Any aAny( rAny );
- lcl_manipulateSetting( aAny, rName );
-
- uno::TypeClass eClass = aAny.getValueTypeClass();
- switch (eClass)
- {
- case uno::TypeClass_VOID:
- {
- /*
- * This assertion pops up when exporting values which are set to:
- * PropertyAttribute::MAYBEVOID, and thus are _supposed_ to have
- * a VOID value...so I'm removing it ...mtg
- * DBG_ERROR("no type");
- */
- }
- break;
- case uno::TypeClass_BOOLEAN:
- {
- exportBool(::cppu::any2bool(aAny), rName);
- }
- break;
- case uno::TypeClass_BYTE:
- {
- sal_Int8 nInt8;
- aAny >>= nInt8;
- exportByte(nInt8, rName);
- }
- break;
- case uno::TypeClass_SHORT:
- {
- sal_Int16 nInt16;
- aAny >>= nInt16;
- exportShort(nInt16, rName);
- }
- break;
- case uno::TypeClass_LONG:
- {
- sal_Int32 nInt32;
- aAny >>= nInt32;
- exportInt(nInt32, rName);
- }
- break;
- case uno::TypeClass_HYPER:
- {
- sal_Int64 nInt64;
- aAny >>= nInt64;
- exportLong(nInt64, rName);
- }
- break;
- case uno::TypeClass_DOUBLE:
- {
- double fDouble;
- aAny >>= fDouble;
- exportDouble(fDouble, rName);
- }
- break;
- case uno::TypeClass_STRING:
- {
- ::rtl::OUString sString;
- aAny >>= sString;
- exportString(sString, rName);
- }
- break;
- default:
- {
- uno::Type aType = aAny.getValueType();
- if (aType.equals(getCppuType( (uno::Sequence<beans::PropertyValue> *)0 ) ) )
- {
- uno::Sequence< beans::PropertyValue> aProps;
- aAny >>= aProps;
- exportSequencePropertyValue(aProps, rName);
- }
- else if( aType.equals(getCppuType( (uno::Sequence<sal_Int8> *)0 ) ) )
- {
- uno::Sequence< sal_Int8 > aProps;
- aAny >>= aProps;
- exportbase64Binary(aProps, rName);
- }
- else if (aType.equals(getCppuType( (uno::Reference<container::XNameContainer> *)0 ) ) ||
- aType.equals(getCppuType( (uno::Reference<container::XNameAccess> *)0 ) ))
- {
- uno::Reference< container::XNameAccess> aNamed;
- aAny >>= aNamed;
- exportNameAccess(aNamed, rName);
- }
- else if (aType.equals(getCppuType( (uno::Reference<container::XIndexAccess> *)0 ) ) ||
- aType.equals(getCppuType( (uno::Reference<container::XIndexContainer> *)0 ) ) )
- {
- uno::Reference<container::XIndexAccess> aIndexed;
- aAny >>= aIndexed;
- exportIndexAccess(aIndexed, rName);
- }
- else if (aType.equals(getCppuType( (util::DateTime *)0 ) ) )
- {
- util::DateTime aDateTime;
- aAny >>= aDateTime;
- exportDateTime(aDateTime, rName);
- }
- else if( aType.equals(getCppuType( (uno::Reference<i18n::XForbiddenCharacters> *)0 ) ) )
- {
- exportForbiddenCharacters( aAny, rName );
- }
- else if( aType.equals(getCppuType( (uno::Sequence<formula::SymbolDescriptor> *)0 ) ) )
- {
- uno::Sequence< formula::SymbolDescriptor > aProps;
- aAny >>= aProps;
- exportSymbolDescriptors(aProps, rName);
- }
- else
- DBG_ERROR("this type is not implemented now");
- }
- break;
- }
-}
-
-void XMLSettingsExportHelper::exportBool(const sal_Bool bValue, const ::rtl::OUString& rName) const
-{
- DBG_ASSERT(rName.getLength(), "no name");
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_BOOLEAN);
- SvXMLElementExport aBoolElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
- ::rtl::OUString sValue;
- if (bValue)
- sValue = GetXMLToken(XML_TRUE);
- else
- sValue = GetXMLToken(XML_FALSE);
- rExport.GetDocHandler()->characters(sValue);
-}
-
-void XMLSettingsExportHelper::exportByte(const sal_Int8 nValue, const ::rtl::OUString& rName) const
-{
- DBG_ASSERT(rName.getLength(), "no name");
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_BYTE);
- SvXMLElementExport aShortElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
- ::rtl::OUStringBuffer sBuffer;
- SvXMLUnitConverter::convertNumber(sBuffer, sal_Int32(nValue));
- rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear());
-}
-void XMLSettingsExportHelper::exportShort(const sal_Int16 nValue, const ::rtl::OUString& rName) const
-{
- DBG_ASSERT(rName.getLength(), "no name");
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_SHORT);
- SvXMLElementExport aShortElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
- ::rtl::OUStringBuffer sBuffer;
- SvXMLUnitConverter::convertNumber(sBuffer, sal_Int32(nValue));
- rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear());
-}
-
-void XMLSettingsExportHelper::exportInt(const sal_Int32 nValue, const ::rtl::OUString& rName) const
-{
- DBG_ASSERT(rName.getLength(), "no name");
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_INT);
- SvXMLElementExport aIntElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
- ::rtl::OUStringBuffer sBuffer;
- SvXMLUnitConverter::convertNumber(sBuffer, nValue);
- rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear());
-}
-
-void XMLSettingsExportHelper::exportLong(const sal_Int64 nValue, const ::rtl::OUString& rName) const
-{
- DBG_ASSERT(rName.getLength(), "no name");
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_LONG);
- SvXMLElementExport aIntElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
- ::rtl::OUString sValue( ::rtl::OUString::valueOf(nValue));
- rExport.GetDocHandler()->characters(sValue);
-}
-
-void XMLSettingsExportHelper::exportDouble(const double fValue, const ::rtl::OUString& rName) const
-{
- DBG_ASSERT(rName.getLength(), "no name");
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_DOUBLE);
- SvXMLElementExport aDoubleElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
- ::rtl::OUStringBuffer sBuffer;
- SvXMLUnitConverter::convertDouble(sBuffer, fValue);
- rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear());
-}
-
-void XMLSettingsExportHelper::exportString(const ::rtl::OUString& sValue, const ::rtl::OUString& rName) const
-{
- DBG_ASSERT(rName.getLength(), "no name");
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_STRING);
- SvXMLElementExport aDoubleElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
- if (sValue.getLength())
- rExport.GetDocHandler()->characters(sValue);
-}
-
-void XMLSettingsExportHelper::exportDateTime(const util::DateTime& aValue, const ::rtl::OUString& rName) const
-{
- DBG_ASSERT(rName.getLength(), "no name");
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_DATETIME);
- ::rtl::OUStringBuffer sBuffer;
- SvXMLUnitConverter::convertDateTime(sBuffer, aValue);
- SvXMLElementExport aDoubleElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
- rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear());
-}
-
-void XMLSettingsExportHelper::exportSequencePropertyValue(
- const uno::Sequence<beans::PropertyValue>& aProps,
- const ::rtl::OUString& rName) const
-{
- DBG_ASSERT(rName.getLength(), "no name");
- sal_Int32 nLength(aProps.getLength());
- if(nLength)
- {
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- SvXMLElementExport aSequenceElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM_SET, sal_True, sal_True);
- for (sal_Int32 i = 0; i < nLength; i++)
- CallTypeFunction(aProps[i].Value, aProps[i].Name);
- }
-}
-void XMLSettingsExportHelper::exportSymbolDescriptors(
- const uno::Sequence < formula::SymbolDescriptor > &rProps,
- const ::rtl::OUString rName) const
-{
- // #110680#
- // uno::Reference< lang::XMultiServiceFactory > xServiceFactory( comphelper::getProcessServiceFactory() );
- uno::Reference< lang::XMultiServiceFactory > xServiceFactory( rExport.getServiceFactory() );
- DBG_ASSERT( xServiceFactory.is(), "XMLSettingsExportHelper::exportSymbolDescriptors: got no service manager" );
-
- if( xServiceFactory.is() )
- {
- uno::Reference< container::XIndexContainer > xBox(xServiceFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.document.IndexedPropertyValues") ) ), uno::UNO_QUERY);
- DBG_ASSERT( xBox.is(), "could not create service com.sun.star.document.IndexedPropertyValues" );
- if (xBox.is() )
- {
- const ::rtl::OUString sName ( RTL_CONSTASCII_USTRINGPARAM ( "Name" ) );
- const ::rtl::OUString sExportName ( RTL_CONSTASCII_USTRINGPARAM ( "ExportName" ) );
- const ::rtl::OUString sSymbolSet ( RTL_CONSTASCII_USTRINGPARAM ( "SymbolSet" ) );
- const ::rtl::OUString sCharacter ( RTL_CONSTASCII_USTRINGPARAM ( "Character" ) );
- const ::rtl::OUString sFontName ( RTL_CONSTASCII_USTRINGPARAM ( "FontName" ) );
- const ::rtl::OUString sCharSet ( RTL_CONSTASCII_USTRINGPARAM ( "CharSet" ) );
- const ::rtl::OUString sFamily ( RTL_CONSTASCII_USTRINGPARAM ( "Family" ) );
- const ::rtl::OUString sPitch ( RTL_CONSTASCII_USTRINGPARAM ( "Pitch" ) );
- const ::rtl::OUString sWeight ( RTL_CONSTASCII_USTRINGPARAM ( "Weight" ) );
- const ::rtl::OUString sItalic ( RTL_CONSTASCII_USTRINGPARAM ( "Italic" ) );
-
- sal_Int32 nCount = rProps.getLength();
- const formula::SymbolDescriptor *pDescriptor = rProps.getConstArray();
-
- for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++, pDescriptor++ )
- {
- uno::Sequence < beans::PropertyValue > aSequence ( XML_SYMBOL_DESCRIPTOR_MAX );
- beans::PropertyValue *pSymbol = aSequence.getArray();
-
- pSymbol[XML_SYMBOL_DESCRIPTOR_NAME].Name = sName;
- pSymbol[XML_SYMBOL_DESCRIPTOR_NAME].Value <<= pDescriptor->sName;
- pSymbol[XML_SYMBOL_DESCRIPTOR_EXPORT_NAME].Name = sExportName;
- pSymbol[XML_SYMBOL_DESCRIPTOR_EXPORT_NAME].Value<<= pDescriptor->sExportName;
- pSymbol[XML_SYMBOL_DESCRIPTOR_FONT_NAME].Name = sFontName;
- pSymbol[XML_SYMBOL_DESCRIPTOR_FONT_NAME].Value <<= pDescriptor->sFontName;
- pSymbol[XML_SYMBOL_DESCRIPTOR_CHAR_SET].Name = sCharSet;
- pSymbol[XML_SYMBOL_DESCRIPTOR_CHAR_SET].Value <<= pDescriptor->nCharSet;
- pSymbol[XML_SYMBOL_DESCRIPTOR_FAMILY].Name = sFamily;
- pSymbol[XML_SYMBOL_DESCRIPTOR_FAMILY].Value <<= pDescriptor->nFamily;
- pSymbol[XML_SYMBOL_DESCRIPTOR_PITCH].Name = sPitch;
- pSymbol[XML_SYMBOL_DESCRIPTOR_PITCH].Value <<= pDescriptor->nPitch;
- pSymbol[XML_SYMBOL_DESCRIPTOR_WEIGHT].Name = sWeight;
- pSymbol[XML_SYMBOL_DESCRIPTOR_WEIGHT].Value <<= pDescriptor->nWeight;
- pSymbol[XML_SYMBOL_DESCRIPTOR_ITALIC].Name = sItalic;
- pSymbol[XML_SYMBOL_DESCRIPTOR_ITALIC].Value <<= pDescriptor->nItalic;
- pSymbol[XML_SYMBOL_DESCRIPTOR_SYMBOL_SET].Name = sSymbolSet;
- pSymbol[XML_SYMBOL_DESCRIPTOR_SYMBOL_SET].Value <<= pDescriptor->sSymbolSet;
- pSymbol[XML_SYMBOL_DESCRIPTOR_CHARACTER].Name = sCharacter;
- pSymbol[XML_SYMBOL_DESCRIPTOR_CHARACTER].Value <<= pDescriptor->nCharacter;
-
- xBox->insertByIndex(nIndex, uno::makeAny( aSequence ));
- }
-
- uno::Reference< container::XIndexAccess > xIA( xBox, uno::UNO_QUERY );
- exportIndexAccess( xIA, rName );
- }
- }
-}
-void XMLSettingsExportHelper::exportbase64Binary(
- const uno::Sequence<sal_Int8>& aProps,
- const ::rtl::OUString& rName) const
-{
- DBG_ASSERT(rName.getLength(), "no name");
- sal_Int32 nLength(aProps.getLength());
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_BASE64BINARY);
- SvXMLElementExport aDoubleElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
- if(nLength)
- {
- ::rtl::OUStringBuffer sBuffer;
- SvXMLUnitConverter::encodeBase64(sBuffer, aProps);
- rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear());
- }
-}
-
-void XMLSettingsExportHelper::exportMapEntry(const uno::Any& rAny,
- const ::rtl::OUString& rName,
- const sal_Bool bNameAccess) const
-{
- DBG_ASSERT((bNameAccess && rName.getLength()) || !bNameAccess, "no name");
- uno::Sequence<beans::PropertyValue> aProps;
- rAny >>= aProps;
- sal_Int32 nLength = aProps.getLength();
- if (nLength)
- {
- if (bNameAccess)
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- SvXMLElementExport aEntryElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM_MAP_ENTRY, sal_True, sal_True);
- for (sal_Int32 i = 0; i < nLength; i++)
- CallTypeFunction(aProps[i].Value, aProps[i].Name);
- }
-}
-
-void XMLSettingsExportHelper::exportNameAccess(
- const uno::Reference<container::XNameAccess>& aNamed,
- const ::rtl::OUString& rName) const
-{
- DBG_ASSERT(rName.getLength(), "no name");
- DBG_ASSERT(aNamed->getElementType().equals(getCppuType( (uno::Sequence<beans::PropertyValue> *)0 ) ),
- "wrong NameAccess" );
- if(aNamed->hasElements())
- {
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- SvXMLElementExport aNamedElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM_MAP_NAMED, sal_True, sal_True);
- uno::Sequence< ::rtl::OUString > aNames(aNamed->getElementNames());
- for (sal_Int32 i = 0; i < aNames.getLength(); i++)
- exportMapEntry(aNamed->getByName(aNames[i]), aNames[i], sal_True);
- }
-}
-
-void XMLSettingsExportHelper::exportIndexAccess(
- const uno::Reference<container::XIndexAccess> aIndexed,
- const ::rtl::OUString rName) const
-{
- DBG_ASSERT(rName.getLength(), "no name");
- DBG_ASSERT(aIndexed->getElementType().equals(getCppuType( (uno::Sequence<beans::PropertyValue> *)0 ) ),
- "wrong NameAccess" );
- ::rtl::OUString sEmpty;// ( RTLCONSTASCII_USTRINGPARAM( "View" ) );
- if(aIndexed->hasElements())
- {
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- SvXMLElementExport aIndexedElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM_MAP_INDEXED, sal_True, sal_True);
- sal_Int32 nCount = aIndexed->getCount();
- for (sal_Int32 i = 0; i < nCount; i++)
- {
- exportMapEntry(aIndexed->getByIndex(i), sEmpty, sal_False);
- }
- }
-}
-
-void XMLSettingsExportHelper::exportForbiddenCharacters(
- const uno::Any &rAny,
- const ::rtl::OUString rName) const
-{
- uno::Reference<i18n::XForbiddenCharacters> xForbChars;
- uno::Reference<linguistic2::XSupportedLocales> xLocales;
-
- rAny >>= xForbChars;
- rAny >>= xLocales;
-
- DBG_ASSERT( xForbChars.is() && xLocales.is(),"XMLSettingsExportHelper::exportForbiddenCharacters: got illegal forbidden characters!" );
-
- if( !xForbChars.is() || !xLocales.is() )
- return;
-
- // #110680#
- // uno::Reference< lang::XMultiServiceFactory > xServiceFactory( comphelper::getProcessServiceFactory() );
- uno::Reference< lang::XMultiServiceFactory > xServiceFactory( rExport.getServiceFactory() );
- DBG_ASSERT( xServiceFactory.is(), "XMLSettingsExportHelper::exportForbiddenCharacters: got no service manager" );
-
- if( xServiceFactory.is() )
- {
- uno::Reference< container::XIndexContainer > xBox(xServiceFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.document.IndexedPropertyValues") ) ), uno::UNO_QUERY);
- DBG_ASSERT( xBox.is(), "could not create service com.sun.star.document.IndexedPropertyValues" );
- if (xBox.is() )
- {
- const uno::Sequence< lang::Locale > aLocales( xLocales->getLocales() );
- const lang::Locale* pLocales = aLocales.getConstArray();
-
- const sal_Int32 nCount = aLocales.getLength();
-
- const ::rtl::OUString sLanguage ( RTL_CONSTASCII_USTRINGPARAM ( "Language" ) );
- const ::rtl::OUString sCountry ( RTL_CONSTASCII_USTRINGPARAM ( "Country" ) );
- const ::rtl::OUString sVariant ( RTL_CONSTASCII_USTRINGPARAM ( "Variant" ) );
- const ::rtl::OUString sBeginLine ( RTL_CONSTASCII_USTRINGPARAM ( "BeginLine" ) );
- const ::rtl::OUString sEndLine ( RTL_CONSTASCII_USTRINGPARAM ( "EndLine" ) );
-
- for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++, pLocales++ )
- {
- const i18n::ForbiddenCharacters aChars( xForbChars->getForbiddenCharacters( *pLocales ) );
-
-
- uno::Sequence < beans::PropertyValue > aSequence ( XML_FORBIDDEN_CHARACTER_MAX );
- beans::PropertyValue *pForChar = aSequence.getArray();
-
- pForChar[XML_FORBIDDEN_CHARACTER_LANGUAGE].Name = sLanguage;
- pForChar[XML_FORBIDDEN_CHARACTER_LANGUAGE].Value <<= pLocales->Language;
- pForChar[XML_FORBIDDEN_CHARACTER_COUNTRY].Name = sCountry;
- pForChar[XML_FORBIDDEN_CHARACTER_COUNTRY].Value <<= pLocales->Country;
- pForChar[XML_FORBIDDEN_CHARACTER_VARIANT].Name = sVariant;
- pForChar[XML_FORBIDDEN_CHARACTER_VARIANT].Value <<= pLocales->Variant;
- pForChar[XML_FORBIDDEN_CHARACTER_BEGIN_LINE].Name = sBeginLine;
- pForChar[XML_FORBIDDEN_CHARACTER_BEGIN_LINE].Value <<= aChars.beginLine;
- pForChar[XML_FORBIDDEN_CHARACTER_END_LINE].Name = sEndLine;
- pForChar[XML_FORBIDDEN_CHARACTER_END_LINE].Value <<= aChars.endLine;
- xBox->insertByIndex(nIndex, uno::makeAny( aSequence ));
- }
-
- uno::Reference< container::XIndexAccess > xIA( xBox, uno::UNO_QUERY );
- exportIndexAccess( xIA, rName );
- }
- }
-}
-
-void XMLSettingsExportHelper::exportSettings(
- const uno::Sequence<beans::PropertyValue>& aProps,
- const ::rtl::OUString& rName) const
-{
- DBG_ASSERT(rName.getLength(), "no name");
- DBG_ASSERT(aProps.getLength(), "no properties to export");
- exportSequencePropertyValue(aProps, rName);
-}
-
-
-/** For some settings we may want to change their API representation
- * from their XML settings representation. This is your chance to do
- * so!
- */
-void lcl_manipulateSetting(
- uno::Any& rAny,
- const ::rtl::OUString& rName )
-{
- if( rName.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM( "PrinterIndependentLayout" ) ) )
- {
- sal_Int16 nTmp;
- if( rAny >>= nTmp )
- {
- if( nTmp == document::PrinterIndependentLayout::LOW_RESOLUTION )
- rAny <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("low-resolution"));
- else if( nTmp == document::PrinterIndependentLayout::DISABLED )
- rAny <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("disabled"));
- else if( nTmp == document::PrinterIndependentLayout::HIGH_RESOLUTION )
- rAny <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("high-resolution"));
- }
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_XMLBase64Export.cxx b/binfilter/bf_xmloff/source/core/xmloff_XMLBase64Export.cxx
deleted file mode 100644
index 02e62b866d32..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_XMLBase64Export.cxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <com/sun/star/io/XInputStream.hpp>
-
-#include "xmluconv.hxx"
-#include "xmlexp.hxx"
-#include "xmlnmspe.hxx"
-
-#include "XMLBase64Export.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::io;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-#define INPUT_BUFFER_SIZE 54
-#define OUTPUT_BUFFER_SIZE 72
-
-XMLBase64Export::XMLBase64Export( SvXMLExport& rExp ) :
- rExport( rExp ){
-}
-
-sal_Bool XMLBase64Export::exportXML( const Reference < XInputStream> & rIn )
-{
- sal_Bool bRet = sal_True;
- try
- {
- Sequence < sal_Int8 > aInBuff( INPUT_BUFFER_SIZE );
- OUStringBuffer aOutBuff( OUTPUT_BUFFER_SIZE );
- sal_Int32 nRead;
- do
- {
- nRead = rIn->readBytes( aInBuff, INPUT_BUFFER_SIZE );
- if( nRead > 0 )
- {
- GetExport().GetMM100UnitConverter().encodeBase64( aOutBuff,
- aInBuff );
- GetExport().Characters( aOutBuff.makeStringAndClear() );
- if( nRead == INPUT_BUFFER_SIZE )
- GetExport().IgnorableWhitespace();
- }
- }
- while( nRead == INPUT_BUFFER_SIZE );
- }
- catch( ... )
- {
- bRet = sal_False;
- }
-
- return bRet;
-}
-
-sal_Bool XMLBase64Export::exportElement(
- const Reference < XInputStream > & rIn,
- sal_uInt16 nNamespace,
- enum ::binfilter::xmloff::token::XMLTokenEnum eName )
-{
- SvXMLElementExport aElem( GetExport(), nNamespace, eName, sal_True,
- sal_True );
- return exportXML( rIn );
-}
-
-sal_Bool XMLBase64Export::exportOfficeBinaryDataElement(
- const Reference < XInputStream > & rIn )
-{
- return exportElement( rIn, XML_NAMESPACE_OFFICE,
- ::binfilter::xmloff::token::XML_BINARY_DATA );
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_XMLBase64ImportContext.cxx b/binfilter/bf_xmloff/source/core/xmloff_XMLBase64ImportContext.cxx
deleted file mode 100644
index dfc3187b7082..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_XMLBase64ImportContext.cxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "xmlimp.hxx"
-#include "xmluconv.hxx"
-
-#include <com/sun/star/io/XOutputStream.hpp>
-
-#include "XMLBase64ImportContext.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::io;
-
-using rtl::OUString;
-
-//-----------------------------------------------------------------------------
-
-TYPEINIT1( XMLBase64ImportContext, SvXMLImportContext );
-
-
-XMLBase64ImportContext::XMLBase64ImportContext(
- SvXMLImport& rImport, USHORT nPrfx, const OUString& rLName,
- const Reference< XAttributeList >& xAttrList,
- const Reference< XOutputStream >& rOut ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- xOut( rOut )
-{
-}
-
-XMLBase64ImportContext::~XMLBase64ImportContext()
-{
-}
-
-
-void XMLBase64ImportContext::EndElement()
-{
- xOut->closeOutput();
-}
-
-void XMLBase64ImportContext::Characters( const ::rtl::OUString& rChars )
-{
- OUString sTrimmedChars( rChars. trim() );
- if( sTrimmedChars.getLength() )
- {
- OUString sChars;
- if( sBase64CharsLeft )
- {
- sChars = sBase64CharsLeft;
- sChars += sTrimmedChars;
- sBase64CharsLeft = OUString();
- }
- else
- {
- sChars = sTrimmedChars;
- }
- Sequence< sal_Int8 > aBuffer( (sChars.getLength() / 4) * 3 );
- sal_Int32 nCharsDecoded =
- GetImport().GetMM100UnitConverter().
- decodeBase64SomeChars( aBuffer, sChars );
- xOut->writeBytes( aBuffer );
- if( nCharsDecoded != sChars.getLength() )
- sBase64CharsLeft = sChars.copy( nCharsDecoded );
- }
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_XMLBasicExportFilter.cxx b/binfilter/bf_xmloff/source/core/xmloff_XMLBasicExportFilter.cxx
deleted file mode 100644
index 87b74300aefc..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_XMLBasicExportFilter.cxx
+++ /dev/null
@@ -1,135 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLBasicExportFilter.hxx"
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-
-
-//.........................................................................
-namespace binfilter
-{
-//.........................................................................
-
- // =============================================================================
- // XMLBasicExportFilter
- // =============================================================================
-
- XMLBasicExportFilter::XMLBasicExportFilter( const Reference< xml::sax::XDocumentHandler >& rxHandler )
- :m_xHandler( rxHandler )
- {
- }
-
- // -----------------------------------------------------------------------------
-
- XMLBasicExportFilter::~XMLBasicExportFilter()
- {
- }
-
- // -----------------------------------------------------------------------------
- // XDocumentHandler
- // -----------------------------------------------------------------------------
-
- void XMLBasicExportFilter::startDocument()
- throw (xml::sax::SAXException, RuntimeException)
- {
- // do nothing, filter this
- }
-
- // -----------------------------------------------------------------------------
-
- void XMLBasicExportFilter::endDocument()
- throw (xml::sax::SAXException, RuntimeException)
- {
- // do nothing, filter this
- }
-
- // -----------------------------------------------------------------------------
-
- void XMLBasicExportFilter::startElement( const ::rtl::OUString& aName,
- const Reference< xml::sax::XAttributeList >& xAttribs )
- throw (xml::sax::SAXException, RuntimeException)
- {
- if ( m_xHandler.is() )
- m_xHandler->startElement( aName, xAttribs );
- }
-
- // -----------------------------------------------------------------------------
-
- void XMLBasicExportFilter::endElement( const ::rtl::OUString& aName )
- throw (xml::sax::SAXException, RuntimeException)
- {
- if ( m_xHandler.is() )
- m_xHandler->endElement( aName );
- }
-
- // -----------------------------------------------------------------------------
-
- void XMLBasicExportFilter::characters( const ::rtl::OUString& aChars )
- throw (xml::sax::SAXException, RuntimeException)
- {
- if ( m_xHandler.is() )
- m_xHandler->characters( aChars );
- }
-
- // -----------------------------------------------------------------------------
-
- void XMLBasicExportFilter::ignorableWhitespace( const ::rtl::OUString& aWhitespaces )
- throw (xml::sax::SAXException, RuntimeException)
- {
- if ( m_xHandler.is() )
- m_xHandler->ignorableWhitespace( aWhitespaces );
- }
-
- // -----------------------------------------------------------------------------
-
- void XMLBasicExportFilter::processingInstruction( const ::rtl::OUString& aTarget,
- const ::rtl::OUString& aData )
- throw (xml::sax::SAXException, RuntimeException)
- {
- if ( m_xHandler.is() )
- m_xHandler->processingInstruction( aTarget, aData );
- }
-
- // -----------------------------------------------------------------------------
-
- void XMLBasicExportFilter::setDocumentLocator( const Reference< xml::sax::XLocator >& xLocator )
- throw (xml::sax::SAXException, RuntimeException)
- {
- if ( m_xHandler.is() )
- m_xHandler->setDocumentLocator( xLocator );
- }
-
- // -----------------------------------------------------------------------------
-
-//.........................................................................
-} // namespace binfilter
-//.........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_XMLEmbeddedObjectExportFilter.cxx b/binfilter/bf_xmloff/source/core/xmloff_XMLEmbeddedObjectExportFilter.cxx
deleted file mode 100644
index d7f894aea5d0..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_XMLEmbeddedObjectExportFilter.cxx
+++ /dev/null
@@ -1,180 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLEmbeddedObjectExportFilter.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::xml::sax;
-
-
-XMLEmbeddedObjectExportFilter::XMLEmbeddedObjectExportFilter(
- const Reference< XDocumentHandler > & rHandler ) throw() :
- xHandler( rHandler ),
- xExtHandler( rHandler, UNO_QUERY )
-{
-}
-
-XMLEmbeddedObjectExportFilter::~XMLEmbeddedObjectExportFilter () throw()
-{
-}
-
-
-void SAL_CALL XMLEmbeddedObjectExportFilter::startDocument( void )
- throw( SAXException, RuntimeException )
-{
- // do nothing, filter this
-}
-
-void SAL_CALL XMLEmbeddedObjectExportFilter::endDocument( void )
- throw( SAXException, RuntimeException)
-{
- // do nothing, filter this
-}
-
-void SAL_CALL XMLEmbeddedObjectExportFilter::startElement(
- const OUString& rName,
- const Reference< XAttributeList >& xAttrList )
- throw(SAXException, RuntimeException)
-{
- xHandler->startElement( rName, xAttrList );
-}
-
-void SAL_CALL XMLEmbeddedObjectExportFilter::endElement( const OUString& rName )
- throw(SAXException, RuntimeException)
-{
- xHandler->endElement( rName );
-}
-
-void SAL_CALL XMLEmbeddedObjectExportFilter::characters( const OUString& rChars )
- throw(SAXException, RuntimeException)
-{
- xHandler->characters( rChars );
-}
-
-void SAL_CALL XMLEmbeddedObjectExportFilter::ignorableWhitespace(
- const OUString& rWhitespaces )
- throw(SAXException, RuntimeException)
-{
- xHandler->ignorableWhitespace( rWhitespaces );
-}
-
-void SAL_CALL XMLEmbeddedObjectExportFilter::processingInstruction(
- const OUString& rTarget,
- const OUString& rData )
- throw(SAXException, RuntimeException)
-{
- xHandler->processingInstruction( rTarget, rData );
-}
-
-void SAL_CALL XMLEmbeddedObjectExportFilter::setDocumentLocator(
- const Reference< XLocator >& rLocator )
- throw(SAXException, RuntimeException)
-{
- xHandler->setDocumentLocator( rLocator );
-}
-
-// XExtendedDocumentHandler
-void SAL_CALL XMLEmbeddedObjectExportFilter::startCDATA( void )
- throw(SAXException, RuntimeException)
-{
- if( xExtHandler.is() )
- xExtHandler->startCDATA();
-}
-
-void SAL_CALL XMLEmbeddedObjectExportFilter::endCDATA( void )
- throw(RuntimeException)
-{
- if( xExtHandler.is() )
- xExtHandler->endCDATA();
-}
-
-void SAL_CALL XMLEmbeddedObjectExportFilter::comment( const OUString& rComment )
- throw(SAXException, RuntimeException)
-{
- if( xExtHandler.is() )
- xExtHandler->comment( rComment );
-}
-
-void SAL_CALL XMLEmbeddedObjectExportFilter::allowLineBreak( void )
- throw(SAXException, RuntimeException)
-{
- if( xExtHandler.is() )
- xExtHandler->allowLineBreak();
-}
-
-void SAL_CALL XMLEmbeddedObjectExportFilter::unknown( const OUString& rString )
- throw(SAXException, RuntimeException)
-{
- if( xExtHandler.is() )
- xExtHandler->unknown( rString );
-}
-
-// XInitialize
-void SAL_CALL XMLEmbeddedObjectExportFilter::initialize(
- const Sequence< Any >& aArguments )
- throw(Exception, RuntimeException)
-{
- const sal_Int32 nAnyCount = aArguments.getLength();
- const Any* pAny = aArguments.getConstArray();
-
- for( sal_Int32 nIndex = 0; nIndex < nAnyCount; nIndex++, pAny++ )
- {
- if( pAny->getValueType() ==
- ::getCppuType((const Reference< XDocumentHandler >*)0))
- {
- *pAny >>= xHandler;
- *pAny >>= xExtHandler;
- }
- }
-}
-
-// XServiceInfo
-OUString SAL_CALL XMLEmbeddedObjectExportFilter::getImplementationName()
- throw(RuntimeException)
-{
- OUString aStr;
- return aStr;
-}
-
-sal_Bool SAL_CALL XMLEmbeddedObjectExportFilter::supportsService( const OUString& ServiceName )
- throw(RuntimeException)
-{
- return sal_False;
-}
-
-Sequence< OUString > SAL_CALL XMLEmbeddedObjectExportFilter::getSupportedServiceNames( )
- throw(RuntimeException)
-{
- Sequence< OUString > aSeq;
- return aSeq;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_XMLEmbeddedObjectImportContext.cxx b/binfilter/bf_xmloff/source/core/xmloff_XMLEmbeddedObjectImportContext.cxx
deleted file mode 100644
index 07153cd0c5dd..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_XMLEmbeddedObjectImportContext.cxx
+++ /dev/null
@@ -1,347 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/frame/XStorable.hpp>
-
-#include <tools/globname.hxx>
-#include <sot/clsids.hxx>
-
-#include "nmspmap.hxx"
-#include "xmlimp.hxx"
-#include "xmlnmspe.hxx"
-#include "xmlerror.hxx"
-
-#include "XMLFilterServiceNames.h"
-#include "XMLEmbeddedObjectImportContext.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::document;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-struct XMLServiceMapEntry_Impl
-{
- enum XMLTokenEnum eClass;
- const sal_Char *sFilterService;
- sal_Int32 nFilterServiceLen;
-};
-
-#define SERVICE_MAP_ENTRY( cls, app ) \
- { XML_##cls, \
- XML_IMPORT_FILTER_##app, sizeof(XML_IMPORT_FILTER_##app)-1 }
-
-const XMLServiceMapEntry_Impl aServiceMap[] =
-{
- SERVICE_MAP_ENTRY( TEXT, WRITER ),
- SERVICE_MAP_ENTRY( ONLINE_TEXT, WRITER ),
- SERVICE_MAP_ENTRY( SPREADSHEET, CALC ),
- SERVICE_MAP_ENTRY( DRAWING, DRAW ),
- SERVICE_MAP_ENTRY( PRESENTATION, IMPRESS ),
- SERVICE_MAP_ENTRY( CHART, CHART ),
- { XML_TOKEN_INVALID, 0, 0 }
-};
-
-class XMLEmbeddedObjectImportContext_Impl : public SvXMLImportContext
-{
- ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XDocumentHandler > xHandler;
-
-public:
- TYPEINFO();
-
- XMLEmbeddedObjectImportContext_Impl( SvXMLImport& rImport, USHORT nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XDocumentHandler >& rHandler );
-
- virtual ~XMLEmbeddedObjectImportContext_Impl();
-
- virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
- virtual void EndElement();
-
- virtual void Characters( const ::rtl::OUString& rChars );
-};
-
-TYPEINIT1( XMLEmbeddedObjectImportContext_Impl, SvXMLImportContext );
-
-XMLEmbeddedObjectImportContext_Impl::XMLEmbeddedObjectImportContext_Impl(
- SvXMLImport& rImport, USHORT nPrfx,
- const OUString& rLName,
- const Reference< XDocumentHandler >& rHandler ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- xHandler( rHandler )
-{
-}
-
-XMLEmbeddedObjectImportContext_Impl::~XMLEmbeddedObjectImportContext_Impl()
-{
-}
-
-SvXMLImportContext *XMLEmbeddedObjectImportContext_Impl::CreateChildContext(
- USHORT nPrefix,
- const OUString& rLocalName,
- const Reference< XAttributeList >& xAttrList )
-{
- return new XMLEmbeddedObjectImportContext_Impl( GetImport(),
- nPrefix, rLocalName,
- xHandler );
-}
-
-void XMLEmbeddedObjectImportContext_Impl::StartElement(
- const Reference< XAttributeList >& xAttrList )
-{
- xHandler->startElement( GetImport().GetNamespaceMap().GetQNameByKey(
- GetPrefix(), GetLocalName() ),
- xAttrList );
-}
-
-void XMLEmbeddedObjectImportContext_Impl::EndElement()
-{
- xHandler->endElement( GetImport().GetNamespaceMap().GetQNameByKey(
- GetPrefix(), GetLocalName() ) );
-}
-
-void XMLEmbeddedObjectImportContext_Impl::Characters( const OUString& rChars )
-{
- xHandler->characters( rChars );
-}
-
-//-----------------------------------------------------------------------------
-
-TYPEINIT1( XMLEmbeddedObjectImportContext, SvXMLImportContext );
-
-sal_Bool XMLEmbeddedObjectImportContext::SetComponent(
- Reference< XComponent >& rComp )
-{
- if( !rComp.is() || !sFilterService.getLength() )
- return sal_False;
-
-
- Sequence<Any> aArgs( 0 );
-
- // #110680#
- // Reference< XMultiServiceFactory > xServiceFactory = comphelper::getProcessServiceFactory();
- Reference< XMultiServiceFactory > xServiceFactory = GetImport().getServiceFactory();
-
- xHandler = Reference < XDocumentHandler >(
- xServiceFactory->createInstanceWithArguments( sFilterService, aArgs),
- UNO_QUERY);
-
- if( !xHandler.is() )
- return sal_False;
-
- Reference < XImporter > xImporter( xHandler, UNO_QUERY );
- xImporter->setTargetDocument( rComp );
-
- xComp = rComp; // keep ref to component only if there is a handler
- return sal_True;
-}
-
-XMLEmbeddedObjectImportContext::XMLEmbeddedObjectImportContext(
- SvXMLImport& rImport, USHORT nPrfx, const OUString& rLName,
- const Reference< XAttributeList >& xAttrList ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- // #i55761#
- bNeedToUnlockControllers(false)
-{
- SvGlobalName aName;
-
- if( nPrfx == XML_NAMESPACE_MATH &&
- IsXMLToken( rLName, XML_MATH ) )
- {
- sFilterService = OUString( RTL_CONSTASCII_USTRINGPARAM(XML_IMPORT_FILTER_MATH) );
- aName = SvGlobalName(SO3_SM_CLASSID);
- }
- else if( nPrfx == XML_NAMESPACE_OFFICE &&
- IsXMLToken( rLName, XML_DOCUMENT ) )
- {
- OUString sClass;
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName );
- if( nPrefix == XML_NAMESPACE_OFFICE &&
- IsXMLToken( aLocalName, XML_CLASS ) )
- {
- sClass = xAttrList->getValueByIndex( i );
- break;
- }
- }
-
- if( sClass.getLength() )
- {
- const XMLServiceMapEntry_Impl *pEntry = aServiceMap;
- while( pEntry->eClass != XML_TOKEN_INVALID )
- {
- if( IsXMLToken( sClass, pEntry->eClass ) )
- {
- sFilterService = OUString( pEntry->sFilterService,
- pEntry->nFilterServiceLen,
- RTL_TEXTENCODING_ASCII_US );
-
- switch( pEntry->eClass )
- {
- case XML_TEXT: aName = SvGlobalName(SO3_SW_CLASSID); break;
- case XML_ONLINE_TEXT: aName = SvGlobalName(SO3_SWWEB_CLASSID); break;
- case XML_SPREADSHEET: aName = SvGlobalName(SO3_SC_CLASSID); break;
- case XML_DRAWING: aName = SvGlobalName(SO3_SDRAW_CLASSID); break;
- case XML_PRESENTATION: aName = SvGlobalName(SO3_SIMPRESS_CLASSID); break;
- case XML_CHART: aName = SvGlobalName(SO3_SCH_CLASSID); break;
- }
-
- break;
- }
- pEntry++;
- }
- }
- }
-
- sCLSID = aName.GetHexName();
-}
-
-XMLEmbeddedObjectImportContext::~XMLEmbeddedObjectImportContext()
-{
-}
-
-SvXMLImportContext *XMLEmbeddedObjectImportContext::CreateChildContext(
- USHORT nPrefix, const OUString& rLocalName,
- const Reference< XAttributeList >& xAttrList )
-{
- if( xHandler.is() )
- return new XMLEmbeddedObjectImportContext_Impl( GetImport(),
- nPrefix, rLocalName,
- xHandler );
- else
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-}
-
-void XMLEmbeddedObjectImportContext::StartElement(
- const Reference< XAttributeList >& xAttrList )
-{
- if( xHandler.is() )
- {
- // #i55761#
- Reference< XModel > xModel( xComp, UNO_QUERY );
- if( xModel.is() && !xModel->hasControllersLocked())
- {
- xModel->lockControllers();
- bNeedToUnlockControllers = true;
- }
-
- xHandler->startDocument();
- xHandler->startElement( GetImport().GetNamespaceMap().GetQNameByKey(
- GetPrefix(), GetLocalName() ),
- xAttrList );
- }
-}
-
-void XMLEmbeddedObjectImportContext::EndElement()
-{
- if( xHandler.is() )
- {
- xHandler->endElement( GetImport().GetNamespaceMap().GetQNameByKey(
- GetPrefix(), GetLocalName() ) );
- xHandler->endDocument();
-
- // #i55761#
- if(bNeedToUnlockControllers)
- {
- Reference< XModel > xModel( xComp, UNO_QUERY );
-
- if(xModel.is())
- {
- xModel->unlockControllers();
- }
- }
-
- // Save the object. That's required because the object should not be
- // modified (it has been loaded just now). Setting it to unmodified
- // only does not work, because it is then assumed that it has been
- // stored.
- Reference < XStorable > xStorable( xComp, UNO_QUERY );
- if( xStorable.is() )
- {
- try
- {
- xStorable->store();
- }
- catch( ::com::sun::star::beans::PropertyVetoException& e )
- {
- Sequence<OUString> aSeq( 0 );
- GetImport().SetError( XMLERROR_FLAG_WARNING |
- XMLERROR_API,
- aSeq );
- }
- }
-#if 0
- // reset modifies state for the object since it has been imported
- // completly and therfor hasn't been modified.
- Reference < XModifiable > xModifiable( xComp, UNO_QUERY );
- if( xModifiable.is() )
- {
- try
- {
- xModifiable->setModified( sal_False );
- }
- catch( ::com::sun::star::beans::PropertyVetoException& e )
- {
- Sequence<OUString> aSeq( 0 );
- GetImport().SetError( XMLERROR_FLAG_WARNING |
- XMLERROR_API,
- aSeq );
- }
- }
-#endif
-
- }
-}
-
-void XMLEmbeddedObjectImportContext::Characters( const ::rtl::OUString& rChars )
-{
- if( xHandler.is() )
- xHandler->characters( rChars );
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_attrlist.cxx b/binfilter/bf_xmloff/source/core/xmloff_attrlist.cxx
deleted file mode 100644
index 09511032deb5..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_attrlist.cxx
+++ /dev/null
@@ -1,241 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <vector>
-
-#include "xmltoken.hxx"
-#include <rtl/uuid.h>
-#include <rtl/memory.h>
-
-#include "attrlist.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::osl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-struct SvXMLTagAttribute_Impl
-{
- SvXMLTagAttribute_Impl(){}
- SvXMLTagAttribute_Impl( const OUString &rName,
- const OUString &rValue )
- : sName(rName),
- sValue(rValue)
- {
- }
-
- OUString sName;
- OUString sValue;
-};
-
-struct SvXMLAttributeList_Impl
-{
- SvXMLAttributeList_Impl()
- {
- // performance improvement during adding
- vecAttribute.reserve(20);
- }
- ::std::vector<struct SvXMLTagAttribute_Impl> vecAttribute;
-};
-
-
-
-sal_Int16 SAL_CALL SvXMLAttributeList::getLength(void) throw( ::com::sun::star::uno::RuntimeException )
-{
- return m_pImpl->vecAttribute.size();
-}
-
-
-SvXMLAttributeList::SvXMLAttributeList( const SvXMLAttributeList &r )
-{
- m_pImpl = new SvXMLAttributeList_Impl;
- *m_pImpl = *(r.m_pImpl);
-}
-
-SvXMLAttributeList::SvXMLAttributeList( const uno::Reference<
- xml::sax::XAttributeList> & rAttrList )
- : sType( GetXMLToken(XML_CDATA) )
-{
- m_pImpl = new SvXMLAttributeList_Impl;
-
- SvXMLAttributeList* pImpl =
- SvXMLAttributeList::getImplementation( rAttrList );
-
- if( pImpl )
- *m_pImpl = *(pImpl->m_pImpl);
- else
- AppendAttributeList( rAttrList );
-}
-
-OUString SAL_CALL SvXMLAttributeList::getNameByIndex(sal_Int16 i) throw( ::com::sun::star::uno::RuntimeException )
-{
- if( i < m_pImpl->vecAttribute.size() ) {
- return m_pImpl->vecAttribute[i].sName;
- }
- return OUString();
-}
-
-
-OUString SAL_CALL SvXMLAttributeList::getTypeByIndex(sal_Int16 i) throw( ::com::sun::star::uno::RuntimeException )
-{
- return sType;
-}
-
-OUString SAL_CALL SvXMLAttributeList::getValueByIndex(sal_Int16 i) throw( ::com::sun::star::uno::RuntimeException )
-{
- if( i < m_pImpl->vecAttribute.size() ) {
- return m_pImpl->vecAttribute[i].sValue;
- }
- return OUString();
-
-}
-
-OUString SAL_CALL SvXMLAttributeList::getTypeByName( const OUString& sName ) throw( ::com::sun::star::uno::RuntimeException )
-{
- return sType;
-}
-
-OUString SAL_CALL SvXMLAttributeList::getValueByName(const OUString& sName) throw( ::com::sun::star::uno::RuntimeException )
-{
- ::std::vector<struct SvXMLTagAttribute_Impl>::iterator ii = m_pImpl->vecAttribute.begin();
-
- for( ; ii != m_pImpl->vecAttribute.end() ; ii ++ ) {
- if( (*ii).sName == sName ) {
- return (*ii).sValue;
- }
- }
- return OUString();
-}
-
-
-uno::Reference< ::com::sun::star::util::XCloneable > SvXMLAttributeList::createClone() throw( ::com::sun::star::uno::RuntimeException )
-{
- uno::Reference< ::com::sun::star::util::XCloneable > r = new SvXMLAttributeList( *this );
- return r;
-}
-
-
-SvXMLAttributeList::SvXMLAttributeList()
- : sType( GetXMLToken(XML_CDATA) )
-{
- m_pImpl = new SvXMLAttributeList_Impl;
-}
-
-
-
-SvXMLAttributeList::~SvXMLAttributeList()
-{
- delete m_pImpl;
-}
-
-
-void SvXMLAttributeList::AddAttribute( const OUString &sName ,
- const OUString &sValue )
-{
- m_pImpl->vecAttribute.push_back( SvXMLTagAttribute_Impl( sName , sValue ) );
-}
-
-void SvXMLAttributeList::Clear()
-{
- m_pImpl->vecAttribute.clear();
-
- OSL_ASSERT( ! getLength() );
-}
-
-void SvXMLAttributeList::RemoveAttribute( const OUString sName )
-{
- ::std::vector<struct SvXMLTagAttribute_Impl>::iterator ii = m_pImpl->vecAttribute.begin();
-
- for( ; ii != m_pImpl->vecAttribute.end() ; ii ++ ) {
- if( (*ii).sName == sName ) {
- m_pImpl->vecAttribute.erase( ii );
- break;
- }
- }
-}
-
-void SvXMLAttributeList::AppendAttributeList( const uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &r )
-{
- OSL_ASSERT( r.is() );
-
- sal_Int32 nMax = r->getLength();
- sal_Int32 nTotalSize = m_pImpl->vecAttribute.size() + nMax;
- m_pImpl->vecAttribute.reserve( nTotalSize );
-
- for( sal_Int32 i = 0 ; i < nMax ; i ++ ) {
- m_pImpl->vecAttribute.push_back( SvXMLTagAttribute_Impl(
- r->getNameByIndex( i ) ,
- r->getValueByIndex( i )));
- }
-
- OSL_ASSERT( nTotalSize == getLength());
-}
-
-// XUnoTunnel & co
-const uno::Sequence< sal_Int8 > & SvXMLAttributeList::getUnoTunnelId() throw()
-{
- static uno::Sequence< sal_Int8 > * pSeq = 0;
- if( !pSeq )
- {
- Guard< Mutex > aGuard( Mutex::getGlobalMutex() );
- if( !pSeq )
- {
- static uno::Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- pSeq = &aSeq;
- }
- }
- return *pSeq;
-}
-
-SvXMLAttributeList* SvXMLAttributeList::getImplementation( uno::Reference< uno::XInterface > xInt ) throw()
-{
- uno::Reference< lang::XUnoTunnel > xUT( xInt, uno::UNO_QUERY );
- if( xUT.is() )
- return (SvXMLAttributeList*)xUT->getSomething( SvXMLAttributeList::getUnoTunnelId() );
- else
- return NULL;
-}
-
-// XUnoTunnel
-sal_Int64 SAL_CALL SvXMLAttributeList::getSomething( const uno::Sequence< sal_Int8 >& rId )
- throw( uno::RuntimeException )
-{
- if( rId.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
- {
- return (sal_Int64)this;
- }
- return 0;
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_facreg.cxx b/binfilter/bf_xmloff/source/core/xmloff_facreg.cxx
deleted file mode 100644
index 1a0e63dc7208..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_facreg.cxx
+++ /dev/null
@@ -1,635 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <string.h>
-
-
-
-#include <osl/diagnose.h>
-
-
-#include <cppuhelper/factory.hxx>
-#include <uno/lbnames.h>
-namespace binfilter {
-
-using namespace rtl;
-using namespace ::com::sun::star;
-
-// impress import
-extern uno::Sequence< OUString > SAL_CALL SdImpressXMLImport_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdImpressXMLImport_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLImport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// impress import.styles
-extern uno::Sequence< OUString > SAL_CALL SdImpressXMLImport_Style_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdImpressXMLImport_Style_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLImport_Style_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// impress import.content
-extern uno::Sequence< OUString > SAL_CALL SdImpressXMLImport_Content_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdImpressXMLImport_Content_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLImport_Content_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// impress import.meta
-extern uno::Sequence< OUString > SAL_CALL SdImpressXMLImport_Meta_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdImpressXMLImport_Meta_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLImport_Meta_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// impress import.settings
-extern uno::Sequence< OUString > SAL_CALL SdImpressXMLImport_Settings_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdImpressXMLImport_Settings_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLImport_Settings_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// for every module, export functionality is disabled for SVX_LIGHT (which means: SOPlayer)
-#ifndef SVX_LIGHT
-// impress export
-extern uno::Sequence< OUString > SAL_CALL SdImpressXMLExport_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdImpressXMLExport_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// impress export.styles
-extern uno::Sequence< OUString > SAL_CALL SdImpressXMLExport_Style_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdImpressXMLExport_Style_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLExport_Style_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// impress export.content
-extern uno::Sequence< OUString > SAL_CALL SdImpressXMLExport_Content_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdImpressXMLExport_Content_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLExport_Content_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// impress export.meta
-extern uno::Sequence< OUString > SAL_CALL SdImpressXMLExport_Meta_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdImpressXMLExport_Meta_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLExport_Meta_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// impress export.settings
-extern uno::Sequence< OUString > SAL_CALL SdImpressXMLExport_Settings_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdImpressXMLExport_Settings_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLExport_Settings_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-#endif // #ifndef SVX_LIGHT
-
-// draw import
-extern uno::Sequence< OUString > SAL_CALL SdDrawXMLImport_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdDrawXMLImport_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLImport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// draw import.styles
-extern uno::Sequence< OUString > SAL_CALL SdDrawXMLImport_Style_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdDrawXMLImport_Style_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLImport_Style_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// draw import.content
-extern uno::Sequence< OUString > SAL_CALL SdDrawXMLImport_Content_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdDrawXMLImport_Content_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLImport_Content_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// draw import.meta
-extern uno::Sequence< OUString > SAL_CALL SdDrawXMLImport_Meta_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdDrawXMLImport_Meta_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLImport_Meta_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// draw import.settings
-extern uno::Sequence< OUString > SAL_CALL SdDrawXMLImport_Settings_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdDrawXMLImport_Settings_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLImport_Settings_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-#ifndef SVX_LIGHT
-// draw export
-extern uno::Sequence< OUString > SAL_CALL SdDrawXMLExport_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdDrawXMLExport_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// drawing layer export
-extern uno::Sequence< OUString > SAL_CALL DrawingLayerXMLExport_getSupportedServiceNames() throw();
-extern OUString SAL_CALL DrawingLayerXMLExport_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL DrawingLayerXMLExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// impress xml clipboard export
-extern uno::Sequence< OUString > SAL_CALL ImpressXMLClipboardExport_getSupportedServiceNames() throw();
-extern OUString SAL_CALL ImpressXMLClipboardExport_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL ImpressXMLClipboardExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// draw export.style
-extern uno::Sequence< OUString > SAL_CALL SdDrawXMLExport_Style_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdDrawXMLExport_Style_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLExport_Style_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// draw export.content
-extern uno::Sequence< OUString > SAL_CALL SdDrawXMLExport_Content_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdDrawXMLExport_Content_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLExport_Content_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// draw export.meta
-extern uno::Sequence< OUString > SAL_CALL SdDrawXMLExport_Meta_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdDrawXMLExport_Meta_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLExport_Meta_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// draw export.settings
-extern uno::Sequence< OUString > SAL_CALL SdDrawXMLExport_Settings_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SdDrawXMLExport_Settings_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLExport_Settings_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-#endif // #ifndef SVX_LIGHT
-
-// complete chart is disabled for SVX_LIGHT
-#ifndef SVX_LIGHT
-// chart import
-// ------------
-extern uno::Sequence< OUString > SAL_CALL SchXMLImport_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SchXMLImport_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SchXMLImport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// styles
-extern uno::Sequence< OUString > SAL_CALL SchXMLImport_Styles_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SchXMLImport_Styles_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SchXMLImport_Styles_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// content
-extern uno::Sequence< OUString > SAL_CALL SchXMLImport_Content_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SchXMLImport_Content_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SchXMLImport_Content_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// chart export
-// ------------
-extern uno::Sequence< OUString > SAL_CALL SchXMLExport_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SchXMLExport_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SchXMLExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// styles
-extern uno::Sequence< OUString > SAL_CALL SchXMLExport_Styles_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SchXMLExport_Styles_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SchXMLExport_Styles_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// content
-extern uno::Sequence< OUString > SAL_CALL SchXMLExport_Content_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SchXMLExport_Content_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL SchXMLExport_Content_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-#endif // #ifndef SVX_LIGHT
-
-
-#ifndef SVX_LIGHT
-// meta export
-extern uno::Sequence< OUString > SAL_CALL XMLMetaExportComponent_getSupportedServiceNames() throw();
-extern OUString SAL_CALL XMLMetaExportComponent_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL XMLMetaExportComponent_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-#endif // #ifndef SVX_LIGHT
-
-// meta import
-extern uno::Sequence< OUString > SAL_CALL XMLMetaImportComponent_getSupportedServiceNames() throw();
-extern OUString SAL_CALL XMLMetaImportComponent_getImplementationName() throw();
-extern uno::Reference< uno::XInterface > SAL_CALL XMLMetaImportComponent_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-
-// component register functionality only for shared lib
-#ifndef SVX_LIGHT
-
-//
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
-void SAL_CALL writeInfo( registry::XRegistryKey * pRegistryKey, const OUString& rImplementationName, const uno::Sequence< OUString >& rServices )
-{
- uno::Reference< registry::XRegistryKey > xNewKey(
- pRegistryKey->createKey(
- OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + rImplementationName + OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ) );
-
- for( sal_Int32 i = 0; i < rServices.getLength(); i++ )
- xNewKey->createKey( rServices.getConstArray()[i]);
-}
-
-sal_Bool SAL_CALL component_writeInfo( void * pServiceManager, void * pRegistryKey )
-{
- if( pRegistryKey )
- {
- try
- {
- registry::XRegistryKey *pKey = reinterpret_cast< registry::XRegistryKey * >( pRegistryKey );
-
- // impress
- writeInfo( pKey, SdImpressXMLImport_getImplementationName(), SdImpressXMLImport_getSupportedServiceNames() );
- writeInfo( pKey, SdImpressXMLExport_getImplementationName(), SdImpressXMLExport_getSupportedServiceNames() );
-
- // impress.styles
- writeInfo( pKey, SdImpressXMLImport_Style_getImplementationName(), SdImpressXMLImport_Style_getSupportedServiceNames() );
- writeInfo( pKey, SdImpressXMLExport_Style_getImplementationName(), SdImpressXMLExport_Style_getSupportedServiceNames() );
-
- // impress.content
- writeInfo( pKey, SdImpressXMLImport_Content_getImplementationName(), SdImpressXMLImport_Content_getSupportedServiceNames() );
- writeInfo( pKey, SdImpressXMLExport_Content_getImplementationName(), SdImpressXMLExport_Content_getSupportedServiceNames() );
-
- // impress.meta
- writeInfo( pKey, SdImpressXMLImport_Meta_getImplementationName(), SdImpressXMLImport_Meta_getSupportedServiceNames() );
- writeInfo( pKey, SdImpressXMLExport_Meta_getImplementationName(), SdImpressXMLExport_Meta_getSupportedServiceNames() );
-
- // impress.settings
- writeInfo( pKey, SdImpressXMLImport_Settings_getImplementationName(), SdImpressXMLImport_Settings_getSupportedServiceNames() );
- writeInfo( pKey, SdImpressXMLExport_Settings_getImplementationName(), SdImpressXMLExport_Settings_getSupportedServiceNames() );
-
- // draw
- writeInfo( pKey, SdDrawXMLImport_getImplementationName(), SdDrawXMLImport_getSupportedServiceNames() );
- writeInfo( pKey, SdDrawXMLExport_getImplementationName(), SdDrawXMLExport_getSupportedServiceNames() );
-
- // drawing layer
- writeInfo( pKey, DrawingLayerXMLExport_getImplementationName(), DrawingLayerXMLExport_getSupportedServiceNames() );
-
- // impress xml clipboard
- writeInfo( pKey, ImpressXMLClipboardExport_getImplementationName(), ImpressXMLClipboardExport_getSupportedServiceNames() );
-
- // draw.styles
- writeInfo( pKey, SdDrawXMLImport_Style_getImplementationName(), SdDrawXMLImport_Style_getSupportedServiceNames() );
- writeInfo( pKey, SdDrawXMLExport_Style_getImplementationName(), SdDrawXMLExport_Style_getSupportedServiceNames() );
-
- // draw.content
- writeInfo( pKey, SdDrawXMLImport_Content_getImplementationName(), SdDrawXMLImport_Content_getSupportedServiceNames() );
- writeInfo( pKey, SdDrawXMLExport_Content_getImplementationName(), SdDrawXMLExport_Content_getSupportedServiceNames() );
-
- // draw.meta
- writeInfo( pKey, SdDrawXMLImport_Meta_getImplementationName(), SdDrawXMLImport_Meta_getSupportedServiceNames() );
- writeInfo( pKey, SdDrawXMLExport_Meta_getImplementationName(), SdDrawXMLExport_Meta_getSupportedServiceNames() );
-
- // draw.settings
- writeInfo( pKey, SdDrawXMLImport_Settings_getImplementationName(), SdDrawXMLImport_Settings_getSupportedServiceNames() );
- writeInfo( pKey, SdDrawXMLExport_Settings_getImplementationName(), SdDrawXMLExport_Settings_getSupportedServiceNames() );
-
- // chart
- writeInfo( pKey, SchXMLImport_getImplementationName(), SchXMLImport_getSupportedServiceNames() );
- writeInfo( pKey, SchXMLExport_getImplementationName(), SchXMLExport_getSupportedServiceNames() );
-
- // chart.styles
- writeInfo( pKey, SchXMLImport_Styles_getImplementationName(), SchXMLImport_Styles_getSupportedServiceNames() );
- writeInfo( pKey, SchXMLExport_Styles_getImplementationName(), SchXMLExport_Styles_getSupportedServiceNames() );
-
- // chart.content
- writeInfo( pKey, SchXMLImport_Content_getImplementationName(), SchXMLImport_Content_getSupportedServiceNames() );
- writeInfo( pKey, SchXMLExport_Content_getImplementationName(), SchXMLExport_Content_getSupportedServiceNames() );
-
- // meta
- writeInfo( pKey, XMLMetaImportComponent_getImplementationName(), XMLMetaImportComponent_getSupportedServiceNames() );
- writeInfo( pKey, XMLMetaExportComponent_getImplementationName(), XMLMetaExportComponent_getSupportedServiceNames() );
- writeInfo( pKey, XMLMetaExportComponent_getImplementationName(), XMLMetaExportComponent_getSupportedServiceNames() );
-
- }
- catch (registry::InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_True;
-}
-
-void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
-{
- void * pRet = 0;
- if( pServiceManager )
- {
- uno::Reference< lang::XMultiServiceFactory > xMSF( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ) );
-
- uno::Reference< lang::XSingleServiceFactory > xFactory;
-
- const sal_Int32 nImplNameLen = strlen( pImplName );
- if( SdImpressXMLImport_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdImpressXMLImport_getImplementationName(),
- SdImpressXMLImport_createInstance,
- SdImpressXMLImport_getSupportedServiceNames() );
- }
- else if( SdImpressXMLImport_Style_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdImpressXMLImport_Style_getImplementationName(),
- SdImpressXMLImport_Style_createInstance,
- SdImpressXMLImport_Style_getSupportedServiceNames() );
- }
- else if( SdImpressXMLImport_Content_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdImpressXMLImport_Content_getImplementationName(),
- SdImpressXMLImport_Content_createInstance,
- SdImpressXMLImport_Content_getSupportedServiceNames() );
- }
- else if( SdImpressXMLImport_Meta_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdImpressXMLImport_Meta_getImplementationName(),
- SdImpressXMLImport_Meta_createInstance,
- SdImpressXMLImport_Meta_getSupportedServiceNames() );
- }
- else if( SdImpressXMLImport_Settings_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdImpressXMLImport_Settings_getImplementationName(),
- SdImpressXMLImport_Settings_createInstance,
- SdImpressXMLImport_Settings_getSupportedServiceNames() );
- }
- else if( SdDrawXMLImport_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdDrawXMLImport_getImplementationName(),
- SdDrawXMLImport_createInstance,
- SdDrawXMLImport_getSupportedServiceNames() );
- }
- else if( SdDrawXMLImport_Style_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdDrawXMLImport_Style_getImplementationName(),
- SdDrawXMLImport_Style_createInstance,
- SdDrawXMLImport_Style_getSupportedServiceNames() );
- }
- else if( SdDrawXMLImport_Content_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdDrawXMLImport_Content_getImplementationName(),
- SdDrawXMLImport_Content_createInstance,
- SdDrawXMLImport_Content_getSupportedServiceNames() );
- }
- else if( SdDrawXMLImport_Meta_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdDrawXMLImport_Meta_getImplementationName(),
- SdDrawXMLImport_Meta_createInstance,
- SdDrawXMLImport_Meta_getSupportedServiceNames() );
- }
- else if( SdDrawXMLImport_Settings_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdDrawXMLImport_Settings_getImplementationName(),
- SdDrawXMLImport_Settings_createInstance,
- SdDrawXMLImport_Settings_getSupportedServiceNames() );
- }
- else if( SdImpressXMLExport_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdImpressXMLExport_getImplementationName(),
- SdImpressXMLExport_createInstance,
- SdImpressXMLExport_getSupportedServiceNames() );
- }
- else if( SdImpressXMLExport_Style_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdImpressXMLExport_Style_getImplementationName(),
- SdImpressXMLExport_Style_createInstance,
- SdImpressXMLExport_Style_getSupportedServiceNames() );
- }
- else if( SdImpressXMLExport_Content_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdImpressXMLExport_Content_getImplementationName(),
- SdImpressXMLExport_Content_createInstance,
- SdImpressXMLExport_Content_getSupportedServiceNames() );
- }
- else if( SdImpressXMLExport_Meta_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdImpressXMLExport_Meta_getImplementationName(),
- SdImpressXMLExport_Meta_createInstance,
- SdImpressXMLExport_Meta_getSupportedServiceNames() );
- }
- else if( SdImpressXMLExport_Settings_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdImpressXMLExport_Settings_getImplementationName(),
- SdImpressXMLExport_Settings_createInstance,
- SdImpressXMLExport_Settings_getSupportedServiceNames() );
- }
- else if( SdDrawXMLExport_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdDrawXMLExport_getImplementationName(),
- SdDrawXMLExport_createInstance,
- SdDrawXMLExport_getSupportedServiceNames() );
- }
- else if( DrawingLayerXMLExport_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- DrawingLayerXMLExport_getImplementationName(),
- DrawingLayerXMLExport_createInstance,
- DrawingLayerXMLExport_getSupportedServiceNames() );
- }
- else if( ImpressXMLClipboardExport_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- ImpressXMLClipboardExport_getImplementationName(),
- ImpressXMLClipboardExport_createInstance,
- ImpressXMLClipboardExport_getSupportedServiceNames() );
- }
- else if( SdDrawXMLExport_Style_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdDrawXMLExport_Style_getImplementationName(),
- SdDrawXMLExport_Style_createInstance,
- SdDrawXMLExport_Style_getSupportedServiceNames() );
- }
- else if( SdDrawXMLExport_Content_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdDrawXMLExport_Content_getImplementationName(),
- SdDrawXMLExport_Content_createInstance,
- SdDrawXMLExport_Content_getSupportedServiceNames() );
- }
- else if( SdDrawXMLExport_Meta_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdDrawXMLExport_Meta_getImplementationName(),
- SdDrawXMLExport_Meta_createInstance,
- SdDrawXMLExport_Meta_getSupportedServiceNames() );
- }
- else if( SdDrawXMLExport_Settings_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SdDrawXMLExport_Settings_getImplementationName(),
- SdDrawXMLExport_Settings_createInstance,
- SdDrawXMLExport_Settings_getSupportedServiceNames() );
- }
- else if( SchXMLImport_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SchXMLImport_getImplementationName(),
- SchXMLImport_createInstance,
- SchXMLImport_getSupportedServiceNames() );
- }
- else if( SchXMLExport_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SchXMLExport_getImplementationName(),
- SchXMLExport_createInstance,
- SchXMLExport_getSupportedServiceNames() );
- }
-
- else if( SchXMLImport_Styles_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SchXMLImport_Styles_getImplementationName(),
- SchXMLImport_Styles_createInstance,
- SchXMLImport_Styles_getSupportedServiceNames() );
- }
- else if( SchXMLExport_Styles_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SchXMLExport_Styles_getImplementationName(),
- SchXMLExport_Styles_createInstance,
- SchXMLExport_Styles_getSupportedServiceNames() );
- }
- else if( SchXMLImport_Content_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SchXMLImport_Content_getImplementationName(),
- SchXMLImport_Content_createInstance,
- SchXMLImport_Content_getSupportedServiceNames() );
- }
- else if( SchXMLExport_Content_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- SchXMLExport_Content_getImplementationName(),
- SchXMLExport_Content_createInstance,
- SchXMLExport_Content_getSupportedServiceNames() );
- }
- else if ( XMLMetaExportComponent_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- XMLMetaExportComponent_getImplementationName(),
- XMLMetaExportComponent_createInstance,
- XMLMetaExportComponent_getSupportedServiceNames() );
- }
- else if ( XMLMetaImportComponent_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )
- {
- xFactory = ::cppu::createSingleFactory( xMSF,
- XMLMetaImportComponent_getImplementationName(),
- XMLMetaImportComponent_createInstance,
- XMLMetaImportComponent_getSupportedServiceNames() );
- }
- if( xFactory.is())
- {
- xFactory->acquire();
- pRet = xFactory.get();
- }
- }
- return pRet;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#else
-
-// register necessary services manually
-sal_Bool XMLRegisterServices( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory )
-{
- // ask the MultiServiceFactory for the XSet interface
- uno::Reference< ::com::sun::star::container::XSet > xSet( xServiceFactory, uno::UNO_QUERY );
-
- if ( !xSet.is() )
- return sal_False;
-
- try
- {
- uno::Any aAny;
-
- // SdImpressXMLImport
- aAny <<= ::cppu::createSingleFactory( xServiceFactory,
- SdImpressXMLImport_getImplementationName(),
- SdImpressXMLImport_createInstance,
- SdImpressXMLImport_getSupportedServiceNames() );
- xSet->insert( aAny );
-
- aAny <<= ::cppu::createSingleFactory( xServiceFactory,
- SdImpressXMLImport_Style_getImplementationName(),
- SdImpressXMLImport_Style_createInstance,
- SdImpressXMLImport_Style_getSupportedServiceNames() );
- xSet->insert( aAny );
-
- aAny <<= ::cppu::createSingleFactory( xServiceFactory,
- SdImpressXMLImport_Content_getImplementationName(),
- SdImpressXMLImport_Content_createInstance,
- SdImpressXMLImport_Content_getSupportedServiceNames() );
- xSet->insert( aAny );
-
- aAny <<= ::cppu::createSingleFactory( xServiceFactory,
- SdImpressXMLImport_Meta_getImplementationName(),
- SdImpressXMLImport_Meta_createInstance,
- SdImpressXMLImport_Meta_getSupportedServiceNames() );
- xSet->insert( aAny );
-
- aAny <<= ::cppu::createSingleFactory( xServiceFactory,
- SdImpressXMLImport_Settings_getImplementationName(),
- SdImpressXMLImport_Settings_createInstance,
- SdImpressXMLImport_Settings_getSupportedServiceNames() );
- xSet->insert( aAny );
-
- // SdDrawXMLImport
- aAny <<= ::cppu::createSingleFactory( xServiceFactory,
- SdDrawXMLImport_getImplementationName(),
- SdDrawXMLImport_createInstance,
- SdDrawXMLImport_getSupportedServiceNames() );
- xSet->insert( aAny );
-
- aAny <<= ::cppu::createSingleFactory( xServiceFactory,
- SdDrawXMLImport_Style_getImplementationName(),
- SdDrawXMLImport_Style_createInstance,
- SdDrawXMLImport_Style_getSupportedServiceNames() );
- xSet->insert( aAny );
-
- aAny <<= ::cppu::createSingleFactory( xServiceFactory,
- SdDrawXMLImport_Content_getImplementationName(),
- SdDrawXMLImport_Content_createInstance,
- SdDrawXMLImport_Content_getSupportedServiceNames() );
- xSet->insert( aAny );
-
- aAny <<= ::cppu::createSingleFactory( xServiceFactory,
- SdDrawXMLImport_Meta_getImplementationName(),
- SdDrawXMLImport_Meta_createInstance,
- SdDrawXMLImport_Meta_getSupportedServiceNames() );
- xSet->insert( aAny );
-
- aAny <<= ::cppu::createSingleFactory( xServiceFactory,
- SdDrawXMLImport_Settings_getImplementationName(),
- SdDrawXMLImport_Settings_createInstance,
- SdDrawXMLImport_Settings_getSupportedServiceNames() );
- xSet->insert( aAny );
- }
- catch( uno::Exception& )
- {
-#ifdef DBG_UTIL
- DBG_ERROR( "Cannot register XMLOFF services" );
-#endif
- return sal_False;
- }
-
- return sal_True;
-}
-
-#endif // #ifndef SVX_LIGHT
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_i18nmap.cxx b/binfilter/bf_xmloff/source/core/xmloff_i18nmap.cxx
deleted file mode 100644
index 88d57b555500..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_i18nmap.cxx
+++ /dev/null
@@ -1,132 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <rtl/ustring.hxx>
-
-#include <tools/debug.hxx>
-
-#include <bf_svtools/svarray.hxx>
-
-#include "i18nmap.hxx"
-namespace binfilter {
-
-using namespace rtl;
-
-class SvI18NMapEntry_Impl
-{
- USHORT nKind;
- OUString aName;
- OUString aNewName;
-
-public:
-
- const OUString& GetNewName() const { return aNewName; }
-
- SvI18NMapEntry_Impl( USHORT nKnd, const OUString& rName,
- const OUString& rNewName ) :
- nKind( nKnd ),
- aName( rName ),
- aNewName( rNewName )
- {}
-
- SvI18NMapEntry_Impl( USHORT nKnd, const OUString& rName ) :
- nKind( nKnd ),
- aName( rName )
- {}
-
- BOOL operator==( const SvI18NMapEntry_Impl& r ) const
- {
- return nKind == r.nKind &&
- aName == r.aName;
- }
-
- BOOL operator<( const SvI18NMapEntry_Impl& r ) const
- {
- return nKind < r.nKind ||
- ( nKind == r.nKind &&
- aName < r.aName);
- }
-};
-
-typedef SvI18NMapEntry_Impl *SvI18NMapEntry_ImplPtr;
-SV_DECL_PTRARR_SORT_DEL( SvI18NMap_Impl, SvI18NMapEntry_ImplPtr, 20, 5 )
-SV_IMPL_OP_PTRARR_SORT( SvI18NMap_Impl, SvI18NMapEntry_ImplPtr )
-
-// ---------------------------------------------------------------------
-
-SvI18NMapEntry_Impl *SvI18NMap::_Find( USHORT nKind,
- const OUString& rName ) const
-{
- SvI18NMapEntry_Impl *pRet = 0;
- SvI18NMapEntry_Impl aTst( nKind, rName );
-
- USHORT nPos;
- if( pImpl->Seek_Entry( &aTst, &nPos ) )
- {
- pRet = (*pImpl)[nPos];
- }
-
- return pRet;
-}
-
-SvI18NMap::SvI18NMap() :
- pImpl( 0 )
-{
- pImpl = new SvI18NMap_Impl;
-}
-
-SvI18NMap::~SvI18NMap()
-{
- delete pImpl;
-}
-
-void SvI18NMap::Add( USHORT nKind, const OUString& rName,
- const OUString& rNewName )
-{
- SvI18NMapEntry_Impl *pEntry = _Find( nKind, rName );
- DBG_ASSERT( !pEntry, "SvI18NMap::Add: item registered already" );
- if( !pEntry )
- {
- pEntry = new SvI18NMapEntry_Impl( nKind, rName, rNewName );
- pImpl->Insert( pEntry );
- }
-}
-
-const OUString& SvI18NMap::Get( USHORT nKind, const OUString& rName ) const
-{
- SvI18NMapEntry_Impl *pEntry = _Find( nKind, rName );
- if( pEntry )
- return pEntry->GetNewName();
- else
- return rName;
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_nmspmap.cxx b/binfilter/bf_xmloff/source/core/xmloff_nmspmap.cxx
deleted file mode 100644
index 8789bdc26250..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_nmspmap.cxx
+++ /dev/null
@@ -1,384 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-
-#include <rtl/ustrbuf.hxx>
-
-#include <xmltoken.hxx>
-
-#include <nmspmap.hxx>
-namespace binfilter {
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::binfilter::xmloff::token::GetXMLToken;
-using ::binfilter::xmloff::token::XML_XMLNS;
-
-/* The basic idea of this class is that we have two two ways to search our
- * data...by prefix and by key. We use an STL hash_map for fast prefix
- * searching and an STL map for fast key searching.
- *
- * The references to an 'Index' refer to an earlier implementation of the
- * name space map and remain to support code which uses these interfaces.
- *
- * In this implementation, key and index should always be the same number.
- *
- * All references to Indices are now deprecated and the corresponding
- * 'Key' methods should be used instead
- *
- * Martin 13/06/01
- */
-
-SvXMLNamespaceMap::SvXMLNamespaceMap()
-: sXMLNS( GetXMLToken ( XML_XMLNS ) )
-{
-}
-
-SvXMLNamespaceMap::SvXMLNamespaceMap( const SvXMLNamespaceMap& rMap )
-: sXMLNS( GetXMLToken ( XML_XMLNS ) )
-{
- aNameHash = rMap.aNameHash;
- aNameMap = rMap.aNameMap;
-}
-
-SvXMLNamespaceMap::~SvXMLNamespaceMap()
-{
- QNameCache::iterator aIter = aQNameCache.begin(), aEnd = aQNameCache.end();
- while ( aIter != aEnd )
- {
- const OUString *pString = (*aIter).first.second;
- aIter++;
- delete pString;
- }
-}
-
-int SvXMLNamespaceMap::operator ==( const SvXMLNamespaceMap& rCmp ) const
-{
-#if STLPORT_VERSION >= 500
-//FIXME: STLport5 alternative map compare?
- return static_cast < int > (aNameHash.size() == rCmp.aNameHash.size());
-#else
- return static_cast < int > (aNameHash == rCmp.aNameHash);
-#endif
-}
-
-sal_uInt16 SvXMLNamespaceMap::_Add( const OUString& rPrefix, const OUString &rName, sal_uInt16 nKey )
-{
- if( XML_NAMESPACE_UNKNOWN == nKey )
- {
- // create a new unique key with UNKNOWN flag set
- nKey = XML_NAMESPACE_UNKNOWN_FLAG;
- do
- {
- NameSpaceMap::const_iterator aIter = aNameMap.find ( nKey );
- if( aIter == aNameMap.end() )
- break;
- nKey++;
- }
- while ( sal_True );
- }
- NameSpaceEntry *pEntry = new NameSpaceEntry;
- pEntry->sName = rName;
- pEntry->nKey = nKey;
- pEntry->sPrefix = rPrefix;
- aNameHash[ rPrefix ] = pEntry;
- aNameMap [ nKey ] = pEntry;
- return nKey;
-}
-
-sal_uInt16 SvXMLNamespaceMap::Add( const OUString& rPrefix, const OUString& rName,
- sal_uInt16 nKey )
-{
- if( XML_NAMESPACE_UNKNOWN == nKey )
- nKey = GetKeyByName( rName );
-
- DBG_ASSERT( XML_NAMESPACE_NONE != nKey,
- "SvXMLNamespaceMap::Add: invalid namespace key" );
-
- if( XML_NAMESPACE_NONE == nKey )
- return USHRT_MAX;
-
- if ( aNameHash.find ( rPrefix ) == aNameHash.end() )
- nKey = _Add( rPrefix, rName, nKey );
-
- return nKey;
-}
-
-sal_uInt16 SvXMLNamespaceMap::GetKeyByPrefix( const OUString& rPrefix ) const
-{
- NameSpaceHash::const_iterator aIter = aNameHash.find(rPrefix);
- return (aIter != aNameHash.end()) ? (*aIter).second->nKey : USHRT_MAX;
-}
-
-sal_uInt16 SvXMLNamespaceMap::GetKeyByName( const OUString& rName ) const
-{
- sal_uInt16 nKey = XML_NAMESPACE_UNKNOWN;
- NameSpaceHash::const_iterator aIter = aNameHash.begin(), aEnd = aNameHash.end();
- while (aIter != aEnd )
- {
- if ((*aIter).second->sName == rName)
- {
- nKey = (*aIter).second->nKey;
- break;
- }
- aIter++;
- }
- return nKey;
-}
-
-const OUString& SvXMLNamespaceMap::GetPrefixByKey( sal_uInt16 nKey ) const
-{
- NameSpaceMap::const_iterator aIter = aNameMap.find (nKey);
- return (aIter != aNameMap.end()) ? (*aIter).second->sPrefix : sEmpty;
-}
-
-const OUString& SvXMLNamespaceMap::GetNameByKey( sal_uInt16 nKey ) const
-{
- NameSpaceMap::const_iterator aIter = aNameMap.find (nKey);
- return (aIter != aNameMap.end()) ? (*aIter).second->sName : sEmpty;
-}
-
-OUString SvXMLNamespaceMap::GetAttrNameByKey( sal_uInt16 nKey ) const
-{
- OUStringBuffer sAttrName;
- NameSpaceMap::const_iterator aIter = aNameMap.find ( nKey );
- if (aIter != aNameMap.end())
- {
- sAttrName.append( sXMLNS );
- sAttrName.append( sal_Unicode(':') );
- sAttrName.append( (*aIter).second->sPrefix);
- }
- return sAttrName.makeStringAndClear();
-}
-
-OUString SvXMLNamespaceMap::GetQNameByKey( sal_uInt16 nKey,
- const OUString& rLocalName ) const
-{
- // We always want to return at least the rLocalName...
-
- switch ( nKey )
- {
- case XML_NAMESPACE_UNKNOWN:
- // ...if it's a completely unknown namespace, assert and return the local name
- DBG_ASSERT( sal_False, "SvXMLNamespaceMap::GetQNameByKey: invalid namespace key" );
- case XML_NAMESPACE_NONE:
- // ...if there isn't one, return the local name
- return rLocalName;
- break;
- case XML_NAMESPACE_XMLNS:
- {
- // ...if it's in the xmlns namespace, make the prefix
- // don't bother caching this, it rarely happens
- OUStringBuffer sQName;
- sQName.append ( sXMLNS );
- sQName.append ( sal_Unicode(':') );
- sQName.append ( rLocalName );
- return sQName.makeStringAndClear();;
- }
- break;
- default:
- {
- QNameCache::const_iterator aQCacheIter = aQNameCache.find ( QNamePair ( nKey, &rLocalName ) );
- if ( aQCacheIter != aQNameCache.end() )
- return (*aQCacheIter).second;
- else
- {
- NameSpaceMap::const_iterator aIter = aNameMap.find ( nKey );
- if ( aIter != aNameMap.end() )
- {
- OUStringBuffer sQName;
- // ...if it's in our map, make the prefix
- sQName.append ( (*aIter).second->sPrefix);
- sQName.append ( sal_Unicode(':') );
- sQName.append ( rLocalName );
- OUString *pString = new OUString ( rLocalName );
- OUString sString = sQName.makeStringAndClear();
- const_cast < QNameCache * > (&aQNameCache)->operator[] ( QNamePair ( nKey, pString ) ) = sString;
- return sString;
- }
- else
- {
- // ... if it isn't, this is a Bad Thing, assert and return the local name
- DBG_ASSERT( sal_False, "SvXMLNamespaceMap::GetQNameByKey: invalid namespace key" );
- return rLocalName;
- }
- }
- }
- }
-}
-
-sal_uInt16 SvXMLNamespaceMap::_GetKeyByAttrName( const OUString& rAttrName,
- OUString *pPrefix,
- OUString *pLocalName,
- OUString *pNamespace ) const
-{
- sal_uInt16 nKey = XML_NAMESPACE_UNKNOWN;
-
- NameSpaceHash::const_iterator aIter = aNameCache.find ( rAttrName );
- if ( aIter != aNameCache.end() )
- {
- const NameSpaceEntry &rEntry = *((*aIter).second);
- if ( pPrefix )
- *pPrefix = rEntry.sPrefix;
- if ( pLocalName )
- *pLocalName = rEntry.sName;
- nKey = rEntry.nKey;
- if ( pNamespace )
- {
- NameSpaceMap::const_iterator aMapIter = aNameMap.find (nKey);
- *pNamespace = aMapIter != aNameMap.end() ? (*aMapIter).second->sName : sEmpty;
- }
- }
- else
- {
- sal_Int32 nColonPos = rAttrName.indexOf( sal_Unicode(':') );
- NameSpaceEntry *pEntry = new NameSpaceEntry;
- if( -1L == nColonPos )
- {
- // case: no ':' found -> default namespace
- pEntry->sPrefix = OUString();
- pEntry->sName = rAttrName;
- }
- else
- {
- // normal case: ':' found -> get prefix/suffix
- pEntry->sPrefix = rAttrName.copy( 0L, nColonPos );
- pEntry->sName = rAttrName.copy( nColonPos + 1L );
- }
-
- if( pPrefix )
- *pPrefix = pEntry->sPrefix;
- if( pLocalName )
- *pLocalName = pEntry->sName;
-
- NameSpaceHash::const_iterator aIter = aNameHash.find( pEntry->sPrefix );
- if ( aIter != aNameHash.end() )
- {
- // found: retrieve namespace key
- nKey = pEntry->nKey = (*aIter).second->nKey;
- if ( pNamespace )
- *pNamespace = (*aIter).second->sName;
- }
- else if ( pEntry->sPrefix == sXMLNS )
- // not found, but xmlns prefix: return xmlns 'namespace'
- nKey = pEntry->nKey = XML_NAMESPACE_XMLNS;
- else if( nColonPos == -1L )
- // not found, and no namespace: 'namespace' none
- nKey = pEntry->nKey = XML_NAMESPACE_NONE;
-
- const_cast < NameSpaceHash* > ( &aNameCache )->operator[] ( rAttrName ) = pEntry;
- }
-
- return nKey;
-}
-
-sal_uInt16 SvXMLNamespaceMap::GetFirstKey() const
-{
- return aNameMap.empty() ? USHRT_MAX : (*aNameMap.begin()).second->nKey;
-}
-
-sal_uInt16 SvXMLNamespaceMap::GetNextKey( sal_uInt16 nLastKey ) const
-{
- NameSpaceMap::const_iterator aIter = aNameMap.find ( nLastKey );
- return (++aIter == aNameMap.end()) ? USHRT_MAX : (*aIter).second->nKey;
-}
-
-
-// All methods after this are deprecated...
-
-sal_Bool SvXMLNamespaceMap::AddAtIndex( sal_uInt16 nIdx, const OUString& rPrefix,
- const OUString& rName, sal_uInt16 nKey )
-{
- sal_Bool bRet = sal_False;
-
- if( XML_NAMESPACE_UNKNOWN == nKey )
- nKey = GetKeyByName( rName );
-
- DBG_ASSERT( XML_NAMESPACE_NONE != nKey,
- "SvXMLNamespaceMap::AddAtIndex: invalid namespace key" );
- if( XML_NAMESPACE_NONE != nKey && ! ( aNameHash.count ( rPrefix ) ) )
- {
- _Add( rPrefix, rName, nKey );
- bRet = sal_True;
- }
- return bRet;
-}
-
-sal_Bool SvXMLNamespaceMap::AddAtIndex( sal_uInt16 nIdx, const sal_Char *pPrefix,
- const sal_Char *pName, sal_uInt16 nKey )
-{
- OUString sPrefix( OUString::createFromAscii(pPrefix) );
- OUString sName( OUString::createFromAscii(pName) );
-
- return AddAtIndex( nIdx, sPrefix, sName, nKey );
-}
-
-OUString SvXMLNamespaceMap::GetQNameByIndex( sal_uInt16 nIdx,
- const OUString& rLocalName ) const
-{
- return GetQNameByKey( nIdx, rLocalName );
-}
-
-const OUString& SvXMLNamespaceMap::GetPrefixByIndex( sal_uInt16 nIdx ) const
-{
- NameSpaceMap::const_iterator aIter = aNameMap.find (nIdx);
- return (aIter != aNameMap.end()) ? (*aIter).second->sPrefix : sEmpty;
-}
-
-const OUString& SvXMLNamespaceMap::GetNameByIndex( sal_uInt16 nIdx ) const
-{
- NameSpaceMap::const_iterator aIter = aNameMap.find (nIdx);
- return (aIter != aNameMap.end()) ? (*aIter).second->sName : sEmpty;
-}
-
-sal_uInt16 SvXMLNamespaceMap::GetIndexByPrefix( const OUString& rPrefix ) const
-{
- NameSpaceHash::const_iterator aIter = aNameHash.find(rPrefix);
- return (aIter != aNameHash.end()) ? (*aIter).second->nKey : USHRT_MAX;
-}
-sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName(
- const OUString& rAttrName,
- OUString *pLocalName,
- sal_uInt16 nIdxGuess) const
-{
- return _GetKeyByAttrName( rAttrName, 0, pLocalName, 0 );
-}
-
-sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName( const OUString& rAttrName,
- OUString *pPrefix,
- OUString *pLocalName,
- OUString *pNamespace,
- USHORT nIdxGuess ) const
-{
- return _GetKeyByAttrName ( rAttrName, pPrefix, pLocalName, pNamespace );
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_unoatrcn.cxx b/binfilter/bf_xmloff/source/core/xmloff_unoatrcn.cxx
deleted file mode 100644
index c6167b7e0859..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_unoatrcn.cxx
+++ /dev/null
@@ -1,305 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <com/sun/star/xml/AttributeData.hpp>
-
-#include <rtl/ustrbuf.hxx>
-
-#include <rtl/uuid.h>
-
-#include <rtl/memory.h>
-
-#include "xmlcnimp.hxx"
-
-#include "unoatrcn.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-
-// --------------------------------------------------------------------
-// Interface implementation
-// --------------------------------------------------------------------
-
-#define IMPL ((AttrContainerImpl*)mpData)
-
-uno::Reference< uno::XInterface > SvUnoAttributeContainer_CreateInstance()
-{
- return *(new SvUnoAttributeContainer);
-}
-
-SvUnoAttributeContainer::SvUnoAttributeContainer( SvXMLAttrContainerData* pContainer)
-: mpContainer( pContainer )
-{
- if( mpContainer == NULL )
- mpContainer = new SvXMLAttrContainerData;
-}
-
-SvUnoAttributeContainer::~SvUnoAttributeContainer()
-{
- delete mpContainer;
-}
-
-// container::XElementAccess
-uno::Type SAL_CALL SvUnoAttributeContainer::getElementType(void)
- throw( uno::RuntimeException )
-{
- return ::getCppuType((const xml::AttributeData*)0);
-}
-
-sal_Bool SAL_CALL SvUnoAttributeContainer::hasElements(void)
- throw( uno::RuntimeException )
-{
- return mpContainer->GetAttrCount();
-}
-
-sal_uInt16 SvUnoAttributeContainer::getIndexByName(const OUString& aName ) const
-{
- const sal_uInt16 nAttrCount = mpContainer->GetAttrCount();
-
- sal_Int32 nPos = aName.indexOf( sal_Unicode(':') );
- if( nPos == -1L )
- {
- for( sal_uInt16 nAttr = 0; nAttr < nAttrCount; nAttr++ )
- {
- if( mpContainer->GetAttrLName(nAttr) == aName &&
- mpContainer->GetAttrPrefix(nAttr).getLength() == 0L )
- return nAttr;
- }
- }
- else
- {
- const OUString aPrefix( aName.copy( 0L, nPos ) );
- const OUString aLName( aName.copy( nPos+1L ) );
-
- for( sal_uInt16 nAttr = 0; nAttr < nAttrCount; nAttr++ )
- {
- if( mpContainer->GetAttrLName(nAttr) == aLName &&
- mpContainer->GetAttrPrefix(nAttr) == aPrefix )
- return nAttr;
- }
- }
-
- return USHRT_MAX;
-}
-
-const ::com::sun::star::uno::Sequence< sal_Int8 > & SvUnoAttributeContainer::getUnoTunnelId() throw()
-{
- static ::com::sun::star::uno::Sequence< sal_Int8 > * pSeq = 0;
- if( !pSeq )
- {
- ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !pSeq )
- {
- static ::com::sun::star::uno::Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- pSeq = &aSeq;
- }
- }
- return *pSeq;
-}
-
-sal_Int64 SAL_CALL SvUnoAttributeContainer::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw(::com::sun::star::uno::RuntimeException)
-{
- if( rId.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
- {
- return (sal_Int64)this;
- }
- return 0;
-}
-
-// container::XNameAccess
-uno::Any SAL_CALL SvUnoAttributeContainer::getByName(const OUString& aName)
- throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
-{
- sal_uInt16 nAttr = getIndexByName(aName );
-
- if( nAttr == USHRT_MAX )
- throw container::NoSuchElementException();
-
- xml::AttributeData aData;
- aData.Namespace = mpContainer->GetAttrNamespace(nAttr);
- aData.Type = OUString::createFromAscii("CDATA");
- aData.Value = mpContainer->GetAttrValue(nAttr);
-
- uno::Any aAny;
- aAny <<= aData;
- return aAny;
-}
-
-uno::Sequence< OUString > SAL_CALL SvUnoAttributeContainer::getElementNames(void) throw( uno::RuntimeException )
-{
- const sal_uInt16 nAttrCount = mpContainer->GetAttrCount();
-
- uno::Sequence< OUString > aElementNames( (sal_Int32)nAttrCount );
- OUString *pNames = aElementNames.getArray();
-
- for( sal_uInt16 nAttr = 0; nAttr < nAttrCount; nAttr++ )
- {
- OUStringBuffer sBuffer( mpContainer->GetAttrPrefix(nAttr) );
- if( sBuffer.getLength() != 0L )
- sBuffer.append( (sal_Unicode)':' );
- sBuffer.append( mpContainer->GetAttrLName(nAttr) );
- *pNames++ = sBuffer.makeStringAndClear();
- }
-
- return aElementNames;
-}
-
-sal_Bool SAL_CALL SvUnoAttributeContainer::hasByName(const OUString& aName) throw( uno::RuntimeException )
-{
- return getIndexByName(aName ) != USHRT_MAX;
-}
-
-// container::XNameReplace
-void SAL_CALL SvUnoAttributeContainer::replaceByName(const OUString& aName, const uno::Any& aElement)
- throw( lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
-{
- if( aElement.hasValue() && aElement.getValueType() == ::getCppuType((const xml::AttributeData*)0) )
- {
- sal_uInt16 nAttr = getIndexByName(aName );
- if( nAttr == USHRT_MAX )
- throw container::NoSuchElementException();
-
- xml::AttributeData* pData = (xml::AttributeData*)aElement.getValue();
-
- sal_Int32 nPos = aName.indexOf( sal_Unicode(':') );
- if( nPos != -1L )
- {
- const OUString aPrefix( aName.copy( 0L, nPos ));
- const OUString aLName( aName.copy( nPos+1L ));
-
- if( pData->Namespace.getLength() == 0L )
- {
- if( mpContainer->SetAt( nAttr, aPrefix, aLName, pData->Value ) )
- return;
- }
- else
- {
- if( mpContainer->SetAt( nAttr, aPrefix, pData->Namespace, aLName, pData->Value ) )
- return;
- }
- }
- else
- {
- if( pData->Namespace.getLength() == 0L )
- {
- if( mpContainer->SetAt( nAttr, aName, pData->Value ) )
- return;
- }
- }
- }
-
- throw lang::IllegalArgumentException();
-}
-
-// container::XNameContainer
-void SAL_CALL SvUnoAttributeContainer::insertByName(const OUString& aName, const uno::Any& aElement)
-throw( lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException )
-{
- if( !aElement.hasValue() || aElement.getValueType() != ::getCppuType((const xml::AttributeData*)0) )
- throw lang::IllegalArgumentException();
-
- sal_uInt16 nAttr = getIndexByName(aName );
- if( nAttr != USHRT_MAX )
- throw container::ElementExistException();
-
- xml::AttributeData* pData = (xml::AttributeData*)aElement.getValue();
-
- sal_Int32 nPos = aName.indexOf( sal_Unicode(':') );
- if( nPos != -1L )
- {
- const OUString aPrefix( aName.copy( 0L, nPos ));
- const OUString aLName( aName.copy( nPos+1L ));
-
- if( pData->Namespace.getLength() == 0L )
- {
- if( mpContainer->AddAttr( aPrefix, aLName, pData->Value ) )
- return;
- }
- else
- {
- if( mpContainer->AddAttr( aPrefix, pData->Namespace, aLName, pData->Value ) )
- return;
- }
- }
- else
- {
- if( pData->Namespace.getLength() == 0L )
- {
- if( mpContainer->AddAttr( aName, pData->Value ) )
- return;
- }
- }
-}
-
-void SAL_CALL SvUnoAttributeContainer::removeByName(const OUString& Name)
- throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
-{
- sal_uInt16 nAttr = getIndexByName(Name);
- if( nAttr == USHRT_MAX )
- throw container::NoSuchElementException();
-
- mpContainer->Remove( nAttr );
-}
-
-//XServiceInfo
-OUString SAL_CALL SvUnoAttributeContainer::getImplementationName(void) throw( uno::RuntimeException )
-{
- return OUString::createFromAscii( "SvUnoAttributeContainer" );
-}
-
-uno::Sequence< OUString > SvUnoAttributeContainer::getSupportedServiceNames(void)
- throw( uno::RuntimeException )
-{
- OUString aSN( OUString::createFromAscii( "com.sun.star.xml.AttributeContainer" ) );
- uno::Sequence< OUString > aNS( &aSN, 1L );
- return aNS;
-}
-
-sal_Bool SvUnoAttributeContainer::supportsService(const OUString& ServiceName)
- throw( uno::RuntimeException )
-{
- const uno::Sequence < OUString > aServiceNames( getSupportedServiceNames() );
- const OUString* pNames = aServiceNames.getConstArray();
- sal_Int32 nCount = aServiceNames.getLength();
- while( nCount-- )
- {
- if( *pNames++ == ServiceName )
- return sal_True;
- }
-
- return sal_False;
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_xmlcnitm.cxx b/binfilter/bf_xmloff/source/core/xmloff_xmlcnitm.cxx
deleted file mode 100644
index 98fd53bf48af..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_xmlcnitm.cxx
+++ /dev/null
@@ -1,221 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-#include <com/sun/star/xml/AttributeData.hpp>
-
-#include "xmlcnimp.hxx"
-namespace binfilter {
-
-using namespace rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::xml;
-
-typedef ::rtl::OUString *OUStringPtr;
-SV_DECL_PTRARR_DEL( SvXMLAttrContainerData_Impl, OUStringPtr, 5, 5 )
-SV_IMPL_PTRARR( SvXMLAttrContainerData_Impl, OUStringPtr )
-
-
-SvXMLAttrContainerData::SvXMLAttrContainerData(
- const SvXMLAttrContainerData& rImpl ) :
- aNamespaceMap( rImpl.aNamespaceMap ),
- pLNames( new SvXMLAttrContainerData_Impl ),
- pValues( new SvXMLAttrContainerData_Impl )
-{
- USHORT nCount = rImpl.pLNames->Count();
- for( USHORT i=0; i<nCount; i++ )
- {
- aPrefixPoss.Insert( rImpl.aPrefixPoss[i], i );
- pLNames->Insert( new OUString( *(*rImpl.pLNames)[i] ), i );
- pValues->Insert( new OUString( *(*rImpl.pValues)[i] ), i );
- }
-}
-
-SvXMLAttrContainerData::SvXMLAttrContainerData() :
- pLNames( new SvXMLAttrContainerData_Impl ),
- pValues( new SvXMLAttrContainerData_Impl )
-{
-}
-
-SvXMLAttrContainerData::~SvXMLAttrContainerData()
-{
- delete pLNames;
- delete pValues;
-}
-
-int SvXMLAttrContainerData::operator ==(
- const SvXMLAttrContainerData& rCmp ) const
-{
- BOOL bRet = pLNames->Count() == rCmp.pLNames->Count() &&
- aNamespaceMap == rCmp.aNamespaceMap;
- if( bRet )
- {
- USHORT nCount = pLNames->Count();
- USHORT i;
- for( i=0; bRet && i < nCount; i++ )
- bRet = aPrefixPoss[i] == rCmp.aPrefixPoss[i];
-
- if( bRet )
- {
- for( i=0; bRet && i < nCount; i++ )
- bRet = *(*pLNames)[i] == *(*rCmp.pLNames)[i] &&
- *(*pValues)[i] == *(*rCmp.pValues)[i];
- }
- }
-
- return (int)bRet;
-}
-
-BOOL SvXMLAttrContainerData::AddAttr( const OUString& rLName,
- const OUString& rValue )
-{
- aPrefixPoss.Insert( USHRT_MAX, aPrefixPoss.Count() );
- pLNames->Insert( new OUString(rLName), pLNames->Count() );
- pValues->Insert( new OUString(rValue), pValues->Count() );
-
- return TRUE;
-}
-
-BOOL SvXMLAttrContainerData::AddAttr( const OUString& rPrefix,
- const OUString& rNamespace,
- const OUString& rLName,
- const OUString& rValue )
-{
- USHORT nPos = aNamespaceMap.Add( rPrefix, rNamespace );
- aPrefixPoss.Insert( nPos, aPrefixPoss.Count() );
- pLNames->Insert( new OUString(rLName), pLNames->Count() );
- pValues->Insert( new OUString(rValue), pValues->Count() );
-
- return TRUE;
-}
-
-BOOL SvXMLAttrContainerData::AddAttr( const OUString& rPrefix,
- const OUString& rLName,
- const OUString& rValue )
-{
- USHORT nPos = aNamespaceMap.GetIndexByPrefix( rPrefix );
- if( USHRT_MAX == nPos )
- return FALSE;
-
- aPrefixPoss.Insert( nPos, aPrefixPoss.Count() );
- pLNames->Insert( new OUString(rLName), pLNames->Count() );
- pValues->Insert( new OUString(rValue), pValues->Count() );
-
- return TRUE;
-}
-
-BOOL SvXMLAttrContainerData::SetAt( USHORT i,
- const ::rtl::OUString& rLName, const ::rtl::OUString& rValue )
-{
- if( i >= GetAttrCount() )
- return FALSE;
-
- *(*pLNames)[i] = rLName;
- *(*pValues)[i] = rValue;
- aPrefixPoss[i] = USHRT_MAX;
-
- return TRUE;
-}
-
-BOOL SvXMLAttrContainerData::SetAt( USHORT i,
- const ::rtl::OUString& rPrefix, const ::rtl::OUString& rNamespace,
- const ::rtl::OUString& rLName, const ::rtl::OUString& rValue )
-{
- if( i >= GetAttrCount() )
- return FALSE;
-
- USHORT nPos = aNamespaceMap.Add( rPrefix, rNamespace );
- if( USHRT_MAX == nPos )
- return FALSE;
-
- *(*pLNames)[i] = rLName;
- *(*pValues)[i] = rValue;
- aPrefixPoss[i] = nPos;
-
- return TRUE;
-}
-
-BOOL SvXMLAttrContainerData::SetAt( USHORT i,
- const ::rtl::OUString& rPrefix,
- const ::rtl::OUString& rLName,
- const ::rtl::OUString& rValue )
-{
- if( i >= GetAttrCount() )
- return FALSE;
-
- USHORT nPos = aNamespaceMap.GetIndexByPrefix( rPrefix );
- if( USHRT_MAX == nPos )
- return FALSE;
-
- *(*pLNames)[i] = rLName;
- *(*pValues)[i] = rValue;
- aPrefixPoss[i] = nPos;
-
- return TRUE;
-}
-
-void SvXMLAttrContainerData::Remove( USHORT i )
-{
- if( i < GetAttrCount() )
- {
- delete (*pLNames)[i];
- pLNames->Remove( i );
- delete (*pValues)[i];
- pValues->Remove( i );
- aPrefixPoss.Remove( i );
- }
- else
- {
- DBG_ERROR( "illegal index" );
- }
-}
-
-sal_uInt16 SvXMLAttrContainerData::GetAttrCount() const
-{
- return pLNames->Count();
-}
-
-const ::rtl::OUString& SvXMLAttrContainerData::GetAttrLName(sal_uInt16 i) const
-{
- OSL_ENSURE( i >= 0 && i < pLNames->Count(),
- "SvXMLAttrContainerData::GetLName: illegal index" );
- return *(*pLNames)[i];
-}
-
-const ::rtl::OUString& SvXMLAttrContainerData::GetAttrValue(sal_uInt16 i) const
-{
- OSL_ENSURE( i >= 0 && i < pValues->Count(),
- "SvXMLAttrContainerData::GetValue: illegal index" );
- return *(*pValues)[i];
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_xmlehelp.cxx b/binfilter/bf_xmloff/source/core/xmloff_xmlehelp.cxx
deleted file mode 100644
index 5e13ec76bfc3..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_xmlehelp.cxx
+++ /dev/null
@@ -1,529 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <limits.h>
-#include <tools/bigint.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <vcl/outdev.hxx>
-
-#include "xmlehelp.hxx"
-
-#include "xmltoken.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::binfilter::xmloff::token;
-
-void SvXMLExportHelper::AddLength( sal_Int32 nValue, MapUnit eValueUnit,
- OUStringBuffer& rOut,
- MapUnit eOutUnit )
-{
- // the sign is processed seperatly
- if( nValue < 0 )
- {
- nValue = -nValue;
- rOut.append( sal_Unicode('-') );
- }
-
- // The new length is (nVal * nMul)/(nDiv*nFac*10)
- sal_Int32 nMul = 1000;
- sal_Int32 nDiv = 1;
- sal_Int32 nFac = 100;
- enum XMLTokenEnum eUnit = XML_TOKEN_INVALID;
- switch( eValueUnit )
- {
- case MAP_TWIP:
- switch( eOutUnit )
- {
- case MAP_100TH_MM:
- case MAP_10TH_MM:
- DBG_ASSERT( MAP_INCH == eOutUnit,
- "output unit not supported for twip values" );
- case MAP_MM:
- // 0.01mm = 0.57twip (exactly)
- nMul = 25400; // 25.4 * 1000
- nDiv = 1440; // 72 * 20;
- nFac = 100;
- eUnit = XML_UNIT_MM;
- break;
-
- case MAP_CM:
- // 0.001cm = 0.57twip (exactly)
- nMul = 25400; // 2.54 * 10000
- nDiv = 1440; // 72 * 20;
- nFac = 1000;
- eUnit = XML_UNIT_CM;
- break;
-
- case MAP_POINT:
- // 0.01pt = 0.2twip (exactly)
- nMul = 1000;
- nDiv = 20;
- nFac = 100;
- eUnit = XML_UNIT_PT;
- break;
-
- case MAP_INCH:
- default:
- DBG_ASSERT( MAP_INCH == eOutUnit,
- "output unit not supported for twip values" );
- // 0.0001in = 0.144twip (exactly)
- nMul = 100000;
- nDiv = 1440; // 72 * 20;
- nFac = 10000;
- eUnit = XML_UNIT_INCH;
- break;
- }
- break;
-
- case MAP_POINT:
- // 1pt = 1pt (exactly)
- DBG_ASSERT( MAP_POINT == eOutUnit,
- "output unit not supported for pt values" );
- nMul = 10;
- nDiv = 1;
- nFac = 1;
- eUnit = XML_UNIT_PT;
- break;
-
- case MAP_100TH_MM:
- switch( eOutUnit )
- {
- case MAP_100TH_MM:
- case MAP_10TH_MM:
- DBG_ASSERT( MAP_INCH == eOutUnit,
- "output unit not supported for 1/100mm values" );
- case MAP_MM:
- // 0.01mm = 1 mm/100 (exactly)
- nMul = 10;
- nDiv = 1;
- nFac = 100;
- eUnit = XML_UNIT_MM;
- break;
-
- case MAP_CM:
- // 0.001mm = 1 mm/100 (exactly)
- nMul = 10;
- nDiv = 1; // 72 * 20;
- nFac = 1000;
- eUnit = XML_UNIT_CM;
- break;
-
- case MAP_POINT:
- // 0.01pt = 0.35 mm/100 (exactly)
- nMul = 72000;
- nDiv = 2540;
- nFac = 100;
- eUnit = XML_UNIT_PT;
- break;
-
- case MAP_INCH:
- default:
- DBG_ASSERT( MAP_INCH == eOutUnit,
- "output unit not supported for 1/100mm values" );
- // 0.0001in = 0.254 mm/100 (exactly)
- nMul = 100000;
- nDiv = 2540;
- nFac = 10000;
- eUnit = XML_UNIT_INCH;
- break;
- }
- break;
- }
-
-
- sal_Int32 nLongVal;
- BOOL bOutLongVal = TRUE;
- if( nValue > SAL_MAX_INT32 / nMul )
- {
- // A big int is required for calculation
- BigInt nBigVal( nValue );
- BigInt nBigFac( nFac );
- nBigVal *= nMul;
- nBigVal /= nDiv;
- nBigVal += 5;
- nBigVal /= 10;
-
- if( nBigVal.IsLong() )
- {
- // To convert the value into a string a sal_Int32 is sufficient
- nLongVal = (sal_Int32)nBigVal;
- }
- else
- {
- BigInt nBigFac( nFac );
- BigInt nBig10( 10 );
- rOut.append( (sal_Int32)(nBigVal / nBigFac) );
- if( !(nBigVal % nBigFac).IsZero() )
- {
- rOut.append( sal_Unicode('.') );
- while( nFac > 1 && !(nBigVal % nBigFac).IsZero() )
- {
- nFac /= 10;
- nBigFac = nFac;
- rOut.append( (sal_Int32)((nBigVal / nBigFac) % nBig10 ) );
- }
- }
- bOutLongVal = FALSE;
- }
- }
- else
- {
- nLongVal = nValue * nMul;
- nLongVal /= nDiv;
- nLongVal += 5;
- nLongVal /= 10;
- }
-
- if( bOutLongVal )
- {
- rOut.append( (sal_Int32)(nLongVal / nFac) );
- if( nFac > 1 && (nLongVal % nFac) != 0 )
- {
- rOut.append( sal_Unicode('.') );
- while( nFac > 1 && (nLongVal % nFac) != 0 )
- {
- nFac /= 10;
- rOut.append( (sal_Int32)((nLongVal / nFac) % 10) );
- }
- }
- }
-
- if( eUnit != XML_TOKEN_INVALID )
- rOut.append( GetXMLToken(eUnit) );
-#if 0
- enum XMLTokenEnum eUnit;
- long nFac = 1;
- switch( eOutUnit )
- {
- case MAP_100TH_MM:
- nFac *= 10L;
- case MAP_10TH_MM:
- nFac *= 10L;
- eOutUnit = MAP_MM;
- case MAP_MM:
- // 0.01mm
- nFac *= 100L;
- eUnit = XML_UNIT_MM;
- break;
-
- case MAP_CM:
-#ifdef EXACT_VALUES
- // 0.001cm
- nFac *= 1000L;
-#else
- // 0.01cm
- nFac *= 100L;
-#endif
- eUnit = XML_UNIT_CM;
- break;
-
- case MAP_TWIP:
- case MAP_POINT:
-#ifdef EXACT_VALUES
- // 0.01pt
- nFac *= 100L;
-#else
- // 0.1pt
- nFac *= 10L;
-#endif
- eUnit = XML_UNIT_PT;
- break;
-
- case MAP_1000TH_INCH:
- nFac *= 10L;
- case MAP_100TH_INCH:
- nFac *= 10L;
- case MAP_10TH_INCH:
- nFac *= 10L;
- case MAP_INCH:
- default:
- eOutUnit = MAP_INCH;
-#ifdef EXACT_VALUES
- // 0.0001in
- nFac *= 10000L;
-#else
- // 0.01in
- nFac *= 100L;
-#endif
- eUnit = XML_UNIT_INCH;
- break;
- }
-
- if( eValueUnit != eOutUnit )
- nValue = OutputDevice::LogicToLogic( nValue, eValueUnit, eOutUnit );
-
- rOut.append( nValue / nFac );
- if( nFac > 1 && (nValue % nFac) != 0 )
- {
- rOut.append( sal_Unicode('.') );
- while( nFac > 1 && (nValue % nFac) != 0 )
- {
- nFac /= 10L;
- rOut.append( (nValue / nFac) % 10L );
- }
- }
-
- rOut.append( GetXMLToken(eUnit) );
-#endif
-
-}
-
-double SvXMLExportHelper::GetConversionFactor(::rtl::OUStringBuffer& rUnit,
- const MapUnit eCoreUnit, const MapUnit eDestUnit)
-{
- double fRetval(1.0);
- rUnit.setLength(0L);
-
- if(eCoreUnit != eDestUnit)
- {
- enum XMLTokenEnum eUnit = XML_TOKEN_INVALID;
-
- switch(eCoreUnit)
- {
- case MAP_TWIP:
- {
- switch(eDestUnit)
- {
- case MAP_100TH_MM:
- case MAP_10TH_MM:
- {
- DBG_ASSERT(MAP_INCH == eDestUnit, "output unit not supported for twip values");
- }
- case MAP_MM:
- {
- // 0.01mm = 0.57twip (exactly)
- fRetval = ((25400.0 / 1440.0) / 1000.0);
- eUnit = XML_UNIT_MM;
- break;
- }
- case MAP_CM:
- {
- // 0.001cm = 0.57twip (exactly)
- fRetval = ((25400.0 / 1440.0) / 10000.0);
- eUnit = XML_UNIT_CM;
- break;
- }
- case MAP_POINT:
- {
- // 0.01pt = 0.2twip (exactly)
- fRetval = ((1000.0 / 20.0) / 1000.0);
- eUnit = XML_UNIT_PT;
- break;
- }
- case MAP_INCH:
- default:
- {
- DBG_ASSERT(MAP_INCH == eDestUnit, "output unit not supported for twip values");
- // 0.0001in = 0.144twip (exactly)
- fRetval = ((100000.0 / 1440.0) / 100000.0);
- eUnit = XML_UNIT_INCH;
- break;
- }
- }
- break;
- }
- case MAP_POINT:
- {
- switch(eDestUnit)
- {
- case MAP_MM:
- // 1mm = 72 / 25.4 pt (exactly)
- fRetval = ( 25.4 / 72.0 );
- eUnit = XML_UNIT_MM;
- break;
-
- case MAP_CM:
- // 1cm = 72 / 2.54 pt (exactly)
- fRetval = ( 2.54 / 72.0 );
- eUnit = XML_UNIT_CM;
- break;
-
- case MAP_TWIP:
- // 1twip = 72 / 1440 pt (exactly)
- fRetval = 20.0; // 1440.0 / 72.0
- eUnit = XML_UNIT_PC;
- break;
-
- case MAP_INCH:
- default:
- DBG_ASSERT(MAP_INCH == eDestUnit, "output unit not supported for pt values");
- // 1in = 72 pt (exactly)
- fRetval = ( 1.0 / 72.0 );
- eUnit = XML_UNIT_INCH;
- break;
- }
- break;
- }
- case MAP_100TH_MM:
- {
- switch(eDestUnit)
- {
- case MAP_100TH_MM:
- case MAP_10TH_MM:
- {
- DBG_ASSERT(MAP_INCH == eDestUnit, "output unit not supported for 1/100mm values");
- }
- case MAP_MM:
- {
- // 0.01mm = 1 mm/100 (exactly)
- fRetval = ((10.0 / 1.0) / 1000.0);
- eUnit = XML_UNIT_MM;
- break;
- }
- case MAP_CM:
- {
- // 0.001mm = 1 mm/100 (exactly)
- fRetval = ((10.0 / 1.0) / 10000.0);
- eUnit = XML_UNIT_CM;
- break;
- }
- case MAP_POINT:
- {
- // 0.01pt = 0.35 mm/100 (exactly)
- fRetval = ((72000.0 / 2540.0) / 1000.0);
- eUnit = XML_UNIT_PT;
- break;
- }
- case MAP_INCH:
- default:
- {
- DBG_ASSERT(MAP_INCH == eDestUnit, "output unit not supported for 1/100mm values");
- // 0.0001in = 0.254 mm/100 (exactly)
- fRetval = ((100000.0 / 2540.0) / 100000.0);
- eUnit = XML_UNIT_INCH;
- break;
- }
- }
- break;
- }
- }
-
- if(eUnit != XML_TOKEN_INVALID)
- rUnit.append(GetXMLToken(eUnit));
- }
-
- return fRetval;
-}
-
-MapUnit SvXMLExportHelper::GetUnitFromString(const ::rtl::OUString& rString, MapUnit eDefaultUnit)
-{
- sal_Int32 nPos = 0L;
- sal_Int32 nLen = rString.getLength();
- MapUnit eRetUnit = eDefaultUnit;
-
- // skip white space
- while( nPos < nLen && sal_Unicode(' ') == rString[nPos] )
- nPos++;
-
- // skip negative
- if( nPos < nLen && sal_Unicode('-') == rString[nPos] )
- nPos++;
-
- // skip number
- while( nPos < nLen && sal_Unicode('0') <= rString[nPos] && sal_Unicode('9') >= rString[nPos] )
- nPos++;
-
- if( nPos < nLen && sal_Unicode('.') == rString[nPos] )
- {
- nPos++;
- while( nPos < nLen && sal_Unicode('0') <= rString[nPos] && sal_Unicode('9') >= rString[nPos] )
- nPos++;
- }
-
- // skip white space
- while( nPos < nLen && sal_Unicode(' ') == rString[nPos] )
- nPos++;
-
- if( nPos < nLen )
- {
- switch(rString[nPos])
- {
- case sal_Unicode('%') :
- {
- eRetUnit = MAP_RELATIVE;
- break;
- }
- case sal_Unicode('c'):
- case sal_Unicode('C'):
- {
- if(nPos+1 < nLen && (rString[nPos+1] == sal_Unicode('m')
- || rString[nPos+1] == sal_Unicode('M')))
- eRetUnit = MAP_CM;
- break;
- }
- case sal_Unicode('e'):
- case sal_Unicode('E'):
- {
- // CSS1_EMS or CSS1_EMX later
- break;
- }
- case sal_Unicode('i'):
- case sal_Unicode('I'):
- {
- if(nPos+3 < nLen)
- {
- if(rString[nPos+1] == sal_Unicode('n') || rString[nPos+1] == sal_Unicode('N'))
- {
- if(rString[nPos+2] == sal_Unicode('c') || rString[nPos+2] == sal_Unicode('C'))
- {
- if(rString[nPos+3] == sal_Unicode('h') || rString[nPos+3] == sal_Unicode('H'))
- {
- eRetUnit = MAP_INCH;
- }
- }
- }
- }
- break;
- }
- case sal_Unicode('m'):
- case sal_Unicode('M'):
- {
- if(nPos+1 < nLen && (rString[nPos+1] == sal_Unicode('m')
- || rString[nPos+1] == sal_Unicode('M')))
- eRetUnit = MAP_MM;
- break;
- }
- case sal_Unicode('p'):
- case sal_Unicode('P'):
- {
- if(nPos+1 < nLen && (rString[nPos+1] == sal_Unicode('t')
- || rString[nPos+1] == sal_Unicode('T')))
- eRetUnit = MAP_POINT;
- if(nPos+1 < nLen && (rString[nPos+1] == sal_Unicode('c')
- || rString[nPos+1] == sal_Unicode('C')))
- eRetUnit = MAP_TWIP;
- break;
- }
- }
- }
-
- return eRetUnit;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_xmlerror.cxx b/binfilter/bf_xmloff/source/core/xmloff_xmlerror.cxx
deleted file mode 100644
index 2b9eb3ae2835..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_xmlerror.cxx
+++ /dev/null
@@ -1,247 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "xmlerror.hxx"
-
-#include <tools/debug.hxx>
-
-
-#include <com/sun/star/xml/sax/XLocator.hpp>
-
-
-
-
-#include <com/sun/star/uno/Sequence.hxx>
-
-
-#include <rtl/ustrbuf.hxx>
-
-#include <tools/string.hxx>
-namespace binfilter {
-
-
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::xml::sax::XLocator;
-using ::com::sun::star::xml::sax::SAXParseException;
-
-
-//
-/// ErrorRecord: contains all information for one error
-//
-
-class ErrorRecord
-{
-public:
-
- ErrorRecord( sal_Int32 nId,
- const Sequence<OUString>& rParams,
- const OUString& rExceptionMessage,
- sal_Int32 nRow,
- sal_Int32 nColumn,
- const OUString& rPublicId,
- const OUString& rSystemId);
- ~ErrorRecord();
-
- sal_Int32 nId; /// error ID
-
- OUString sExceptionMessage;/// message of original exception (if available)
-
- // XLocator information:
- sal_Int32 nRow; /// row number where error occured (or -1 for unknown)
- sal_Int32 nColumn; /// column number where error occured (or -1)
- OUString sPublicId; /// public identifier
- OUString sSystemId; /// public identifier
-
- /// message Parameters
- Sequence<OUString> aParams;
-};
-
-
-ErrorRecord::ErrorRecord( sal_Int32 nID, const Sequence<OUString>& rParams,
- const OUString& rExceptionMessage, sal_Int32 nRowNumber, sal_Int32 nCol,
- const OUString& rPublicId, const OUString& rSystemId) :
- nId(nID),
- aParams(rParams),
- sExceptionMessage(rExceptionMessage),
- nRow(nRowNumber),
- nColumn(nCol),
- sPublicId(rPublicId),
- sSystemId(rSystemId)
-{
-}
-
-ErrorRecord::~ErrorRecord()
-{
-}
-
-
-
-
-XMLErrors::XMLErrors()
-{
-}
-
-XMLErrors::~XMLErrors()
-{
-}
-
-void XMLErrors::AddRecord(
- sal_Int32 nId,
- const Sequence<OUString> & rParams,
- const OUString& rExceptionMessage,
- sal_Int32 nRow,
- sal_Int32 nColumn,
- const OUString& rPublicId,
- const OUString& rSystemId )
-{
- aErrors.push_back( ErrorRecord( nId, rParams, rExceptionMessage,
- nRow, nColumn, rPublicId, rSystemId ) );
-
-#ifdef DBG_UTIL
-
- // give detailed assertion on this message
-
- OUStringBuffer sMessage;
-
- sMessage.appendAscii( "An error or a warning has occured during XML import/export!\n" );
-
- // ID & flags
- sMessage.appendAscii( "Error-Id: 0x");
- sMessage.append( nId, 16 );
- sMessage.appendAscii( "\n Flags: " );
- sal_Int32 nFlags = (nId & XMLERROR_MASK_FLAG);
- sMessage.append( nFlags >> 28, 16 );
- if( (nFlags & XMLERROR_FLAG_WARNING) != 0 )
- sMessage.appendAscii( " WARNING" );
- if( (nFlags & XMLERROR_FLAG_ERROR) != 0 )
- sMessage.appendAscii( " ERRROR" );
- if( (nFlags & XMLERROR_FLAG_SEVERE) != 0 )
- sMessage.appendAscii( " SEVERE" );
- sMessage.appendAscii( "\n Class: " );
- sal_Int32 nClass = (nId & XMLERROR_MASK_CLASS);
- sMessage.append( nClass >> 16, 16 );
- if( (nClass & XMLERROR_CLASS_IO) != 0 )
- sMessage.appendAscii( " IO" );
- if( (nClass & XMLERROR_CLASS_FORMAT) != 0 )
- sMessage.appendAscii( " FORMAT" );
- if( (nClass & XMLERROR_CLASS_API) != 0 )
- sMessage.appendAscii( " API" );
- if( (nClass & XMLERROR_CLASS_OTHER) != 0 )
- sMessage.appendAscii( " OTHER" );
- sMessage.appendAscii( "\n Number: " );
- sal_Int32 nNumber = (nId & XMLERROR_MASK_NUMBER);
- sMessage.append( nNumber, 16 );
- sMessage.appendAscii( "\n");
-
- // the parameters
- sMessage.appendAscii( "Parameters:\n" );
- sal_Int32 nLength = rParams.getLength();
- const OUString* pParams = rParams.getConstArray();
- for( sal_Int32 i = 0; i < nLength; i++ )
- {
- sMessage.appendAscii( " " );
- sMessage.append( i );
- sMessage.appendAscii( ": " );
- sMessage.append( pParams[i] );
- sMessage.appendAscii( "\n" );
- }
-
- // the exception message
- sMessage.appendAscii( "Exception-Message: " );
- sMessage.append( rExceptionMessage );
- sMessage.appendAscii( "\n" );
-
- // position (if given)
- if( (nRow != -1) || (nColumn != -1) )
- {
- sMessage.appendAscii( "Position:\n Public Identifier: " );
- sMessage.append( rPublicId );
- sMessage.appendAscii( "\n System Identifier: " );
- sMessage.append( rSystemId );
- sMessage.appendAscii( "\n Row, Column: " );
- sMessage.append( nRow );
- sMessage.appendAscii( "," );
- sMessage.append( nColumn );
- sMessage.appendAscii( "\n" );
- }
-
- // convert to byte string and signal the error
- ByteString aError( String( sMessage.makeStringAndClear() ),
- RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR( aError.GetBuffer() );
-#endif
-}
-
-void XMLErrors::AddRecord(
- sal_Int32 nId,
- const Sequence<OUString> & rParams,
- const OUString& rExceptionMessage,
- const Reference<XLocator> & rLocator)
-{
- if ( rLocator.is() )
- {
- AddRecord( nId, rParams, rExceptionMessage,
- rLocator->getLineNumber(), rLocator->getColumnNumber(),
- rLocator->getPublicId(), rLocator->getSystemId() );
- }
- else
- {
- OUString sEmpty;
- AddRecord( nId, rParams, rExceptionMessage,
- -1, -1, sEmpty, sEmpty );
- }
-}
-
-void XMLErrors::ThrowErrorAsSAXException(sal_Int32 nIdMask)
- throw( SAXParseException )
-{
- // search first error/warning that matches the nIdMask
- for( ErrorList::iterator aIter = aErrors.begin();
- aIter != aErrors.end();
- aIter++ )
- {
- if ( (aIter->nId & nIdMask) != 0 )
- {
- // we throw the error
- ErrorRecord& rErr = aErrors[0];
- Any aAny;
- aAny <<= rErr.aParams;
- throw SAXParseException(
- rErr.sExceptionMessage, NULL, aAny,
- rErr.sPublicId, rErr.sSystemId, rErr.nRow, rErr.nColumn );
- }
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_xmlexp.cxx b/binfilter/bf_xmloff/source/core/xmloff_xmlexp.cxx
deleted file mode 100644
index 8c2301afa713..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_xmlexp.cxx
+++ /dev/null
@@ -1,1766 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <rtl/uuid.h>
-#include <tools/debug.hxx>
-#include <tools/urlobj.hxx>
-
-#include <com/sun/star/document/XBinaryStreamResolver.hpp>
-#include <com/sun/star/xml/sax/SAXInvalidCharacterException.hpp>
-
-#include "nmspmap.hxx"
-#include "xmluconv.hxx"
-
-#include "xmlnmspe.hxx"
-
-#include "xmlmetae.hxx"
-
-#include "XMLEventExport.hxx"
-
-#include "XMLStarBasicExportHandler.hxx"
-
-#include "XMLScriptExportHandler.hxx"
-
-#include "SettingsExportHelper.hxx"
-
-#include <com/sun/star/document/XEventsSupplier.hpp>
-#include <com/sun/star/document/XViewDataSupplier.hpp>
-
-#include <GradientStyle.hxx>
-#include <HatchStyle.hxx>
-#include <ImageStyle.hxx>
-#include <TransGradientStyle.hxx>
-#include <MarkerStyle.hxx>
-#include <DashStyle.hxx>
-#include <bf_xmloff/XMLFontAutoStylePool.hxx>
-#include "XMLImageMapExport.hxx"
-#include "XMLBase64Export.hxx"
-#include "xmlerror.hxx"
-
-#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
-#include "XMLFilterServiceNames.h"
-#include "XMLEmbeddedObjectExportFilter.hxx"
-#include "XMLBasicExportFilter.hxx"
-
-#include <osl/mutex.hxx>
-
-#include <rtl/logfile.hxx>
-#include <cppuhelper/implbase1.hxx>
-
-#include <comphelper/extract.hxx>
-#include "bf_so3/staticbaseurl.hxx"
-namespace binfilter {
-
-using namespace ::osl;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::document;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::io;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-sal_Char __READONLY_DATA sXML_1_0[] = "1.0";
-
-#define LOGFILE_AUTHOR "mb93740"
-
-#define XML_MODEL_SERVICE_WRITER "com.sun.star.text.TextDocument"
-#define XML_MODEL_SERVICE_CALC "com.sun.star.sheet.SpreadsheetDocument"
-#define XML_MODEL_SERVICE_DRAW "com.sun.star.drawing.DrawingDocument"
-#define XML_MODEL_SERVICE_IMPRESS "com.sun.star.presentation.PresentationDocument"
-#define XML_MODEL_SERVICE_MATH "com.sun.star.formula.FormulaProperties"
-#define XML_MODEL_SERVICE_CHART "com.sun.star.chart.ChartDocument"
-
-#define XML_USEPRETTYPRINTING "UsePrettyPrinting"
-
-struct XMLServiceMapEntry_Impl
-{
- const sal_Char *sModelService;
- sal_Int32 nModelServiceLen;
- const sal_Char *sFilterService;
- sal_Int32 nFilterServiceLen;
-};
-
-#define SERVICE_MAP_ENTRY( app ) \
- { XML_MODEL_SERVICE_##app, sizeof(XML_MODEL_SERVICE_##app)-1, \
- XML_EXPORT_FILTER_##app, sizeof(XML_EXPORT_FILTER_##app)-1 }
-
-const XMLServiceMapEntry_Impl aServiceMap[] =
-{
- SERVICE_MAP_ENTRY( WRITER ),
- SERVICE_MAP_ENTRY( CALC ),
- SERVICE_MAP_ENTRY( IMPRESS ),// Impress supports DrawingDocument, too, so
- SERVICE_MAP_ENTRY( DRAW ), // it must appear before Draw
- SERVICE_MAP_ENTRY( MATH ),
- SERVICE_MAP_ENTRY( CHART ),
- { 0, 0, 0, 0 }
-};
-
-//==============================================================================
-
-class SvXMLExportEventListener : public ::cppu::WeakImplHelper1<
- ::com::sun::star::lang::XEventListener >
-{
-private:
- SvXMLExport* pExport;
-
-public:
- SvXMLExportEventListener(SvXMLExport* pExport);
- virtual ~SvXMLExportEventListener();
-
- // XEventListener
- virtual void SAL_CALL disposing(const lang::EventObject& rEventObject) throw(::com::sun::star::uno::RuntimeException);
-};
-
-SvXMLExportEventListener::SvXMLExportEventListener(SvXMLExport* pTempExport)
- : pExport(pTempExport)
-{
-}
-
-SvXMLExportEventListener::~SvXMLExportEventListener()
-{
-}
-
-// XEventListener
-void SAL_CALL SvXMLExportEventListener::disposing( const lang::EventObject& rEventObject )
- throw(uno::RuntimeException)
-{
- if (pExport)
- pExport->DisposingModel();
-}
-
-//==============================================================================
-
-
-void SvXMLExport::_InitCtor()
-{
- pNamespaceMap->Add( GetXMLToken(XML_NP_OFFICE), GetXMLToken(XML_N_OFFICE), XML_NAMESPACE_OFFICE );
- if( (getExportFlags() & (EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_FONTDECLS) ) != 0 )
- {
- pNamespaceMap->Add( GetXMLToken(XML_NP_FO), GetXMLToken(XML_N_FO), XML_NAMESPACE_FO );
- }
- if( (getExportFlags() & (EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS) ) != 0 )
- {
- pNamespaceMap->Add( GetXMLToken(XML_NP_XLINK), GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK );
- }
- if( (getExportFlags() & EXPORT_SETTINGS) != 0 )
- {
- pNamespaceMap->Add( GetXMLToken(XML_NP_CONFIG), GetXMLToken(XML_N_CONFIG), XML_NAMESPACE_CONFIG );
- }
-
- if( (getExportFlags() & EXPORT_META) != 0 )
- {
- pNamespaceMap->Add( GetXMLToken(XML_NP_DC), GetXMLToken(XML_N_DC), XML_NAMESPACE_DC );
- pNamespaceMap->Add( GetXMLToken(XML_NP_META), GetXMLToken(XML_N_META), XML_NAMESPACE_META );
- }
- if( (getExportFlags() & (EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_FONTDECLS) ) != 0 )
- {
- pNamespaceMap->Add( GetXMLToken(XML_NP_STYLE), GetXMLToken(XML_N_STYLE), XML_NAMESPACE_STYLE );
- }
-
- // namespaces for documents
- if( (getExportFlags() & (EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 )
- {
- pNamespaceMap->Add( GetXMLToken(XML_NP_TEXT), GetXMLToken(XML_N_TEXT), XML_NAMESPACE_TEXT );
- pNamespaceMap->Add( GetXMLToken(XML_NP_DRAW), GetXMLToken(XML_N_DRAW), XML_NAMESPACE_DRAW );
- pNamespaceMap->Add( GetXMLToken(XML_NP_DR3D), GetXMLToken(XML_N_DR3D), XML_NAMESPACE_DR3D );
- pNamespaceMap->Add( GetXMLToken(XML_NP_SVG), GetXMLToken(XML_N_SVG), XML_NAMESPACE_SVG );
- pNamespaceMap->Add( GetXMLToken(XML_NP_CHART), GetXMLToken(XML_N_CHART), XML_NAMESPACE_CHART );
- pNamespaceMap->Add( GetXMLToken(XML_NP_TABLE), GetXMLToken(XML_N_TABLE), XML_NAMESPACE_TABLE );
- pNamespaceMap->Add( GetXMLToken(XML_NP_NUMBER), GetXMLToken(XML_N_NUMBER), XML_NAMESPACE_NUMBER );
- }
- if( (getExportFlags() & (EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 )
- {
- pNamespaceMap->Add( GetXMLToken(XML_NP_MATH), GetXMLToken(XML_N_MATH), XML_NAMESPACE_MATH );
- pNamespaceMap->Add( GetXMLToken(XML_NP_FORM), GetXMLToken(XML_N_FORM), XML_NAMESPACE_FORM );
- }
- if( (getExportFlags() & (EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS) ) != 0 )
- {
- pNamespaceMap->Add( GetXMLToken(XML_NP_SCRIPT), GetXMLToken(XML_N_SCRIPT), XML_NAMESPACE_SCRIPT );
- }
-
- xAttrList = (xml::sax::XAttributeList*)pAttrList;
-
- sPicturesPath = OUString( RTL_CONSTASCII_USTRINGPARAM( "#Pictures/" ) );
- sObjectsPath = OUString( RTL_CONSTASCII_USTRINGPARAM( "#./" ) );
- sGraphicObjectProtocol = OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.GraphicObject:" ) );
- sEmbeddedObjectProtocol = OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.EmbeddedObject:" ) );
-
- if (xModel.is() && !pEventListener)
- {
- pEventListener = new SvXMLExportEventListener(this);
- xModel->addEventListener(pEventListener);
- }
-}
-
-// #110680#
-SvXMLExport::SvXMLExport(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- MapUnit eDfltUnit, const enum XMLTokenEnum eClass, sal_uInt16 nExportFlags )
-: pImpl( 0 ),
- // #110680#
- mxServiceFactory(xServiceFactory),
- meClass( eClass ),
- sWS( GetXMLToken(XML_WS) ),
- pNamespaceMap( new SvXMLNamespaceMap ),
-
- // #110680#
- // pUnitConv( new SvXMLUnitConverter( MAP_100TH_MM, eDfltUnit ) ),
- pUnitConv( new SvXMLUnitConverter( MAP_100TH_MM, eDfltUnit, getServiceFactory() ) ),
-
- pAttrList( new SvXMLAttributeList ),
- bExtended( sal_False ),
- pNumExport(0L),
- pProgressBarHelper( NULL ),
- pEventExport( NULL ),
- pImageMapExport( NULL ),
- pEventListener( NULL ),
- pXMLErrors( NULL ),
- bSaveLinkedSections(sal_True),
- mnExportFlags( nExportFlags ),
- mnErrorFlags( ERROR_NO )
-{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
- _InitCtor();
-}
-
-SvXMLExport::~SvXMLExport()
-{
- delete pXMLErrors;
- delete pImageMapExport;
- delete pEventExport;
- delete pNamespaceMap;
- delete pUnitConv;
- if (pProgressBarHelper || pNumExport)
- {
- if (xExportInfo.is())
- {
- uno::Reference< beans::XPropertySetInfo > xPropertySetInfo = xExportInfo->getPropertySetInfo();
- if (xPropertySetInfo.is())
- {
- if (pProgressBarHelper)
- {
- OUString sProgressMax(RTL_CONSTASCII_USTRINGPARAM(XML_PROGRESSMAX));
- OUString sProgressCurrent(RTL_CONSTASCII_USTRINGPARAM(XML_PROGRESSCURRENT));
- OUString sRepeat(RTL_CONSTASCII_USTRINGPARAM(XML_PROGRESSREPEAT));
- if (xPropertySetInfo->hasPropertyByName(sProgressMax) &&
- xPropertySetInfo->hasPropertyByName(sProgressCurrent))
- {
- sal_Int32 nProgressMax(pProgressBarHelper->GetReference());
- sal_Int32 nProgressCurrent(pProgressBarHelper->GetValue());
- uno::Any aAny;
- aAny <<= nProgressMax;
- xExportInfo->setPropertyValue(sProgressMax, aAny);
- aAny <<= nProgressCurrent;
- xExportInfo->setPropertyValue(sProgressCurrent, aAny);
- }
- if (xPropertySetInfo->hasPropertyByName(sRepeat))
- xExportInfo->setPropertyValue(sRepeat, ::cppu::bool2any(pProgressBarHelper->GetRepeat()));
- }
- if (pNumExport && (mnExportFlags & (EXPORT_AUTOSTYLES | EXPORT_STYLES)))
- {
- OUString sWrittenNumberFormats(RTL_CONSTASCII_USTRINGPARAM(XML_WRITTENNUMBERSTYLES));
- if (xPropertySetInfo->hasPropertyByName(sWrittenNumberFormats))
- {
- uno::Sequence<sal_Int32> aWasUsed;
- pNumExport->GetWasUsed(aWasUsed);
- uno::Any aAny;
- aAny <<= aWasUsed;
- xExportInfo->setPropertyValue(sWrittenNumberFormats, aAny);
- }
- }
- }
- }
- delete pProgressBarHelper;
- delete pNumExport;
- }
-
- xmloff::token::ResetTokens();
-
- if (pEventListener && xModel.is())
- xModel->removeEventListener(pEventListener);
-}
-
-///////////////////////////////////////////////////////////////////////
-
-// XExporter
-void SAL_CALL SvXMLExport::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc )
- throw(lang::IllegalArgumentException, uno::RuntimeException)
-{
- xModel = uno::Reference< frame::XModel >::query( xDoc );
- if( !xModel.is() )
- throw lang::IllegalArgumentException();
- if (xModel.is() && !pEventListener)
- {
- pEventListener = new SvXMLExportEventListener(this);
- xModel->addEventListener(pEventListener);
- }
-
- if(!xNumberFormatsSupplier.is() )
- {
- xNumberFormatsSupplier = xNumberFormatsSupplier.query( xModel );
- if(xNumberFormatsSupplier.is() && xHandler.is())
- pNumExport = new SvXMLNumFmtExport(*this, xNumberFormatsSupplier);
- }
- if (xExportInfo.is())
- {
- uno::Reference< beans::XPropertySetInfo > xPropertySetInfo = xExportInfo->getPropertySetInfo();
- if (xPropertySetInfo.is())
- {
- OUString sUsePrettyPrinting(RTL_CONSTASCII_USTRINGPARAM(XML_USEPRETTYPRINTING));
- if (xPropertySetInfo->hasPropertyByName(sUsePrettyPrinting))
- {
- uno::Any aAny = xExportInfo->getPropertyValue(sUsePrettyPrinting);
- if (::cppu::any2bool(aAny))
- mnExportFlags |= EXPORT_PRETTY;
- else
- mnExportFlags &= ~EXPORT_PRETTY;
- }
- if (pNumExport && (mnExportFlags & (EXPORT_AUTOSTYLES | EXPORT_STYLES)))
- {
- OUString sWrittenNumberFormats(RTL_CONSTASCII_USTRINGPARAM(XML_WRITTENNUMBERSTYLES));
- if (xPropertySetInfo->hasPropertyByName(sWrittenNumberFormats))
- {
- uno::Any aAny = xExportInfo->getPropertyValue(sWrittenNumberFormats);
- uno::Sequence<sal_Int32> aWasUsed;
- if(aAny >>= aWasUsed)
- pNumExport->SetWasUsed(aWasUsed);
- }
- }
- }
- }
-
- // namespaces for user defined attributes
- Reference< XMultiServiceFactory > xFactory( xModel, UNO_QUERY );
- if( xFactory.is() )
- {
- try
- {
- Reference < XInterface > xIfc =
- xFactory->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.xml.NamespaceMap")) );
- if( xIfc.is() )
- {
- Reference< XNameAccess > xNamespaceMap( xIfc, UNO_QUERY );
- if( xNamespaceMap.is() )
- {
- Sequence< OUString > aPrefixes( xNamespaceMap->getElementNames() );
-
- OUString* pPrefix = aPrefixes.getArray();
- const sal_Int32 nCount = aPrefixes.getLength();
- sal_Int32 nIndex;
- OUString aURL;
-
- for( nIndex = 0; nIndex < nCount; nIndex++, *pPrefix++ )
- {
- if( xNamespaceMap->getByName( *pPrefix ) >>= aURL )
- _GetNamespaceMap().Add( *pPrefix, aURL, XML_NAMESPACE_UNKNOWN );
- }
- }
- }
- }
- catch( ::com::sun::star::uno::Exception& )
- {
- }
- }
-}
-
-// XInitialize
-void SAL_CALL SvXMLExport::initialize( const uno::Sequence< uno::Any >& aArguments )
- throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
-{
- // #93186# we need to queryInterface every single Any with any expected outcome. This variable hold the queryInterface results.
-
- const sal_Int32 nAnyCount = aArguments.getLength();
- const uno::Any* pAny = aArguments.getConstArray();
-
- for( sal_Int32 nIndex = 0; nIndex < nAnyCount; nIndex++, pAny++ )
- {
- Reference<XInterface> xValue;
- *pAny >>= xValue;
-
- // status indicator
- uno::Reference<task::XStatusIndicator> xTmpStatus( xValue, UNO_QUERY );
- if ( xTmpStatus.is() )
- xStatusIndicator = xTmpStatus;
-
- // graphic resolver
- uno::Reference<document::XGraphicObjectResolver> xTmpGraphic(
- xValue, UNO_QUERY );
- if ( xTmpGraphic.is() )
- xGraphicResolver = xTmpGraphic;
-
- // object resolver
- uno::Reference<document::XEmbeddedObjectResolver> xTmpObjectResolver(
- xValue, UNO_QUERY );
- if ( xTmpObjectResolver.is() )
- xEmbeddedResolver = xTmpObjectResolver;
-
- // document handler
- uno::Reference<xml::sax::XDocumentHandler> xTmpDocHandler(
- xValue, UNO_QUERY );
- if( xTmpDocHandler.is() )
- {
- xHandler = xTmpDocHandler;
- *pAny >>= xExtHandler;
-
- if (xNumberFormatsSupplier.is() && pNumExport == NULL)
- pNumExport = new SvXMLNumFmtExport(*this, xNumberFormatsSupplier);
- }
-
- // property set to transport data across
- uno::Reference<beans::XPropertySet> xTmpPropertySet(
- xValue, UNO_QUERY );
- if( xTmpPropertySet.is() )
- xExportInfo = xTmpPropertySet;
- }
-}
-
-// XFilter
-sal_Bool SAL_CALL SvXMLExport::filter( const uno::Sequence< beans::PropertyValue >& aDescriptor ) throw(uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogContext, "xmloff", LOGFILE_AUTHOR,
- "SvXMLExport::filter" );
-
- // check for xHandler first... should have been supplied in initialize
- if( !xHandler.is() )
- return sal_False;
-
- try
- {
- const sal_Int32 nPropCount = aDescriptor.getLength();
- const beans::PropertyValue* pProps = aDescriptor.getConstArray();
-
- for( sal_Int32 nIndex = 0; nIndex < nPropCount; nIndex++, pProps++ )
- {
- const OUString& rPropName = pProps->Name;
- const Any& rValue = pProps->Value;
-
- if( rPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FileName" ) ) )
- {
- if( !(rValue >>= sOrigFileName ) )
- return sal_False;
- }
- else if (rPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FilterName" ) ) )
- {
- if( !(rValue >>= sFilterName ) )
- return sal_False;
- }
- }
-
-#ifdef TIMELOG
- // print a trace message with the URL
- ByteString aUrl( (String) GetModel()->getURL(),
- RTL_TEXTENCODING_ASCII_US );
- RTL_LOGFILE_CONTEXT_TRACE1( aLogContext, "%s", aUrl.GetBuffer() );
-
- // we also want a trace message with the document class
- ByteString aClass( (String)GetXMLToken(meClass),
- RTL_TEXTENCODING_ASCII_US );
- RTL_LOGFILE_CONTEXT_TRACE1( aLogContext, "class=\"%s\"",
- aClass.GetBuffer() );
-#endif
-
- exportDoc( meClass );
- }
- catch( uno::Exception e )
- {
- // We must catch exceptions, because according to the
- // API definition export must not throw one!
- Sequence<OUString> aSeq(0);
- SetError( XMLERROR_FLAG_ERROR | XMLERROR_FLAG_SEVERE | XMLERROR_API,
- aSeq, e.Message, NULL );
- }
-
- // return true only if no error occured
- return (GetErrorFlags() & (ERROR_DO_NOTHING|ERROR_ERROR_OCCURED)) == 0;
-}
-
-void SAL_CALL SvXMLExport::cancel() throw(uno::RuntimeException)
-{
- // stop export
- Sequence<OUString> aEmptySeq;
- SetError(XMLERROR_CANCEL|XMLERROR_FLAG_SEVERE, aEmptySeq);
-}
-
-::rtl::OUString SAL_CALL SvXMLExport::getName( )
- throw (::com::sun::star::uno::RuntimeException)
-{
- return sFilterName;
-}
-
-void SAL_CALL SvXMLExport::setName( const ::rtl::OUString& aName )
- throw (::com::sun::star::uno::RuntimeException)
-{
- // do nothing, because it is not possible to set the FilterName
-}
-
-
-// XServiceInfo
-OUString SAL_CALL SvXMLExport::getImplementationName( ) throw(uno::RuntimeException)
-{
- OUString aStr;
- return aStr;
-}
-
-sal_Bool SAL_CALL SvXMLExport::supportsService( const OUString& rServiceName ) throw(uno::RuntimeException)
-{
- return
- rServiceName.equalsAsciiL(
- "com.sun.star.document.ExportFilter",
- sizeof("com.sun.star.document.ExportFilter")-1 ) ||
- rServiceName.equalsAsciiL(
- "com.sun.star.xml.XMLExportFilter",
- sizeof("com.sun.star.xml.XMLExportFilter")-1);
-}
-
-uno::Sequence< OUString > SAL_CALL SvXMLExport::getSupportedServiceNames( )
- throw(uno::RuntimeException)
-{
- uno::Sequence<OUString> aSeq(2);
- OUString* pSeq = aSeq.getArray();
- aSeq[0] = OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ExportFilter"));
- aSeq[1] = OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.XMLExportFilter"));
- return aSeq;
-}
-
-///////////////////////////////////////////////////////////////////////
-
-void SvXMLExport::AddAttributeASCII( sal_uInt16 nPrefixKey,
- const sal_Char *pName,
- const sal_Char *pValue )
-{
- OUString sName( OUString::createFromAscii( pName ) );
- OUString sValue( OUString::createFromAscii( pValue ) );
-
- pAttrList->AddAttribute( pNamespaceMap->GetQNameByKey( nPrefixKey,
- sName ),
- sValue );
-}
-
-void SvXMLExport::AddAttribute( sal_uInt16 nPrefixKey, const sal_Char *pName,
- const OUString& rValue )
-{
- OUString sName( OUString::createFromAscii( pName ) );
-
- pAttrList->AddAttribute( pNamespaceMap->GetQNameByKey( nPrefixKey,
- sName ),
- rValue );
-}
-
-void SvXMLExport::AddAttribute( sal_uInt16 nPrefixKey, const OUString& rName,
- const OUString& rValue )
-{
- pAttrList->AddAttribute( pNamespaceMap->GetQNameByKey( nPrefixKey, rName ),
- rValue );
-}
-
-void SvXMLExport::AddAttribute( sal_uInt16 nPrefixKey,
- enum XMLTokenEnum eName,
- const OUString& rValue )
-{
- pAttrList->AddAttribute(
- pNamespaceMap->GetQNameByKey( nPrefixKey, GetXMLToken(eName) ),
- rValue );
-}
-
-void SvXMLExport::AddAttribute( sal_uInt16 nPrefixKey,
- enum XMLTokenEnum eName,
- enum XMLTokenEnum eValue)
-{
- pAttrList->AddAttribute(
- pNamespaceMap->GetQNameByKey( nPrefixKey, GetXMLToken(eName) ),
- GetXMLToken(eValue) );
-}
-
-void SvXMLExport::AddAttribute( const ::rtl::OUString& rQName,
- const ::rtl::OUString& rValue )
-{
- pAttrList->AddAttribute(
- rQName,
- rValue );
-}
-
-void SvXMLExport::AddAttribute( const ::rtl::OUString& rQName,
- enum ::binfilter::xmloff::token::XMLTokenEnum eValue )
-{
- pAttrList->AddAttribute(
- rQName,
- GetXMLToken(eValue) );
-}
-
-void SvXMLExport::ClearAttrList()
-{
- pAttrList->Clear();
-}
-
-#ifdef DBG_UTIL
-void SvXMLExport::CheckAttrList()
-{
- DBG_ASSERT( !pAttrList->getLength(),
- "XMLExport::CheckAttrList: list is not empty" );
-}
-#endif
-
-void SvXMLExport::ImplExportMeta()
-{
- CheckAttrList();
-
- {
- // <office:meta>
- SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_META,
- sal_True, sal_True );
-
- _ExportMeta();
- }
-}
-
-void SvXMLExport::ImplExportSettings()
-{
- CheckAttrList();
-
- {
- SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_SETTINGS,
- sal_True, sal_True );
- XMLSettingsExportHelper aSettingsExportHelper(*this);
- _ExportViewSettings(aSettingsExportHelper);
- _ExportConfigurationSettings(aSettingsExportHelper);
- }
-}
-
-void SvXMLExport::ImplExportStyles( sal_Bool bUsed )
-{
- CheckAttrList();
-
-// AddAttribute( XML_NAMESPACE_NONE, XML_ID, XML_STYLES_ID );
- {
- // <style:styles>
- SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_STYLES,
- sal_True, sal_True );
-
- _ExportStyles( sal_False );
- }
-}
-
-void SvXMLExport::ImplExportAutoStyles( sal_Bool bUsed )
-{
-// AddAttributeASCII( XML_NAMESPACE_NONE, XML_ID, XML_AUTO_STYLES_ID );
- {
- // <style:automatic-styles>
- SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE,
- XML_AUTOMATIC_STYLES, sal_True, sal_True );
-
-#if 0
- AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
- AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, XML_STYLES_HREF );
- AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD );
- AddAttribute( XML_NAMESPACE_XLINK, XML_ROLE,
- pNamespaceMap->GetQNameByKey( XML_NAMESPACE_OFFICE,
- GetXMLToken(XML_STYLESHEET)) );
- {
- // <style:use-styles>
- SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE,
- XML_USE_STYLES, sal_True, sal_True );
- }
-#endif
- _ExportAutoStyles();
- }
-}
-
-void SvXMLExport::ImplExportMasterStyles( sal_Bool bUsed )
-{
- {
- // <style:master-styles>
- SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_MASTER_STYLES,
- sal_True, sal_True );
-
- _ExportMasterStyles();
- }
-
-#if 0
- AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
- AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, XML_AUTO_STYLES_HREF );
- AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD );
- AddAttribute( XML_NAMESPACE_XLINK, XML_ROLE,
- pNamespaceMap->GetQNameByKey( XML_NAMESPACE_OFFICE,
- GetXMLToken(XML_STYLESHEET) ) );
- {
- // <style:use-styles>
- SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE,
- XML_USE_STYLES, sal_True, sal_True );
- }
-#endif
-}
-
-void SvXMLExport::ImplExportContent()
-{
- CheckAttrList();
-
- CheckAttrList();
-
- {
- // <office:body ...>
- SetBodyAttributes();
- SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_BODY,
- sal_True, sal_True );
-
- _ExportContent();
- }
-}
-
-void SvXMLExport::SetBodyAttributes()
-{
-}
-
-sal_uInt32 SvXMLExport::exportDoc( enum ::binfilter::xmloff::token::XMLTokenEnum eClass )
-{
- bool bOwnGraphicResolver = false;
- bool bOwnEmbeddedResolver = false;
-
- if( !xGraphicResolver.is() || !xEmbeddedResolver.is() )
- {
- Reference< XMultiServiceFactory > xFactory( xModel, UNO_QUERY );
- if( xFactory.is() )
- {
- try
- {
- if( !xGraphicResolver.is() )
- {
- xGraphicResolver = Reference< XGraphicObjectResolver >::query(
- xFactory->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.document.ExportGraphicObjectResolver"))));
- bOwnGraphicResolver = xGraphicResolver.is();
- }
-
- if( !xEmbeddedResolver.is() )
- {
- xEmbeddedResolver = Reference< XEmbeddedObjectResolver >::query(
- xFactory->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.document.ExportEmbeddedObjectResolver"))));
- bOwnEmbeddedResolver = xEmbeddedResolver.is();
- }
- }
- catch( ::com::sun::star::uno::Exception& )
- {
- }
- }
- }
-
-
- xHandler->startDocument();
-
- // <?xml version="1.0" encoding="UTF-8"?>
-// xHandler->processingInstruction( S2U( sXML_xml ), S2U( sXML_xml_pi ) );
-
- // <office:document ...>
- CheckAttrList();
-
- // namespace attributes
- // ( The namespace decls should be first attributes in the element;
- // some faulty XML parsers (JAXP1.1) have a problem with this,
- // also it's more elegant )
- sal_uInt16 nPos = pNamespaceMap->GetFirstKey();
- while( USHRT_MAX != nPos )
- {
- pAttrList->AddAttribute( pNamespaceMap->GetAttrNameByKey( nPos ),
- pNamespaceMap->GetNameByKey( nPos ) );
- nPos = pNamespaceMap->GetNextKey( nPos );
- }
-
- // office:class = ... (only for stream containing the content)
- if( (eClass != XML_TOKEN_INVALID) && ((mnExportFlags & EXPORT_CONTENT) != 0) )
- AddAttribute( XML_NAMESPACE_OFFICE, XML_CLASS, eClass );
-
- // office:version = ...
- if( !bExtended )
- AddAttribute( XML_NAMESPACE_OFFICE, XML_VERSION,
- OUString::createFromAscii(sXML_1_0) );
-
- {
- enum XMLTokenEnum eRootService = XML_TOKEN_INVALID;
- const sal_Int32 nExportMode = mnExportFlags & (EXPORT_META|EXPORT_STYLES|EXPORT_CONTENT|EXPORT_SETTINGS);
- if( EXPORT_META == nExportMode )
- {
- // export only meta
- eRootService = XML_DOCUMENT_META;
- }
- else if ( EXPORT_SETTINGS == nExportMode )
- {
- // export only settings
- eRootService = XML_DOCUMENT_SETTINGS;
- }
- else if( EXPORT_STYLES == nExportMode )
- {
- // export only styles
- eRootService = XML_DOCUMENT_STYLES;
- }
- else if( EXPORT_CONTENT == nExportMode )
- {
- // export only content
- eRootService = XML_DOCUMENT_CONTENT;
- }
- else
- {
- // the god'ol one4all element
- eRootService = XML_DOCUMENT;
- }
-
- if( (getExportFlags() & EXPORT_NODOCTYPE) == 0 &&
- xExtHandler.is() )
- {
- OUStringBuffer aDocType(
- GetXMLToken(XML_XML_DOCTYPE_PREFIX).getLength() +
- GetXMLToken(XML_XML_DOCTYPE_SUFFIX).getLength() + 30 );
-
- aDocType.append( GetXMLToken(XML_XML_DOCTYPE_PREFIX) );
- aDocType.append( GetNamespaceMap().GetQNameByKey(
- XML_NAMESPACE_OFFICE, GetXMLToken(eRootService) ) );
- aDocType.append( GetXMLToken(XML_XML_DOCTYPE_SUFFIX) );
- xExtHandler->unknown( aDocType.makeStringAndClear() );
- }
-
- SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, eRootService, sal_True, sal_True );
-
- // meta information
- if( mnExportFlags & EXPORT_META )
- ImplExportMeta();
-
- // settings
- if( mnExportFlags & EXPORT_SETTINGS )
- ImplExportSettings();
-
- // scripts
- if( mnExportFlags & EXPORT_SCRIPTS )
- _ExportScripts();
-
- // font declerations
- if( mnExportFlags & EXPORT_FONTDECLS )
- _ExportFontDecls();
-
- // styles
- if( mnExportFlags & EXPORT_STYLES )
- ImplExportStyles( sal_False );
-
- // autostyles
- if( mnExportFlags & EXPORT_AUTOSTYLES )
- ImplExportAutoStyles( sal_False );
-
- // masterstyles
- if( mnExportFlags & EXPORT_MASTERSTYLES )
- ImplExportMasterStyles( sal_False );
-
- // contnt
- if( mnExportFlags & EXPORT_CONTENT )
- ImplExportContent();
- }
-
-
- xHandler->endDocument();
-
- if( bOwnGraphicResolver )
- {
- Reference< XComponent > xComp( xGraphicResolver, UNO_QUERY );
- xComp->dispose();
- }
-
- if( bOwnEmbeddedResolver )
- {
- Reference< XComponent > xComp( xEmbeddedResolver, UNO_QUERY );
- xComp->dispose();
- }
-
- return 0;
-}
-
-void SvXMLExport::_ExportMeta()
-{
- SfxXMLMetaExport aMeta( *this, xModel );
- aMeta.Export();
-}
-
-void SvXMLExport::_ExportViewSettings(const XMLSettingsExportHelper& rSettingsExportHelper)
-{
- uno::Sequence<beans::PropertyValue> aProps;
- GetViewSettings(aProps);
- uno::Reference<document::XViewDataSupplier> xViewDataSupplier(GetModel(), uno::UNO_QUERY);
- if(xViewDataSupplier.is())
- {
- uno::Reference<container::XIndexAccess> xIndexAccess;
- xViewDataSupplier->setViewData( xIndexAccess ); // make sure we get a newly created sequence
- xIndexAccess = xViewDataSupplier->getViewData();
- if(xIndexAccess.is())
- {
- sal_Int32 nOldLength(aProps.getLength());
- aProps.realloc(nOldLength + 1);
- beans::PropertyValue aProp;
- aProp.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("Views"));
- aProp.Value <<= xIndexAccess;
- aProps[nOldLength] = aProp;
- }
- }
- OUString sViewSettings(GetXMLToken(XML_VIEW_SETTINGS));
- rSettingsExportHelper.exportSettings(aProps, sViewSettings);
-}
-
-void SvXMLExport::_ExportConfigurationSettings(const XMLSettingsExportHelper& rSettingsExportHelper)
-{
- uno::Sequence<beans::PropertyValue> aProps;
- GetConfigurationSettings(aProps);
- OUString sConfigurationSettings(GetXMLToken(XML_CONFIGURATION_SETTINGS));
- rSettingsExportHelper.exportSettings(aProps, sConfigurationSettings);
-}
-
-void SvXMLExport::_ExportScripts()
-{
- SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_SCRIPT, sal_True, sal_True );
-
- // export Basic macros (only for FlatXML)
- if ( mnExportFlags & EXPORT_EMBEDDED )
- {
- ::rtl::OUString aValue( RTL_CONSTASCII_USTRINGPARAM( "Basic" ) );
- AddAttribute( XML_NAMESPACE_SCRIPT, XML_LANGUAGE, aValue );
- SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_SCRIPT_DATA, sal_True, sal_True );
-
- Reference< document::XExporter > xExporter;
- Reference< lang::XMultiServiceFactory > xMSF( getServiceFactory() );
- if ( xMSF.is() )
- {
- Reference < XDocumentHandler > xHdl( new XMLBasicExportFilter( xHandler ) );
- Sequence < Any > aArgs( 1 );
- aArgs[0] <<= xHdl;
- xExporter.set( xMSF->createInstanceWithArguments(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.XMLBasicExporter" ) ), aArgs ),
- UNO_QUERY );
- }
-
- OSL_ENSURE( xExporter.is(),
- "SvXMLExport::_ExportScripts: can't instantiate export filter component for Basic macros" );
-
- if ( xExporter.is() )
- {
- Reference< XComponent > xComp( xModel, UNO_QUERY );
- xExporter->setSourceDocument( xComp );
- Reference< XFilter > xFilter( xExporter, UNO_QUERY );
- if ( xFilter.is() )
- {
- Sequence < PropertyValue > aMediaDesc( 0 );
- xFilter->filter( aMediaDesc );
- }
- }
- }
-
- // export document events
- Reference< document::XEventsSupplier > xEvents( GetModel(), UNO_QUERY );
- GetEventExport().Export( xEvents, sal_True );
-}
-
-void SvXMLExport::_ExportFontDecls()
-{
- if( mxFontAutoStylePool.is() )
- mxFontAutoStylePool->exportXML();
-}
-
-void SvXMLExport::_ExportStyles( sal_Bool bUsed )
-{
- uno::Reference< lang::XMultiServiceFactory > xFact( GetModel(), uno::UNO_QUERY );
- if( xFact.is())
- {
- // export (fill-)gradient-styles
- try
- {
- uno::Reference< container::XNameAccess > xGradient( xFact->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GradientTable") ) ), uno::UNO_QUERY );
- if( xGradient.is() )
- {
- XMLGradientStyleExport aGradientStyle( *this );
-
- if( xGradient->hasElements() )
- {
- uno::Sequence< OUString > aNamesSeq ( xGradient->getElementNames() );
- sal_Int32 nCount = aNamesSeq.getLength();
- for( sal_Int32 i=0; i<nCount; i++ )
- {
- const OUString& rStrName = aNamesSeq[ i ];
-
- try
- {
- uno::Any aValue = xGradient->getByName( rStrName );
-
- aGradientStyle.exportXML( rStrName, aValue );
- }
- catch( container::NoSuchElementException& )
- {}
- }
- }
- }
- }
- catch( lang::ServiceNotRegisteredException& )
- {}
-
- // export (fill-)hatch-styles
- try
- {
- uno::Reference< container::XNameAccess > xHatch( xFact->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.HatchTable") ) ), uno::UNO_QUERY );
- if( xHatch.is() )
- {
- XMLHatchStyleExport aHatchStyle( *this );
-
- if( xHatch->hasElements() )
- {
- uno::Sequence< OUString > aNamesSeq ( xHatch->getElementNames() );
- sal_Int32 nCount = aNamesSeq.getLength();
- for( sal_Int32 i=0; i<nCount; i++ )
- {
- const OUString& rStrName = aNamesSeq[ i ];
-
- try
- {
- uno::Any aValue = xHatch->getByName( rStrName );
-
- aHatchStyle.exportXML( rStrName, aValue );
- }
- catch( container::NoSuchElementException& )
- {}
- }
- }
- }
- }
- catch( lang::ServiceNotRegisteredException& )
- {}
-
- // export (fill-)bitmap-styles
- try
- {
- uno::Reference< container::XNameAccess > xBitmap( xFact->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.BitmapTable") ) ), uno::UNO_QUERY );
- if( xBitmap.is() )
- {
- XMLImageStyle aImageStyle;
-
- if( xBitmap->hasElements() )
- {
- uno::Sequence< OUString > aNamesSeq ( xBitmap->getElementNames() );
- sal_Int32 nCount = aNamesSeq.getLength();
- for( sal_Int32 i=0; i<nCount; i++ )
- {
- const OUString& rStrName = aNamesSeq[ i ];
-
- try
- {
- uno::Any aValue = xBitmap->getByName( rStrName );
-
- aImageStyle.exportXML( rStrName, aValue, *this );
- }
- catch( container::NoSuchElementException& )
- {}
- }
- }
- }
- }
- catch( lang::ServiceNotRegisteredException& )
- {}
-
- // export transparency-gradient -styles
- try
- {
- uno::Reference< container::XNameAccess > xTransGradient( xFact->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.TransparencyGradientTable") ) ), uno::UNO_QUERY );
- if( xTransGradient.is() )
- {
- XMLTransGradientStyleExport aTransGradientstyle( *this );
-
- if( xTransGradient->hasElements() )
- {
- uno::Sequence< OUString > aNamesSeq ( xTransGradient->getElementNames() );
- sal_Int32 nCount = aNamesSeq.getLength();
- for( sal_Int32 i=0; i<nCount; i++ )
- {
- const OUString& rStrName = aNamesSeq[ i ];
-
- try
- {
- uno::Any aValue = xTransGradient->getByName( rStrName );
-
- aTransGradientstyle.exportXML( rStrName, aValue );
- }
- catch( container::NoSuchElementException& )
- {}
- }
- }
- }
- }
- catch( lang::ServiceNotRegisteredException& )
- {}
-
- // export marker-styles
- try
- {
- uno::Reference< container::XNameAccess > xMarker( xFact->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.MarkerTable") ) ), uno::UNO_QUERY );
- if( xMarker.is() )
- {
- XMLMarkerStyleExport aMarkerStyle( *this );
-
- if( xMarker->hasElements() )
- {
- uno::Sequence< OUString > aNamesSeq ( xMarker->getElementNames() );
- sal_Int32 nCount = aNamesSeq.getLength();
- for( sal_Int32 i=0; i<nCount; i++ )
- {
- const OUString& rStrName = aNamesSeq[ i ];
-
- try
- {
- uno::Any aValue = xMarker->getByName( rStrName );
-
- aMarkerStyle.exportXML( rStrName, aValue );
- }
- catch( container::NoSuchElementException& )
- {}
- }
- }
- }
- }
- catch( lang::ServiceNotRegisteredException& )
- {}
-
- // export dash-styles
- try
- {
- uno::Reference< container::XNameAccess > xDashes( xFact->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.DashTable") ) ), uno::UNO_QUERY );
- if( xDashes.is() )
- {
- XMLDashStyleExport aDashStyle( *this );
-
- if( xDashes->hasElements() )
- {
- uno::Sequence< OUString > aNamesSeq ( xDashes->getElementNames() );
- sal_Int32 nCount = aNamesSeq.getLength();
- for( sal_Int32 i=0; i<nCount; i++ )
- {
- const OUString& rStrName = aNamesSeq[ i ];
-
- try
- {
- uno::Any aValue = xDashes->getByName( rStrName );
-
- aDashStyle.exportXML( rStrName, aValue );
- }
- catch( container::NoSuchElementException& )
- {}
- }
- }
- }
- }
- catch( lang::ServiceNotRegisteredException& )
- {}
- }
-}
-
-XMLTextParagraphExport* SvXMLExport::CreateTextParagraphExport()
-{
- return new XMLTextParagraphExport( *this, *(GetAutoStylePool().get()) );
-}
-
-XMLShapeExport* SvXMLExport::CreateShapeExport()
-{
- return new XMLShapeExport(*this);
-}
-
-SvXMLAutoStylePoolP* SvXMLExport::CreateAutoStylePool()
-{
- return new SvXMLAutoStylePoolP(*this);
-}
-
-XMLPageExport* SvXMLExport::CreatePageExport()
-{
- return new XMLPageExport( *this );
-}
-
-SchXMLExportHelper* SvXMLExport::CreateChartExport()
-{
- return new SchXMLExportHelper(*this,*GetAutoStylePool().get());
-}
-
-XMLFontAutoStylePool* SvXMLExport::CreateFontAutoStylePool()
-{
- return new XMLFontAutoStylePool( *this );
-}
-
-xmloff::OFormLayerXMLExport* SvXMLExport::CreateFormExport()
-{
- return new xmloff::OFormLayerXMLExport(*this);
-}
-
-void SvXMLExport::GetViewSettings(uno::Sequence<beans::PropertyValue>& aProps)
-{
-}
-
-void SvXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>& aProps)
-{
-}
-
-void SvXMLExport::addDataStyle(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat )
-{
- if(pNumExport)
- pNumExport->SetUsed(nNumberFormat);
-}
-
-void SvXMLExport::exportDataStyles()
-{
- if(pNumExport)
- pNumExport->Export(sal_False);
-}
-
-void SvXMLExport::exportAutoDataStyles()
-{
- if(pNumExport)
- pNumExport->Export(sal_True);
-
- if (mxFormExport.is())
- mxFormExport->exportAutoControlNumberStyles();
-}
-
-OUString SvXMLExport::getDataStyleName(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat ) const
-{
- OUString sTemp;
- if(pNumExport)
- sTemp = pNumExport->GetStyleName(nNumberFormat);
- return sTemp;
-}
-
-sal_Int32 SvXMLExport::dataStyleForceSystemLanguage(sal_Int32 nFormat) const
-{
- return ( pNumExport != NULL )
- ? pNumExport->ForceSystemLanguage( nFormat ) : nFormat;
-}
-
-
-OUString SvXMLExport::AddEmbeddedGraphicObject( const OUString& rGraphicObjectURL )
-{
- OUString sRet( rGraphicObjectURL );
- if( 0 == rGraphicObjectURL.compareTo( sGraphicObjectProtocol,
- sGraphicObjectProtocol.getLength() ) &&
- xGraphicResolver.is() )
- {
- if( (getExportFlags() & EXPORT_EMBEDDED) == 0 )
- sRet = xGraphicResolver->resolveGraphicObjectURL( rGraphicObjectURL );
- else
- sRet = OUString();
- }
- else
- sRet = ::binfilter::StaticBaseUrl::AbsToRel( sRet );
-
- return sRet;
-}
-
-sal_Bool SvXMLExport::AddEmbeddedGraphicObjectAsBase64( const OUString& rGraphicObjectURL )
-{
- sal_Bool bRet = sal_False;
-
- if( (getExportFlags() & EXPORT_EMBEDDED) != 0 &&
- 0 == rGraphicObjectURL.compareTo( sGraphicObjectProtocol,
- sGraphicObjectProtocol.getLength() ) &&
- xGraphicResolver.is() )
- {
- Reference< XBinaryStreamResolver > xStmResolver( xGraphicResolver, UNO_QUERY );
-
- if( xStmResolver.is() )
- {
- Reference< XInputStream > xIn( xStmResolver->getInputStream( rGraphicObjectURL ) );
-
- if( xIn.is() )
- {
- XMLBase64Export aBase64Exp( *this );
- bRet = aBase64Exp.exportOfficeBinaryDataElement( xIn );
- }
- }
- }
-
- return bRet;
-}
-
-OUString SvXMLExport::AddEmbeddedObject( const OUString& rEmbeddedObjectURL )
-{
- OUString sRet;
- if( 0 == rEmbeddedObjectURL.compareTo( sEmbeddedObjectProtocol,
- sEmbeddedObjectProtocol.getLength() ) &&
- xEmbeddedResolver.is() )
- {
- sRet =
- xEmbeddedResolver->resolveEmbeddedObjectURL( rEmbeddedObjectURL );
- }
-
- return sRet;
-}
-
-sal_Bool SvXMLExport::AddEmbeddedObjectAsBase64( const OUString& rEmbeddedObjectURL )
-{
- sal_Bool bRet = sal_False;
- if( 0 == rEmbeddedObjectURL.compareTo( sEmbeddedObjectProtocol,
- sEmbeddedObjectProtocol.getLength() ) &&
- xEmbeddedResolver.is() )
- {
- Reference < XNameAccess > xNA( xEmbeddedResolver, UNO_QUERY );
- if( xNA.is() )
- {
- Any aAny = xNA->getByName( rEmbeddedObjectURL );
- Reference < XInputStream > xIn;
- aAny >>= xIn;
- if( xIn.is() )
- {
- XMLBase64Export aBase64Exp( *this );
- bRet = aBase64Exp.exportOfficeBinaryDataElement( xIn );
- }
- }
- }
-
- return bRet;
-}
-
-ProgressBarHelper* SvXMLExport::GetProgressBarHelper()
-{
- if (!pProgressBarHelper)
- {
- pProgressBarHelper = new ProgressBarHelper(xStatusIndicator, sal_True);
-
- if (pProgressBarHelper && xExportInfo.is())
- {
- uno::Reference< beans::XPropertySetInfo > xPropertySetInfo = xExportInfo->getPropertySetInfo();
- if (xPropertySetInfo.is())
- {
- OUString sProgressRange(RTL_CONSTASCII_USTRINGPARAM(XML_PROGRESSRANGE));
- OUString sProgressMax(RTL_CONSTASCII_USTRINGPARAM(XML_PROGRESSMAX));
- OUString sProgressCurrent(RTL_CONSTASCII_USTRINGPARAM(XML_PROGRESSCURRENT));
- OUString sRepeat(RTL_CONSTASCII_USTRINGPARAM(XML_PROGRESSREPEAT));
- if (xPropertySetInfo->hasPropertyByName(sProgressMax) &&
- xPropertySetInfo->hasPropertyByName(sProgressCurrent) &&
- xPropertySetInfo->hasPropertyByName(sProgressRange))
- {
- uno::Any aAny;
- sal_Int32 nProgressMax(0);
- sal_Int32 nProgressCurrent(0);
- sal_Int32 nProgressRange(0);
- aAny = xExportInfo->getPropertyValue(sProgressRange);
- if (aAny >>= nProgressRange)
- pProgressBarHelper->SetRange(nProgressRange);
- aAny = xExportInfo->getPropertyValue(sProgressMax);
- if (aAny >>= nProgressMax)
- pProgressBarHelper->SetReference(nProgressMax);
- aAny = xExportInfo->getPropertyValue(sProgressCurrent);
- if (aAny >>= nProgressCurrent)
- pProgressBarHelper->SetValue(nProgressCurrent);
- }
- if (xPropertySetInfo->hasPropertyByName(sRepeat))
- {
- uno::Any aAny = xExportInfo->getPropertyValue(sRepeat);
- if (aAny.getValueType() == getBooleanCppuType())
- pProgressBarHelper->SetRepeat(::cppu::any2bool(aAny));
- else
- DBG_ERRORFILE("why is it no boolean?");
- }
- }
- }
- }
- return pProgressBarHelper;
-}
-
-XMLEventExport& SvXMLExport::GetEventExport()
-{
- if( NULL == pEventExport)
- {
- // create EventExport on demand
- pEventExport = new XMLEventExport(*this, NULL);
-
- // and register standard handlers + names
- OUString sStarBasic(RTL_CONSTASCII_USTRINGPARAM("StarBasic"));
- pEventExport->AddHandler(sStarBasic, new XMLStarBasicExportHandler());
- OUString sScript(RTL_CONSTASCII_USTRINGPARAM("Script"));
- pEventExport->AddHandler(sScript, new XMLScriptExportHandler());
- pEventExport->AddTranslationTable(aStandardEventTable);
- }
-
- return *pEventExport;
-}
-
-XMLImageMapExport& SvXMLExport::GetImageMapExport()
-{
- // image map export, create on-demand
- if( NULL == pImageMapExport )
- {
- pImageMapExport = new XMLImageMapExport(*this);
- }
-
- return *pImageMapExport;
-}
-
-// XUnoTunnel & co
-const uno::Sequence< sal_Int8 > & SvXMLExport::getUnoTunnelId() throw()
-{
- static uno::Sequence< sal_Int8 > * pSeq = 0;
- if( !pSeq )
- {
- Guard< Mutex > aGuard( Mutex::getGlobalMutex() );
- if( !pSeq )
- {
- static uno::Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- pSeq = &aSeq;
- }
- }
- return *pSeq;
-}
-
-SvXMLExport* SvXMLExport::getImplementation( uno::Reference< uno::XInterface > xInt ) throw()
-{
- uno::Reference< lang::XUnoTunnel > xUT( xInt, uno::UNO_QUERY );
- if( xUT.is() )
- return (SvXMLExport*)xUT->getSomething( SvXMLExport::getUnoTunnelId() );
- else
- return NULL;
-}
-
-// XUnoTunnel
-sal_Int64 SAL_CALL SvXMLExport::getSomething( const uno::Sequence< sal_Int8 >& rId )
- throw( uno::RuntimeException )
-{
- if( rId.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
- {
- return (sal_Int64)this;
- }
- return 0;
-}
-
-sal_Bool SvXMLExport::ExportEmbeddedOwnObject( Reference< XComponent >& rComp )
-{
- OUString sFilterService;
-
- Reference < lang::XServiceInfo > xServiceInfo( rComp, UNO_QUERY );
- if( xServiceInfo.is() )
- {
- const XMLServiceMapEntry_Impl *pEntry = aServiceMap;
- while( pEntry->sModelService )
- {
- OUString sModelService( pEntry->sModelService,
- pEntry->nModelServiceLen,
- RTL_TEXTENCODING_ASCII_US );
- if( xServiceInfo->supportsService( sModelService ) )
- {
- sFilterService = OUString( pEntry->sFilterService,
- pEntry->nFilterServiceLen,
- RTL_TEXTENCODING_ASCII_US );
- break;
- }
- pEntry++;
- }
- }
-
- OSL_ENSURE( sFilterService.getLength(), "no export filter for own object" );
-
- if( !sFilterService.getLength() )
- return sal_False;
-
- Reference < XDocumentHandler > xHdl =
- new XMLEmbeddedObjectExportFilter( xHandler );
-
- Sequence < Any > aArgs( 1 );
- aArgs[0] <<= xHdl;
-
- // #110680#
- // Reference< lang::XMultiServiceFactory > xServiceFactory = comphelper::getProcessServiceFactory();
- Reference< lang::XMultiServiceFactory > xServiceFactory = getServiceFactory();
-
- Reference< document::XExporter > xExporter(
- xServiceFactory->createInstanceWithArguments( sFilterService, aArgs),
- UNO_QUERY);
- OSL_ENSURE( xExporter.is(),
- "can't instantiate export filter component for own object" );
- if( !xExporter.is() )
- return sal_False;
-
- xExporter->setSourceDocument( rComp );
-
- Reference<XFilter> xFilter( xExporter, UNO_QUERY );
-
- Sequence < PropertyValue > aMediaDesc( 0 );
- return xFilter->filter( aMediaDesc );
-}
-
-OUString SvXMLExport::GetRelativeReference(const OUString& rValue)
-{
- return ::binfilter::StaticBaseUrl::AbsToRel( rValue );
-}
-
-void SvXMLExport::StartElement(sal_uInt16 nPrefix,
- enum ::binfilter::xmloff::token::XMLTokenEnum eName,
- sal_Bool bIgnWSOutside )
-{
- StartElement(pNamespaceMap->GetQNameByKey( nPrefix, GetXMLToken(eName) ), bIgnWSOutside);
-}
-
-void SvXMLExport::StartElement(const OUString& rName,
- sal_Bool bIgnWSOutside )
-{
- if ((mnErrorFlags & ERROR_DO_NOTHING) != ERROR_DO_NOTHING)
- {
- try
- {
- if( bIgnWSOutside && ((mnExportFlags & EXPORT_PRETTY) == EXPORT_PRETTY))
- xHandler->ignorableWhitespace( sWS );
- xHandler->startElement( rName, GetXAttrList() );
- }
- catch ( SAXInvalidCharacterException& e )
- {
- Sequence<OUString> aPars(1);
- aPars[0] = rName;
- SetError( XMLERROR_SAX|XMLERROR_FLAG_WARNING, aPars, e.Message, NULL );
- }
- catch ( SAXException& e )
- {
- Sequence<OUString> aPars(1);
- aPars[0] = rName;
- SetError( XMLERROR_SAX|XMLERROR_FLAG_ERROR|XMLERROR_FLAG_SEVERE,
- aPars, e.Message, NULL );
- }
- }
- ClearAttrList();
-}
-
-void SvXMLExport::Characters(const ::rtl::OUString& rChars)
-{
- if ((mnErrorFlags & ERROR_DO_NOTHING) != ERROR_DO_NOTHING)
- {
- try
- {
- xHandler->characters(rChars);
- }
- catch ( SAXInvalidCharacterException& e )
- {
- Sequence<OUString> aPars(1);
- aPars[0] = rChars;
- SetError( XMLERROR_SAX|XMLERROR_FLAG_WARNING, aPars, e.Message, NULL );
- }
- catch ( SAXException& e )
- {
- Sequence<OUString> aPars(1);
- aPars[0] = rChars;
- SetError( XMLERROR_SAX|XMLERROR_FLAG_ERROR|XMLERROR_FLAG_SEVERE,
- aPars, e.Message, NULL );
- }
- }
-}
-
-void SvXMLExport::EndElement(sal_uInt16 nPrefix,
- enum ::binfilter::xmloff::token::XMLTokenEnum eName,
- sal_Bool bIgnWSInside )
-{
- EndElement(pNamespaceMap->GetQNameByKey( nPrefix, GetXMLToken(eName) ), bIgnWSInside);
-}
-
-void SvXMLExport::EndElement(const OUString& rName,
- sal_Bool bIgnWSInside )
-{
- if ((mnErrorFlags & ERROR_DO_NOTHING) != ERROR_DO_NOTHING)
- {
- try
- {
- if( bIgnWSInside && ((mnExportFlags & EXPORT_PRETTY) == EXPORT_PRETTY))
- xHandler->ignorableWhitespace( sWS );
- xHandler->endElement( rName );
- }
- catch ( SAXException& e )
- {
- Sequence<OUString> aPars(1);
- aPars[0] = rName;
- SetError( XMLERROR_SAX|XMLERROR_FLAG_ERROR|XMLERROR_FLAG_SEVERE,
- aPars, e.Message, NULL );
- }
- }
-}
-
-void SvXMLExport::IgnorableWhitespace()
-{
- if ((mnExportFlags & EXPORT_PRETTY) != EXPORT_PRETTY)
- return;
-
- if ((mnErrorFlags & ERROR_DO_NOTHING) != ERROR_DO_NOTHING)
- {
- try
- {
- xHandler->ignorableWhitespace( sWS );
- }
- catch ( SAXException& e )
- {
- Sequence<OUString> aPars(0);
- SetError( XMLERROR_SAX|XMLERROR_FLAG_ERROR|XMLERROR_FLAG_SEVERE,
- aPars, e.Message, NULL );
- }
- }
-}
-
-
-void SvXMLExport::SetError(
- sal_Int32 nId,
- const Sequence<OUString>& rMsgParams,
- const OUString& rExceptionMessage,
- const Reference<XLocator>& rLocator )
-{
- // allow multi-threaded access to the cancel() method
- static ::osl::Mutex aMutex;
- ::osl::MutexGuard aGuard(aMutex);
-
- // maintain error flags
- if ( ( nId & XMLERROR_FLAG_ERROR ) != 0 )
- mnErrorFlags |= ERROR_ERROR_OCCURED;
- if ( ( nId & XMLERROR_FLAG_WARNING ) != 0 )
- mnErrorFlags |= ERROR_WARNING_OCCURED;
- if ( ( nId & XMLERROR_FLAG_SEVERE ) != 0 )
- mnErrorFlags |= ERROR_DO_NOTHING;
-
- // create error lsit on demand
- if ( pXMLErrors == NULL )
- pXMLErrors = new XMLErrors();
-
- // save error information
- pXMLErrors->AddRecord( nId, rMsgParams, rExceptionMessage, rLocator );
-}
-
-void SvXMLExport::SetError(
- sal_Int32 nId,
- const Sequence<OUString>& rMsgParams)
-{
- OUString sEmpty;
- SetError( nId, rMsgParams, sEmpty, NULL );
-}
-
-
-void SvXMLExport::DisposingModel()
-{
- xModel = 0;
- pEventListener = NULL;
-}
-
-// #110680#
-::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > SvXMLExport::getServiceFactory()
-{
- // #110680#
- return mxServiceFactory;
-}
-
-//=============================================================================
-
-void SvXMLElementExport::StartElement( SvXMLExport& rExp,
- sal_uInt16 nPrefixKey,
- const OUString& rLName,
- sal_Bool bIWSOutside )
-{
- aName = rExp.GetNamespaceMap().GetQNameByKey(nPrefixKey, rLName);
- rExp.StartElement(aName, bIWSOutside);
-}
-
-SvXMLElementExport::SvXMLElementExport( SvXMLExport& rExp,
- sal_uInt16 nPrefixKey,
- const sal_Char *pLName,
- sal_Bool bIWSOutside,
- sal_Bool bIWSInside ) :
- rExport( rExp ),
- bIgnWS( bIWSInside ),
- bDoSomething( sal_True )
-{
- OUString sLName( OUString::createFromAscii(pLName) );
- StartElement( rExp, nPrefixKey, sLName, bIWSOutside );
-}
-
-SvXMLElementExport::SvXMLElementExport( SvXMLExport& rExp,
- sal_uInt16 nPrefixKey,
- const OUString& rLName,
- sal_Bool bIWSOutside,
- sal_Bool bIWSInside ) :
- rExport( rExp ),
- bIgnWS( bIWSInside ),
- bDoSomething( sal_True )
-{
- StartElement( rExp, nPrefixKey, rLName, bIWSOutside );
-}
-
-SvXMLElementExport::SvXMLElementExport( SvXMLExport& rExp,
- sal_uInt16 nPrefixKey,
- enum XMLTokenEnum eLName,
- sal_Bool bIWSOutside,
- sal_Bool bIWSInside ) :
- rExport( rExp ),
- bIgnWS( bIWSInside ),
- bDoSomething( sal_True )
-{
- StartElement( rExp, nPrefixKey, GetXMLToken(eLName), bIWSOutside );
-}
-
-SvXMLElementExport::SvXMLElementExport( SvXMLExport& rExp,
- sal_Bool bDoSth,
- sal_uInt16 nPrefixKey,
- enum XMLTokenEnum eLName,
- sal_Bool bIWSOutside,
- sal_Bool bIWSInside ) :
- rExport( rExp ),
- bIgnWS( bIWSInside ),
- bDoSomething( bDoSth )
-{
- if( bDoSomething )
- StartElement( rExport, nPrefixKey, GetXMLToken(eLName), bIWSOutside );
-}
-
-SvXMLElementExport::SvXMLElementExport( SvXMLExport& rExp,
- const OUString& rQName,
- sal_Bool bIWSOutside,
- sal_Bool bIWSInside ) :
- rExport( rExp ),
- bIgnWS( bIWSInside ),
- bDoSomething( sal_True )
-{
- aName = rQName;
- rExp.StartElement( rQName, bIWSOutside );
-}
-
-SvXMLElementExport::~SvXMLElementExport()
-{
- if( bDoSomething )
- {
- rExport.EndElement( aName, bIgnWS );
- }
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_xmlictxt.cxx b/binfilter/bf_xmloff/source/core/xmloff_xmlictxt.cxx
deleted file mode 100644
index 4c4a1ac683da..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_xmlictxt.cxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-
-#include "xmlimp.hxx"
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-
-TYPEINIT0( SvXMLImportContext );
-
-SvXMLImportContext::SvXMLImportContext( SvXMLImport& rImp, USHORT nPrfx,
- const OUString& rLName ) :
- rImport( rImp ),
- nPrefix( nPrfx ),
- aLocalName( rLName ),
- pRewindMap( 0 )
-{
-}
-
-SvXMLImportContext::~SvXMLImportContext()
-{
-}
-
-SvXMLImportContext *SvXMLImportContext::CreateChildContext( USHORT nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- return rImport.CreateContext( nPrefix, rLocalName, xAttrList );
-}
-
-void SvXMLImportContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& )
-{
-}
-
-void SvXMLImportContext::EndElement()
-{
-}
-
-void SvXMLImportContext::Characters( const OUString& rChars )
-{
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_xmlimp.cxx b/binfilter/bf_xmloff/source/core/xmloff_xmlimp.cxx
deleted file mode 100644
index 0b584799d8f2..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_xmlimp.cxx
+++ /dev/null
@@ -1,1326 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-#include <tools/urlobj.hxx>
-#include <rtl/uuid.h>
-#include <rtl/memory.h>
-
-#include <bf_svtools/svarray.hxx>
-
-#include "nmspmap.hxx"
-#include "xmluconv.hxx"
-
-#include "xmlnmspe.hxx"
-
-#include "xmlkywd.hxx"
-#include "XMLFontStylesContext.hxx"
-
-
-#include "xmlimp.hxx"
-#include "xmlnumfi.hxx"
-#include "XMLEventImportHelper.hxx"
-#include "XMLStarBasicContextFactory.hxx"
-#include "XMLScriptContextFactory.hxx"
-
-
-
-#include "xmlerror.hxx"
-
-#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
-#include <com/sun/star/document/XBinaryStreamResolver.hpp>
-
-#include <comphelper/namecontainer.hxx>
-
-#include <rtl/logfile.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <comphelper/extract.hxx>
-#ifdef CONV_STAR_FONTS
-#include <unotools/fontcvt.hxx>
-#endif
-#include "bf_so3/staticbaseurl.hxx"
-namespace binfilter {
-
-using namespace ::osl;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::io;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::document;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-sal_Char __READONLY_DATA sXML_np__office[] = "_office";
-sal_Char __READONLY_DATA sXML_np__style[] = "_style";
-sal_Char __READONLY_DATA sXML_np__text[] = "_text";
-sal_Char __READONLY_DATA sXML_np__table[] = "_table";
-sal_Char __READONLY_DATA sXML_np__draw[] = "_draw";
-sal_Char __READONLY_DATA sXML_np__dr3d[] = "_dr3d";
-sal_Char __READONLY_DATA sXML_np__fo[] = "_fo";
-sal_Char __READONLY_DATA sXML_np__xlink[] = "_xlink";
-sal_Char __READONLY_DATA sXML_np__dc[] = "_dc";
-sal_Char __READONLY_DATA sXML_np__meta[] = "_meta";
-sal_Char __READONLY_DATA sXML_np__number[] = "_number";
-sal_Char __READONLY_DATA sXML_np__svg[] = "_svg";
-sal_Char __READONLY_DATA sXML_np__chart[] = "_chart";
-sal_Char __READONLY_DATA sXML_np__math[] = "_math";
-sal_Char __READONLY_DATA sXML_np__script[] = "_script";
-sal_Char __READONLY_DATA sXML_np__config[] = "_config";
-
-sal_Char __READONLY_DATA sXML_np__fo_old[] = "__fo";
-sal_Char __READONLY_DATA sXML_np__xlink_old[] = "__xlink";
-sal_Char __READONLY_DATA sXML_np__office_old[] = "__office";
-sal_Char __READONLY_DATA sXML_np__style_old[] = "__style";
-sal_Char __READONLY_DATA sXML_np__text_old[] = "__text";
-sal_Char __READONLY_DATA sXML_np__table_old[] = "__table";
-sal_Char __READONLY_DATA sXML_np__meta_old[] = "__meta";
-
-#define LOGFILE_AUTHOR "mb93740"
-
-#ifdef CONV_STAR_FONTS
-
-class SvXMLImportEventListener : public ::cppu::WeakImplHelper1<
- ::com::sun::star::lang::XEventListener >
-{
-private:
- SvXMLImport* pImport;
-
-public:
- SvXMLImportEventListener(SvXMLImport* pImport);
- virtual ~SvXMLImportEventListener();
-
- // XEventListener
- virtual void SAL_CALL disposing(const lang::EventObject& rEventObject) throw(::com::sun::star::uno::RuntimeException);
-};
-
-SvXMLImportEventListener::SvXMLImportEventListener(SvXMLImport* pTempImport)
- : pImport(pTempImport)
-{
-}
-
-SvXMLImportEventListener::~SvXMLImportEventListener()
-{
-}
-
-// XEventListener
-void SAL_CALL SvXMLImportEventListener::disposing( const lang::EventObject& rEventObject )
- throw(uno::RuntimeException)
-{
- if (pImport)
- pImport->DisposingModel();
-}
-
-//==============================================================================
-
-class SvXMLImport_Impl
-{
-public:
- FontToSubsFontConverter hBatsFontConv;
- FontToSubsFontConverter hMathFontConv;
-
- bool mbOwnGraphicResolver;
- bool mbOwnEmbeddedResolver;
-
- SvXMLImport_Impl() : hBatsFontConv( 0 ), hMathFontConv( 0 ), mbOwnGraphicResolver( false ), mbOwnEmbeddedResolver( false ) {}
- ~SvXMLImport_Impl()
- {
- if( hBatsFontConv )
- DestroyFontToSubsFontConverter( hBatsFontConv );
- if( hMathFontConv )
- DestroyFontToSubsFontConverter( hMathFontConv );
- }
-};
-#endif
-
-typedef SvXMLImportContext *SvXMLImportContextPtr;
-SV_DECL_PTRARR( SvXMLImportContexts_Impl, SvXMLImportContextPtr, 20, 5 )
-SV_IMPL_PTRARR( SvXMLImportContexts_Impl, SvXMLImportContextPtr )
-
-SvXMLImportContext *SvXMLImport::CreateContext( USHORT nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- return new SvXMLImportContext( *this, nPrefix, rLocalName );
-}
-
-void SvXMLImport::_InitCtor()
-{
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__office ) ),
- GetXMLToken(XML_N_OFFICE),
- XML_NAMESPACE_OFFICE );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__style) ),
- GetXMLToken(XML_N_STYLE),
- XML_NAMESPACE_STYLE );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__text) ),
- GetXMLToken(XML_N_TEXT),
- XML_NAMESPACE_TEXT );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__table ) ),
- GetXMLToken(XML_N_TABLE),
- XML_NAMESPACE_TABLE );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__draw ) ),
- GetXMLToken(XML_N_DRAW),
- XML_NAMESPACE_DRAW );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM (sXML_np__dr3d ) ),
- GetXMLToken(XML_N_DR3D),
- XML_NAMESPACE_DR3D );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__fo) ),
- GetXMLToken(XML_N_FO),
- XML_NAMESPACE_FO );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__xlink) ),
- GetXMLToken(XML_N_XLINK),
- XML_NAMESPACE_XLINK );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__dc) ),
- GetXMLToken(XML_N_DC),
- XML_NAMESPACE_DC );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__meta) ),
- GetXMLToken(XML_N_META),
- XML_NAMESPACE_META );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__number) ),
- GetXMLToken(XML_N_NUMBER),
- XML_NAMESPACE_NUMBER );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__svg) ),
- GetXMLToken(XML_N_SVG),
- XML_NAMESPACE_SVG );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__chart) ),
- GetXMLToken(XML_N_CHART),
- XML_NAMESPACE_CHART );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__math) ),
- GetXMLToken(XML_N_MATH),
- XML_NAMESPACE_MATH );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_namespace_form) ),
- GetXMLToken(XML_N_FORM),
- XML_NAMESPACE_FORM );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__script) ),
- GetXMLToken(XML_N_SCRIPT),
- XML_NAMESPACE_SCRIPT );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__config) ),
- GetXMLToken(XML_N_CONFIG),
- XML_NAMESPACE_CONFIG );
-
- // namespaces used in the technical preview (SO 5.2)
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__fo_old) ),
- GetXMLToken(XML_N_FO_OLD),
- XML_NAMESPACE_FO );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__xlink_old) ),
- GetXMLToken(XML_N_XLINK_OLD),
- XML_NAMESPACE_XLINK );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__office) ),
- GetXMLToken(XML_N_OFFICE_OLD),
- XML_NAMESPACE_OFFICE );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__style_old) ),
- GetXMLToken(XML_N_STYLE_OLD),
- XML_NAMESPACE_STYLE );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__text_old) ),
- GetXMLToken(XML_N_TEXT_OLD),
- XML_NAMESPACE_TEXT );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__table_old) ),
- GetXMLToken(XML_N_TABLE_OLD),
- XML_NAMESPACE_TABLE );
- pNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__meta_old) ),
- GetXMLToken(XML_N_META_OLD),
- XML_NAMESPACE_META );
- sPackageProtocol = OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.Package:" ) );
-
- if (xNumberFormatsSupplier.is())
- pNumImport = new SvXMLNumFmtHelper(xNumberFormatsSupplier, getServiceFactory());
-
- if (xModel.is() && !pEventListener)
- {
- pEventListener = new SvXMLImportEventListener(this);
- xModel->addEventListener(pEventListener);
- }
-}
-
-// #110680#
-SvXMLImport::SvXMLImport(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- sal_uInt16 nImportFlags ) throw ()
-: pImpl( new SvXMLImport_Impl() ),
- // #110680#
- mxServiceFactory(xServiceFactory),
- pNamespaceMap( new SvXMLNamespaceMap ),
-
- // #110680#
- // pUnitConv( new SvXMLUnitConverter( MAP_100TH_MM, MAP_100TH_MM ) ),
- pUnitConv( new SvXMLUnitConverter( MAP_100TH_MM, MAP_100TH_MM, getServiceFactory() ) ),
-
- pContexts( new SvXMLImportContexts_Impl ),
- pNumImport( NULL ),
- pProgressBarHelper( NULL ),
- pEventImportHelper( NULL ),
- pEventListener( NULL ),
- pXMLErrors( NULL ),
- mnImportFlags( nImportFlags ),
- mbIsFormsSupported( sal_True )
-{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
- _InitCtor();
-}
-
-SvXMLImport::~SvXMLImport() throw ()
-{
- delete pXMLErrors;
- delete pNamespaceMap;
- delete pUnitConv;
- delete pContexts;
- delete pEventImportHelper;
-// delete pImageMapImportHelper;
-
- // #i9518# the import component might not be deleted until after the document has been closed,
- // so the stuff that accesses the document has been moved to endDocument.
-
- // pNumImport is allocated in the ctor, so it must also be deleted here in case the component
- // is created and deleted without actually importing.
- delete pNumImport;
- delete pProgressBarHelper;
-
- xmloff::token::ResetTokens();
-
- if( pImpl )
- delete pImpl;
-
- if (pEventListener && xModel.is())
- xModel->removeEventListener(pEventListener);
-}
-
-// XUnoTunnel & co
-const uno::Sequence< sal_Int8 > & SvXMLImport::getUnoTunnelId() throw()
-{
- static uno::Sequence< sal_Int8 > * pSeq = 0;
- if( !pSeq )
- {
- Guard< Mutex > aGuard( Mutex::getGlobalMutex() );
- if( !pSeq )
- {
- static uno::Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- pSeq = &aSeq;
- }
- }
- return *pSeq;
-}
-
-SvXMLImport* SvXMLImport::getImplementation( uno::Reference< uno::XInterface > xInt ) throw()
-{
- uno::Reference< lang::XUnoTunnel > xUT( xInt, uno::UNO_QUERY );
- if( xUT.is() )
- return (SvXMLImport*)xUT->getSomething( SvXMLImport::getUnoTunnelId() );
- else
- return NULL;
-}
-
-// XUnoTunnel
-sal_Int64 SAL_CALL SvXMLImport::getSomething( const uno::Sequence< sal_Int8 >& rId )
- throw( uno::RuntimeException )
-{
- if( rId.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
- {
- return (sal_Int64)this;
- }
- return 0;
-}
-
-void SAL_CALL SvXMLImport::startDocument( void )
- throw( xml::sax::SAXException, uno::RuntimeException )
-{
- RTL_LOGFILE_TRACE_AUTHOR( "xmloff", LOGFILE_AUTHOR, "{ SvXMLImport::startDocument" );
-
- if( !xGraphicResolver.is() || !xEmbeddedResolver.is() )
- {
- Reference< lang::XMultiServiceFactory > xFactory( xModel, UNO_QUERY );
- if( xFactory.is() )
- {
- try
- {
- if( !xGraphicResolver.is() )
- {
- xGraphicResolver = Reference< XGraphicObjectResolver >::query(
- xFactory->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- // #99870# Import... instead of Export...
- "com.sun.star.document.ImportGraphicObjectResolver"))));
- pImpl->mbOwnGraphicResolver = xGraphicResolver.is();
- }
-
- if( !xEmbeddedResolver.is() )
- {
- xEmbeddedResolver = Reference< XEmbeddedObjectResolver >::query(
- xFactory->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- // #99870# Import... instead of Export...
- "com.sun.star.document.ImportEmbeddedObjectResolver"))));
- pImpl->mbOwnEmbeddedResolver = xEmbeddedResolver.is();
- }
- }
- catch( ::com::sun::star::uno::Exception& )
- {
- }
- }
- }
-}
-
-void SAL_CALL SvXMLImport::endDocument( void )
- throw( xml::sax::SAXException, uno::RuntimeException)
-{
- RTL_LOGFILE_TRACE_AUTHOR( "xmloff", LOGFILE_AUTHOR, "} SvXMLImport::startDocument" );
-
- // #i9518# All the stuff that accesses the document has to be done here, not in the dtor,
- // because the SvXMLImport dtor might not be called until after the document has been closed.
-
- if (pNumImport)
- {
- delete pNumImport;
- pNumImport = NULL;
- }
- if (xImportInfo.is())
- {
- uno::Reference< beans::XPropertySetInfo > xPropertySetInfo = xImportInfo->getPropertySetInfo();
- if (xPropertySetInfo.is())
- {
- if (pProgressBarHelper)
- {
- OUString sProgressMax(RTL_CONSTASCII_USTRINGPARAM(XML_PROGRESSMAX));
- OUString sProgressCurrent(RTL_CONSTASCII_USTRINGPARAM(XML_PROGRESSCURRENT));
- OUString sRepeat(RTL_CONSTASCII_USTRINGPARAM(XML_PROGRESSREPEAT));
- if (xPropertySetInfo->hasPropertyByName(sProgressMax) &&
- xPropertySetInfo->hasPropertyByName(sProgressCurrent))
- {
- sal_Int32 nProgressMax(pProgressBarHelper->GetReference());
- sal_Int32 nProgressCurrent(pProgressBarHelper->GetValue());
- uno::Any aAny;
- aAny <<= nProgressMax;
- xImportInfo->setPropertyValue(sProgressMax, aAny);
- aAny <<= nProgressCurrent;
- xImportInfo->setPropertyValue(sProgressCurrent, aAny);
- }
- if (xPropertySetInfo->hasPropertyByName(sRepeat))
- xImportInfo->setPropertyValue(sRepeat, ::cppu::bool2any(pProgressBarHelper->GetRepeat()));
- // pProgressBarHelper is deleted in dtor
- }
- OUString sNumberStyles(RTL_CONSTASCII_USTRINGPARAM(XML_NUMBERSTYLES));
- if (xNumberStyles.is() && xPropertySetInfo->hasPropertyByName(sNumberStyles))
- {
- uno::Any aAny;
- aAny <<= xNumberStyles;
- xImportInfo->setPropertyValue(sNumberStyles, aAny);
- }
- }
- }
-
- if( xFontDecls.Is() )
- ((SvXMLStylesContext *)&xFontDecls)->Clear();
- if( xStyles.Is() )
- ((SvXMLStylesContext *)&xStyles)->Clear();
- if( xAutoStyles.Is() )
- ((SvXMLStylesContext *)&xAutoStyles)->Clear();
- if( xMasterStyles.Is() )
- ((SvXMLStylesContext *)&xMasterStyles)->Clear();
-
- // possible form-layer related knittings which can only be done when
- // the whole document exists
- if ( mxFormImport.is() )
- mxFormImport->documentDone();
-
- // The shape import helper does the z-order sorting in the dtor,
- // so it must be deleted here, too.
- mxShapeImport = NULL;
-
- if( pImpl->mbOwnGraphicResolver )
- {
- Reference< lang::XComponent > xComp( xGraphicResolver, UNO_QUERY );
- xComp->dispose();
- }
-
- if( pImpl->mbOwnEmbeddedResolver )
- {
- Reference< lang::XComponent > xComp( xEmbeddedResolver, UNO_QUERY );
- xComp->dispose();
- }
-
- if ( pXMLErrors != NULL )
- {
- pXMLErrors->ThrowErrorAsSAXException( XMLERROR_FLAG_SEVERE );
- }
-}
-
-void SAL_CALL SvXMLImport::startElement( const OUString& rName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
- throw(xml::sax::SAXException, uno::RuntimeException)
-{
- SvXMLNamespaceMap *pRewindMap = 0;
-
- // Process namespace attributes. This must happen before creating the
- // context, because namespace decaration apply to the element name itself.
- INT16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( INT16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- if( ( rAttrName.getLength() >= 5 ) &&
- ( rAttrName.compareToAscii( sXML_xmlns, 5 ) == 0 ) &&
- ( rAttrName.getLength() == 5 || ':' == rAttrName[5] ) )
- {
- if( !pRewindMap )
- {
- pRewindMap = pNamespaceMap;
- pNamespaceMap = new SvXMLNamespaceMap( *pNamespaceMap );
- }
- const OUString& rAttrValue = xAttrList->getValueByIndex( i );
-
- OUString aPrefix( ( rAttrName.getLength() == 5 )
- ? OUString()
- : rAttrName.copy( 6 ) );
- pNamespaceMap->Add( aPrefix, rAttrValue );
- }
- }
-
- // Get element's namespace and local name.
- OUString aLocalName;
- USHORT nPrefix =
- pNamespaceMap->GetKeyByAttrName( rName, &aLocalName );
-
- // If there are contexts already, call a CreateChildContext at the topmost
- // context. Otherwise, create a default context.
- SvXMLImportContext *pContext;
- USHORT nCount = pContexts->Count();
- if( nCount > 0 )
- {
- pContext = (*pContexts)[nCount - 1]->CreateChildContext( nPrefix,
- aLocalName,
- xAttrList );
- }
- else
- {
-#ifdef TIMELOG
- // If we do profiling, we want a trace message for the first element
- // in order to identify the stream.
- ByteString aString( (String)rName, RTL_TEXTENCODING_ASCII_US );
- RTL_LOGFILE_TRACE_AUTHOR1( "xmloff", LOGFILE_AUTHOR,
- "SvXMLImport::StartElement( \"%s\", ... )",
- aString.GetBuffer() );
-#endif
-
- pContext = CreateContext( nPrefix, aLocalName, xAttrList );
- }
-
- DBG_ASSERT( pContext, "SvXMLImport::startElement: missing context" );
- if( !pContext )
- pContext = new SvXMLImportContext( *this, nPrefix, aLocalName );
-
- pContext->AddRef();
-
- // Remeber old namespace map.
- if( pRewindMap )
- pContext->SetRewindMap( pRewindMap );
-
- // Call a startElement at the new context.
- pContext->StartElement( xAttrList );
-
- // Push context on stack.
- pContexts->Insert( pContext, nCount );
-}
-
-void SAL_CALL SvXMLImport::endElement( const OUString& rName )
- throw(xml::sax::SAXException, uno::RuntimeException)
-{
- USHORT nCount = pContexts->Count();
- DBG_ASSERT( nCount, "SvXMLImport::endElement: no context left" );
- if( nCount > 0 )
- {
- // Get topmost context and remove it from the stack.
- SvXMLImportContext *pContext = (*pContexts)[nCount-1];
- pContexts->Remove( nCount-1, 1 );
-
-#ifdef DBG_UTIL
- // Non product only: check if endElement call matches startELement call.
- OUString aLocalName;
- USHORT nPrefix =
- pNamespaceMap->GetKeyByAttrName( rName, &aLocalName );
- DBG_ASSERT( pContext->GetPrefix() == nPrefix,
- "SvXMLImport::endElement: popped context has wrong prefix" );
- DBG_ASSERT( pContext->GetLocalName() == aLocalName,
- "SvXMLImport::endElement: popped context has wrong lname" );
-#endif
-
- // Call a EndElement at the current context.
- pContext->EndElement();
-
- // Get a namespace map to rewind.
- SvXMLNamespaceMap *pRewindMap = pContext->GetRewindMap();
-
- // Delete the current context.
- pContext->ReleaseRef();
- pContext = 0;
-
- // Rewind a namespace map.
- if( pRewindMap )
- {
- delete pNamespaceMap;
- pNamespaceMap = pRewindMap;
- }
- }
-}
-
-void SAL_CALL SvXMLImport::characters( const OUString& rChars )
- throw(xml::sax::SAXException, uno::RuntimeException)
-{
- USHORT nCount = pContexts->Count();
- if( nCount > 0 )
- {
- (*pContexts)[nCount - 1]->Characters( rChars );
- }
-}
-
-void SAL_CALL SvXMLImport::ignorableWhitespace( const OUString& rWhitespaces )
- throw(xml::sax::SAXException, uno::RuntimeException)
-{
-}
-
-void SAL_CALL SvXMLImport::processingInstruction( const OUString& rTarget,
- const OUString& rData )
- throw(xml::sax::SAXException, uno::RuntimeException)
-{
-}
-
-void SAL_CALL SvXMLImport::setDocumentLocator( const uno::Reference< xml::sax::XLocator >& rLocator )
- throw(xml::sax::SAXException, uno::RuntimeException)
-{
- xLocator = rLocator;
-}
-
-// XExtendedDocumentHandler
-void SAL_CALL SvXMLImport::startCDATA( void ) throw(xml::sax::SAXException, uno::RuntimeException)
-{
-}
-
-void SAL_CALL SvXMLImport::endCDATA( void ) throw(uno::RuntimeException)
-{
-}
-
-void SAL_CALL SvXMLImport::comment( const OUString& rComment )
- throw(xml::sax::SAXException, uno::RuntimeException)
-{
-}
-
-void SAL_CALL SvXMLImport::allowLineBreak( void )
- throw(xml::sax::SAXException, uno::RuntimeException)
-{
-}
-
-void SAL_CALL SvXMLImport::unknown( const OUString& sString )
- throw(xml::sax::SAXException, uno::RuntimeException)
-{
-}
-
-void SvXMLImport::SetStatisticAttributes(const uno::Reference< xml::sax::XAttributeList > & xAttribs)
-{
- GetProgressBarHelper()->SetRepeat(sal_False);
- GetProgressBarHelper()->SetReference(0);
-}
-
-///////////////////////////////////////////////////////////////////////
-
-// XImporter
-void SAL_CALL SvXMLImport::setTargetDocument( const uno::Reference< lang::XComponent >& xDoc )
- throw(lang::IllegalArgumentException, uno::RuntimeException)
-{
- xModel = uno::Reference< frame::XModel >::query( xDoc );
- if( !xModel.is() )
- throw lang::IllegalArgumentException();
- if (xModel.is() && !pEventListener)
- {
- pEventListener = new SvXMLImportEventListener(this);
- xModel->addEventListener(pEventListener);
- }
-
- DBG_ASSERT( !pNumImport, "number format import already exists." );
- if( pNumImport )
- {
- delete pNumImport;
- pNumImport = 0;
- }
-}
-
-// XFilter
-sal_Bool SAL_CALL SvXMLImport::filter( const uno::Sequence< beans::PropertyValue >& aDescriptor )
- throw (uno::RuntimeException)
-{
- return sal_False;
-}
-
-void SAL_CALL SvXMLImport::cancel( )
- throw (uno::RuntimeException)
-{
-}
-
-// XInitialize
-void SAL_CALL SvXMLImport::initialize( const uno::Sequence< uno::Any >& aArguments )
- throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
-{
- const sal_Int32 nAnyCount = aArguments.getLength();
- const uno::Any* pAny = aArguments.getConstArray();
-
- for( sal_Int32 nIndex = 0; nIndex < nAnyCount; nIndex++, pAny++ )
- {
- Reference<XInterface> xValue;
- *pAny >>= xValue;
-
- uno::Reference<task::XStatusIndicator> xTmpStatusIndicator(
- xValue, UNO_QUERY );
- if( xTmpStatusIndicator.is() )
- mxStatusIndicator = xTmpStatusIndicator;
-
- uno::Reference<document::XGraphicObjectResolver> xTmpGraphicResolver(
- xValue, UNO_QUERY );
- if( xTmpGraphicResolver.is() )
- xGraphicResolver = xTmpGraphicResolver;
-
- uno::Reference<document::XEmbeddedObjectResolver> xTmpObjectResolver(
- xValue, UNO_QUERY );
- if( xTmpObjectResolver.is() )
- xEmbeddedResolver = xTmpObjectResolver;
-
- uno::Reference<beans::XPropertySet> xTmpPropSet( xValue, UNO_QUERY );
- if( xTmpPropSet.is() )
- {
- xImportInfo = xTmpPropSet;
- uno::Reference< beans::XPropertySetInfo > xPropertySetInfo = xImportInfo->getPropertySetInfo();
- if (xPropertySetInfo.is())
- {
- OUString sNumberStyles(RTL_CONSTASCII_USTRINGPARAM(XML_NUMBERSTYLES));
- if (xPropertySetInfo->hasPropertyByName(sNumberStyles))
- {
- uno::Any aAny = xImportInfo->getPropertyValue(sNumberStyles);
- aAny >>= xNumberStyles;
- }
- }
- }
- }
-}
-
-// XServiceInfo
-OUString SAL_CALL SvXMLImport::getImplementationName()
- throw(uno::RuntimeException)
-{
- OUString aStr;
- return aStr;
-}
-
-sal_Bool SAL_CALL SvXMLImport::supportsService( const OUString& rServiceName )
- throw(::com::sun::star::uno::RuntimeException)
-{
- return
- rServiceName.equalsAsciiL(
- "com.sun.star.document.ImportFilter",
- sizeof("com.sun.star.document.ImportFilter")-1 ) ||
- rServiceName.equalsAsciiL(
- "com.sun.star.xml.XMLImportFilter",
- sizeof("com.sun.star.xml.XMLImportFilter")-1);
-}
-
-uno::Sequence< OUString > SAL_CALL SvXMLImport::getSupportedServiceNames( )
- throw(uno::RuntimeException)
-{
- uno::Sequence<OUString> aSeq(2);
- OUString* pSeq = aSeq.getArray();
- aSeq[0] = OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ImportFilter"));
- aSeq[1] = OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.XMLImportFilter"));
- return aSeq;
-}
-
-///////////////////////////////////////////////////////////////////////
-
-XMLTextImportHelper* SvXMLImport::CreateTextImport()
-{
- return new XMLTextImportHelper( xModel, *this );
-}
-
-XMLShapeImportHelper* SvXMLImport::CreateShapeImport()
-{
- return new XMLShapeImportHelper( *this, xModel );
-}
-
-#ifndef SVX_LIGHT
-SchXMLImportHelper* SvXMLImport::CreateChartImport()
-{
- return new SchXMLImportHelper();
-}
-#endif
-
-#ifndef SVX_LIGHT
-::binfilter::xmloff::OFormLayerXMLImport* SvXMLImport::CreateFormImport()
-{
- return new ::binfilter::xmloff::OFormLayerXMLImport(*this);
-}
-#endif // #ifndef SVX_LIGHT
-
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Get or create fill/line/lineend-style-helper
-//
-
-const Reference< container::XNameContainer > & SvXMLImport::GetGradientHelper()
-{
- if( !xGradientHelper.is() )
- {
- if( xModel.is() )
- {
- Reference< lang::XMultiServiceFactory > xServiceFact( xModel, UNO_QUERY);
- if( xServiceFact.is() )
- {
- try
- {
- xGradientHelper = Reference< container::XNameContainer >( xServiceFact->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.GradientTable" ) ) ), UNO_QUERY);
- }
- catch( lang::ServiceNotRegisteredException& )
- {}
- }
- }
- }
-
- return xGradientHelper;
-}
-
-const Reference< container::XNameContainer > & SvXMLImport::GetHatchHelper()
-{
- if( !xHatchHelper.is() )
- {
- if( xModel.is() )
- {
- Reference< lang::XMultiServiceFactory > xServiceFact( xModel, UNO_QUERY);
- if( xServiceFact.is() )
- {
- try
- {
- xHatchHelper = Reference< container::XNameContainer >( xServiceFact->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.HatchTable" ) ) ), UNO_QUERY);
- }
- catch( lang::ServiceNotRegisteredException& )
- {}
- }
- }
- }
-
- return xHatchHelper;
-}
-
-const Reference< container::XNameContainer > & SvXMLImport::GetBitmapHelper()
-{
- if( !xBitmapHelper.is() )
- {
- if( xModel.is() )
- {
- Reference< lang::XMultiServiceFactory > xServiceFact( xModel, UNO_QUERY);
- if( xServiceFact.is() )
- {
- try
- {
- xBitmapHelper = Reference< container::XNameContainer >( xServiceFact->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.BitmapTable" ) ) ), UNO_QUERY);
- }
- catch( lang::ServiceNotRegisteredException& )
- {}
- }
- }
- }
-
- return xBitmapHelper;
-}
-
-const Reference< container::XNameContainer > & SvXMLImport::GetTransGradientHelper()
-{
- if( !xTransGradientHelper.is() )
- {
- if( xModel.is() )
- {
- Reference< lang::XMultiServiceFactory > xServiceFact( xModel, UNO_QUERY);
- if( xServiceFact.is() )
- {
- try
- {
- xTransGradientHelper = Reference< container::XNameContainer >( xServiceFact->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.TransparencyGradientTable" ) ) ), UNO_QUERY);
- }
- catch( lang::ServiceNotRegisteredException& )
- {}
- }
- }
- }
-
- return xTransGradientHelper;
-}
-
-const Reference< container::XNameContainer > & SvXMLImport::GetMarkerHelper()
-{
- if( !xMarkerHelper.is() )
- {
- if( xModel.is() )
- {
- Reference< lang::XMultiServiceFactory > xServiceFact( xModel, UNO_QUERY);
- if( xServiceFact.is() )
- {
- try
- {
- xMarkerHelper = Reference< container::XNameContainer >( xServiceFact->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.MarkerTable" ) ) ), UNO_QUERY);
- }
- catch( lang::ServiceNotRegisteredException& )
- {}
- }
- }
- }
-
- return xMarkerHelper;
-}
-
-const Reference< container::XNameContainer > & SvXMLImport::GetDashHelper()
-{
- if( !xDashHelper.is() )
- {
- if( xModel.is() )
- {
- Reference< lang::XMultiServiceFactory > xServiceFact( xModel, UNO_QUERY);
- if( xServiceFact.is() )
- {
- try
- {
- xDashHelper = Reference< container::XNameContainer >( xServiceFact->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.DashTable" ) ) ), UNO_QUERY);
- }
- catch( lang::ServiceNotRegisteredException& )
- {}
- }
- }
- }
-
- return xDashHelper;
-}
-
-::rtl::OUString SvXMLImport::ResolveGraphicObjectURL( const ::rtl::OUString& rURL,
- sal_Bool bLoadOnDemand )
-{
- ::rtl::OUString sRet;
-
- if( 0 == rURL.compareTo( ::rtl::OUString( '#' ), 1 ) )
- {
- if( !bLoadOnDemand && xGraphicResolver.is() )
- {
- ::rtl::OUString aTmp( sPackageProtocol );
- aTmp += rURL.copy( 1 );
- sRet = xGraphicResolver->resolveGraphicObjectURL( aTmp );
- }
-
- if( !sRet.getLength() )
- {
- sRet = sPackageProtocol;
- sRet += rURL.copy( 1 );
- }
- }
-
- if( !sRet.getLength() )
- sRet = ::binfilter::StaticBaseUrl::RelToAbs( rURL );
-
- return sRet;
-}
-
-Reference< XOutputStream > SvXMLImport::GetStreamForGraphicObjectURLFromBase64()
-{
- Reference< XOutputStream > xOStm;
- Reference< document::XBinaryStreamResolver > xStmResolver( xGraphicResolver, UNO_QUERY );
-
- if( xStmResolver.is() )
- xOStm = xStmResolver->createOutputStream();
-
- return xOStm;
-}
-
-::rtl::OUString SvXMLImport::ResolveGraphicObjectURLFromBase64(
- const Reference < XOutputStream >& rOut )
-{
- OUString sURL;
- Reference< document::XBinaryStreamResolver > xStmResolver( xGraphicResolver, UNO_QUERY );
- if( xStmResolver.is() )
- sURL = xStmResolver->resolveOutputStream( rOut );
-
- return sURL;
-}
-
-::rtl::OUString SvXMLImport::ResolveEmbeddedObjectURL(
- const ::rtl::OUString& rURL,
- const ::rtl::OUString& rClassId )
-{
- ::rtl::OUString sRet;
-
- if( 0 == rURL.compareTo( ::rtl::OUString( '#' ), 1 ) &&
- xEmbeddedResolver.is() )
- {
- OUString sURL( rURL );
- if( rClassId.getLength() )
- {
- sURL += OUString( '!' );
- sURL += rClassId;
- }
- sRet = xEmbeddedResolver->resolveEmbeddedObjectURL( sURL );
- }
-
- return sRet;
-}
-
-Reference < XOutputStream > SvXMLImport::ResolveEmbeddedObjectURLFromBase64(
- const ::rtl::OUString& rURL )
-{
- Reference < XOutputStream > xOLEStream;
-
- if( 0 == rURL.compareTo( ::rtl::OUString( '#' ), 1 ) &&
- xEmbeddedResolver.is() )
- {
- Reference< XNameAccess > xNA( xEmbeddedResolver, UNO_QUERY );
- if( xNA.is() )
- {
- Any aAny = xNA->getByName( rURL );
- aAny >>= xOLEStream;
- }
- }
-
- return xOLEStream;
-}
-
-void SvXMLImport::SetViewSettings(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aViewProps)
-{
-}
-
-void SvXMLImport::SetConfigurationSettings(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aConfigProps)
-{
-}
-
-ProgressBarHelper* SvXMLImport::GetProgressBarHelper()
-{
- if (!pProgressBarHelper)
- {
- pProgressBarHelper = new ProgressBarHelper(mxStatusIndicator, sal_False);
-
- if (pProgressBarHelper && xImportInfo.is())
- {
- uno::Reference< beans::XPropertySetInfo > xPropertySetInfo = xImportInfo->getPropertySetInfo();
- if (xPropertySetInfo.is())
- {
- OUString sProgressRange(RTL_CONSTASCII_USTRINGPARAM(XML_PROGRESSRANGE));
- OUString sProgressMax(RTL_CONSTASCII_USTRINGPARAM(XML_PROGRESSMAX));
- OUString sProgressCurrent(RTL_CONSTASCII_USTRINGPARAM(XML_PROGRESSCURRENT));
- OUString sRepeat(RTL_CONSTASCII_USTRINGPARAM(XML_PROGRESSREPEAT));
- if (xPropertySetInfo->hasPropertyByName(sProgressMax) &&
- xPropertySetInfo->hasPropertyByName(sProgressCurrent) &&
- xPropertySetInfo->hasPropertyByName(sProgressRange))
- {
- uno::Any aAny;
- sal_Int32 nProgressMax(0);
- sal_Int32 nProgressCurrent(0);
- sal_Int32 nProgressRange(0);
- aAny = xImportInfo->getPropertyValue(sProgressRange);
- if (aAny >>= nProgressRange)
- pProgressBarHelper->SetRange(nProgressRange);
- aAny = xImportInfo->getPropertyValue(sProgressMax);
- if (aAny >>= nProgressMax)
- pProgressBarHelper->SetReference(nProgressMax);
- aAny = xImportInfo->getPropertyValue(sProgressCurrent);
- if (aAny >>= nProgressCurrent)
- pProgressBarHelper->SetValue(nProgressCurrent);
- }
- if (xPropertySetInfo->hasPropertyByName(sRepeat))
- {
- uno::Any aAny = xImportInfo->getPropertyValue(sRepeat);
- if (aAny.getValueType() == getBooleanCppuType())
- pProgressBarHelper->SetRepeat(::cppu::any2bool(aAny));
- else
- DBG_ERRORFILE("why is it no boolean?");
- }
- }
- }
- }
- return pProgressBarHelper;
-}
-
-void SvXMLImport::AddNumberStyle(sal_Int32 nKey, const OUString& rName)
-{
- if (!xNumberStyles.is())
- xNumberStyles = uno::Reference< container::XNameContainer >( comphelper::NameContainer_createInstance( ::getCppuType((const sal_Int32*)0)) );
- if (xNumberStyles.is())
- {
- uno::Any aAny;
- aAny <<= nKey;
- try
- {
- xNumberStyles->insertByName(rName, aAny);
- }
- catch ( uno::Exception& )
- {
- DBG_ERROR("Numberformat could not be inserted");
- }
- }
- else
- DBG_ERROR("not possible to create NameContainer");
-}
-
-XMLEventImportHelper& SvXMLImport::GetEventImport()
-{
-#ifndef SVX_LIGHT
- if (!pEventImportHelper)
- {
- // construct event helper and register StarBasic handler and standard
- // event tables
- pEventImportHelper = new XMLEventImportHelper();
- OUString sStarBasic(GetXMLToken(XML_STARBASIC));
- pEventImportHelper->RegisterFactory(sStarBasic,
- new XMLStarBasicContextFactory());
- OUString sScript(GetXMLToken(XML_SCRIPT));
- pEventImportHelper->RegisterFactory(sScript,
- new XMLScriptContextFactory());
- pEventImportHelper->AddTranslationTable(aStandardEventTable);
-
- // register StarBasic event handler with capitalized spelling
- OUString sStarBasicCap(RTL_CONSTASCII_USTRINGPARAM("StarBasic"));
- pEventImportHelper->RegisterFactory(sStarBasicCap,
- new XMLStarBasicContextFactory());
- }
-#endif
-
- return *pEventImportHelper;
-}
-
-void SvXMLImport::SetFontDecls( XMLFontStylesContext *pFontDecls )
-{
- xFontDecls = pFontDecls;
- GetTextImport()->SetFontDecls( pFontDecls );
-}
-
-void SvXMLImport::SetStyles( SvXMLStylesContext *pStyles )
-{
- xStyles = pStyles;
-}
-
-void SvXMLImport::SetAutoStyles( SvXMLStylesContext *pAutoStyles )
-{
- if (pAutoStyles && xNumberStyles.is() && (mnImportFlags & IMPORT_CONTENT) )
- {
- uno::Reference<xml::sax::XAttributeList> xAttrList;
- uno::Sequence< ::rtl::OUString > aNames = xNumberStyles->getElementNames();
- sal_uInt32 nCount(aNames.getLength());
- if (nCount)
- {
- const OUString* pNames = aNames.getConstArray();
- if ( pNames )
- {
- SvXMLStyleContext* pContext;
- uno::Any aAny;
- sal_Int32 nKey(0);
- for (sal_uInt32 i = 0; i < nCount; i++, pNames++)
- {
- aAny = xNumberStyles->getByName(*pNames);
- if (aAny >>= nKey)
- {
- pContext = new SvXMLNumFormatContext( *this, XML_NAMESPACE_NUMBER,
- *pNames, xAttrList, nKey, *pAutoStyles );
- pAutoStyles->AddStyle(*pContext);
- }
- }
- }
- }
- }
- xAutoStyles = pAutoStyles;
- GetTextImport()->SetAutoStyles( pAutoStyles );
- GetShapeImport()->SetAutoStylesContext( pAutoStyles );
-#ifndef SVX_LIGHT
- GetChartImport()->SetAutoStylesContext( pAutoStyles );
- GetFormImport()->setAutoStyleContext( pAutoStyles );
-#endif
-}
-
-void SvXMLImport::SetMasterStyles( SvXMLStylesContext *pMasterStyles )
-{
- xMasterStyles = pMasterStyles;
-}
-
-XMLFontStylesContext *SvXMLImport::GetFontDecls()
-{
- return (XMLFontStylesContext *)&xFontDecls;
-}
-
-SvXMLStylesContext *SvXMLImport::GetStyles()
-{
- return (SvXMLStylesContext *)&xStyles;
-}
-
-SvXMLStylesContext *SvXMLImport::GetAutoStyles()
-{
- return (SvXMLStylesContext *)&xAutoStyles;
-}
-
-const XMLFontStylesContext *SvXMLImport::GetFontDecls() const
-{
- return (const XMLFontStylesContext *)&xFontDecls;
-}
-
-const SvXMLStylesContext *SvXMLImport::GetStyles() const
-{
- return (const SvXMLStylesContext *)&xStyles;
-}
-
-const SvXMLStylesContext *SvXMLImport::GetAutoStyles() const
-{
- return (const SvXMLStylesContext *)&xAutoStyles;
-}
-
-OUString SvXMLImport::GetAbsoluteReference(const OUString& rValue)
-{
- return ::binfilter::StaticBaseUrl::RelToAbs( rValue );
-}
-
-void SvXMLImport::_CreateNumberFormatsSupplier()
-{
- DBG_ASSERT( !xNumberFormatsSupplier.is(),
- "number formats supplier already exists!" );
- if(xModel.is())
- xNumberFormatsSupplier =
- uno::Reference< util::XNumberFormatsSupplier> (xModel, uno::UNO_QUERY);
-}
-
-
-void SvXMLImport::_CreateDataStylesImport()
-{
- DBG_ASSERT( pNumImport == NULL, "data styles import already exists!" );
- uno::Reference<util::XNumberFormatsSupplier> xNum =
- GetNumberFormatsSupplier();
- if ( xNum.is() )
- pNumImport = new SvXMLNumFmtHelper(xNum, getServiceFactory());
-}
-
-
-#ifdef CONV_STAR_FONTS
-sal_Unicode SvXMLImport::ConvStarBatsCharToStarSymbol( sal_Unicode c )
-{
- sal_Unicode cNew = c;
- if( !pImpl->hBatsFontConv )
- {
- OUString sStarBats( RTL_CONSTASCII_USTRINGPARAM( "StarBats" ) );
- pImpl->hBatsFontConv = CreateFontToSubsFontConverter( sStarBats,
- FONTTOSUBSFONT_IMPORT|FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS );
- OSL_ENSURE( pImpl->hBatsFontConv, "Got no symbol font converter" );
- }
- if( pImpl->hBatsFontConv )
- {
- cNew = ConvertFontToSubsFontChar( pImpl->hBatsFontConv, c );
- }
-
- return cNew;
-}
-
-sal_Unicode SvXMLImport::ConvStarMathCharToStarSymbol( sal_Unicode c )
-{
- sal_Unicode cNew = c;
- if( !pImpl->hMathFontConv )
- {
- OUString sStarMath( RTL_CONSTASCII_USTRINGPARAM( "StarMath" ) );
- pImpl->hMathFontConv = CreateFontToSubsFontConverter( sStarMath,
- FONTTOSUBSFONT_IMPORT|FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS );
- OSL_ENSURE( pImpl->hMathFontConv, "Got no symbol font converter" );
- }
- if( pImpl->hMathFontConv )
- {
- cNew = ConvertFontToSubsFontChar( pImpl->hMathFontConv, c );
- }
-
- return cNew;
-}
-#endif
-
-
-
-void SvXMLImport::SetError(
- sal_Int32 nId,
- const Sequence<OUString>& rMsgParams,
- const OUString& rExceptionMessage,
- const Reference<xml::sax::XLocator>& rLocator )
-{
- // maintain error flags
- if ( ( nId & XMLERROR_FLAG_ERROR ) != 0 )
- mnErrorFlags |= ERROR_ERROR_OCCURED;
- if ( ( nId & XMLERROR_FLAG_WARNING ) != 0 )
- mnErrorFlags |= ERROR_WARNING_OCCURED;
- if ( ( nId & XMLERROR_FLAG_SEVERE ) != 0 )
- mnErrorFlags |= ERROR_DO_NOTHING;
-
- // create error list on demand
- if ( pXMLErrors == NULL )
- pXMLErrors = new XMLErrors();
-
- // save error information
- // use document locator (if none supplied)
- pXMLErrors->AddRecord( nId, rMsgParams, rExceptionMessage,
- rLocator.is() ? rLocator : xLocator );
-}
-
-void SvXMLImport::SetError(
- sal_Int32 nId,
- const Sequence<OUString>& rMsgParams)
-{
- OUString sEmpty;
- SetError( nId, rMsgParams, sEmpty, NULL );
-}
-
-void SvXMLImport::DisposingModel()
-{
- if( xFontDecls.Is() )
- ((SvXMLStylesContext *)&xFontDecls)->Clear();
- if( xStyles.Is() )
- ((SvXMLStylesContext *)&xStyles)->Clear();
- if( xAutoStyles.Is() )
- ((SvXMLStylesContext *)&xAutoStyles)->Clear();
- if( xMasterStyles.Is() )
- ((SvXMLStylesContext *)&xMasterStyles)->Clear();
-
- xModel = 0;
- pEventListener = NULL;
-}
-
-::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > SvXMLImport::getServiceFactory()
-{
- // #110680#
- return mxServiceFactory;
-}
-
-// eof
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_xmlkywd.cxx b/binfilter/bf_xmloff/source/core/xmloff_xmlkywd.cxx
deleted file mode 100644
index 725114b3d979..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_xmlkywd.cxx
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLKYWD_HXX
-#define XML_DEFINE_KEYWORDS
-#include "xmlkywd.hxx"
-#undef XML_DEFINE_KEYWORDS
-#endif
-namespace binfilter {
-
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_xmltkmap.cxx b/binfilter/bf_xmloff/source/core/xmloff_xmltkmap.cxx
deleted file mode 100644
index 43ffe2018232..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_xmltkmap.cxx
+++ /dev/null
@@ -1,128 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include <rtl/ustring.hxx>
-
-#include <bf_svtools/svarray.hxx>
-
-#include "xmltkmap.hxx"
-
-namespace binfilter {
-
-using namespace rtl;
-using namespace ::binfilter::xmloff::token;
-
-class SvXMLTokenMapEntry_Impl
-{
- sal_uInt16 nPrefixKey;
- OUString sLocalName;
- sal_uInt16 nToken;
-
-public:
-
- sal_uInt16 GetToken() const { return nToken; }
-
- SvXMLTokenMapEntry_Impl( sal_uInt16 nPrefix, const OUString& rLName,
- sal_uInt16 nTok=XML_TOK_UNKNOWN ) :
- nPrefixKey( nPrefix ),
- sLocalName( rLName ),
- nToken( nTok )
- {}
-
- SvXMLTokenMapEntry_Impl( const SvXMLTokenMapEntry& rEntry ) :
- nPrefixKey( rEntry.nPrefixKey ),
- sLocalName( GetXMLToken( rEntry.eLocalName ) ),
- nToken( rEntry.nToken )
- {}
-
- BOOL operator==( const SvXMLTokenMapEntry_Impl& r ) const
- {
- return nPrefixKey == r.nPrefixKey &&
- sLocalName == r.sLocalName;
- }
-
- BOOL operator<( const SvXMLTokenMapEntry_Impl& r ) const
- {
- return nPrefixKey < r.nPrefixKey ||
- ( nPrefixKey == r.nPrefixKey &&
- sLocalName < r.sLocalName);
- }
-};
-
-typedef SvXMLTokenMapEntry_Impl *SvXMLTokenMapEntry_ImplPtr;
-SV_DECL_PTRARR_SORT_DEL( SvXMLTokenMap_Impl, SvXMLTokenMapEntry_ImplPtr, 5, 5 )
-SV_IMPL_OP_PTRARR_SORT( SvXMLTokenMap_Impl, SvXMLTokenMapEntry_ImplPtr )
-
-// ---------------------------------------------------------------------
-
-SvXMLTokenMapEntry_Impl *SvXMLTokenMap::_Find( sal_uInt16 nKeyPrefix,
- const OUString& rLName ) const
-{
- SvXMLTokenMapEntry_Impl *pRet = 0;
- SvXMLTokenMapEntry_Impl aTst( nKeyPrefix, rLName );
-
- sal_uInt16 nPos;
- if( pImpl->Seek_Entry( &aTst, &nPos ) )
- {
- pRet = (*pImpl)[nPos];
- }
-
- return pRet;
-}
-
-SvXMLTokenMap::SvXMLTokenMap( SvXMLTokenMapEntry *pMap ) :
- pImpl( new SvXMLTokenMap_Impl )
-{
- while( pMap->eLocalName != XML_TOKEN_INVALID )
- {
- pImpl->Insert( new SvXMLTokenMapEntry_Impl( *pMap ) );
- pMap++;
- }
-}
-
-SvXMLTokenMap::~SvXMLTokenMap()
-{
- delete pImpl;
-}
-
-sal_uInt16 SvXMLTokenMap::Get( sal_uInt16 nKeyPrefix,
- const OUString& rLName ) const
-{
- SvXMLTokenMapEntry_Impl *pEntry = _Find( nKeyPrefix, rLName );
- if( pEntry )
- return pEntry->GetToken();
- else
- return XML_TOK_UNKNOWN;
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_xmltoken.cxx b/binfilter/bf_xmloff/source/core/xmloff_xmltoken.cxx
deleted file mode 100644
index 3ce7df21ce34..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_xmltoken.cxx
+++ /dev/null
@@ -1,2166 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "xmltoken.hxx"
-
-#include <tools/debug.hxx>
-
-#include <rtl/ustring.hxx>
-namespace binfilter {
-
-using ::rtl::OUString;
-
-namespace xmloff { namespace token {
-
- // keep the tokens (and their length)
- struct XMLTokenEntry
- {
- sal_Int32 nLength;
- const sal_Char* pChar;
- ::rtl::OUString* pOUString;
- };
-
-
-
-
-#define TOKEN( s ) { sizeof(s)-1, s, NULL }
-
- struct XMLTokenEntry aTokenList[] =
- {
- { 0, NULL, NULL }, // XML_TOKEN_START
-
- // common XML
- TOKEN( "CDATA" ), // XML_CDATA
- TOKEN( " " ), // XML_WS
- TOKEN( "xml" ), // XML_xml
- TOKEN( "xmlns" ), // XML_xmlns
- TOKEN( "version=\"1.0\" encoding=\"UTF-8\"" ), // XML_xml_pi
- TOKEN( "<!DOCTYPE " ), // XML_xml_doctype_prefix
- TOKEN( " PUBLIC \"-//OpenOffice.org//DTD OfficeDocument 1.0//EN\" \"office.dtd\">" ), // XML_xml_doctype_suffix
-
- // namespace prefixes and names
- TOKEN( "office" ), // XML_np_office
- TOKEN( "http://openoffice.org/2000/office" ), // XML_n_office
- TOKEN( "http://sun.com/xmlns/staroffice/office" ), // XML_n_office_old
- TOKEN( "meta" ), // XML_np_meta
- TOKEN( "http://openoffice.org/2000/meta" ), // XML_n_meta
- TOKEN( "http://sun.com/xmlns/staroffice/meta" ), // XML_n_meta_old
- TOKEN( "style" ), // XML_np_style
- TOKEN( "http://openoffice.org/2000/style" ), // XML_n_style
- TOKEN( "http://sun.com/xmlns/staroffice/style" ), // XML_n_style_old
- TOKEN( "number" ), // XML_np_number
- TOKEN( "http://openoffice.org/2000/datastyle" ), // XML_n_number
- TOKEN( "http://sun.com/xmlns/staroffice/number" ), // XML_n_number_old
- TOKEN( "text" ), // XML_np_text
- TOKEN( "http://openoffice.org/2000/text" ), // XML_n_text
- TOKEN( "http://sun.com/xmlns/staroffice/text" ), // XML_n_text_old
- TOKEN( "table" ), // XML_np_table
- TOKEN( "http://openoffice.org/2000/table" ), // XML_n_table
- TOKEN( "http://sun.com/xmlns/staroffice/table" ), // XML_n_table_old
- TOKEN( "draw" ), // XML_np_draw
- TOKEN( "http://openoffice.org/2000/drawing" ), // XML_n_draw
- TOKEN( "dr3d" ), // XML_np_dr3d
- TOKEN( "http://openoffice.org/2000/dr3d" ), // XML_n_dr3d
- TOKEN( "http://sun.com/xmlns/staroffice/draw" ), // XML_n_draw_old
- TOKEN( "presentation" ), // XML_np_presentation
- TOKEN( "http://openoffice.org/2000/presentation" ), // XML_n_presentation
- TOKEN( "http://sun.com/xmlns/staroffice/presentation" ), // XML_n_presentation_old
- TOKEN( "chart" ), // XML_np_chart
- TOKEN( "http://openoffice.org/2000/chart" ), // XML_n_chart
- TOKEN( "config" ), // XML_np_config
- TOKEN( "http://openoffice.org/2001/config" ), // XML_n_config
- TOKEN( "http://sun.com/xmlns/staroffice/chart" ), // XML_n_chart_old
- TOKEN( "fo" ), // XML_np_fo
- TOKEN( "http://www.w3.org/1999/XSL/Format/" ), // XML_n_fo_old
- TOKEN( "http://www.w3.org/1999/XSL/Format" ), // XML_n_fo
- TOKEN( "xlink" ), // XML_np_xlink
- TOKEN( "http://www.w3.org/1999/xlink" ), // XML_n_xlink
- TOKEN( "http://www.w3.org/1999/xlink/namespace" ), // XML_n_xlink_old
- TOKEN( "dc" ), // XML_np_dc
- TOKEN( "http://purl.org/dc/elements/1.1/" ), // XML_n_dc
- TOKEN( "svg" ), // XML_np_svg
- TOKEN( "http://www.w3.org/2000/svg" ), // XML_n_svg
- TOKEN( "form" ), // XML_NP_form
- TOKEN( "http://openoffice.org/2000/form" ), // XML_N_form
- TOKEN( "script" ), // XML_NP_script
- TOKEN( "http://openoffice.org/2000/script" ), // XML_N_script
-
-
- TOKEN( "block-list" ), // XML_np_block_list
- TOKEN( "http://openoffice.org/2001/block-list" ), // XML_n_block_list
-
- TOKEN( "math" ), // XML_np_math
- TOKEN( "http://www.w3.org/1998/Math/MathML" ), // XML_n_math
-
- TOKEN( "VL" ), // XML_np_versions_list
- TOKEN( "http://openoffice.org/2001/versions-list" ), // XML_n_versions_list
-
- // units
- TOKEN( "mm" ), // XML_unit_mm
- TOKEN( "m" ), // XML_unit_m
- TOKEN( "km" ), // XML_unit_km
- TOKEN( "cm" ), // XML_unit_cm
- TOKEN( "pt" ), // XML_unit_pt
- TOKEN( "pc" ), // XML_unit_pc
- TOKEN( "ft" ), // XML_unit_foot
- TOKEN( "mi" ), // XML_unit_miles
- TOKEN( "inch" ), // XML_unit_inch
-
- // any other
- TOKEN( "1" ), // XML_1
- TOKEN( "10" ), // XML_10
- TOKEN( "2" ), // XML_2
- TOKEN( "3" ), // XML_3
- TOKEN( "4" ), // XML_4
- TOKEN( "5" ), // XML_5
- TOKEN( "6" ), // XML_6
- TOKEN( "7" ), // XML_7
- TOKEN( "8" ), // XML_8
- TOKEN( "9" ), // XML_9
- TOKEN( "A" ), // XML_A_UPCASE
- TOKEN( "I" ), // XML_I_UPCASE
- TOKEN( "IBM437" ), // XML_IBM437
- TOKEN( "IBM850" ), // XML_IBM850
- TOKEN( "IBM860" ), // XML_IBM860
- TOKEN( "IBM861" ), // XML_IBM861
- TOKEN( "IBM863" ), // XML_IBM863
- TOKEN( "IBM865" ), // XML_IBM865
- TOKEN( "ISO-8859-1" ), // XML_ISO_8859_1
- TOKEN( "ole2" ), // XML_OLE2
- TOKEN( ":" ), // XML__COLON
- TOKEN( "" ), // XML__EMPTY
- TOKEN( "_unknown_" ), // XML__UNKNOWN_
-
- TOKEN( "a" ), // XML_A
- TOKEN( "abbreviated-name" ), // XML_ABBREVIATED_NAME
- TOKEN( "above" ), // XML_ABOVE
- TOKEN( "abs" ), // XML_ABS
- TOKEN( "accent" ), // XML_ACCENT
- TOKEN( "accentunder" ), // XML_ACCENTUNDER
- TOKEN( "acceptance-state" ), // XML_ACCEPTANCE_STATE
- TOKEN( "accepted" ), // XML_ACCEPTED
- TOKEN( "action" ), // XML_ACTION
- TOKEN( "active" ), // XML_ACTIVE
- TOKEN( "active-split-range" ), // XML_ACTIVE_SPLIT_RANGE
- TOKEN( "active-table" ), // XML_ACTIVE_TABLE
- TOKEN( "actuate" ), // XML_ACTUATE
- TOKEN( "add-in" ), // XML_ADD_IN
- TOKEN( "add-in-name" ), // XML_ADD_IN_NAME
- TOKEN( "address" ), // XML_ADDRESS
- TOKEN( "adjustment" ), // XML_ADJUSTMENT
- TOKEN( "algorithm" ), // XML_ALGORITHM
- TOKEN( "align" ), // XML_ALIGN
- TOKEN( "all" ), // XML_ALL
- TOKEN( "allow-empty-cell" ), // XML_ALLOW_EMPTY_CELL
- TOKEN( "alphabetical-index" ), // XML_ALPHABETICAL_INDEX
- TOKEN( "alphabetical-index-auto-mark-file" ), // XML_ALPHABETICAL_INDEX_AUTO_MARK_FILE
- TOKEN( "alphabetical-index-entry-template" ), // XML_ALPHABETICAL_INDEX_ENTRY_TEMPLATE
- TOKEN( "alphabetical-index-mark" ), // XML_ALPHABETICAL_INDEX_MARK
- TOKEN( "alphabetical-index-mark-end" ),// XML_ALPHABETICAL_INDEX_MARK_END
- TOKEN( "alphabetical-index-mark-start" ), // XML_ALPHABETICAL_INDEX_MARK_START
- TOKEN( "alphabetical-index-source" ), // XML_ALPHABETICAL_INDEX_SOURCE
- TOKEN( "alphabetical-separators" ), // XML_ALPHABETICAL_SEPARATORS
- TOKEN( "alternate" ), // XML_ALTERNATE
- TOKEN( "am-pm" ), // XML_AM_PM
- TOKEN( "ambient-color" ), // XML_AMBIENT_COLOR
- TOKEN( "anchor-page-number" ), // XML_ANCHOR_PAGE_NUMBER
- TOKEN( "anchor-type" ), // XML_ANCHOR_TYPE
- TOKEN( "and" ), // XML_AND
- TOKEN( "animation" ), // XML_ANIMATION
- TOKEN( "animation-delay" ), // XML_ANIMATION_DELAY
- TOKEN( "animation-direction" ), // XML_ANIMATION_DIRECTION
- TOKEN( "animation-repeat" ), // XML_ANIMATION_REPEAT
- TOKEN( "animation-start-inside" ), // XML_ANIMATION_START_INSIDE
- TOKEN( "animation-steps" ), // XML_ANIMATION_STEPS
- TOKEN( "animation-stop-inside" ), // XML_ANIMATION_STOP_INSIDE
- TOKEN( "animations" ), // XML_ANIMATIONS
- TOKEN( "annotation" ), // XML_ANNOTATION
- TOKEN( "annotations" ), // XML_ANNOTATIONS
- TOKEN( "annote" ), // XML_ANNOTE
- TOKEN( "appear" ), // XML_APPEAR
- TOKEN( "applet" ), // XML_APPLET
- TOKEN( "applet-name" ), // XML_APPLET_NAME
- TOKEN( "application-data" ), // XML_APPLICATION_DATA
- TOKEN( "application-xml" ), // XML_APPLICATION_XML
- TOKEN( "apply" ), // XML_APPLY
- TOKEN( "apply-style-name" ), // XML_APPLY_STYLE_NAME
- TOKEN( "aqua" ), // XML_AQUA
- TOKEN( "arc" ), // XML_ARC
- TOKEN( "arccos" ), // XML_ARCCOS
- TOKEN( "archive" ), // XML_ARCHIVE
- TOKEN( "arcsin" ), // XML_ARCSIN
- TOKEN( "arctan" ), // XML_ARCTAN
- TOKEN( "area" ), // XML_AREA
- TOKEN( "area-circle" ), // XML_AREA_CIRCLE
- TOKEN( "area-polygon" ), // XML_AREA_POLYGON
- TOKEN( "area-rectangle" ), // XML_AREA_RECTANGLE
- TOKEN( "article" ), // XML_ARTICLE
- TOKEN( "as-char" ), // XML_AS_CHAR
- TOKEN( "ascending" ), // XML_ASCENDING
- TOKEN( "attached-axis" ), // XML_ATTACHED_AXIS
- TOKEN( "attractive" ), // XML_ATTRACTIVE
- TOKEN( "author" ), // XML_AUTHOR
- TOKEN( "author-initials" ), // XML_AUTHOR_INITIALS
- TOKEN( "author-name" ), // XML_AUTHOR_NAME
- TOKEN( "auto" ), // XML_AUTO
- TOKEN( "auto-grow-height" ), // XML_AUTO_GROW_HEIGHT
- TOKEN( "auto-grow-width" ), // XML_AUTO_GROW_WIDTH
- TOKEN( "auto-reload" ), // XML_AUTO_RELOAD
- TOKEN( "auto-text" ), // XML_AUTO_TEXT
- TOKEN( "auto-text-events" ), // XML_AUTO_TEXT_EVENTS
- TOKEN( "auto-text-group" ), // XML_AUTO_TEXT_GROUP
- TOKEN( "auto-text-indent" ), // XML_AUTO_TEXT_INDENT
- TOKEN( "auto-update" ), // XML_AUTO_UPDATE
- TOKEN( "automatic" ), // XML_AUTOMATIC
- TOKEN( "automatic-find-labels" ), // XML_AUTOMATIC_FIND_LABELS
- TOKEN( "automatic-order" ), // XML_AUTOMATIC_ORDER
- TOKEN( "automatic-styles" ), // XML_AUTOMATIC_STYLES
- TOKEN( "automatic-update" ), // XML_AUTOMATIC_UPDATE
- TOKEN( "autosize" ), // XML_AUTOSIZE
- TOKEN( "average" ), // XML_AVERAGE
- TOKEN( "axis" ), // XML_AXIS
- TOKEN( "back-scale" ), // XML_BACK_SCALE
- TOKEN( "backface-culling" ), // XML_BACKFACE_CULLING
- TOKEN( "background" ), // XML_BACKGROUND
- TOKEN( "background-color" ), // XML_BACKGROUND_COLOR
- TOKEN( "background-image" ), // XML_BACKGROUND_IMAGE
- TOKEN( "no-repeat" ), // XML_BACKGROUND_NO_REPEAT
- TOKEN( "repeat" ), // XML_BACKGROUND_REPEAT
- TOKEN( "stretch" ), // XML_BACKGROUND_STRETCH
- TOKEN( "bar" ), // XML_BAR
- TOKEN( "base64Binary" ), // XML_BASE64BINARY
- TOKEN( "base-cell-address" ), // XML_BASE_CELL_ADDRESS
- TOKEN( "baseline" ), // XML_BASELINE
- TOKEN( "before-date-time" ), // XML_BEFORE_DATE_TIME
- TOKEN( "below" ), // XML_BELOW
- TOKEN( "between-date-times" ), // XML_BETWEEN_DATE_TIMES
- TOKEN( "bevel" ), // XML_BEVEL
- TOKEN( "bibiliographic-type" ), // XML_BIBILIOGRAPHIC_TYPE
- TOKEN( "bibliography" ), // XML_BIBLIOGRAPHY
- TOKEN( "bibliography-configuration" ), // XML_BIBLIOGRAPHY_CONFIGURATION
- TOKEN( "bibliography-data-field" ), // XML_BIBLIOGRAPHY_DATA_FIELD
- TOKEN( "bibliography-entry-template" ),// XML_BIBLIOGRAPHY_ENTRY_TEMPLATE
- TOKEN( "bibliography-mark" ), // XML_BIBLIOGRAPHY_MARK
- TOKEN( "bibliography-source" ), // XML_BIBLIOGRAPHY_SOURCE
- TOKEN( "bibliography-type" ), // XML_BIBLIOGRAPHY_TYPE
- TOKEN( "bind-styles-to-content" ), // XML_BIND_STYLES_TO_CONTENT
- TOKEN( "bitmap" ), // XML_BITMAP
- TOKEN( "black" ), // XML_BLACK
- TOKEN( "blend" ), // XML_BLEND
- TOKEN( "blinking" ), // XML_BLINKING
- TOKEN( "block" ), // XML_BLOCK
- TOKEN( "block-list" ), // XML_BLOCK_LIST
- TOKEN( "blue" ), // XML_BLUE
- TOKEN( "body" ), // XML_BODY
- TOKEN( "bold" ), // XML_BOLD
- TOKEN( "book" ), // XML_BOOK
- TOKEN( "booklet" ), // XML_BOOKLET
- TOKEN( "bookmark" ), // XML_BOOKMARK
- TOKEN( "bookmark-end" ), // XML_BOOKMARK_END
- TOKEN( "bookmark-ref" ), // XML_BOOKMARK_REF
- TOKEN( "bookmark-start" ), // XML_BOOKMARK_START
- TOKEN( "booktitle" ), // XML_BOOKTITLE
- TOKEN( "boolean" ), // XML_BOOLEAN
- TOKEN( "boolean-style" ), // XML_BOOLEAN_STYLE
- TOKEN( "boolean-value" ), // XML_BOOLEAN_VALUE
- TOKEN( "border" ), // XML_BORDER
- TOKEN( "border-bottom" ), // XML_BORDER_BOTTOM
- TOKEN( "border-color" ), // XML_BORDER_COLOR
- TOKEN( "border-left" ), // XML_BORDER_LEFT
- TOKEN( "border-line-width" ), // XML_BORDER_LINE_WIDTH
- TOKEN( "border-line-width-bottom" ), // XML_BORDER_LINE_WIDTH_BOTTOM
- TOKEN( "border-line-width-left" ), // XML_BORDER_LINE_WIDTH_LEFT
- TOKEN( "border-line-width-right" ), // XML_BORDER_LINE_WIDTH_RIGHT
- TOKEN( "border-line-width-top" ), // XML_BORDER_LINE_WIDTH_TOP
- TOKEN( "border-right" ), // XML_BORDER_RIGHT
- TOKEN( "border-top" ), // XML_BORDER_TOP
- TOKEN( "both" ), // XML_BOTH
- TOKEN( "bottom" ), // XML_BOTTOM
- TOKEN( "bottom-left" ), // XML_BOTTOM_LEFT
- TOKEN( "bottom percent" ), // XML_BOTTOM_PERCENT
- TOKEN( "bottom-right" ), // XML_BOTTOM_RIGHT
- TOKEN( "bottom values" ), // XML_BOTTOM_VALUES
- TOKEN( "bottom-arc" ), // XML_BOTTOMARC
- TOKEN( "bottom-circle" ), // XML_BOTTOMCIRCLE
- TOKEN( "break-after" ), // XML_BREAK_AFTER
- TOKEN( "break-before" ), // XML_BREAK_BEFORE
- TOKEN( "break-inside" ), // XML_BREAK_INSIDE
- TOKEN( "bubble" ), // XML_BUBBLE
- TOKEN( "bullet-char" ), // XML_BULLET_CHAR
- TOKEN( "bullet-relative-size" ), // XML_BULLET_RELATIVE_SIZE
- TOKEN( "button1" ), // XML_BUTTON1
- TOKEN( "button2" ), // XML_BUTTON2
- TOKEN( "button3" ), // XML_BUTTON3
- TOKEN( "button4" ), // XML_BUTTON4
- TOKEN( "buttons" ), // XML_BUTTONS
- TOKEN( "bvar" ), // XML_BVAR
- TOKEN( "c" ), // XML_C
- TOKEN( "calculation-settings" ), // XML_CALCULATION_SETTINGS
- TOKEN( "calendar" ), // XML_CALENDAR
- TOKEN( "capitalize-entries" ), // XML_CAPITALIZE_ENTRIES
- TOKEN( "caption" ), // XML_CAPTION
- TOKEN( "caption-point-x" ), // XML_CAPTION_POINT_X
- TOKEN( "caption-point-y" ), // XML_CAPTION_POINT_Y
- TOKEN( "caption-sequence-format" ), // XML_CAPTION_SEQUENCE_FORMAT
- TOKEN( "caption-sequence-name" ), // XML_CAPTION_SEQUENCE_NAME
- TOKEN( "case-sensitive" ), // XML_CASE_SENSITIVE
- TOKEN( "capitalize" ), // XML_CASEMAP_CAPITALIZE
- TOKEN( "lowercase" ), // XML_CASEMAP_LOWERCASE
- TOKEN( "normal" ), // XML_CASEMAP_NORMAL
- TOKEN( "small-caps" ), // XML_CASEMAP_SMALL_CAPS
- TOKEN( "uppercase" ), // XML_CASEMAP_UPPERCASE
- TOKEN( "categories" ), // XML_CATEGORIES
- TOKEN( "category" ), // XML_CATEGORY
- TOKEN( "category-and-value" ), // XML_CATEGORY_AND_VALUE
- TOKEN( "cell-address" ), // XML_CELL_ADDRESS
- TOKEN( "cell-content-change" ), // XML_CELL_CONTENT_CHANGE
- TOKEN( "cell-content-deletion" ), // XML_CELL_CONTENT_DELETION
- TOKEN( "cell-count" ), // XML_CELL_COUNT
- TOKEN( "cell-protect" ), // XML_CELL_PROTECT
- TOKEN( "cell-range-address" ), // XML_CELL_RANGE_ADDRESS
- TOKEN( "cell-range-address-list" ), // XML_CELL_RANGE_ADDRESS_LIST
- TOKEN( "cell-range-source" ), // XML_CELL_RANGE_SOURCE
- TOKEN( "center" ), // XML_CENTER
- TOKEN( "chain-next-name" ), // XML_CHAIN_NEXT_NAME
- TOKEN( "change" ), // XML_CHANGE
- TOKEN( "change-deletion" ), // XML_CHANGE_DELETION
- TOKEN( "change-end" ), // XML_CHANGE_END
- TOKEN( "change-id" ), // XML_CHANGE_ID
- TOKEN( "change-info" ), // XML_CHANGE_INFO
- TOKEN( "change-start" ), // XML_CHANGE_START
- TOKEN( "change-track-table-cell" ), // XML_CHANGE_TRACK_TABLE_CELL
- TOKEN( "change-view-conditions" ), // XML_CHANGE_VIEW_CONDITIONS
- TOKEN( "change-view-settings" ), // XML_CHANGE_VIEW_SETTINGS
- TOKEN( "changed-region" ), // XML_CHANGED_REGION
- TOKEN( "chapter" ), // XML_CHAPTER
- TOKEN( "char" ), // XML_CHAR
- TOKEN( "character-count" ), // XML_CHARACTER_COUNT
- TOKEN( "chart" ), // XML_CHART
- TOKEN( "charts" ), // XML_CHARTS
- TOKEN( "checkerboard" ), // XML_CHECKERBOARD
- TOKEN( "chg-author" ), // XML_CHG_AUTHOR
- TOKEN( "chg-comment" ), // XML_CHG_COMMENT
- TOKEN( "chg-date-time" ), // XML_CHG_DATE_TIME
- TOKEN( "ci" ), // XML_CI
- TOKEN( "circle" ), // XML_CIRCLE
- TOKEN( "citation-body-style-name" ), // XML_CITATION_BODY_STYLE_NAME
- TOKEN( "citation-style-name" ), // XML_CITATION_STYLE_NAME
- TOKEN( "class" ), // XML_CLASS
- TOKEN( "class-id" ), // XML_CLASS_ID
- TOKEN( "clip" ), // XML_CLIP
- TOKEN( "clockwise" ), // XML_CLOCKWISE
- TOKEN( "close" ), // XML_CLOSE
- TOKEN( "close-horizontal" ), // XML_CLOSE_HORIZONTAL
- TOKEN( "close-vertical" ), // XML_CLOSE_VERTICAL
- TOKEN( "cm" ), // XML_CM
- TOKEN( "cn" ), // XML_CN
- TOKEN( "code" ), // XML_CODE
- TOKEN( "codebase" ), // XML_CODEBASE
- TOKEN( "collapse" ), // XML_COLLAPSE
- TOKEN( "color" ), // XML_COLOR
- TOKEN( "color-inversion" ), // XML_COLOR_INVERSION
- TOKEN( "color-mode" ), // XML_COLOR_MODE
- TOKEN( "column" ), // XML_COLUMN
- TOKEN( "column-count" ), // XML_COLUMN_COUNT
- TOKEN( "column-gap" ), // XML_COLUMN_GAP
- TOKEN( "column-name" ), // XML_COLUMN_NAME
- TOKEN( "column-sep" ), // XML_COLUMN_SEP
- TOKEN( "column-width" ), // XML_COLUMN_WIDTH
- TOKEN( "columns" ), // XML_COLUMNS
- TOKEN( "auto" ), // XML_COLUMNSPLIT_AUTO
- TOKEN( "avoid" ), // XML_COLUMNSPLIT_AVOID
- TOKEN( "combine-entries" ), // XML_COMBINE_ENTRIES
- TOKEN( "combine-entries-with-dash" ), // XML_COMBINE_ENTRIES_WITH_DASH
- TOKEN( "combine-entries-with-pp" ), // XML_COMBINE_ENTRIES_WITH_PP
- TOKEN( "comma-separated" ), // XML_COMMA_SEPARATED
- TOKEN( "command" ), // XML_COMMAND
- TOKEN( "comment" ), // XML_COMMENT
- TOKEN( "compose" ), // XML_COMPOSE
- TOKEN( "cond-style-name" ), // XML_COND_STYLE_NAME
- TOKEN( "condition" ), // XML_CONDITION
- TOKEN( "condition-source" ), // XML_CONDITION_SOURCE
- TOKEN( "condition-source-range-address" ), // XML_CONDITION_SOURCE_RANGE_ADDRESS
- TOKEN( "conditional-text" ), // XML_CONDITIONAL_TEXT
- TOKEN( "cone" ), // XML_CONE
- TOKEN( "conference" ), // XML_CONFERENCE
- TOKEN( "config-item" ), // XML_CONFIG_ITEM
- TOKEN( "config-item-map-entry" ), // XML_CONFIG_ITEM_MAP_ENTRY
- TOKEN( "config-item-map-indexed" ), // XML_CONFIG_ITEM_MAP_INDEXED
- TOKEN( "config-item-map-named" ), // XML_CONFIG_ITEM_MAP_NAMED
- TOKEN( "config-item-set" ), // XML_CONFIG_ITEM_SET
- TOKEN( "configuration-settings" ), // XML_CONFIGURATION_SETTINGS
- TOKEN( "conjugate" ), // XML_CONJUGATE
- TOKEN( "connect-bars" ), // XML_CONNECT_BARS
- TOKEN( "connection-name" ), // XML_CONNECTION_NAME
- TOKEN( "connector" ), // XML_CONNECTOR
- TOKEN( "consecutive-numbering" ), // XML_CONSECUTIVE_NUMBERING
- TOKEN( "consolidation" ), // XML_CONSOLIDATION
- TOKEN( "constant" ), // XML_CONSTANT
- TOKEN( "contains-error" ), // XML_CONTAINS_ERROR
- TOKEN( "contains-header" ), // XML_CONTAINS_HEADER
- TOKEN( "content" ), // XML_CONTENT
- TOKEN( "content-validation" ), // XML_CONTENT_VALIDATION
- TOKEN( "validation-name" ), // XML_CONTENT_VALIDATION_NAME
- TOKEN( "content-validations" ), // XML_CONTENT_VALIDATIONS
- TOKEN( "continue" ), // XML_CONTINUE
- TOKEN( "continue-numbering" ), // XML_CONTINUE_NUMBERING
- TOKEN( "contour-path" ), // XML_CONTOUR_PATH
- TOKEN( "contour-polygon" ), // XML_CONTOUR_POLYGON
- TOKEN( "contrast" ), // XML_CONTRAST
- TOKEN( "control" ), // XML_CONTROL
- TOKEN( "conversion-mode" ), // XML_CONVERSION_MODE
- TOKEN( "copy-back" ), // XML_COPY_BACK
- TOKEN( "copy-formulas" ), // XML_COPY_FORMULAS
- TOKEN( "copy-outline-levels" ), // XML_COPY_OUTLINE_LEVELS
- TOKEN( "copy-results-only" ), // XML_COPY_RESULTS_ONLY
- TOKEN( "copy-styles" ), // XML_COPY_STYLES
- TOKEN( "corner-radius" ), // XML_CORNER_RADIUS
- TOKEN( "correct" ), // XML_CORRECT
- TOKEN( "cos" ), // XML_COS
- TOKEN( "cosh" ), // XML_COSH
- TOKEN( "cot" ), // XML_COT
- TOKEN( "coth" ), // XML_COTH
- TOKEN( "count" ), // XML_COUNT
- TOKEN( "count-empty-lines" ), // XML_COUNT_EMPTY_LINES
- TOKEN( "count-in-floating-frames" ), // XML_COUNT_IN_FLOATING_FRAMES
- TOKEN( "counter-clockwise" ), // XML_COUNTER_CLOCKWISE
- TOKEN( "counterclockwise" ), // XML_COUNTERCLOCKWISE
- TOKEN( "countnums" ), // XML_COUNTNUMS
- TOKEN( "country" ), // XML_COUNTRY
- TOKEN( "country-asian" ), // XML_COUNTRY_ASIAN
- TOKEN( "country-complex" ), // XML_COUNTRY_COMPLEX
- TOKEN( "covered-table-cell" ), // XML_COVERED_TABLE_CELL
- TOKEN( "create-date" ), // XML_CREATE_DATE
- TOKEN( "create-date-string" ), // XML_CREATE_DATE_STRING
- TOKEN( "creation-date" ), // XML_CREATION_DATE
- TOKEN( "creation-time" ), // XML_CREATION_TIME
- TOKEN( "creator" ), // XML_CREATOR
- TOKEN( "X" ), // XML_CROSSEDOUT_CROSS
- TOKEN( "double-line" ), // XML_CROSSEDOUT_DOUBLE
- TOKEN( "none" ), // XML_CROSSEDOUT_NONE
- TOKEN( "single-line" ), // XML_CROSSEDOUT_SINGLE
- TOKEN( "slash" ), // XML_CROSSEDOUT_SLASH
- TOKEN( "thick-line" ), // XML_CROSSEDOUT_THICK
- TOKEN( "csc" ), // XML_CSC
- TOKEN( "csch" ), // XML_CSCH
- TOKEN( "cube" ), // XML_CUBE
- TOKEN( "cuboid" ), // XML_CUBOID
- TOKEN( "currency" ), // XML_CURRENCY
- TOKEN( "currency-style" ), // XML_CURRENCY_STYLE
- TOKEN( "currency-symbol" ), // XML_CURRENCY_SYMBOL
- TOKEN( "current" ), // XML_CURRENT
- TOKEN( "current-value" ), // XML_CURRENT_VALUE
- TOKEN( "cursor-position" ), // XML_CURSOR_POSITION
- TOKEN( "cursor-position-x" ), // XML_CURSOR_POSITION_X
- TOKEN( "cursor-position-y" ), // XML_CURSOR_POSITION_Y
- TOKEN( "curve" ), // XML_CURVE
- TOKEN( "custom1" ), // XML_CUSTOM1
- TOKEN( "custom2" ), // XML_CUSTOM2
- TOKEN( "custom3" ), // XML_CUSTOM3
- TOKEN( "custom4" ), // XML_CUSTOM4
- TOKEN( "custom5" ), // XML_CUSTOM5
- TOKEN( "cut" ), // XML_CUT
- TOKEN( "cut-offs" ), // XML_CUT_OFFS
- TOKEN( "cx" ), // XML_CX
- TOKEN( "cy" ), // XML_CY
- TOKEN( "cylinder" ), // XML_CYLINDER
- TOKEN( "d" ), // XML_D
- TOKEN( "dash" ), // XML_DASH
- TOKEN( "dashed" ), // XML_DASHED
- TOKEN( "data" ), // XML_DATA
- TOKEN( "data-cell-range-address" ), // XML_DATA_CELL_RANGE_ADDRESS
- TOKEN( "data-label-number" ), // XML_DATA_LABEL_NUMBER
- TOKEN( "data-label-symbol" ), // XML_DATA_LABEL_SYMBOL
- TOKEN( "data-label-text" ), // XML_DATA_LABEL_TEXT
- TOKEN( "data-pilot-field" ), // XML_DATA_PILOT_FIELD
- TOKEN( "data-pilot-level" ), // XML_DATA_PILOT_LEVEL
- TOKEN( "data-pilot-member" ), // XML_DATA_PILOT_MEMBER
- TOKEN( "data-pilot-members" ), // XML_DATA_PILOT_MEMBERS
- TOKEN( "data-pilot-subtotal" ), // XML_DATA_PILOT_SUBTOTAL
- TOKEN( "data-pilot-subtotals" ), // XML_DATA_PILOT_SUBTOTALS
- TOKEN( "data-pilot-table" ), // XML_DATA_PILOT_TABLE
- TOKEN( "data-pilot-tables" ), // XML_DATA_PILOT_TABLES
- TOKEN( "data-point" ), // XML_DATA_POINT
- TOKEN( "data-style" ), // XML_DATA_STYLE
- TOKEN( "data-style-name" ), // XML_DATA_STYLE_NAME
- TOKEN( "data-type" ), // XML_DATA_TYPE
- TOKEN( "database-display" ), // XML_DATABASE_DISPLAY
- TOKEN( "database-name" ), // XML_DATABASE_NAME
- TOKEN( "database-next" ), // XML_DATABASE_NEXT
- TOKEN( "database-range" ), // XML_DATABASE_RANGE
- TOKEN( "database-ranges" ), // XML_DATABASE_RANGES
- TOKEN( "database-row-number" ), // XML_DATABASE_ROW_NUMBER
- TOKEN( "database-select" ), // XML_DATABASE_SELECT
- TOKEN( "database-source-query" ), // XML_DATABASE_SOURCE_QUERY
- TOKEN( "database-source-sql" ), // XML_DATABASE_SOURCE_SQL
- TOKEN( "database-source-table" ), // XML_DATABASE_SOURCE_TABLE
- TOKEN( "date" ), // XML_DATE
- TOKEN( "date-adjust" ), // XML_DATE_ADJUST
- TOKEN( "date-style" ), // XML_DATE_STYLE
- TOKEN( "date-time" ), // XML_DATE_TIME
- TOKEN( "date-value" ), // XML_DATE_VALUE
- TOKEN( "datetime" ), // XML_DATETIME
- TOKEN( "day" ), // XML_DAY
- TOKEN( "day-of-week" ), // XML_DAY_OF_WEEK
- TOKEN( "dde-application" ), // XML_DDE_APPLICATION
- TOKEN( "dde-connection" ), // XML_DDE_CONNECTION
- TOKEN( "dde-connection-decl" ), // XML_DDE_CONNECTION_DECL
- TOKEN( "dde-connection-decls" ), // XML_DDE_CONNECTION_DECLS
- TOKEN( "dde-item" ), // XML_DDE_ITEM
- TOKEN( "dde-link" ), // XML_DDE_LINK
- TOKEN( "dde-links" ), // XML_DDE_LINKS
- TOKEN( "dde-source" ), // XML_DDE_SOURCE
- TOKEN( "dde-topic" ), // XML_DDE_TOPIC
- TOKEN( "decimal-places" ), // XML_DECIMAL_PLACES
- TOKEN( "decimal-replacement" ), // XML_DECIMAL_REPLACEMENT
- TOKEN( "declare" ), // XML_DECLARE
- TOKEN( "decorate-words-only" ), // XML_DECORATE_WORDS_ONLY
- TOKEN( "decorative" ), // XML_DECORATIVE
- TOKEN( "deep" ), // XML_DEEP
- TOKEN( "default" ), // XML_DEFAULT
- TOKEN( "default-cell-style-name" ), // XML_DEFAULT_CELL_STYLE_NAME
- TOKEN( "default-style" ), // XML_DEFAULT_STYLE
- TOKEN( "default-style-name" ), // XML_DEFAULT_STYLE_NAME
- TOKEN( "degree" ), // XML_DEGREE
- TOKEN( "delay" ), // XML_DELAY
- TOKEN( "deletion" ), // XML_DELETION
- TOKEN( "deletions" ), // XML_DELETIONS
- TOKEN( "dependence" ), // XML_DEPENDENCE
- TOKEN( "dependences" ), // XML_DEPENDENCES
- TOKEN( "depth" ), // XML_DEPTH
- TOKEN( "desc" ), // XML_DESC
- TOKEN( "descending" ), // XML_DESCENDING
- TOKEN( "description" ), // XML_DESCRIPTION
- TOKEN( "detective" ), // XML_DETECTIVE
- TOKEN( "determinant" ), // XML_DETERMINANT
- TOKEN( "diff" ), // XML_DIFF
- TOKEN( "diffuse-color" ), // XML_DIFFUSE_COLOR
- TOKEN( "dim" ), // XML_DIM
- TOKEN( "direction" ), // XML_DIRECTION
- TOKEN( "disabled" ), // XML_DISABLED
- TOKEN( "disc" ), // XML_DISC
- TOKEN( "display" ), // XML_DISPLAY
- TOKEN( "display-border" ), // XML_DISPLAY_BORDER
- TOKEN( "display-details" ), // XML_DISPLAY_DETAILS
- TOKEN( "display-duplicates" ), // XML_DISPLAY_DUPLICATES
- TOKEN( "display-empty" ), // XML_DISPLAY_EMPTY
- TOKEN( "display-filter-buttons" ), // XML_DISPLAY_FILTER_BUTTONS
- TOKEN( "display-formula" ), // XML_DISPLAY_FORMULA
- TOKEN( "display-label" ), // XML_DISPLAY_LABEL
- TOKEN( "display-levels" ), // XML_DISPLAY_LEVELS
- TOKEN( "display-name" ), // XML_DISPLAY_NAME
- TOKEN( "display-outline-level" ), // XML_DISPLAY_OUTLINE_LEVEL
- TOKEN( "dissolve" ), // XML_DISSOLVE
- TOKEN( "distance" ), // XML_DISTANCE
- TOKEN( "distance-after-sep" ), // XML_DISTANCE_AFTER_SEP
- TOKEN( "distance-before-sep" ), // XML_DISTANCE_BEFORE_SEP
- TOKEN( "distribute-letter" ), // XML_DISTRIBUTE_LETTER
- TOKEN( "distribute-space" ), // XML_DISTRIBUTE_SPACE
- TOKEN( "divide" ), // XML_DIVIDE
- TOKEN( "document" ), // XML_DOCUMENT
- TOKEN( "document-content" ), // XML_DOCUMENT_CONTENT
- TOKEN( "document-meta" ), // XML_DOCUMENT_META
- TOKEN( "document-settings" ), // XML_DOCUMENT_SETTINGS
- TOKEN( "document-statistic" ), // XML_DOCUMENT_STATISTIC
- TOKEN( "document-styles" ), // XML_DOCUMENT_STYLES
- TOKEN( "domain" ), // XML_DOMAIN
- TOKEN( "dot" ), // XML_DOT
- TOKEN( "dots1" ), // XML_DOTS1
- TOKEN( "dots1-length" ), // XML_DOTS1_LENGTH
- TOKEN( "dots2" ), // XML_DOTS2
- TOKEN( "dots2-length" ), // XML_DOTS2_LENGTH
- TOKEN( "dotted" ), // XML_DOTTED
- TOKEN( "double" ), // XML_DOUBLE
- TOKEN( "double-sided" ), // XML_DOUBLE_SIDED
- TOKEN( "down" ), // XML_DOWN
- TOKEN( "draft" ), // XML_DRAFT
- TOKEN( "draw" ), // XML_DRAW
- TOKEN( "draw-aspect" ), // XML_DRAW_ASPECT
- TOKEN( "drawing" ), // XML_DRAWING
- TOKEN( "drawings" ), // XML_DRAWINGS
- TOKEN( "drawpool" ), // XML_DRAWPOOL
- TOKEN( "drop-cap" ), // XML_DROP_CAP
- TOKEN( "dynamic" ), // XML_DYNAMIC
- TOKEN( "edge-rounding" ), // XML_EDGE_ROUNDING
- TOKEN( "editable" ), // XML_EDITABLE
- TOKEN( "editing-cycles" ), // XML_EDITING_CYCLES
- TOKEN( "editing-duration" ), // XML_EDITING_DURATION
- TOKEN( "edition" ), // XML_EDITION
- TOKEN( "editor" ), // XML_EDITOR
- TOKEN( "effect" ), // XML_EFFECT
- TOKEN( "ellipse" ), // XML_ELLIPSE
- TOKEN( "email" ), // XML_EMAIL
- TOKEN( "embed" ), // XML_EMBED
- TOKEN( "embedded-visible-area" ), // XML_EMBEDDED_VISIBLE_AREA
- TOKEN( "embossed" ), // XML_EMBOSSED
- TOKEN( "emissive-color" ), // XML_EMISSIVE_COLOR
- TOKEN( "empty" ), // XML_EMPTY
- TOKEN( "enable-numbering" ), // XML_ENABLE_NUMBERING
- TOKEN( "enabled" ), // XML_ENABLED
- TOKEN( "encoding" ), // XML_ENCODING
- TOKEN( "end" ), // XML_END
- TOKEN( "end-angle" ), // XML_END_ANGLE
- TOKEN( "end-cell-address" ), // XML_END_CELL_ADDRESS
- TOKEN( "end-color" ), // XML_END_COLOR
- TOKEN( "end-column" ), // XML_END_COLUMN
- TOKEN( "end-glue-point" ), // XML_END_GLUE_POINT
- TOKEN( "end-guide" ), // XML_END_GUIDE
- TOKEN( "end-intensity" ), // XML_END_INTENSITY
- TOKEN( "end-line-spacing-horizontal" ),// XML_END_LINE_SPACING_HORIZONTAL
- TOKEN( "end-line-spacing-vertical" ), // XML_END_LINE_SPACING_VERTICAL
- TOKEN( "end-position" ), // XML_END_POSITION
- TOKEN( "end-row" ), // XML_END_ROW
- TOKEN( "end-shape" ), // XML_END_SHAPE
- TOKEN( "end-table" ), // XML_END_TABLE
- TOKEN( "end-x" ), // XML_END_X
- TOKEN( "end-y" ), // XML_END_Y
- TOKEN( "endless" ), // XML_ENDLESS
- TOKEN( "endnote" ), // XML_ENDNOTE
- TOKEN( "endnote-body" ), // XML_ENDNOTE_BODY
- TOKEN( "endnote-citation" ), // XML_ENDNOTE_CITATION
- TOKEN( "endnote-ref" ), // XML_ENDNOTE_REF
- TOKEN( "endnotes-configuration" ), // XML_ENDNOTES_CONFIGURATION
- TOKEN( "engraved" ), // XML_ENGRAVED
- TOKEN( "eq" ), // XML_EQ
- TOKEN( "equal-author" ), // XML_EQUAL_AUTHOR
- TOKEN( "equal-comment" ), // XML_EQUAL_COMMENT
- TOKEN( "equal-date" ), // XML_EQUAL_DATE
- TOKEN( "era" ), // XML_ERA
- TOKEN( "ergo-sum" ), // XML_ERGO_SUM
- TOKEN( "error-category" ), // XML_ERROR_CATEGORY
- TOKEN( "error-lower-indicator" ), // XML_ERROR_LOWER_INDICATOR
- TOKEN( "error-lower-limit" ), // XML_ERROR_LOWER_LIMIT
- TOKEN( "error-macro" ), // XML_ERROR_MACRO
- TOKEN( "error-margin" ), // XML_ERROR_MARGIN
- TOKEN( "error-message" ), // XML_ERROR_MESSAGE
- TOKEN( "error-percentage" ), // XML_ERROR_PERCENTAGE
- TOKEN( "error-upper-indicator" ), // XML_ERROR_UPPER_INDICATOR
- TOKEN( "error-upper-limit" ), // XML_ERROR_UPPER_LIMIT
- TOKEN( "sub" ), // XML_ESCAPEMENT_SUB
- TOKEN( "super" ), // XML_ESCAPEMENT_SUPER
- TOKEN( "even-page" ), // XML_EVEN_PAGE
- TOKEN( "event" ), // XML_EVENT
- TOKEN( "event-name" ), // XML_EVENT_NAME
- TOKEN( "events" ), // XML_EVENTS
- TOKEN( "execute" ), // XML_EXECUTE
- TOKEN( "execute-macro" ), // XML_EXECUTE_MACRO
- TOKEN( "exists" ), // XML_EXISTS
- TOKEN( "exp" ), // XML_EXP
- TOKEN( "exponential" ), // XML_EXPONENTIAL
- TOKEN( "expression" ), // XML_EXPRESSION
- TOKEN( "extra" ), // XML_EXTRA
- TOKEN( "extrude" ), // XML_EXTRUDE
- TOKEN( "factorial" ), // XML_FACTORIAL
- TOKEN( "fade" ), // XML_FADE
- TOKEN( "fade-from-bottom" ), // XML_FADE_FROM_BOTTOM
- TOKEN( "fade-from-center" ), // XML_FADE_FROM_CENTER
- TOKEN( "fade-from-left" ), // XML_FADE_FROM_LEFT
- TOKEN( "fade-from-lowerleft" ), // XML_FADE_FROM_LOWERLEFT
- TOKEN( "fade-from-lowerright" ), // XML_FADE_FROM_LOWERRIGHT
- TOKEN( "fade-from-right" ), // XML_FADE_FROM_RIGHT
- TOKEN( "fade-from-top" ), // XML_FADE_FROM_TOP
- TOKEN( "fade-from-upperleft" ), // XML_FADE_FROM_UPPERLEFT
- TOKEN( "fade-from-upperright" ), // XML_FADE_FROM_UPPERRIGHT
- TOKEN( "fade-out" ), // XML_FADE_OUT
- TOKEN( "fade-to-center" ), // XML_FADE_TO_CENTER
- TOKEN( "false" ), // XML_FALSE
- TOKEN( "family" ), // XML_FAMILY
- TOKEN( "fast" ), // XML_FAST
- TOKEN( "field-number" ), // XML_FIELD_NUMBER
- TOKEN( "file-name" ), // XML_FILE_NAME
- TOKEN( "fill" ), // XML_FILL
- TOKEN( "fill-color" ), // XML_FILL_COLOR
- TOKEN( "fill-gradient-name" ), // XML_FILL_GRADIENT_NAME
- TOKEN( "fill-hatch-name" ), // XML_FILL_HATCH_NAME
- TOKEN( "fill-hatch-solid" ), // XML_FILL_HATCH_SOLID
- TOKEN( "fill-image" ), // XML_FILL_IMAGE
- TOKEN( "fill-image-height" ), // XML_FILL_IMAGE_HEIGHT
- TOKEN( "fill-image-name" ), // XML_FILL_IMAGE_NAME
- TOKEN( "fill-image-ref-point" ), // XML_FILL_IMAGE_REF_POINT
- TOKEN( "fill-image-ref-point-x" ), // XML_FILL_IMAGE_REF_POINT_X
- TOKEN( "fill-image-ref-point-y" ), // XML_FILL_IMAGE_REF_POINT_Y
- TOKEN( "fill-image-width" ), // XML_FILL_IMAGE_WIDTH
- TOKEN( "filter" ), // XML_FILTER
- TOKEN( "filter-and" ), // XML_FILTER_AND
- TOKEN( "filter-condition" ), // XML_FILTER_CONDITION
- TOKEN( "filter-name" ), // XML_FILTER_NAME
- TOKEN( "filter-options" ), // XML_FILTER_OPTIONS
- TOKEN( "filter-or" ), // XML_FILTER_OR
- TOKEN( "first-date-time" ), // XML_FIRST_DATE_TIME
- TOKEN( "first-page" ), // XML_FIRST_PAGE
- TOKEN( "first-page-number" ), // XML_FIRST_PAGE_NUMBER
- TOKEN( "fit-to-contour" ), // XML_FIT_TO_CONTOUR
- TOKEN( "fit-to-size" ), // XML_FIT_TO_SIZE
- TOKEN( "fix" ), // XML_FIX
- TOKEN( "fixed" ), // XML_FIXED
- TOKEN( "flat" ), // XML_FLAT
- TOKEN( "float" ), // XML_FLOAT
- TOKEN( "floating-frame" ), // XML_FLOATING_FRAME
- TOKEN( "floor" ), // XML_FLOOR
- TOKEN( "fn" ), // XML_FN
- TOKEN( "focal-length" ), // XML_FOCAL_LENGTH
- TOKEN( "font-char-width" ), // XML_FONT_CHAR_WIDTH
- TOKEN( "font-charset" ), // XML_FONT_CHARSET
- TOKEN( "font-charset-asian" ), // XML_FONT_CHARSET_ASIAN
- TOKEN( "font-charset-complex" ), // XML_FONT_CHARSET_COMPLEX
- TOKEN( "font-color" ), // XML_FONT_COLOR
- TOKEN( "font-decl" ), // XML_FONT_DECL
- TOKEN( "font-decls" ), // XML_FONT_DECLS
- TOKEN( "font-family" ), // XML_FONT_FAMILY
- TOKEN( "font-family-asian" ), // XML_FONT_FAMILY_ASIAN
- TOKEN( "font-family-complex" ), // XML_FONT_FAMILY_COMPLEX
- TOKEN( "font-family-generic" ), // XML_FONT_FAMILY_GENERIC
- TOKEN( "font-family-generic-asian" ), // XML_FONT_FAMILY_GENERIC_ASIAN
- TOKEN( "font-family-generic-complex" ),// XML_FONT_FAMILY_GENERIC_COMPLEX
- TOKEN( "font-kerning" ), // XML_FONT_KERNING
- TOKEN( "font-name" ), // XML_FONT_NAME
- TOKEN( "font-name-asian" ), // XML_FONT_NAME_ASIAN
- TOKEN( "font-name-complex" ), // XML_FONT_NAME_COMPLEX
- TOKEN( "font-pitch" ), // XML_FONT_PITCH
- TOKEN( "font-pitch-asian" ), // XML_FONT_PITCH_ASIAN
- TOKEN( "font-pitch-complex" ), // XML_FONT_PITCH_COMPLEX
- TOKEN( "font-relief" ), // XML_FONT_RELIEF
- TOKEN( "font-size" ), // XML_FONT_SIZE
- TOKEN( "font-size-asian" ), // XML_FONT_SIZE_ASIAN
- TOKEN( "font-size-complex" ), // XML_FONT_SIZE_COMPLEX
- TOKEN( "font-size-rel" ), // XML_FONT_SIZE_REL
- TOKEN( "font-size-rel-asian" ), // XML_FONT_SIZE_REL_ASIAN
- TOKEN( "font-size-rel-complex" ), // XML_FONT_SIZE_REL_COMPLEX
- TOKEN( "font-style" ), // XML_FONT_STYLE
- TOKEN( "font-style-asian" ), // XML_FONT_STYLE_ASIAN
- TOKEN( "font-style-complex" ), // XML_FONT_STYLE_COMPLEX
- TOKEN( "font-style-name" ), // XML_FONT_STYLE_NAME
- TOKEN( "font-style-name-asian" ), // XML_FONT_STYLE_NAME_ASIAN
- TOKEN( "font-style-name-complex" ), // XML_FONT_STYLE_NAME_COMPLEX
- TOKEN( "font-variant" ), // XML_FONT_VARIANT
- TOKEN( "font-weight" ), // XML_FONT_WEIGHT
- TOKEN( "font-weight-asian" ), // XML_FONT_WEIGHT_ASIAN
- TOKEN( "font-weight-complex" ), // XML_FONT_WEIGHT_COMPLEX
- TOKEN( "font-width" ), // XML_FONT_WIDTH
- TOKEN( "font-word-line-mode" ), // XML_FONT_WORD_LINE_MODE
- TOKEN( "fontfamily" ), // XML_FONTFAMILY
- TOKEN( "fontsize" ), // XML_FONTSIZE
- TOKEN( "fontstyle" ), // XML_FONTSTYLE
- TOKEN( "fontweight" ), // XML_FONTWEIGHT
- TOKEN( "fontwork-adjust" ), // XML_FONTWORK_ADJUST
- TOKEN( "fontwork-distance" ), // XML_FONTWORK_DISTANCE
- TOKEN( "fontwork-form" ), // XML_FONTWORK_FORM
- TOKEN( "fontwork-hide-form" ), // XML_FONTWORK_HIDE_FORM
- TOKEN( "fontwork-mirror" ), // XML_FONTWORK_MIRROR
- TOKEN( "fontwork-outline" ), // XML_FONTWORK_OUTLINE
- TOKEN( "fontwork-shadow" ), // XML_FONTWORK_SHADOW
- TOKEN( "fontwork-shadow-color" ), // XML_FONTWORK_SHADOW_COLOR
- TOKEN( "fontwork-shadow-offset-x" ), // XML_FONTWORK_SHADOW_OFFSET_X
- TOKEN( "fontwork-shadow-offset-y" ), // XML_FONTWORK_SHADOW_OFFSET_Y
- TOKEN( "fontwork-shadow-transparence" ), // XML_FONTWORK_SHADOW_TRANSPARENCE
- TOKEN( "fontwork-start" ), // XML_FONTWORK_START
- TOKEN( "fontwork-style" ), // XML_FONTWORK_STYLE
- TOKEN( "footer" ), // XML_FOOTER
- TOKEN( "footer-left" ), // XML_FOOTER_LEFT
- TOKEN( "footer-style" ), // XML_FOOTER_STYLE
- TOKEN( "footnote" ), // XML_FOOTNOTE
- TOKEN( "footnote-body" ), // XML_FOOTNOTE_BODY
- TOKEN( "footnote-citation" ), // XML_FOOTNOTE_CITATION
- TOKEN( "footnote-continuation-notice-backward" ), // XML_FOOTNOTE_CONTINUATION_NOTICE_BACKWARD
- TOKEN( "footnote-continuation-notice-forward" ), // XML_FOOTNOTE_CONTINUATION_NOTICE_FORWARD
- TOKEN( "footnote-max-height" ), // XML_FOOTNOTE_MAX_HEIGHT
- TOKEN( "footnote-ref" ), // XML_FOOTNOTE_REF
- TOKEN( "footnote-sep" ), // XML_FOOTNOTE_SEP
- TOKEN( "footnotes-configuration" ), // XML_FOOTNOTES_CONFIGURATION
- TOKEN( "footnotes-position" ), // XML_FOOTNOTES_POSITION
- TOKEN( "forall" ), // XML_FORALL
- TOKEN( "force-manual" ), // XML_FORCE_MANUAL
- TOKEN( "foreground" ), // XML_FOREGROUND
- TOKEN( "foreign-object" ), // XML_FOREIGN_OBJECT
- TOKEN( "format-change" ), // XML_FORMAT_CHANGE
- TOKEN( "format-source" ), // XML_FORMAT_SOURCE
- TOKEN( "forms" ), // XML_FORMS
- TOKEN( "formula" ), // XML_FORMULA
- TOKEN( "formula-hidden" ), // XML_FORMULA_HIDDEN
- TOKEN( "formulas" ), // XML_FORMULAS
- TOKEN( "fraction" ), // XML_FRACTION
- TOKEN( "frame" ), // XML_FRAME
- TOKEN( "frame-content" ), // XML_FRAME_CONTENT
- TOKEN( "frame-display-border" ), // XML_FRAME_DISPLAY_BORDER
- TOKEN( "frame-display-scrollbar" ), // XML_FRAME_DISPLAY_SCROLLBAR
- TOKEN( "frame-end-margin" ), // XML_FRAME_END_MARGIN
- TOKEN( "frame-margin-horizontal" ), // XML_FRAME_MARGIN_HORIZONTAL
- TOKEN( "frame-margin-vertical" ), // XML_FRAME_MARGIN_VERTICAL
- TOKEN( "frame-name" ), // XML_FRAME_NAME
- TOKEN( "frame-start-margin" ), // XML_FRAME_START_MARGIN
- TOKEN( "freeze" ), // XML_FREEZE
- TOKEN( "freeze-position" ), // XML_FREEZE_POSITION
- TOKEN( "from-another-table" ), // XML_FROM_ANOTHER_TABLE
- TOKEN( "from-bottom" ), // XML_FROM_BOTTOM
- TOKEN( "from-center" ), // XML_FROM_CENTER
- TOKEN( "from-inside" ), // XML_FROM_INSIDE
- TOKEN( "from-left" ), // XML_FROM_LEFT
- TOKEN( "from-lower-left" ), // XML_FROM_LOWER_LEFT
- TOKEN( "from-lower-right" ), // XML_FROM_LOWER_RIGHT
- TOKEN( "from-right" ), // XML_FROM_RIGHT
- TOKEN( "from-same-table" ), // XML_FROM_SAME_TABLE
- TOKEN( "from-top" ), // XML_FROM_TOP
- TOKEN( "from-upper-left" ), // XML_FROM_UPPER_LEFT
- TOKEN( "from-upper-right" ), // XML_FROM_UPPER_RIGHT
- TOKEN( "fuchsia" ), // XML_FUCHSIA
- TOKEN( "full" ), // XML_FULL
- TOKEN( "full-screen" ), // XML_FULL_SCREEN
- TOKEN( "function" ), // XML_FUNCTION
- TOKEN( "g" ), // XML_G
- TOKEN( "gamma" ), // XML_GAMMA
- TOKEN( "gap" ), // XML_GAP
- TOKEN( "gap-width" ), // XML_GAP_WIDTH
- TOKEN( "gcd" ), // XML_GCD
- TOKEN( "generator" ), // XML_GENERATOR
- TOKEN( "geq" ), // XML_GEQ
- TOKEN( "gouraud" ), // XML_GOURAUD
- TOKEN( "gradient" ), // XML_GRADIENT
- TOKEN( "angle" ), // XML_GRADIENT_ANGLE
- TOKEN( "border" ), // XML_GRADIENT_BORDER
- TOKEN( "gradient-step-count" ), // XML_GRADIENT_STEP_COUNT
- TOKEN( "gradient-style" ), // XML_GRADIENT_STYLE
- TOKEN( "axial" ), // XML_GRADIENTSTYLE_AXIAL
- TOKEN( "ellipsoid" ), // XML_GRADIENTSTYLE_ELLIPSOID
- TOKEN( "linear" ), // XML_GRADIENTSTYLE_LINEAR
- TOKEN( "radial" ), // XML_GRADIENTSTYLE_RADIAL
- TOKEN( "rectangular" ), // XML_GRADIENTSTYLE_RECTANGULAR
- TOKEN( "square" ), // XML_GRADIENTSTYLE_SQUARE
- TOKEN( "grand-total" ), // XML_GRAND_TOTAL
- TOKEN( "graphic" ), // XML_GRAPHIC
- TOKEN( "gray" ), // XML_GRAY
- TOKEN( "green" ), // XML_GREEN
- TOKEN( "greyscale" ), // XML_GREYSCALE
- TOKEN( "grid" ), // XML_GRID
- TOKEN( "groove" ), // XML_GROOVE
- TOKEN( "group-by-field-number" ), // XML_GROUP_BY_FIELD_NUMBER
- TOKEN( "group-name" ), // XML_GROUP_NAME
- TOKEN( "grouping" ), // XML_GROUPING
- TOKEN( "gt" ), // XML_GT
- TOKEN( "guide-distance" ), // XML_GUIDE_DISTANCE
- TOKEN( "guide-overhang" ), // XML_GUIDE_OVERHANG
- TOKEN( "h" ), // XML_H
- TOKEN( "hanging" ), // XML_HANGING
- TOKEN( "has-persistent-data" ), // XML_HAS_PERSISTENT_DATA
- TOKEN( "hatch" ), // XML_HATCH
- TOKEN( "distance" ), // XML_HATCH_DISTANCE
- TOKEN( "style" ), // XML_HATCH_STYLE
- TOKEN( "double" ), // XML_HATCHSTYLE_DOUBLE
- TOKEN( "single" ), // XML_HATCHSTYLE_SINGLE
- TOKEN( "triple" ), // XML_HATCHSTYLE_TRIPLE
- TOKEN( "header" ), // XML_HEADER
- TOKEN( "header-left" ), // XML_HEADER_LEFT
- TOKEN( "header-style" ), // XML_HEADER_STYLE
- TOKEN( "headers" ), // XML_HEADERS
- TOKEN( "height" ), // XML_HEIGHT
- TOKEN( "help-file-name" ), // XML_HELP_FILE_NAME
- TOKEN( "help-id" ), // XML_HELP_ID
- TOKEN( "help-message" ), // XML_HELP_MESSAGE
- TOKEN( "hidden" ), // XML_HIDDEN
- TOKEN( "hidden-and-protected" ), // XML_HIDDEN_AND_PROTECTED
- TOKEN( "hidden-paragraph" ), // XML_HIDDEN_PARAGRAPH
- TOKEN( "hidden-text" ), // XML_HIDDEN_TEXT
- TOKEN( "hide" ), // XML_HIDE
- TOKEN( "hide-shape" ), // XML_HIDE_SHAPE
- TOKEN( "hide-text" ), // XML_HIDE_TEXT
- TOKEN( "highlighted-range" ), // XML_HIGHLIGHTED_RANGE
- TOKEN( "horizontal" ), // XML_HORIZONTAL
- TOKEN( "horizontal-lines" ), // XML_HORIZONTAL_LINES
- TOKEN( "horizontal-on-left-pages" ), // XML_HORIZONTAL_ON_LEFT_PAGES
- TOKEN( "horizontal-on-right-pages" ), // XML_HORIZONTAL_ON_RIGHT_PAGES
- TOKEN( "horizontal-pos" ), // XML_HORIZONTAL_POS
- TOKEN( "horizontal-rel" ), // XML_HORIZONTAL_REL
- TOKEN( "horizontal-scrollbar-width" ), // XML_HORIZONTAL_SCROLLBAR_WIDTH
- TOKEN( "horizontal-segments" ), // XML_HORIZONTAL_SEGMENTS
- TOKEN( "horizontal-split-mode" ), // XML_HORIZONTAL_SPLIT_MODE
- TOKEN( "horizontal-split-position" ), // XML_HORIZONTAL_SPLIT_POSITION
- TOKEN( "horizontal-stripes" ), // XML_HORIZONTAL_STRIPES
- TOKEN( "hours" ), // XML_HOURS
- TOKEN( "howpublished" ), // XML_HOWPUBLISHED
- TOKEN( "href" ), // XML_HREF
- TOKEN( "html" ), // XML_HTML
- TOKEN( "hyperlink-behaviour" ), // XML_HYPERLINK_BEHAVIOUR
- TOKEN( "hyphenate" ), // XML_HYPHENATE
- TOKEN( "hyphenation-keep" ), // XML_HYPHENATION_KEEP
- TOKEN( "hyphenation-ladder-count" ), // XML_HYPHENATION_LADDER_COUNT
- TOKEN( "hyphenation-push-char-count" ),// XML_HYPHENATION_PUSH_CHAR_COUNT
- TOKEN( "hyphenation-remain-char-count" ), // XML_HYPHENATION_REMAIN_CHAR_COUNT
- TOKEN( "i" ), // XML_I
- TOKEN( "icon" ), // XML_ICON
- TOKEN( "id" ), // XML_ID
- TOKEN( "ident" ), // XML_IDENT
- TOKEN( "identifier" ), // XML_IDENTIFIER
- TOKEN( "identify-categories" ), // XML_IDENTIFY_CATEGORIES
- TOKEN( "ideograph-alpha" ), // XML_IDEOGRAPH_ALPHA
- TOKEN( "ignore-case" ), // XML_IGNORE_CASE
- TOKEN( "ignore-empty-rows" ), // XML_IGNORE_EMPTY_ROWS
- TOKEN( "illustration-index" ), // XML_ILLUSTRATION_INDEX
- TOKEN( "illustration-index-entry-template" ), // XML_ILLUSTRATION_INDEX_ENTRY_TEMPLATE
- TOKEN( "illustration-index-source" ), // XML_ILLUSTRATION_INDEX_SOURCE
- TOKEN( "image" ), // XML_IMAGE
- TOKEN( "image-count" ), // XML_IMAGE_COUNT
- TOKEN( "image-map" ), // XML_IMAGE_MAP
- TOKEN( "implies" ), // XML_IMPLIES
- TOKEN( "in" ), // XML_IN
- TOKEN( "in-range" ), // XML_IN_RANGE
- TOKEN( "inbook" ), // XML_INBOOK
- TOKEN( "incollection" ), // XML_INCOLLECTION
- TOKEN( "increment" ), // XML_INCREMENT
- TOKEN( "index" ), // XML_INDEX
- TOKEN( "index-body" ), // XML_INDEX_BODY
- TOKEN( "index-entry-bibliography" ), // XML_INDEX_ENTRY_BIBLIOGRAPHY
- TOKEN( "index-entry-chapter" ), // XML_INDEX_ENTRY_CHAPTER
- TOKEN( "index-entry-chapter-number" ), // XML_INDEX_ENTRY_CHAPTER_NUMBER
- TOKEN( "index-entry-link-end" ), // XML_INDEX_ENTRY_LINK_END
- TOKEN( "index-entry-link-start" ), // XML_INDEX_ENTRY_LINK_START
- TOKEN( "index-entry-page-number" ), // XML_INDEX_ENTRY_PAGE_NUMBER
- TOKEN( "index-entry-span" ), // XML_INDEX_ENTRY_SPAN
- TOKEN( "index-entry-tab-stop" ), // XML_INDEX_ENTRY_TAB_STOP
- TOKEN( "index-entry-template" ), // XML_INDEX_ENTRY_TEMPLATE
- TOKEN( "index-entry-text" ), // XML_INDEX_ENTRY_TEXT
- TOKEN( "index-name" ), // XML_INDEX_NAME
- TOKEN( "index-scope" ), // XML_INDEX_SCOPE
- TOKEN( "index-source-style" ), // XML_INDEX_SOURCE_STYLE
- TOKEN( "index-source-styles" ), // XML_INDEX_SOURCE_STYLES
- TOKEN( "index-title" ), // XML_INDEX_TITLE
- TOKEN( "index-title-template" ), // XML_INDEX_TITLE_TEMPLATE
- TOKEN( "information" ), // XML_INFORMATION
- TOKEN( "initial-creator" ), // XML_INITIAL_CREATOR
- TOKEN( "inproceedings" ), // XML_INPROCEEDINGS
- TOKEN( "insertion" ), // XML_INSERTION
- TOKEN( "insertion-cut-off" ), // XML_INSERTION_CUT_OFF
- TOKEN( "inset" ), // XML_INSET
- TOKEN( "inside" ), // XML_INSIDE
- TOKEN( "institution" ), // XML_INSTITUTION
- TOKEN( "int" ), // XML_INT
- TOKEN( "intensity" ), // XML_INTENSITY
- TOKEN( "intersect" ), // XML_INTERSECT
- TOKEN( "interval" ), // XML_INTERVAL
- TOKEN( "interval-major" ), // XML_INTERVAL_MAJOR
- TOKEN( "interval-minor" ), // XML_INTERVAL_MINOR
- TOKEN( "into-english-number" ), // XML_INTO_ENGLISH_NUMBER
- TOKEN( "inverse" ), // XML_INVERSE
- TOKEN( "is-active" ), // XML_IS_ACTIVE
- TOKEN( "is-data-layout-field" ), // XML_IS_DATA_LAYOUT_FIELD
- TOKEN( "is-hidden" ), // XML_IS_HIDDEN
- TOKEN( "is-selection" ), // XML_IS_SELECTION
- TOKEN( "isbn" ), // XML_ISBN
- TOKEN( "italic" ), // XML_ITALIC
- TOKEN( "iteration" ), // XML_ITERATION
- TOKEN( "journal" ), // XML_JOURNAL
- TOKEN( "justified" ), // XML_JUSTIFIED
- TOKEN( "justify" ), // XML_JUSTIFY
- TOKEN( "justify-single-word" ), // XML_JUSTIFY_SINGLE_WORD
- TOKEN( "keep-with-next" ), // XML_KEEP_WITH_NEXT
- TOKEN( "normal" ), // XML_KERNING_NORMAL
- TOKEN( "key" ), // XML_KEY
- TOKEN( "key1" ), // XML_KEY1
- TOKEN( "key2" ), // XML_KEY2
- TOKEN( "keyword" ), // XML_KEYWORD
- TOKEN( "keywords" ), // XML_KEYWORDS
- TOKEN( "kind" ), // XML_KIND
- TOKEN( "km" ), // XML_KM
- TOKEN( "label" ), // XML_LABEL
- TOKEN( "label-arrangement" ), // XML_LABEL_ARRANGEMENT
- TOKEN( "label-cell-address" ), // XML_LABEL_CELL_ADDRESS
- TOKEN( "label-cell-range-address" ), // XML_LABEL_CELL_RANGE_ADDRESS
- TOKEN( "label-range" ), // XML_LABEL_RANGE
- TOKEN( "label-ranges" ), // XML_LABEL_RANGES
- TOKEN( "lambda" ), // XML_LAMBDA
- TOKEN( "landscape" ), // XML_LANDSCAPE
- TOKEN( "language" ), // XML_LANGUAGE
- TOKEN( "language-asian" ), // XML_LANGUAGE_ASIAN
- TOKEN( "language-complex" ), // XML_LANGUAGE_COMPLEX
- TOKEN( "laser" ), // XML_LASER
- TOKEN( "last-column-spanned" ), // XML_LAST_COLUMN_SPANNED
- TOKEN( "last-page" ), // XML_LAST_PAGE
- TOKEN( "last-row-spanned" ), // XML_LAST_ROW_SPANNED
- TOKEN( "layer" ), // XML_LAYER
- TOKEN( "layer-set" ), // XML_LAYER_SET
- TOKEN( "leader-char" ), // XML_LEADER_CHAR
- TOKEN( "left" ), // XML_LEFT
- TOKEN( "left-outside" ), // XML_LEFT_OUTSIDE
- TOKEN( "left-top-position" ), // XML_LEFT_TOP_POSITION
- TOKEN( "left-arc" ), // XML_LEFTARC
- TOKEN( "left-circle" ), // XML_LEFTCIRCLE
- TOKEN( "legend" ), // XML_LEGEND
- TOKEN( "legend-position" ), // XML_LEGEND_POSITION
- TOKEN( "length" ), // XML_LENGTH
- TOKEN( "leq" ), // XML_LEQ
- TOKEN( "let-text" ), // XML_LET_TEXT
- TOKEN( "letter-kerning" ), // XML_LETTER_KERNING
- TOKEN( "letter-spacing" ), // XML_LETTER_SPACING
- TOKEN( "letters" ), // XML_LETTERS
- TOKEN( "level" ), // XML_LEVEL
- TOKEN( "library" ), // XML_LIBRARY
- TOKEN( "library-embedded" ), // XML_LIBRARY_EMBEDDED
- TOKEN( "library-linked" ), // XML_LIBRARY_LINKED
- TOKEN( "light" ), // XML_LIGHT
- TOKEN( "lighting-mode" ), // XML_LIGHTING_MODE
- TOKEN( "lime" ), // XML_LIME
- TOKEN( "limit" ), // XML_LIMIT
- TOKEN( "line" ), // XML_LINE
- TOKEN( "line-break" ), // XML_LINE_BREAK
- TOKEN( "line-distance" ), // XML_LINE_DISTANCE
- TOKEN( "line-height" ), // XML_LINE_HEIGHT
- TOKEN( "line-height-at-least" ), // XML_LINE_HEIGHT_AT_LEAST
- TOKEN( "line-number" ), // XML_LINE_NUMBER
- TOKEN( "line-skew" ), // XML_LINE_SKEW
- TOKEN( "line-spacing" ), // XML_LINE_SPACING
- TOKEN( "linear" ), // XML_LINEAR
- TOKEN( "linenumbering-configuration" ),// XML_LINENUMBERING_CONFIGURATION
- TOKEN( "linenumbering-separator" ), // XML_LINENUMBERING_SEPARATOR
- TOKEN( "lines" ), // XML_LINES
- TOKEN( "lines-used" ), // XML_LINES_USED
- TOKEN( "link-to-source-data" ), // XML_LINK_TO_SOURCE_DATA
- TOKEN( "list" ), // XML_LIST
- TOKEN( "list-block" ), // XML_LIST_BLOCK
- TOKEN( "list-header" ), // XML_LIST_HEADER
- TOKEN( "list-info" ), // XML_LIST_INFO
- TOKEN( "list-item" ), // XML_LIST_ITEM
- TOKEN( "list-level" ), // XML_LIST_LEVEL
- TOKEN( "list-level-style-bullet" ), // XML_LIST_LEVEL_STYLE_BULLET
- TOKEN( "list-level-style-image" ), // XML_LIST_LEVEL_STYLE_IMAGE
- TOKEN( "list-level-style-number" ), // XML_LIST_LEVEL_STYLE_NUMBER
- TOKEN( "list-name" ), // XML_LIST_NAME
- TOKEN( "list-style" ), // XML_LIST_STYLE
- TOKEN( "list-style-name" ), // XML_LIST_STYLE_NAME
- TOKEN( "ln" ), // XML_LN
- TOKEN( "locked" ), // XML_LOCKED
- TOKEN( "log" ), // XML_LOG
- TOKEN( "logarithmic" ), // XML_LOGARITHMIC
- TOKEN( "logbase" ), // XML_LOGBASE
- TOKEN( "long" ), // XML_LONG
- TOKEN( "lowlimit" ), // XML_LOWLIMIT
- TOKEN( "lr-tb" ), // XML_LR_TB
- TOKEN( "lt" ), // XML_LT
- TOKEN( "ltr" ), // XML_LTR
- TOKEN( "luminance" ), // XML_LUMINANCE
- TOKEN( "macro-name" ), // XML_MACRO_NAME
- TOKEN( "maction" ), // XML_MACTION
- TOKEN( "main-entry-style-name" ), // XML_MAIN_ENTRY_STYLE_NAME
- TOKEN( "major" ), // XML_MAJOR
- TOKEN( "maligngroup" ), // XML_MALIGNGROUP
- TOKEN( "malignmark" ), // XML_MALIGNMARK
- TOKEN( "manual" ), // XML_MANUAL
- TOKEN( "map" ), // XML_MAP
- TOKEN( "margin-bottom" ), // XML_MARGIN_BOTTOM
- TOKEN( "margin-left" ), // XML_MARGIN_LEFT
- TOKEN( "margin-right" ), // XML_MARGIN_RIGHT
- TOKEN( "margin-top" ), // XML_MARGIN_TOP
- TOKEN( "margins" ), // XML_MARGINS
- TOKEN( "marker" ), // XML_MARKER
- TOKEN( "marker-end" ), // XML_MARKER_END
- TOKEN( "marker-end-center" ), // XML_MARKER_END_CENTER
- TOKEN( "marker-end-width" ), // XML_MARKER_END_WIDTH
- TOKEN( "marker-start" ), // XML_MARKER_START
- TOKEN( "marker-start-center" ), // XML_MARKER_START_CENTER
- TOKEN( "marker-start-width" ), // XML_MARKER_START_WIDTH
- TOKEN( "maroon" ), // XML_MAROON
- TOKEN( "master-page" ), // XML_MASTER_PAGE
- TOKEN( "master-page-name" ), // XML_MASTER_PAGE_NAME
- TOKEN( "master-styles" ), // XML_MASTER_STYLES
- TOKEN( "mastersthesis" ), // XML_MASTERSTHESIS
- TOKEN( "match" ), // XML_MATCH
- TOKEN( "math" ), // XML_MATH
- TOKEN( "matrix" ), // XML_MATRIX
- TOKEN( "matrix-covered" ), // XML_MATRIX_COVERED
- TOKEN( "matrixrow" ), // XML_MATRIXROW
- TOKEN( "max" ), // XML_MAX
- TOKEN( "max-edge" ), // XML_MAX_EDGE
- TOKEN( "max-height" ), // XML_MAX_HEIGHT
- TOKEN( "max-width" ), // XML_MAX_WIDTH
- TOKEN( "maximum" ), // XML_MAXIMUM
- TOKEN( "maximum-difference" ), // XML_MAXIMUM_DIFFERENCE
- TOKEN( "may-break-between-rows" ), // XML_MAY_BREAK_BETWEEN_ROWS
- TOKEN( "may-script" ), // XML_MAY_SCRIPT
- TOKEN( "mean" ), // XML_MEAN
- TOKEN( "mean-value" ), // XML_MEAN_VALUE
- TOKEN( "measure" ), // XML_MEASURE
- TOKEN( "measure-align" ), // XML_MEASURE_ALIGN
- TOKEN( "measure-vertical-align" ), // XML_MEASURE_VERTICAL_ALIGN
- TOKEN( "median" ), // XML_MEDIAN
- TOKEN( "medium" ), // XML_MEDIUM
- TOKEN( "merror" ), // XML_MERROR
- TOKEN( "message-type" ), // XML_MESSAGE_TYPE
- TOKEN( "meta" ), // XML_META
- TOKEN( "mfenced" ), // XML_MFENCED
- TOKEN( "mfrac" ), // XML_MFRAC
- TOKEN( "mi" ), // XML_MI
- TOKEN( "middle" ), // XML_MIDDLE
- TOKEN( "mime-type" ), // XML_MIME_TYPE
- TOKEN( "min" ), // XML_MIN
- TOKEN( "min-denominator-digits" ), // XML_MIN_DENOMINATOR_DIGITS
- TOKEN( "min-edge" ), // XML_MIN_EDGE
- TOKEN( "min-exponent-digits" ), // XML_MIN_EXPONENT_DIGITS
- TOKEN( "min-height" ), // XML_MIN_HEIGHT
- TOKEN( "min-integer-digits" ), // XML_MIN_INTEGER_DIGITS
- TOKEN( "min-label-distance" ), // XML_MIN_LABEL_DISTANCE
- TOKEN( "min-label-width" ), // XML_MIN_LABEL_WIDTH
- TOKEN( "min-line-height" ), // XML_MIN_LINE_HEIGHT
- TOKEN( "min-numerator-digits" ), // XML_MIN_NUMERATOR_DIGITS
- TOKEN( "min-row-height" ), // XML_MIN_ROW_HEIGHT
- TOKEN( "min-width" ), // XML_MIN_WIDTH
- TOKEN( "minimum" ), // XML_MINIMUM
- TOKEN( "minor" ), // XML_MINOR
- TOKEN( "minus" ), // XML_MINUS
- TOKEN( "minutes" ), // XML_MINUTES
- TOKEN( "mirror" ), // XML_MIRROR
- TOKEN( "mirrored" ), // XML_MIRRORED
- TOKEN( "misc" ), // XML_MISC
- TOKEN( "miter" ), // XML_MITER
- TOKEN( "mm" ), // XML_MM
- TOKEN( "mmultiscripts" ), // XML_MMULTISCRIPTS
- TOKEN( "mn" ), // XML_MN
- TOKEN( "mo" ), // XML_MO
- TOKEN( "mode" ), // XML_MODE
- TOKEN( "modern" ), // XML_MODERN
- TOKEN( "modification-date" ), // XML_MODIFICATION_DATE
- TOKEN( "modification-time" ), // XML_MODIFICATION_TIME
- TOKEN( "modulate" ), // XML_MODULATE
- TOKEN( "module" ), // XML_MODULE
- TOKEN( "moment" ), // XML_MOMENT
- TOKEN( "mono" ), // XML_MONO
- TOKEN( "month" ), // XML_MONTH
- TOKEN( "mouse-as-pen" ), // XML_MOUSE_AS_PEN
- TOKEN( "mouse-visible" ), // XML_MOUSE_VISIBLE
- TOKEN( "move" ), // XML_MOVE
- TOKEN( "move-from-bottom" ), // XML_MOVE_FROM_BOTTOM
- TOKEN( "move-from-left" ), // XML_MOVE_FROM_LEFT
- TOKEN( "move-from-right" ), // XML_MOVE_FROM_RIGHT
- TOKEN( "move-from-top" ), // XML_MOVE_FROM_TOP
- TOKEN( "move-protect" ), // XML_MOVE_PROTECT
- TOKEN( "move-short" ), // XML_MOVE_SHORT
- TOKEN( "movement" ), // XML_MOVEMENT
- TOKEN( "movement-cut-off" ), // XML_MOVEMENT_CUT_OFF
- TOKEN( "mover" ), // XML_MOVER
- TOKEN( "mpadded" ), // XML_MPADDED
- TOKEN( "mphantom" ), // XML_MPHANTOM
- TOKEN( "mprescripts" ), // XML_MPRESCRIPTS
- TOKEN( "mroot" ), // XML_MROOT
- TOKEN( "mrow" ), // XML_MROW
- TOKEN( "ms" ), // XML_MS
- TOKEN( "mspace" ), // XML_MSPACE
- TOKEN( "msqrt" ), // XML_MSQRT
- TOKEN( "mstyle" ), // XML_MSTYLE
- TOKEN( "msub" ), // XML_MSUB
- TOKEN( "msubsup" ), // XML_MSUBSUP
- TOKEN( "msup" ), // XML_MSUP
- TOKEN( "mtable" ), // XML_MTABLE
- TOKEN( "mtd" ), // XML_MTD
- TOKEN( "mtext" ), // XML_MTEXT
- TOKEN( "mtr" ), // XML_MTR
- TOKEN( "multi-deletion-spanned" ), // XML_MULTI_DELETION_SPANNED
- TOKEN( "munder" ), // XML_MUNDER
- TOKEN( "munderover" ), // XML_MUNDEROVER
- TOKEN( "name" ), // XML_NAME
- TOKEN( "name-and-extension" ), // XML_NAME_AND_EXTENSION
- TOKEN( "named-expression" ), // XML_NAMED_EXPRESSION
- TOKEN( "named-expressions" ), // XML_NAMED_EXPRESSIONS
- TOKEN( "named-range" ), // XML_NAMED_RANGE
- TOKEN( "navy" ), // XML_NAVY
- TOKEN( "neq" ), // XML_NEQ
- TOKEN( "new" ), // XML_NEW
- TOKEN( "next" ), // XML_NEXT
- TOKEN( "next-page" ), // XML_NEXT_PAGE
- TOKEN( "next-style-name" ), // XML_NEXT_STYLE_NAME
- TOKEN( "no-limit" ), // XML_NO_LIMIT
- TOKEN( "no-wrap" ), // XML_NO_WRAP
- TOKEN( "!empty" ), // XML_NOEMPTY
- TOKEN( "nohref" ), // XML_NOHREF
- TOKEN( "!match" ), // XML_NOMATCH
- TOKEN( "none" ), // XML_NONE
- TOKEN( "notprsubset" ), // XML_NOPRTSUBSET
- TOKEN( "normal" ), // XML_NORMAL
- TOKEN( "normals-direction" ), // XML_NORMALS_DIRECTION
- TOKEN( "normals-kind" ), // XML_NORMALS_KIND
- TOKEN( "not" ), // XML_NOT
- TOKEN( "not-equal-date" ), // XML_NOT_EQUAL_DATE
- TOKEN( "note" ), // XML_NOTE
- TOKEN( "notes" ), // XML_NOTES
- TOKEN( "notin" ), // XML_NOTIN
- TOKEN( "notsubset" ), // XML_NOTSUBSET
- TOKEN( "null-date" ), // XML_NULL_DATE
- TOKEN( "null-year" ), // XML_NULL_YEAR
- TOKEN( "num-format" ), // XML_NUM_FORMAT
- TOKEN( "num-letter-sync" ), // XML_NUM_LETTER_SYNC
- TOKEN( "num-prefix" ), // XML_NUM_PREFIX
- TOKEN( "num-suffix" ), // XML_NUM_SUFFIX
- TOKEN( "number" ), // XML_NUMBER
- TOKEN( "number-and-name" ), // XML_NUMBER_AND_NAME
- TOKEN( "number-columns-repeated" ), // XML_NUMBER_COLUMNS_REPEATED
- TOKEN( "number-columns-spanned" ), // XML_NUMBER_COLUMNS_SPANNED
- TOKEN( "number-lines" ), // XML_NUMBER_LINES
- TOKEN( "number-matrix-columns-spanned" ), // XML_NUMBER_MATRIX_COLUMNS_SPANNED
- TOKEN( "number-matrix-rows-spanned" ), // XML_NUMBER_MATRIX_ROWS_SPANNED
- TOKEN( "number-position" ), // XML_NUMBER_POSITION
- TOKEN( "number-rows-repeated" ), // XML_NUMBER_ROWS_REPEATED
- TOKEN( "number-rows-spanned" ), // XML_NUMBER_ROWS_SPANNED
- TOKEN( "number-style" ), // XML_NUMBER_STYLE
- TOKEN( "number-wrapped-paragraphs" ), // XML_NUMBER_WRAPPED_PARAGRAPHS
- TOKEN( "numbered-entries" ), // XML_NUMBERED_ENTRIES
- TOKEN( "object" ), // XML_OBJECT
- TOKEN( "object-count" ), // XML_OBJECT_COUNT
- TOKEN( "object-index" ), // XML_OBJECT_INDEX
- TOKEN( "object-index-entry-template" ),// XML_OBJECT_INDEX_ENTRY_TEMPLATE
- TOKEN( "object-index-source" ), // XML_OBJECT_INDEX_SOURCE
- TOKEN( "object-name" ), // XML_OBJECT_NAME
- TOKEN( "object-ole" ), // XML_OBJECT_OLE
- TOKEN( "objects" ), // XML_OBJECTS
- TOKEN( "odd-page" ), // XML_ODD_PAGE
- TOKEN( "offset" ), // XML_OFFSET
- TOKEN( "olive" ), // XML_OLIVE
- TOKEN( "onLoad" ), // XML_ONLOAD
- TOKEN( "onRequest" ), // XML_ONREQUEST
- TOKEN( "on-update-keep-size" ), // XML_ON_UPDATE_KEEP_SIZE
- TOKEN( "on-update-keep-styles" ), // XML_ON_UPDATE_KEEP_STYLES
- TOKEN( "online" ), // XML_ONLINE
- TOKEN( "online-text" ), // XML_ONLINE_TEXT
- TOKEN( "background" ), // XML_OPAQUE_BACKGROUND
- TOKEN( "foreground" ), // XML_OPAQUE_FOREGROUND
- TOKEN( "open" ), // XML_OPEN
- TOKEN( "open-horizontal" ), // XML_OPEN_HORIZONTAL
- TOKEN( "open-vertical" ), // XML_OPEN_VERTICAL
- TOKEN( "operation" ), // XML_OPERATION
- TOKEN( "operator" ), // XML_OPERATOR
- TOKEN( "optimal" ), // XML_OPTIMAL
- TOKEN( "or" ), // XML_OR
- TOKEN( "order" ), // XML_ORDER
- TOKEN( "ordered-list" ), // XML_ORDERED_LIST
- TOKEN( "organizations" ), // XML_ORGANIZATIONS
- TOKEN( "orientation" ), // XML_ORIENTATION
- TOKEN( "orientation-landscape" ), // XML_ORIENTATION_LANDSCAPE
- TOKEN( "orientation-portrait" ), // XML_ORIENTATION_PORTRAIT
- TOKEN( "origin" ), // XML_ORIGIN
- TOKEN( "orphans" ), // XML_ORPHANS
- TOKEN( "outline-level" ), // XML_OUTLINE_LEVEL
- TOKEN( "outline-level-style" ), // XML_OUTLINE_LEVEL_STYLE
- TOKEN( "outline-style" ), // XML_OUTLINE_STYLE
- TOKEN( "outset" ), // XML_OUTSET
- TOKEN( "outside" ), // XML_OUTSIDE
- TOKEN( "overlap" ), // XML_OVERLAP
- TOKEN( "p" ), // XML_P
- TOKEN( "package-name" ), // XML_PACKAGE_NAME
- TOKEN( "padding" ), // XML_PADDING
- TOKEN( "padding-bottom" ), // XML_PADDING_BOTTOM
- TOKEN( "padding-left" ), // XML_PADDING_LEFT
- TOKEN( "padding-right" ), // XML_PADDING_RIGHT
- TOKEN( "padding-top" ), // XML_PADDING_TOP
- TOKEN( "page" ), // XML_PAGE
- TOKEN( "page-adjust" ), // XML_PAGE_ADJUST
- TOKEN( "page-breaks-on-group-change" ),// XML_PAGE_BREAKS_ON_GROUP_CHANGE
- TOKEN( "page-content" ), // XML_PAGE_CONTENT
- TOKEN( "page-continuation-string" ), // XML_PAGE_CONTINUATION_STRING
- TOKEN( "page-count" ), // XML_PAGE_COUNT
- TOKEN( "page-end-margin" ), // XML_PAGE_END_MARGIN
- TOKEN( "page-height" ), // XML_PAGE_HEIGHT
- TOKEN( "page-master" ), // XML_PAGE_MASTER
- TOKEN( "page-master-name" ), // XML_PAGE_MASTER_NAME
- TOKEN( "page-number" ), // XML_PAGE_NUMBER
- TOKEN( "page-start-margin" ), // XML_PAGE_START_MARGIN
- TOKEN( "page-style-name" ), // XML_PAGE_STYLE_NAME
- TOKEN( "page-thumbnail" ), // XML_PAGE_THUMBNAIL
- TOKEN( "page-usage" ), // XML_PAGE_USAGE
- TOKEN( "page-variable-get" ), // XML_PAGE_VARIABLE_GET
- TOKEN( "page-variable-set" ), // XML_PAGE_VARIABLE_SET
- TOKEN( "page-view-zoom-value" ), // XML_PAGE_VIEW_ZOOM_VALUE
- TOKEN( "page-width" ), // XML_PAGE_WIDTH
- TOKEN( "pages" ), // XML_PAGES
- TOKEN( "paper-tray-number" ), // XML_PAPER_TRAY_NUMBER
- TOKEN( "paragraph" ), // XML_PARAGRAPH
- TOKEN( "paragraph-content" ), // XML_PARAGRAPH_CONTENT
- TOKEN( "paragraph-count" ), // XML_PARAGRAPH_COUNT
- TOKEN( "paragraph-end-margin" ), // XML_PARAGRAPH_END_MARGIN
- TOKEN( "paragraph-start-margin" ), // XML_PARAGRAPH_START_MARGIN
- TOKEN( "parallel" ), // XML_PARALLEL
- TOKEN( "param" ), // XML_PARAM
- TOKEN( "parent-style-name" ), // XML_PARENT_STYLE_NAME
- TOKEN( "parse-sql-statement" ), // XML_PARSE_SQL_STATEMENT
- TOKEN( "parsed" ), // XML_PARSED
- TOKEN( "partialdiff" ), // XML_PARTIALDIFF
- TOKEN( "password" ), // XML_PASSWORD
- TOKEN( "passwort" ), // XML_PASSWORT
- TOKEN( "path" ), // XML_PATH
- TOKEN( "path-id" ), // XML_PATH_ID
- TOKEN( "pause" ), // XML_PAUSE
- TOKEN( "pending" ), // XML_PENDING
- TOKEN( "percentage" ), // XML_PERCENTAGE
- TOKEN( "percentage-style" ), // XML_PERCENTAGE_STYLE
- TOKEN( "perspective" ), // XML_PERSPECTIVE
- TOKEN( "phdthesis" ), // XML_PHDTHESIS
- TOKEN( "phong" ), // XML_PHONG
- TOKEN( "pie-offset" ), // XML_PIE_OFFSET
- TOKEN( "placeholder" ), // XML_PLACEHOLDER
- TOKEN( "placeholder-type" ), // XML_PLACEHOLDER_TYPE
- TOKEN( "placing" ), // XML_PLACING
- TOKEN( "plain-number" ), // XML_PLAIN_NUMBER
- TOKEN( "plain-number-and-name" ), // XML_PLAIN_NUMBER_AND_NAME
- TOKEN( "play-full" ), // XML_PLAY_FULL
- TOKEN( "plot-area" ), // XML_PLOT_AREA
- TOKEN( "plugin" ), // XML_PLUGIN
- TOKEN( "plus" ), // XML_PLUS
- TOKEN( "points" ), // XML_POINTS
- TOKEN( "polygon" ), // XML_POLYGON
- TOKEN( "polyline" ), // XML_POLYLINE
- TOKEN( "polynomial" ), // XML_POLYNOMIAL
- TOKEN( "pool-id" ), // XML_POOL_ID
- TOKEN( "portrait" ), // XML_PORTRAIT
- TOKEN( "position" ), // XML_POSITION
- TOKEN( "position-bottom" ), // XML_POSITION_BOTTOM
- TOKEN( "position-left" ), // XML_POSITION_LEFT
- TOKEN( "position-right" ), // XML_POSITION_RIGHT
- TOKEN( "position-top" ), // XML_POSITION_TOP
- TOKEN( "italic" ), // XML_POSTURE_ITALIC
- TOKEN( "normal" ), // XML_POSTURE_NORMAL
- TOKEN( "oblique" ), // XML_POSTURE_OBLIQUE
- TOKEN( "power" ), // XML_POWER
- TOKEN( "precision-as-shown" ), // XML_PRECISION_AS_SHOWN
- TOKEN( "prefix" ), // XML_PREFIX
- TOKEN( "presentation" ), // XML_PRESENTATION
- TOKEN( "chart" ), // XML_PRESENTATION_CHART
- TOKEN( "graphic" ), // XML_PRESENTATION_GRAPHIC
- TOKEN( "notes" ), // XML_PRESENTATION_NOTES
- TOKEN( "object" ), // XML_PRESENTATION_OBJECT
- TOKEN( "orgchart" ), // XML_PRESENTATION_ORGCHART
- TOKEN( "outline" ), // XML_PRESENTATION_OUTLINE
- TOKEN( "page" ), // XML_PRESENTATION_PAGE
- TOKEN( "presentation-page-layout" ), // XML_PRESENTATION_PAGE_LAYOUT
- TOKEN( "presentation-page-layout-name" ), // XML_PRESENTATION_PAGE_LAYOUT_NAME
- TOKEN( "subtitle" ), // XML_PRESENTATION_SUBTITLE
- TOKEN( "table" ), // XML_PRESENTATION_TABLE
- TOKEN( "title" ), // XML_PRESENTATION_TITLE
- TOKEN( "previous" ), // XML_PREVIOUS
- TOKEN( "previous-page" ), // XML_PREVIOUS_PAGE
- TOKEN( "print" ), // XML_PRINT
- TOKEN( "print-content" ), // XML_PRINT_CONTENT
- TOKEN( "print-date" ), // XML_PRINT_DATE
- TOKEN( "print-orientation" ), // XML_PRINT_ORIENTATION
- TOKEN( "print-page-order" ), // XML_PRINT_PAGE_ORDER
- TOKEN( "print-range" ), // XML_PRINT_RANGE
- TOKEN( "print-ranges" ), // XML_PRINT_RANGES
- TOKEN( "print-time" ), // XML_PRINT_TIME
- TOKEN( "printable" ), // XML_PRINTABLE
- TOKEN( "printed-by" ), // XML_PRINTED_BY
- TOKEN( "proceedings" ), // XML_PROCEEDINGS
- TOKEN( "product" ), // XML_PRODUCT
- TOKEN( "projection" ), // XML_PROJECTION
- TOKEN( "properties" ), // XML_PROPERTIES
- TOKEN( "protect" ), // XML_PROTECT
- TOKEN( "content" ), // XML_PROTECT_CONTENT
- TOKEN( "position" ), // XML_PROTECT_POSITION
- TOKEN( "size" ), // XML_PROTECT_SIZE
- TOKEN( "protected" ), // XML_PROTECTED
- TOKEN( "protection-key" ), // XML_PROTECTION_KEY
- TOKEN( "prsubset" ), // XML_PRSUBSET
- TOKEN( "publisher" ), // XML_PUBLISHER
- TOKEN( "punctuation-wrap" ), // XML_PUNCTUATION_WRAP
- TOKEN( "purple" ), // XML_PURPLE
- TOKEN( "pyramid" ), // XML_PYRAMID
- TOKEN( "quarter" ), // XML_QUARTER
- TOKEN( "query-name" ), // XML_QUERY_NAME
- TOKEN( "quo-vadis" ), // XML_QUO_VADIS
- TOKEN( "quotient" ), // XML_QUOTIENT
- TOKEN( "r" ), // XML_R
- TOKEN( "radar" ), // XML_RADAR
- TOKEN( "random" ), // XML_RANDOM
- TOKEN( "range-address" ), // XML_RANGE_ADDRESS
- TOKEN( "range-usable-as" ), // XML_RANGE_USABLE_AS
- TOKEN( "recreate-on-edit" ), // XML_RECREATE_ON_EDIT
- TOKEN( "rect" ), // XML_RECT
- TOKEN( "red" ), // XML_RED
- TOKEN( "ref-name" ), // XML_REF_NAME
- TOKEN( "reference" ), // XML_REFERENCE
- TOKEN( "reference-end" ), // XML_REFERENCE_END
- TOKEN( "reference-format" ), // XML_REFERENCE_FORMAT
- TOKEN( "reference-mark" ), // XML_REFERENCE_MARK
- TOKEN( "reference-mark-end" ), // XML_REFERENCE_MARK_END
- TOKEN( "reference-mark-start" ), // XML_REFERENCE_MARK_START
- TOKEN( "reference-ref" ), // XML_REFERENCE_REF
- TOKEN( "reference-start" ), // XML_REFERENCE_START
- TOKEN( "reference-type" ), // XML_REFERENCE_TYPE
- TOKEN( "refresh-delay" ), // XML_REFRESH_DELAY
- TOKEN( "region-center" ), // XML_REGION_CENTER
- TOKEN( "region-left" ), // XML_REGION_LEFT
- TOKEN( "region-right" ), // XML_REGION_RIGHT
- TOKEN( "register-true" ), // XML_REGISTER_TRUE
- TOKEN( "register-truth-ref-style-name" ), // XML_REGISTER_TRUTH_REF_STYLE_NAME
- TOKEN( "regression-type" ), // XML_REGRESSION_TYPE
- TOKEN( "rejected" ), // XML_REJECTED
- TOKEN( "rejecting-change-id" ), // XML_REJECTING_CHANGE_ID
- TOKEN( "rejection" ), // XML_REJECTION
- TOKEN( "rel-column-width" ), // XML_REL_COLUMN_WIDTH
- TOKEN( "rel-height" ), // XML_REL_HEIGHT
- TOKEN( "rel-width" ), // XML_REL_WIDTH
- TOKEN( "relative" ), // XML_RELATIVE
- TOKEN( "relative-tab-stop-position" ), // XML_RELATIVE_TAB_STOP_POSITION
- TOKEN( "reln" ), // XML_RELN
- TOKEN( "rem" ), // XML_REM
- TOKEN( "remove-dependents" ), // XML_REMOVE_DEPENDENTS
- TOKEN( "remove-precedents" ), // XML_REMOVE_PRECEDENTS
- TOKEN( "repeat" ), // XML_REPEAT
- TOKEN( "repeat-column" ), // XML_REPEAT_COLUMN
- TOKEN( "repeat-row" ), // XML_REPEAT_ROW
- TOKEN( "repeated" ), // XML_REPEATED
- TOKEN( "replace" ), // XML_REPLACE
- TOKEN( "report-type" ), // XML_REPORT_TYPE
- TOKEN( "restart-on-page" ), // XML_RESTART_ON_PAGE
- TOKEN( "revision" ), // XML_REVISION
- TOKEN( "ridge" ), // XML_RIDGE
- TOKEN( "right" ), // XML_RIGHT
- TOKEN( "right-outside" ), // XML_RIGHT_OUTSIDE
- TOKEN( "right-arc" ), // XML_RIGHTARC
- TOKEN( "right-circle" ), // XML_RIGHTCIRCLE
- TOKEN( "ring" ), // XML_RING
- TOKEN( "role" ), // XML_ROLE
- TOKEN( "roll-from-bottom" ), // XML_ROLL_FROM_BOTTOM
- TOKEN( "roll-from-left" ), // XML_ROLL_FROM_LEFT
- TOKEN( "roll-from-right" ), // XML_ROLL_FROM_RIGHT
- TOKEN( "roman" ), // XML_ROMAN
- TOKEN( "root" ), // XML_ROOT
- TOKEN( "rotate" ), // XML_ROTATE
- TOKEN( "rotation" ), // XML_ROTATION
- TOKEN( "rotation-align" ), // XML_ROTATION_ALIGN
- TOKEN( "rotation-angle" ), // XML_ROTATION_ANGLE
- TOKEN( "round" ), // XML_ROUND
- TOKEN( "row" ), // XML_ROW
- TOKEN( "row-height" ), // XML_ROW_HEIGHT
- TOKEN( "row-number" ), // XML_ROW_NUMBER
- TOKEN( "rows" ), // XML_ROWS
- TOKEN( "ruby" ), // XML_RUBY
- TOKEN( "ruby-align" ), // XML_RUBY_ALIGN
- TOKEN( "ruby-base" ), // XML_RUBY_BASE
- TOKEN( "ruby-position" ), // XML_RUBY_POSITION
- TOKEN( "ruby-text" ), // XML_RUBY_TEXT
- TOKEN( "run-through" ), // XML_RUN_THROUGH
- TOKEN( "rx" ), // XML_RX
- TOKEN( "ry" ), // XML_RY
- TOKEN( "s" ), // XML_S
- TOKEN( "scale" ), // XML_SCALE
- TOKEN( "scale-min" ), // XML_SCALE_MIN
- TOKEN( "scale-text" ), // XML_SCALE_TEXT
- TOKEN( "scale-to" ), // XML_SCALE_TO
- TOKEN( "scale-to-pages" ), // XML_SCALE_TO_PAGES
- TOKEN( "scatter" ), // XML_SCATTER
- TOKEN( "scenario" ), // XML_SCENARIO
- TOKEN( "scenario-ranges" ), // XML_SCENARIO_RANGES
- TOKEN( "scene" ), // XML_SCENE
- TOKEN( "school" ), // XML_SCHOOL
- TOKEN( "scientific-number" ), // XML_SCIENTIFIC_NUMBER
- TOKEN( "score-spaces" ), // XML_SCORE_SPACES
- TOKEN( "script" ), // XML_SCRIPT
- TOKEN( "scroll" ), // XML_SCROLL
- TOKEN( "sdev" ), // XML_SDEV
- TOKEN( "search-criteria-must-apply-to-whole-cell" ), // XML_SEARCH_CRITERIA_MUST_APPLY_TO_WHOLE_CELL
- TOKEN( "sec" ), // XML_SEC
- TOKEN( "sech" ), // XML_SECH
- TOKEN( "second-date-time" ), // XML_SECOND_DATE_TIME
- TOKEN( "seconds" ), // XML_SECONDS
- TOKEN( "section" ), // XML_SECTION
- TOKEN( "section-desc" ), // XML_SECTION_DESC
- TOKEN( "section-name" ), // XML_SECTION_NAME
- TOKEN( "section-source" ), // XML_SECTION_SOURCE
- TOKEN( "select-page" ), // XML_SELECT_PAGE
- TOKEN( "selector" ), // XML_SELECTOR
- TOKEN( "semantics" ), // XML_SEMANTICS
- TOKEN( "semi-automatic" ), // XML_SEMI_AUTOMATIC
- TOKEN( "sender-city" ), // XML_SENDER_CITY
- TOKEN( "sender-company" ), // XML_SENDER_COMPANY
- TOKEN( "sender-country" ), // XML_SENDER_COUNTRY
- TOKEN( "sender-email" ), // XML_SENDER_EMAIL
- TOKEN( "sender-fax" ), // XML_SENDER_FAX
- TOKEN( "sender-firstname" ), // XML_SENDER_FIRSTNAME
- TOKEN( "sender-initials" ), // XML_SENDER_INITIALS
- TOKEN( "sender-lastname" ), // XML_SENDER_LASTNAME
- TOKEN( "sender-phone-private" ), // XML_SENDER_PHONE_PRIVATE
- TOKEN( "sender-phone-work" ), // XML_SENDER_PHONE_WORK
- TOKEN( "sender-position" ), // XML_SENDER_POSITION
- TOKEN( "sender-postal-code" ), // XML_SENDER_POSTAL_CODE
- TOKEN( "sender-state-or-province" ), // XML_SENDER_STATE_OR_PROVINCE
- TOKEN( "sender-street" ), // XML_SENDER_STREET
- TOKEN( "sender-title" ), // XML_SENDER_TITLE
- TOKEN( "sep" ), // XML_SEP
- TOKEN( "separation-character" ), // XML_SEPARATION_CHARACTER
- TOKEN( "separator" ), // XML_SEPARATOR
- TOKEN( "sequence" ), // XML_SEQUENCE
- TOKEN( "sequence-decl" ), // XML_SEQUENCE_DECL
- TOKEN( "sequence-decls" ), // XML_SEQUENCE_DECLS
- TOKEN( "sequence-ref" ), // XML_SEQUENCE_REF
- TOKEN( "series" ), // XML_SERIES
- TOKEN( "series-source" ), // XML_SERIES_SOURCE
- TOKEN( "server-map" ), // XML_SERVER_MAP
- TOKEN( "set" ), // XML_SET
- TOKEN( "setdiff" ), // XML_SETDIFF
- TOKEN( "settings" ), // XML_SETTINGS
- TOKEN( "shade-mode" ), // XML_SHADE_MODE
- TOKEN( "shadow" ), // XML_SHADOW
- TOKEN( "shadow-color" ), // XML_SHADOW_COLOR
- TOKEN( "shadow-offset-x" ), // XML_SHADOW_OFFSET_X
- TOKEN( "shadow-offset-y" ), // XML_SHADOW_OFFSET_Y
- TOKEN( "shadow-slant" ), // XML_SHADOW_SLANT
- TOKEN( "shadow-transparency" ), // XML_SHADOW_TRANSPARENCY
- TOKEN( "shape" ), // XML_SHAPE
- TOKEN( "shape-id" ), // XML_SHAPE_ID
- TOKEN( "shapes" ), // XML_SHAPES
- TOKEN( "sheet-name" ), // XML_SHEET_NAME
- TOKEN( "shininess" ), // XML_SHININESS
- TOKEN( "short" ), // XML_SHORT
- TOKEN( "show" ), // XML_SHOW
- TOKEN( "show-accepted-changes" ), // XML_SHOW_ACCEPTED_CHANGES
- TOKEN( "show-changes" ), // XML_SHOW_CHANGES
- TOKEN( "show-changes-by-author" ), // XML_SHOW_CHANGES_BY_AUTHOR
- TOKEN( "show-changes-by-author-name" ),// XML_SHOW_CHANGES_BY_AUTHOR_NAME
- TOKEN( "show-changes-by-comment" ), // XML_SHOW_CHANGES_BY_COMMENT
- TOKEN( "show-changes-by-comment-text" ), // XML_SHOW_CHANGES_BY_COMMENT_TEXT
- TOKEN( "show-changes-by-datetime" ), // XML_SHOW_CHANGES_BY_DATETIME
- TOKEN( "show-changes-by-datetime-first-datetime" ),// XML_SHOW_CHANGES_BY_DATETIME_FIRST_DATETIME
- TOKEN( "show-changes-by-datetime-mode" ), // XML_SHOW_CHANGES_BY_DATETIME_MODE
- TOKEN( "show-changes-by-datetime-second-datetime" ), // XML_SHOW_CHANGES_BY_DATETIME_SECOND_DATETIME
- TOKEN( "show-changes-by-ranges" ), // XML_SHOW_CHANGES_BY_RANGES
- TOKEN( "show-changes-by-ranges-list" ),// XML_SHOW_CHANGES_BY_RANGES_LIST
- TOKEN( "show-logo" ), // XML_SHOW_LOGO
- TOKEN( "show-rejected-changes" ), // XML_SHOW_REJECTED_CHANGES
- TOKEN( "show-shape" ), // XML_SHOW_SHAPE
- TOKEN( "show-text" ), // XML_SHOW_TEXT
- TOKEN( "show-unit" ), // XML_SHOW_UNIT
- TOKEN( "shows" ), // XML_SHOWS
- TOKEN( "side-by-side" ), // XML_SIDE_BY_SIDE
- TOKEN( "silver" ), // XML_SILVER
- TOKEN( "simple" ), // XML_SIMPLE
- TOKEN( "sin" ), // XML_SIN
- TOKEN( "since-date-time" ), // XML_SINCE_DATE_TIME
- TOKEN( "since-save" ), // XML_SINCE_SAVE
- TOKEN( "sinh" ), // XML_SINH
- TOKEN( "size" ), // XML_SIZE
- TOKEN( "size-protect" ), // XML_SIZE_PROTECT
- TOKEN( "slant" ), // XML_SLANT
- TOKEN( "slant-x" ), // XML_SLANT_X
- TOKEN( "slant-y" ), // XML_SLANT_Y
- TOKEN( "slide" ), // XML_SLIDE
- TOKEN( "slow" ), // XML_SLOW
- TOKEN( "solid" ), // XML_SOLID
- TOKEN( "solid-type" ), // XML_SOLID_TYPE
- TOKEN( "sort" ), // XML_SORT
- TOKEN( "sort-ascending" ), // XML_SORT_ASCENDING
- TOKEN( "sort-by" ), // XML_SORT_BY
- TOKEN( "sort-by-position" ), // XML_SORT_BY_POSITION
- TOKEN( "sort-groups" ), // XML_SORT_GROUPS
- TOKEN( "sort-key" ), // XML_SORT_KEY
- TOKEN( "sound" ), // XML_SOUND
- TOKEN( "source-cell-range" ), // XML_SOURCE_CELL_RANGE
- TOKEN( "source-cell-range-addresses" ),// XML_SOURCE_CELL_RANGE_ADDRESSES
- TOKEN( "source-field-name" ), // XML_SOURCE_FIELD_NAME
- TOKEN( "source-name" ), // XML_SOURCE_NAME
- TOKEN( "source-range-address" ), // XML_SOURCE_RANGE_ADDRESS
- TOKEN( "source-service" ), // XML_SOURCE_SERVICE
- TOKEN( "space-before" ), // XML_SPACE_BEFORE
- TOKEN( "span" ), // XML_SPAN
- TOKEN( "specular" ), // XML_SPECULAR
- TOKEN( "specular-color" ), // XML_SPECULAR_COLOR
- TOKEN( "speed" ), // XML_SPEED
- TOKEN( "sphere" ), // XML_SPHERE
- TOKEN( "spiral" ), // XML_SPIRAL
- TOKEN( "spiral-in" ), // XML_SPIRAL_IN
- TOKEN( "spiral-inward-left" ), // XML_SPIRAL_INWARD_LEFT
- TOKEN( "spiral-inward-right" ), // XML_SPIRAL_INWARD_RIGHT
- TOKEN( "spiral-out" ), // XML_SPIRAL_OUT
- TOKEN( "spiral-outward-left" ), // XML_SPIRAL_OUTWARD_LEFT
- TOKEN( "spiral-outward-right" ), // XML_SPIRAL_OUTWARD_RIGHT
- TOKEN( "spiralin-left" ), // XML_SPIRALIN_LEFT
- TOKEN( "spiralin-right" ), // XML_SPIRALIN_RIGHT
- TOKEN( "spiralout-left" ), // XML_SPIRALOUT_LEFT
- TOKEN( "spiralout-right" ), // XML_SPIRALOUT_RIGHT
- TOKEN( "splines" ), // XML_SPLINES
- TOKEN( "split" ), // XML_SPLIT
- TOKEN( "split-column" ), // XML_SPLIT_COLUMN
- TOKEN( "split-position" ), // XML_SPLIT_POSITION
- TOKEN( "split-row" ), // XML_SPLIT_ROW
- TOKEN( "spreadsheet" ), // XML_SPREADSHEET
- TOKEN( "sql-statement" ), // XML_SQL_STATEMENT
- TOKEN( "stacked" ), // XML_STACKED
- TOKEN( "stagger-even" ), // XML_STAGGER_EVEN
- TOKEN( "stagger-odd" ), // XML_STAGGER_ODD
- TOKEN( "standard" ), // XML_STANDARD
- TOKEN( "standard-deviation" ), // XML_STANDARD_DEVIATION
- TOKEN( "starbasic" ), // XML_STARBASIC
- TOKEN( "start" ), // XML_START
- TOKEN( "start-angle" ), // XML_START_ANGLE
- TOKEN( "start-color" ), // XML_START_COLOR
- TOKEN( "start-column" ), // XML_START_COLUMN
- TOKEN( "start-glue-point" ), // XML_START_GLUE_POINT
- TOKEN( "start-guide" ), // XML_START_GUIDE
- TOKEN( "start-intensity" ), // XML_START_INTENSITY
- TOKEN( "start-line-spacing-horizontal" ), // XML_START_LINE_SPACING_HORIZONTAL
- TOKEN( "start-line-spacing-vertical" ),// XML_START_LINE_SPACING_VERTICAL
- TOKEN( "start-numbering-at" ), // XML_START_NUMBERING_AT
- TOKEN( "start-page" ), // XML_START_PAGE
- TOKEN( "start-position" ), // XML_START_POSITION
- TOKEN( "start-row" ), // XML_START_ROW
- TOKEN( "start-scale" ), // XML_START_SCALE
- TOKEN( "start-shape" ), // XML_START_SHAPE
- TOKEN( "start-table" ), // XML_START_TABLE
- TOKEN( "start-value" ), // XML_START_VALUE
- TOKEN( "start-with-navigator" ), // XML_START_WITH_NAVIGATOR
- TOKEN( "statistics" ), // XML_STATISTICS
- TOKEN( "status" ), // XML_STATUS
- TOKEN( "stay-on-top" ), // XML_STAY_ON_TOP
- TOKEN( "stdev" ), // XML_STDEV
- TOKEN( "stdevp" ), // XML_STDEVP
- TOKEN( "steps" ), // XML_STEPS
- TOKEN( "stock" ), // XML_STOCK
- TOKEN( "stock-updown-bars" ), // XML_STOCK_UPDOWN_BARS
- TOKEN( "stock-with-volume" ), // XML_STOCK_WITH_VOLUME
- TOKEN( "stop" ), // XML_STOP
- TOKEN( "stretch" ), // XML_STRETCH
- TOKEN( "stretch-from-bottom" ), // XML_STRETCH_FROM_BOTTOM
- TOKEN( "stretch-from-left" ), // XML_STRETCH_FROM_LEFT
- TOKEN( "stretch-from-right" ), // XML_STRETCH_FROM_RIGHT
- TOKEN( "stretch-from-top" ), // XML_STRETCH_FROM_TOP
- TOKEN( "stretchy" ), // XML_STRETCHY
- TOKEN( "strict" ), // XML_STRICT
- TOKEN( "string" ), // XML_STRING
- TOKEN( "string-value" ), // XML_STRING_VALUE
- TOKEN( "string-value-if-false" ), // XML_STRING_VALUE_IF_FALSE
- TOKEN( "string-value-if-true" ), // XML_STRING_VALUE_IF_TRUE
- TOKEN( "stripes" ), // XML_STRIPES
- TOKEN( "stroke" ), // XML_STROKE
- TOKEN( "stroke-color" ), // XML_STROKE_COLOR
- TOKEN( "stroke-dash" ), // XML_STROKE_DASH
- TOKEN( "stroke-linejoin" ), // XML_STROKE_LINEJOIN
- TOKEN( "stroke-opacity" ), // XML_STROKE_OPACITY
- TOKEN( "stroke-width" ), // XML_STROKE_WIDTH
- TOKEN( "structure-protected" ), // XML_STRUCTURE_PROTECTED
- TOKEN( "style" ), // XML_STYLE
- TOKEN( "style-name" ), // XML_STYLE_NAME
- TOKEN( "styles" ), // XML_STYLES
- TOKEN( "stylesheet" ), // XML_STYLESHEET
- TOKEN( "sub-table" ), // XML_SUB_TABLE
- TOKEN( "subject" ), // XML_SUBJECT
- TOKEN( "subset" ), // XML_SUBSET
- TOKEN( "subtitle" ), // XML_SUBTITLE
- TOKEN( "subtotal-field" ), // XML_SUBTOTAL_FIELD
- TOKEN( "subtotal-rule" ), // XML_SUBTOTAL_RULE
- TOKEN( "subtotal-rules" ), // XML_SUBTOTAL_RULES
- TOKEN( "suffix" ), // XML_SUFFIX
- TOKEN( "sum" ), // XML_SUM
- TOKEN( "swiss" ), // XML_SWISS
- TOKEN( "symbol" ), // XML_SYMBOL
- TOKEN( "symbol-height" ), // XML_SYMBOL_HEIGHT
- TOKEN( "symbol-image-name" ), // XML_SYMBOL_IMAGE_NAME
- TOKEN( "symbol-width" ), // XML_SYMBOL_WIDTH
- TOKEN( "system" ), // XML_SYSTEM
- TOKEN( "tab-stop" ), // XML_TAB_STOP
- TOKEN( "tab-stop-distance" ), // XML_TAB_STOP_DISTANCE
- TOKEN( "tab-stops" ), // XML_TAB_STOPS
- TOKEN( "table" ), // XML_TABLE
- TOKEN( "table-background" ), // XML_TABLE_BACKGROUND
- TOKEN( "table-cell" ), // XML_TABLE_CELL
- TOKEN( "table-centering" ), // XML_TABLE_CENTERING
- TOKEN( "table-column" ), // XML_TABLE_COLUMN
- TOKEN( "table-column-group" ), // XML_TABLE_COLUMN_GROUP
- TOKEN( "table-columns" ), // XML_TABLE_COLUMNS
- TOKEN( "table-count" ), // XML_TABLE_COUNT
- TOKEN( "table-header" ), // XML_TABLE_HEADER
- TOKEN( "table-header-columns" ), // XML_TABLE_HEADER_COLUMNS
- TOKEN( "table-header-rows" ), // XML_TABLE_HEADER_ROWS
- TOKEN( "table-index" ), // XML_TABLE_INDEX
- TOKEN( "table-index-entry-template" ), // XML_TABLE_INDEX_ENTRY_TEMPLATE
- TOKEN( "table-index-source" ), // XML_TABLE_INDEX_SOURCE
- TOKEN( "table-name" ), // XML_TABLE_NAME
- TOKEN( "table-number-list" ), // XML_TABLE_NUMBER_LIST
- TOKEN( "table-of-content" ), // XML_TABLE_OF_CONTENT
- TOKEN( "table-of-content-entry-template" ),// XML_TABLE_OF_CONTENT_ENTRY_TEMPLATE
- TOKEN( "table-of-content-source" ), // XML_TABLE_OF_CONTENT_SOURCE
- TOKEN( "table-page" ), // XML_TABLE_PAGE
- TOKEN( "table-row" ), // XML_TABLE_ROW
- TOKEN( "table-row-group" ), // XML_TABLE_ROW_GROUP
- TOKEN( "table-rows" ), // XML_TABLE_ROWS
- TOKEN( "table-source" ), // XML_TABLE_SOURCE
- TOKEN( "table-view" ), // XML_TABLE_VIEW
- TOKEN( "tables" ), // XML_TABLES
- TOKEN( "tan" ), // XML_TAN
- TOKEN( "tanh" ), // XML_TANH
- TOKEN( "target-cell-address" ), // XML_TARGET_CELL_ADDRESS
- TOKEN( "target-frame-name" ), // XML_TARGET_FRAME_NAME
- TOKEN( "target-range-address" ), // XML_TARGET_RANGE_ADDRESS
- TOKEN( "tb-rl" ), // XML_TB_RL
- TOKEN( "teal" ), // XML_TEAL
- TOKEN( "techreport" ), // XML_TECHREPORT
- TOKEN( "template" ), // XML_TEMPLATE
- TOKEN( "template-name" ), // XML_TEMPLATE_NAME
- TOKEN( "tendsto" ), // XML_TENDSTO
- TOKEN( "texture-filter" ), // XML_TEX_FILTER
- TOKEN( "texture-generation-mode-x" ), // XML_TEX_GENERATION_MODE_X
- TOKEN( "texture-generation-mode-y" ), // XML_TEX_GENERATION_MODE_Y
- TOKEN( "texture-kind" ), // XML_TEX_KIND
- TOKEN( "texture-mode" ), // XML_TEX_MODE
- TOKEN( "text" ), // XML_TEXT
- TOKEN( "text-align" ), // XML_TEXT_ALIGN
- TOKEN( "text-align-last" ), // XML_TEXT_ALIGN_LAST
- TOKEN( "text-align-source" ), // XML_TEXT_ALIGN_SOURCE
- TOKEN( "text-autospace" ), // XML_TEXT_AUTOSPACE
- TOKEN( "text-background-color" ), // XML_TEXT_BACKGROUND_COLOR
- TOKEN( "text-blinking" ), // XML_TEXT_BLINKING
- TOKEN( "text-box" ), // XML_TEXT_BOX
- TOKEN( "text-combine" ), // XML_TEXT_COMBINE
- TOKEN( "text-combine-end-char" ), // XML_TEXT_COMBINE_END_CHAR
- TOKEN( "text-combine-start-char" ), // XML_TEXT_COMBINE_START_CHAR
- TOKEN( "text-content" ), // XML_TEXT_CONTENT
- TOKEN( "text-crossing-out" ), // XML_TEXT_CROSSING_OUT
- TOKEN( "text-emphasize" ), // XML_TEXT_EMPHASIZE
- TOKEN( "text-global" ), // XML_TEXT_GLOBAL
- TOKEN( "text-indent" ), // XML_TEXT_INDENT
- TOKEN( "text-input" ), // XML_TEXT_INPUT
- TOKEN( "text-outline" ), // XML_TEXT_OUTLINE
- TOKEN( "text-position" ), // XML_TEXT_POSITION
- TOKEN( "text-rotation-angle" ), // XML_TEXT_ROTATION_ANGLE
- TOKEN( "text-rotation-scale" ), // XML_TEXT_ROTATION_SCALE
- TOKEN( "text-scale" ), // XML_TEXT_SCALE
- TOKEN( "text-shadow" ), // XML_TEXT_SHADOW
- TOKEN( "text-style" ), // XML_TEXT_STYLE
- TOKEN( "text-transform" ), // XML_TEXT_TRANSFORM
- TOKEN( "text-underline" ), // XML_TEXT_UNDERLINE
- TOKEN( "text-underline-color" ), // XML_TEXT_UNDERLINE_COLOR
- TOKEN( "textarea-horizontal-align" ), // XML_TEXTAREA_HORIZONTAL_ALIGN
- TOKEN( "textarea-vertical-align" ), // XML_TEXTAREA_VERTICAL_ALIGN
- TOKEN( "textual" ), // XML_TEXTUAL
- TOKEN( "thick" ), // XML_THICK
- TOKEN( "thin" ), // XML_THIN
- TOKEN( "three-dimensional" ), // XML_THREE_DIMENSIONAL
- TOKEN( "thumbnail" ), // XML_THUMBNAIL
- TOKEN( "tick-marks-major-inner" ), // XML_TICK_MARKS_MAJOR_INNER
- TOKEN( "tick-marks-major-outer" ), // XML_TICK_MARKS_MAJOR_OUTER
- TOKEN( "tick-marks-minor-inner" ), // XML_TICK_MARKS_MINOR_INNER
- TOKEN( "tick-marks-minor-outer" ), // XML_TICK_MARKS_MINOR_OUTER
- TOKEN( "tile-repeat-offset" ), // XML_TILE_REPEAT_OFFSET
- TOKEN( "time" ), // XML_TIME
- TOKEN( "time-adjust" ), // XML_TIME_ADJUST
- TOKEN( "time-style" ), // XML_TIME_STYLE
- TOKEN( "time-value" ), // XML_TIME_VALUE
- TOKEN( "times" ), // XML_TIMES
- TOKEN( "title" ), // XML_TITLE
- TOKEN( "to-another-table" ), // XML_TO_ANOTHER_TABLE
- TOKEN( "to-bottom" ), // XML_TO_BOTTOM
- TOKEN( "to-center" ), // XML_TO_CENTER
- TOKEN( "to-left" ), // XML_TO_LEFT
- TOKEN( "to-lower-left" ), // XML_TO_LOWER_LEFT
- TOKEN( "to-lower-right" ), // XML_TO_LOWER_RIGHT
- TOKEN( "to-right" ), // XML_TO_RIGHT
- TOKEN( "to-top" ), // XML_TO_TOP
- TOKEN( "to-upper-left" ), // XML_TO_UPPER_LEFT
- TOKEN( "to-upper-right" ), // XML_TO_UPPER_RIGHT
- TOKEN( "toc-mark" ), // XML_TOC_MARK
- TOKEN( "toc-mark-end" ), // XML_TOC_MARK_END
- TOKEN( "toc-mark-start" ), // XML_TOC_MARK_START
- TOKEN( "top" ), // XML_TOP
- TOKEN( "top-left" ), // XML_TOP_LEFT
- TOKEN( "top percent" ), // XML_TOP_PERCENT
- TOKEN( "top-right" ), // XML_TOP_RIGHT
- TOKEN( "top values" ), // XML_TOP_VALUES
- TOKEN( "top-arc" ), // XML_TOPARC
- TOKEN( "top-circle" ), // XML_TOPCIRCLE
- TOKEN( "trace-dependents" ), // XML_TRACE_DEPENDENTS
- TOKEN( "trace-errors" ), // XML_TRACE_ERRORS
- TOKEN( "trace-precedents" ), // XML_TRACE_PRECEDENTS
- TOKEN( "track-changes" ), // XML_TRACK_CHANGES
- TOKEN( "tracked-changes" ), // XML_TRACKED_CHANGES
- TOKEN( "tracked-changes-view-settings" ), // XML_TRACKED_CHANGES_VIEW_SETTINGS
- TOKEN( "transform" ), // XML_TRANSFORM
- TOKEN( "transition-on-click" ), // XML_TRANSITION_ON_CLICK
- TOKEN( "transparency" ), // XML_TRANSPARENCY
- TOKEN( "transparency-name" ), // XML_TRANSPARENCY_NAME
- TOKEN( "transparent" ), // XML_TRANSPARENT
- TOKEN( "transpose" ), // XML_TRANSPOSE
- TOKEN( "true" ), // XML_TRUE
- TOKEN( "truncate-on-overflow" ), // XML_TRUNCATE_ON_OVERFLOW
- TOKEN( "ttb" ), // XML_TTB
- TOKEN( "type" ), // XML_TYPE
- TOKEN( "bold" ), // XML_UNDERLINE_BOLD
- TOKEN( "bold-dash" ), // XML_UNDERLINE_BOLD_DASH
- TOKEN( "bold-dot-dash" ), // XML_UNDERLINE_BOLD_DOT_DASH
- TOKEN( "bold-dot-dot-dash" ), // XML_UNDERLINE_BOLD_DOT_DOT_DASH
- TOKEN( "bold-dotted" ), // XML_UNDERLINE_BOLD_DOTTED
- TOKEN( "bold-long-dash" ), // XML_UNDERLINE_BOLD_LONG_DASH
- TOKEN( "bold-wave" ), // XML_UNDERLINE_BOLD_WAVE
- TOKEN( "dash" ), // XML_UNDERLINE_DASH
- TOKEN( "dot-dash" ), // XML_UNDERLINE_DOT_DASH
- TOKEN( "dot-dot-dash" ), // XML_UNDERLINE_DOT_DOT_DASH
- TOKEN( "dotted" ), // XML_UNDERLINE_DOTTED
- TOKEN( "double" ), // XML_UNDERLINE_DOUBLE
- TOKEN( "double-wave" ), // XML_UNDERLINE_DOUBLE_WAVE
- TOKEN( "long-dash" ), // XML_UNDERLINE_LONG_DASH
- TOKEN( "none" ), // XML_UNDERLINE_NONE
- TOKEN( "single" ), // XML_UNDERLINE_SINGLE
- TOKEN( "small-wave" ), // XML_UNDERLINE_SMALL_WAVE
- TOKEN( "wave" ), // XML_UNDERLINE_WAVE
- TOKEN( "unformatted-text" ), // XML_UNFORMATTED_TEXT
- TOKEN( "union" ), // XML_UNION
- TOKEN( "unit" ), // XML_UNIT
- TOKEN( "unordered-list" ), // XML_UNORDERED_LIST
- TOKEN( "unpublished" ), // XML_UNPUBLISHED
- TOKEN( "up" ), // XML_UP
- TOKEN( "uplimit" ), // XML_UPLIMIT
- TOKEN( "upright" ), // XML_UPRIGHT
- TOKEN( "url" ), // XML_URL
- TOKEN( "use-caption" ), // XML_USE_CAPTION
- TOKEN( "use-cell-protection" ), // XML_USE_CELL_PROTECTION
- TOKEN( "use-chart-objects" ), // XML_USE_CHART_OBJECTS
- TOKEN( "use-condition" ), // XML_USE_CONDITION
- TOKEN( "use-draw-objects" ), // XML_USE_DRAW_OBJECTS
- TOKEN( "use-floating-frames" ), // XML_USE_FLOATING_FRAMES
- TOKEN( "use-graphics" ), // XML_USE_GRAPHICS
- TOKEN( "use-image-objects" ), // XML_USE_IMAGE_OBJECTS
- TOKEN( "use-index-marks" ), // XML_USE_INDEX_MARKS
- TOKEN( "use-index-source-styles" ), // XML_USE_INDEX_SOURCE_STYLES
- TOKEN( "use-keys-as-entries" ), // XML_USE_KEYS_AS_ENTRIES
- TOKEN( "use-label" ), // XML_USE_LABEL
- TOKEN( "use-math-objects" ), // XML_USE_MATH_OBJECTS
- TOKEN( "use-objects" ), // XML_USE_OBJECTS
- TOKEN( "use-optimal-column-width" ), // XML_USE_OPTIMAL_COLUMN_WIDTH
- TOKEN( "use-optimal-row-height" ), // XML_USE_OPTIMAL_ROW_HEIGHT
- TOKEN( "use-other-objects" ), // XML_USE_OTHER_OBJECTS
- TOKEN( "use-spreadsheet-objects" ), // XML_USE_SPREADSHEET_OBJECTS
- TOKEN( "use-styles" ), // XML_USE_STYLES
- TOKEN( "use-tables" ), // XML_USE_TABLES
- TOKEN( "use-window-font-color" ), // XML_USE_WINDOW_FONT_COLOR
- TOKEN( "used-hierarchy" ), // XML_USED_HIERARCHY
- TOKEN( "user-defined" ), // XML_USER_DEFINED
- TOKEN( "user-field-decl" ), // XML_USER_FIELD_DECL
- TOKEN( "user-field-decls" ), // XML_USER_FIELD_DECLS
- TOKEN( "user-field-get" ), // XML_USER_FIELD_GET
- TOKEN( "user-field-input" ), // XML_USER_FIELD_INPUT
- TOKEN( "user-index" ), // XML_USER_INDEX
- TOKEN( "user-index-entry-template" ), // XML_USER_INDEX_ENTRY_TEMPLATE
- TOKEN( "user-index-mark" ), // XML_USER_INDEX_MARK
- TOKEN( "user-index-mark-end" ), // XML_USER_INDEX_MARK_END
- TOKEN( "user-index-mark-start" ), // XML_USER_INDEX_MARK_START
- TOKEN( "user-index-source" ), // XML_USER_INDEX_SOURCE
- TOKEN( "user-info-0" ), // XML_USER_INFO_0
- TOKEN( "user-info-1" ), // XML_USER_INFO_1
- TOKEN( "user-info-2" ), // XML_USER_INFO_2
- TOKEN( "user-info-3" ), // XML_USER_INFO_3
- TOKEN( "user-transformed" ), // XML_USER_TRANSFORMED
- TOKEN( "username" ), // XML_USERNAME
- TOKEN( "value" ), // XML_VALUE
- TOKEN( "value-type" ), // XML_VALUE_TYPE
- TOKEN( "values-cell-range-address" ), // XML_VALUES_CELL_RANGE_ADDRESS
- TOKEN( "var" ), // XML_VAR
- TOKEN( "variable" ), // XML_VARIABLE
- TOKEN( "variable-decl" ), // XML_VARIABLE_DECL
- TOKEN( "variable-decls" ), // XML_VARIABLE_DECLS
- TOKEN( "variable-get" ), // XML_VARIABLE_GET
- TOKEN( "variable-input" ), // XML_VARIABLE_INPUT
- TOKEN( "variable-set" ), // XML_VARIABLE_SET
- TOKEN( "variance" ), // XML_VARIANCE
- TOKEN( "varp" ), // XML_VARP
- TOKEN( "vector" ), // XML_VECTOR
- TOKEN( "verb" ), // XML_VERB
- TOKEN( "version" ), // XML_VERSION
- TOKEN( "version-entry" ), // XML_VERSION_ENTRY
- TOKEN( "version-list" ), // XML_VERSION_LIST
- TOKEN( "vertical" ), // XML_VERTICAL
- TOKEN( "vertical-align" ), // XML_VERTICAL_ALIGN
- TOKEN( "vertical-lines" ), // XML_VERTICAL_LINES
- TOKEN( "vertical-pos" ), // XML_VERTICAL_POS
- TOKEN( "vertical-rel" ), // XML_VERTICAL_REL
- TOKEN( "vertical-segments" ), // XML_VERTICAL_SEGMENTS
- TOKEN( "vertical-split-mode" ), // XML_VERTICAL_SPLIT_MODE
- TOKEN( "vertical-split-position" ), // XML_VERTICAL_SPLIT_POSITION
- TOKEN( "vertical-stripes" ), // XML_VERTICAL_STRIPES
- TOKEN( "view" ), // XML_VIEW
- TOKEN( "viewBox" ), // XML_VIEWBOX
- TOKEN( "view-id" ), // XML_VIEW_ID
- TOKEN( "view-settings" ), // XML_VIEW_SETTINGS
- TOKEN( "visibility" ), // XML_VISIBILITY
- TOKEN( "visible" ), // XML_VISIBLE
- TOKEN( "visible-area" ), // XML_VISIBLE_AREA
- TOKEN( "visible-area-height" ), // XML_VISIBLE_AREA_HEIGHT
- TOKEN( "visible-area-left" ), // XML_VISIBLE_AREA_LEFT
- TOKEN( "visible-area-top" ), // XML_VISIBLE_AREA_TOP
- TOKEN( "visible-area-width" ), // XML_VISIBLE_AREA_WIDTH
- TOKEN( "visited-style-name" ), // XML_VISITED_STYLE_NAME
- TOKEN( "volatile" ), // XML_VOLATILE
- TOKEN( "volume" ), // XML_VOLUME
- TOKEN( "vpn" ), // XML_VPN
- TOKEN( "vrp" ), // XML_VRP
- TOKEN( "vup" ), // XML_VUP
- TOKEN( "wall" ), // XML_WALL
- TOKEN( "warning" ), // XML_WARNING
- TOKEN( "watermark" ), // XML_WATERMARK
- TOKEN( "wavyline" ), // XML_WAVYLINE
- TOKEN( "wavyline-from-bottom" ), // XML_WAVYLINE_FROM_BOTTOM
- TOKEN( "wavyline-from-left" ), // XML_WAVYLINE_FROM_LEFT
- TOKEN( "wavyline-from-right" ), // XML_WAVYLINE_FROM_RIGHT
- TOKEN( "wavyline-from-top" ), // XML_WAVYLINE_FROM_TOP
- TOKEN( "week-of-year" ), // XML_WEEK_OF_YEAR
- TOKEN( "bold" ), // XML_WEIGHT_BOLD
- TOKEN( "normal" ), // XML_WEIGHT_NORMAL
- TOKEN( "white" ), // XML_WHITE
- TOKEN( "whole-page" ), // XML_WHOLE_PAGE
- TOKEN( "widows" ), // XML_WIDOWS
- TOKEN( "width" ), // XML_WIDTH
- TOKEN( "word" ), // XML_WORD
- TOKEN( "word-count" ), // XML_WORD_COUNT
- TOKEN( "wrap" ), // XML_WRAP
- TOKEN( "wrap-contour" ), // XML_WRAP_CONTOUR
- TOKEN( "wrap-contour-mode" ), // XML_WRAP_CONTOUR_MODE
- TOKEN( "wrap-option" ), // XML_WRAP_OPTION
- TOKEN( "writing-mode" ), // XML_WRITING_MODE
- TOKEN( "www" ), // XML_WWW
- TOKEN( "x" ), // XML_X
- TOKEN( "x1" ), // XML_X1
- TOKEN( "x2" ), // XML_X2
- TOKEN( "x-mac-roman" ), // XML_X_MAC_ROMAN
- TOKEN( "x-symbol" ), // XML_X_SYMBOL
- TOKEN( "x-system" ), // XML_X_SYSTEM
- TOKEN( "xor" ), // XML_XOR
- TOKEN( "y" ), // XML_Y
- TOKEN( "y1" ), // XML_Y1
- TOKEN( "y2" ), // XML_Y2
- TOKEN( "year" ), // XML_YEAR
- TOKEN( "yellow" ), // XML_YELLOW
- TOKEN( "zero-values" ), // XML_ZERO_VALUES
- TOKEN( "z-index" ), // XML_ZINDEX
- TOKEN( "zoom-type" ), // XML_ZOOM_TYPE
- TOKEN( "zoom-value" ), // XML_ZOOM_VALUE
-
- TOKEN( "enable" ), // XML_ENABLE
- TOKEN( "use-regular-expressions" ), // XML_USE_REGULAR_EXPRESSIONS
- TOKEN( "data-source-has-labels" ), // XML_DATA_SOURCE_HAS_LABELS
- TOKEN( "link-data-style-to-source" ), // XML_LINK_DATA_STYLE_TO_SOURCE
- TOKEN( "sort-algorithm" ), // XML_SORT_ALGORITHM
- TOKEN( "straight-line" ), // XML_STRAIGHT_LINE
- TOKEN( "angled-line" ), // XML_ANGLED_LINE
- TOKEN( "angled-connector-line" ), // XML_ANGLED_CONNECTOR_LINE
-
- TOKEN( "application/x-www-form-urlencoded" ), // XML_APPLICATION_X_WWW_FORM_URLENCODED
- TOKEN( "multipart/formdata" ), // XML_MULTIPART_FORMDATA
- TOKEN( "application/text" ), // XML_APPLICATION_TEXT
- TOKEN( "get" ), // XML_GET
- TOKEN( "post" ), // XML_POST
- TOKEN( "query" ), // XML_QUERY
- TOKEN( "parent" ), // XML_PARENT
- TOKEN( "records" ), // XML_RECORDS
- TOKEN( "push" ), // XML_PUSH
- TOKEN( "submit" ), // XML_SUBMIT
- TOKEN( "reset" ), // XML_RESET
- TOKEN( "value-list" ), // XML_VALUE_LIST
- TOKEN( "sql" ), // XML_SQL
- TOKEN( "sql-pass-through" ), // XML_SQL_PASS_THROUGH
- TOKEN( "table-fields" ), // XML_TABLE_FIELDS
- TOKEN( "unchecked" ), // XML_UNCHECKED
- TOKEN( "checked" ), // XML_CHECKED
- TOKEN( "unknown" ), // XML_UNKNOWN
- TOKEN( "roll-from-top" ), // XML_ROLL_FROM_TOP
-
- TOKEN( "binary-data" ), // XML_BINARY_DATA
- TOKEN( "notify-on-update-of-table" ), // XML_NOTIFY_ON_UPDATE_OF_TABLE
-
- TOKEN( "0" ), // XML_0
- TOKEN( "play" ), // XML_PLAY
- TOKEN( "handout-master" ), // XML_HANDOUT_MASTER
- TOKEN( "text-style-name" ), // XML_TEXT_STYLE_NAME
- TOKEN( "escape-direction" ), // XML_ESCAPE_DIRECTION
- TOKEN( "glue-point" ), // XML_GLUE_POINT
- TOKEN( "primary-x" ), // XML_PRIMARY_X
- TOKEN( "secondary-x" ), // XML_SECONDARY_X
- TOKEN( "primary-y" ), // XML_PRIMARY_Y
- TOKEN( "secondary-y" ), // XML_SECONDARY_Y
- TOKEN( "primary-z" ), // XML_PRIMARY_Z
-
- TOKEN( "caption-type" ), // XML_CAPTION_TYPE
- TOKEN( "caption-angle-type" ), // XML_CAPTION_ANGLE_TYPE
- TOKEN( "caption-angle" ), // XML_CAPTION_ANGLE
- TOKEN( "caption-gap" ), // XML_CAPTION_GAP
- TOKEN( "caption-escape-direction" ), // XML_CAPTION_ESCAPE_DIRECTION
- TOKEN( "caption-escape" ), // XML_CAPTION_ESCAPE
- TOKEN( "caption-line-length" ), // XML_CAPTION_LINE_LENGTH
- TOKEN( "caption-fit-line-length" ), // XML_CAPTION_FIT_LINE_LENGTH
- TOKEN( "free" ), // XML_FREE
- TOKEN( "transition-type" ), // XML_TRANSITION_TYPE,
- TOKEN( "transition-style" ), // XML_TRANSITION_STYLE
- TOKEN( "transition-speed" ), // XML_TRANSITION_SPEED
- TOKEN( "duration" ), // XML_DURATION,
- TOKEN( "background-size" ), // XML_BACKGROUND_SIZE,
- TOKEN( "background-objects-visible" ), // XML_BACKGROUND_OBJECTS_VISIBLE
- TOKEN( "background-visible" ), // XML_BACKGROUND_VISIBLE
-
- TOKEN( "move-from-upperleft" ), // XML_MOVE_FROM_UPPERLEFT,
- TOKEN( "move-from-upperright" ), // XML_MOVE_FROM_UPPERRIGHT,
- TOKEN( "move-from-lowerright" ), // XML_MOVE_FROM_LOWERRIGHT,
- TOKEN( "move-from-lowerleft" ), // XML_MOVE_FROM_LOWERLEFT,
- TOKEN( "uncover-to-left" ), // XML_UNCOVER_TO_LEFT,
- TOKEN( "uncover-to-upperleft" ), // XML_UNCOVER_TO_UPPERLEFT,
- TOKEN( "uncover-to-top" ), // XML_UNCOVER_TO_TOP,
- TOKEN( "uncover-to-upperright" ), // XML_UNCOVER_TO_UPPERRIGHT,
- TOKEN( "uncover-to-right" ), // XML_UNCOVER_TO_RIGHT,
- TOKEN( "uncover-to-lowerright" ), // XML_UNCOVER_TO_LOWERRIGHT,
- TOKEN( "uncover-to-bottom" ), // XML_UNCOVER_TO_BOTTOM,
- TOKEN( "uncover-to-lowerleft" ), // XML_UNCOVER_TO_LOWERLEFT,
- TOKEN( "vertical-checkerboard" ), // XML_VERTICAL_CHECKERBOARD,
- TOKEN( "horizontal-checkerboard" ), // XML_HORIZONTAL_CHECKERBOARD,
-
- TOKEN( "notify-on-update-of-ranges" ), // XML_NOTIFY_ON_UPDATE_OF_RANGES
-
- TOKEN( "byte" ), // XML_BYTE
- TOKEN( "macro" ), // XML_MACRO
- TOKEN( "location" ), // XML_LOCATION
- TOKEN( "application" ), // XML_APPLICATION
-
- TOKEN( "symbol-image" ), // XML_SYMBOL_IMAGE
- 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
-
- TOKEN( "column-mapping" ), // XML_COLUMN_MAPPING
- TOKEN( "row-mapping" ), // XML_ROW_MAPPING
-
- TOKEN( "table-formula" ), // XML_TABLE_FORMULA
-
- TOKEN( "embedded-text" ), // XML_EMBEDDED_TEXT
-
- TOKEN( "merge-last-paragraph"), // XML_MERGE_LAST_PARAGRAPH
-
- TOKEN( "stock-loss-marker" ), // XML_STOCK_LOSS_MARKER
- TOKEN( "stock-gain-marker" ), // XML_STOCK_GAIN_MARKER
- TOKEN( "stock-range-line" ), // XML_STOCK_RANGE_LINE
-
- TOKEN( "rl-tb" ), // XML_RL_TB
- TOKEN( "tb-lr" ), // XML_TB_LR
- TOKEN( "lr" ), // XML_LR
- TOKEN( "rl" ), // XML_RL
- TOKEN( "tb" ), // XML_TB
-
- TOKEN( "layout-grid-color" ), // XML_LAYOUT_GRID_COLOR
- TOKEN( "layout-grid-lines" ), // XML_LAYOUT_GRID_LINES
- TOKEN( "layout-grid-base-height" ), // XML_LAYOUT_GRID_BASE_HEIGHT
- TOKEN( "layout-grid-ruby-height" ), // XML_LAYOUT_GRID_RUBY_HEIGHT
- TOKEN( "layout-grid-mode" ), // XML_LAYOUT_GRID_MODE
- TOKEN( "layout-grid-ruby-below" ), // XML_LAYOUT_GRID_RUBY_BELOW
- TOKEN( "layout-grid-print" ), // XML_LAYOUT_GRID_PRINT
- TOKEN( "layout-grid-display" ), // XML_LAYOUT_GRID_DISPLAY
-
- TOKEN( "snap-to-layout-grid" ), // XML_SNAP_TO_LAYOUT_GRID
-
- TOKEN( "dont-balance-text-columns" ), // XML_DONT_BALANCE_TEXT_COLUMNS
-
- TOKEN( "glyph-orientation-vertical" ), // XML_GLYPH_ORIENTATION_VERTICAL
-
- TOKEN( "marked-invalid" ), //XML_MARKED_INVALID
-
- TOKEN( "regression-curve" ), // XML_REGRESSION_CURVE
- TOKEN( "error-indicator" ), // XML_ERROR_INDICATOR
-
- TOKEN( "table-type" ), // XML_TABLE_TYPE
-
- TOKEN( "display-factor" ), // XML_DISPLAY_FACTOR
-
- TOKEN( "transliteration-format" ), // XML_TRANSLITERATION_FORMAT
- TOKEN( "transliteration-language" ), // XML_TRANSLITERATION_LANGUAGE
- TOKEN( "transliteration-country" ), // XML_TRANSLITERATION_COUNTRY
- TOKEN( "transliteration-style" ), // XML_TRANSLITERATION_STYLE
-
- TOKEN( "key1-phonetic" ), // XML_KEY1_PHONETIC
- TOKEN( "key2-phonetic" ), // XML_KEY2_PHONETIC
- TOKEN( "string-value-phonetic" ), // XML_STRING_VALUE_PHONETIC
-
- TOKEN( "background-transparency" ), // XML_BACKGROUND_OPACITY
- TOKEN( "background-image-transparency" ), // XML_BACKGROUND_IMAGE_OPACITY
-
- TOKEN( "dynamic-spacing" ), // XML_DYNAMIC_SPACING
-
- TOKEN( "main-etry" ), // XML_MAIN_ENTRY
-
- TOKEN( "use-outline-level" ), // XML_USE_OUTLINE_LEVEL,
-
- // #107245# New 3D properties which are possible for lathe and extrude 3d objects
- TOKEN( "close-front" ), // XML_CLOSE_FRONT
- TOKEN( "close-back" ), // XML_CLOSE_BACK
-
- TOKEN( "drop-down" ), // XML_DROPDOWN
- TOKEN( "current-selected" ), // XML_CURRENT_SELECTED
-
- TOKEN( "join-border" ), // XML_JOIN_BORDER
-
- TOKEN( "show-list" ), // XML_SHOW_LIST
- TOKEN( "no" ), // XML_NO
- TOKEN( "unsorted" ), // XML_UNSORTED
- TOKEN( "sorted-ascending" ), // XML_SORTED_ASCENDING
-
- TOKEN( "font-independent-line-spacing" ), // XML_FONT_INDEPENDENT_LINE_SPACING
- TOKEN( "selection" ), // XML_SELECTION
- TOKEN( "selection-indexes" ), // XML_SELECTION_INDEXES
- TOKEN( "script-data" ), // XML_SCRIPT_DATA
- TOKEN( "libraries" ), // XML_LIBRARIES
-
- { 0, NULL, NULL } // XML_TOKEN_END
- };
-
-
-
- // get OUString representation of token
- const OUString& GetXMLToken( enum XMLTokenEnum eToken )
- {
- DBG_ASSERT( eToken > XML_TOKEN_INVALID, "token value too low!" );
- DBG_ASSERT( eToken < XML_TOKEN_END, "token value too high!" );
-
- XMLTokenEntry* pToken = &aTokenList[(sal_uInt16)eToken];
- if (!pToken->pOUString)
- pToken->pOUString = new OUString( pToken->pChar, pToken->nLength,
- RTL_TEXTENCODING_ASCII_US );
- return *pToken->pOUString;
- }
-
- // does rString represent eToken?
- sal_Bool IsXMLToken(
- const OUString& rString,
- enum XMLTokenEnum eToken )
- {
- DBG_ASSERT( eToken > XML_TOKEN_INVALID, "token value too low!" );
- DBG_ASSERT( eToken < XML_TOKEN_END, "token value too high!" );
-
- const XMLTokenEntry* pToken = &aTokenList[(sal_uInt16)eToken];
- return rString.equalsAsciiL( pToken->pChar, pToken->nLength );
- }
-
- // gives all allocated memory for OUString* back
- void ResetTokens()
- {
- for (sal_Int16 i=0, nEnd = sizeof ( aTokenList ) / sizeof ( XMLTokenEntry );
- i < nEnd;
- i++)
- {
- delete aTokenList[i].pOUString;
- aTokenList[i].pOUString = NULL;
- }
- }
-}
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/core/xmloff_xmluconv.cxx b/binfilter/bf_xmloff/source/core/xmloff_xmluconv.cxx
deleted file mode 100644
index af29a7aee63e..000000000000
--- a/binfilter/bf_xmloff/source/core/xmloff_xmluconv.cxx
+++ /dev/null
@@ -1,1810 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/util/DateTime.hpp>
-
-#include <tools/debug.hxx>
-
-
-#include "xmlehelp.hxx"
-
-
-#include <xmluconv.hxx>
-
-
-#include <rtl/math.hxx>
-
-#ifndef _TOOLS_DATE_HXX
-#include <tools/date.hxx>
-
-#include <tools/string.hxx>
-
-#endif
-
-#include <vcl/fldunit.hxx>
-
-#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#include <com/sun/star/style/NumberingType.hpp>
-#include <com/sun/star/text/XNumberingTypeInfo.hpp>
-
-#include <bf_goodies/vector3d.hxx>
-namespace binfilter {
-
-using namespace rtl;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::style;
-using namespace ::binfilter::xmloff::token;
-
-const sal_Int8 XML_MAXDIGITSCOUNT_TIME = 11;
-const sal_Int8 XML_MAXDIGITSCOUNT_DATETIME = 6;
-#define XML_NULLDATE "NullDate"
-
-OUString SvXMLUnitConverter::msXML_true;
-OUString SvXMLUnitConverter::msXML_false;
-
-void SvXMLUnitConverter::createNumTypeInfo() const
-{
- // #110680#
- //Reference< lang::XMultiServiceFactory > xServiceFactory =
- // comphelper::getProcessServiceFactory();
- //OSL_ENSURE( xServiceFactory.is(),
- // "XMLUnitConverter: got no service factory" );
-
- if( mxServiceFactory.is() )
- {
- ((SvXMLUnitConverter *)this)->xNumTypeInfo =
- Reference < XNumberingTypeInfo > (
- mxServiceFactory->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.DefaultNumberingProvider") ) ), UNO_QUERY );
- }
-}
-
-/** constructs a SvXMLUnitConverter. The core measure unit is the
- default unit for numerical measures, the XML measure unit is
- the default unit for textual measures
-*/
-
-// #110680#
-//SvXMLUnitConverter::SvXMLUnitConverter( MapUnit eCoreMeasureUnit,
-// MapUnit eXMLMeasureUnit ) :
-SvXMLUnitConverter::SvXMLUnitConverter(
- MapUnit eCoreMeasureUnit,
- MapUnit eXMLMeasureUnit,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory ) :
- aNullDate(30, 12, 1899),
- mxServiceFactory( xServiceFactory )
-{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
-
- meCoreMeasureUnit = eCoreMeasureUnit;
- meXMLMeasureUnit = eXMLMeasureUnit;
-}
-
-SvXMLUnitConverter::~SvXMLUnitConverter()
-{
-}
-
-MapUnit SvXMLUnitConverter::GetMapUnit(sal_Int16 nFieldUnit)
-{
- MapUnit eUnit = MAP_INCH;
- switch( nFieldUnit )
- {
- case FUNIT_MM:
- eUnit = MAP_MM;
- break;
- case FUNIT_CM:
- case FUNIT_M:
- case FUNIT_KM:
- eUnit = MAP_CM;
- break;
- case FUNIT_TWIP:
- eUnit = MAP_TWIP;
- break;
- case FUNIT_POINT:
- case FUNIT_PICA:
- eUnit = MAP_POINT;
- break;
-// case FUNIT_INCH:
-// case FUNIT_FOOT:
-// case FUNIT_MILE:
-// eUnit = MAP_INCH;
-// break;
- case FUNIT_100TH_MM:
- eUnit = MAP_100TH_MM;
- break;
- }
- return eUnit;
-}
-
-/** convert string to measure using optional min and max values*/
-sal_Bool SvXMLUnitConverter::convertMeasure( sal_Int32& nValue,
- const OUString& rString,
- sal_Int32 nMin, sal_Int32 nMax ) const
-{
- return SvXMLUnitConverter::convertMeasure( nValue, rString,
- meCoreMeasureUnit,
- nMin, nMax );
-}
-
-/** convert measure to string */
-void SvXMLUnitConverter::convertMeasure( OUStringBuffer& rString,
- sal_Int32 nMeasure ) const
-{
- SvXMLUnitConverter::convertMeasure( rString, nMeasure,
- meCoreMeasureUnit,
- meXMLMeasureUnit );
-}
-
-/** convert the value from the given string to an int value
- with the given map unit using optional min and max values
-*/
-sal_Bool SvXMLUnitConverter::convertMeasure( sal_Int32& rValue,
- const OUString& rString,
- MapUnit eDstUnit,
- sal_Int32 nMin, sal_Int32 nMax )
-{
- sal_Bool bNeg = sal_False;
- double nVal = 0;
-
- sal_Int32 nPos = 0L;
- sal_Int32 nLen = rString.getLength();
-
- // skip white space
- while( nPos < nLen && sal_Unicode(' ') == rString[nPos] )
- nPos++;
-
- if( nPos < nLen && sal_Unicode('-') == rString[nPos] )
- {
- bNeg = sal_True;
- nPos++;
- }
-
- // get number
- while( nPos < nLen &&
- sal_Unicode('0') <= rString[nPos] &&
- sal_Unicode('9') >= rString[nPos] )
- {
- // TODO: check overflow!
- nVal *= 10;
- nVal += (rString[nPos] - sal_Unicode('0'));
- nPos++;
- }
- double nDiv = 1.;
- if( nPos < nLen && sal_Unicode('.') == rString[nPos] )
- {
- nPos++;
-
- while( nPos < nLen &&
- sal_Unicode('0') <= rString[nPos] &&
- sal_Unicode('9') >= rString[nPos] )
- {
- // TODO: check overflow!
- nDiv *= 10;
- nVal += ( ((double)(rString[nPos] - sal_Unicode('0'))) / nDiv );
- nPos++;
- }
- }
-
- // skip white space
- while( nPos < nLen && sal_Unicode(' ') == rString[nPos] )
- nPos++;
-
- if( nPos < nLen )
- {
-
- if( MAP_RELATIVE == eDstUnit )
- {
- if( sal_Unicode('%') != rString[nPos] )
- return sal_False;
- }
- else if( MAP_PIXEL == eDstUnit )
- {
- if( nPos + 1 >= nLen ||
- (sal_Unicode('p') != rString[nPos] &&
- sal_Unicode('P') != rString[nPos])||
- (sal_Unicode('x') != rString[nPos+1] &&
- sal_Unicode('X') != rString[nPos+1]) )
- return sal_False;
- }
- else
- {
- DBG_ASSERT( MAP_TWIP == eDstUnit || MAP_POINT ||
- MAP_100TH_MM == eDstUnit, "unit is not supported");
- const sal_Char *aCmpsL[2] = { 0, 0 };
- const sal_Char *aCmpsU[2] = { 0, 0 };
- double aScales[2] = { 1., 1. };
-
- if( MAP_TWIP == eDstUnit )
- {
- switch( rString[nPos] )
- {
- case sal_Unicode('c'):
- case sal_Unicode('C'):
- aCmpsL[0] = "cm";
- aCmpsU[0] = "CM";
- aScales[0] = (72.*20.)/2.54; // twip
- break;
- case sal_Unicode('e'):
- case sal_Unicode('E'):
- // pCmp1 = sXML_unit_em;
- // nToken1 = CSS1_EMS;
-
- // pCmp2 = sXML_unit_ex;
- // nToken2 = CSS1_EMX;
- break;
- case sal_Unicode('i'):
- case sal_Unicode('I'):
- aCmpsL[0] = "inch";
- aCmpsU[0] = "INCH";
- aScales[0] = 72.*20.; // twip
- break;
- case sal_Unicode('m'):
- case sal_Unicode('M'):
- aCmpsL[0] = "mm";
- aCmpsU[0] = "MM";
- aScales[0] = (72.*20.)/25.4; // twip
- break;
- case sal_Unicode('p'):
- case sal_Unicode('P'):
- aCmpsL[0] = "pt";
- aCmpsU[0] = "PT";
- aScales[0] = 20.; // twip
-
- aCmpsL[1] = "pc";
- aCmpsU[1] = "PC";
- aScales[1] = 12.*20.; // twip
-
- // pCmp3 = sXML_unit_px;
- // nToken3 = CSS1_PIXLENGTH;
- break;
- }
- }
- else if( MAP_100TH_MM == eDstUnit )
- {
- switch( rString[nPos] )
- {
- case sal_Unicode('c'):
- case sal_Unicode('C'):
- aCmpsL[0] = "cm";
- aCmpsU[0] = "CM";
- aScales[0] = 1000.; // mm/100
- break;
- case sal_Unicode('e'):
- case sal_Unicode('E'):
- // pCmp1 = sXML_unit_em;
- // nToken1 = CSS1_EMS;
-
- // pCmp2 = sXML_unit_ex;
- // nToken2 = CSS1_EMX;
- break;
- case sal_Unicode('i'):
- case sal_Unicode('I'):
- aCmpsL[0] = "inch";
- aCmpsU[0] = "INCH";
- aScales[0] = 1000.*2.54; // mm/100
- break;
- case sal_Unicode('m'):
- case sal_Unicode('M'):
- aCmpsL[0] = "mm";
- aCmpsU[0] = "MM";
- aScales[0] = 100.; // mm/100
- break;
- case sal_Unicode('p'):
- case sal_Unicode('P'):
- aCmpsL[0] = "pt";
- aCmpsU[0] = "PT";
- aScales[0] = (1000.*2.54)/72.; // mm/100
-
- aCmpsL[1] = "pc";
- aCmpsU[1] = "PC";
- aScales[1] = (1000.*2.54)/12.; // mm/100
-
- // pCmp3 = sXML_unit_px;
- // nToken3 = CSS1_PIXLENGTH;
- break;
- }
- }
- else if( MAP_POINT == eDstUnit )
- {
- if( rString[nPos] == 'p' || rString[nPos] == 'P' )
- {
- aCmpsL[0] = "pt";
- aCmpsU[0] = "PT";
- aScales[0] = 1;
- }
- }
-
- if( aCmpsL[0] == NULL )
- return sal_False;
-
- double nScale = 0.;
- for( sal_uInt16 i= 0; i < 2; i++ )
- {
- const sal_Char *pL = aCmpsL[i];
- if( pL )
- {
- const sal_Char *pU = aCmpsU[i];
- while( nPos < nLen && *pL )
- {
- sal_Unicode c = rString[nPos];
- if( c != *pL && c != *pU )
- break;
- pL++;
- pU++;
- nPos++;
- }
- if( !*pL && (nPos == nLen || ' ' == rString[nPos]) )
- {
- nScale = aScales[i];
- break;
- }
- }
- }
-
- if( 0. == nScale )
- return sal_False;
-
- // TODO: check overflow
- if( nScale != 1. )
- nVal *= nScale;
- }
- }
-
- nVal += .5;
- if( bNeg )
- nVal = -nVal;
-
- if( nVal <= (double)nMin )
- rValue = nMin;
- else if( nVal >= (double)nMax )
- rValue = nMax;
- else
- rValue = (sal_Int32)nVal;
-
- return sal_True;
-}
-
-/** convert measure in given unit to string with given unit */
-void SvXMLUnitConverter::convertMeasure( OUStringBuffer& rBuffer,
- sal_Int32 nMeasure,
- MapUnit eSrcUnit,
- MapUnit eDstUnit )
-{
- if( eSrcUnit == MAP_RELATIVE )
- {
- DBG_ASSERT( eDstUnit == MAP_RELATIVE,
- "MAP_RELATIVE only maps to MAP_RELATIVE!" );
-
- rBuffer.append( nMeasure );
- rBuffer.append( sal_Unicode('%' ) );
- }
- else
- {
- SvXMLExportHelper::AddLength( nMeasure, eSrcUnit,
- rBuffer, eDstUnit );
- }
-}
-
-/** convert string to boolean */
-sal_Bool SvXMLUnitConverter::convertBool( sal_Bool& rBool,
- const OUString& rString )
-{
- rBool = IsXMLToken(rString, XML_TRUE);
-
- return rBool || IsXMLToken(rString, XML_FALSE);
-}
-
-/** convert boolean to string */
-void SvXMLUnitConverter::convertBool( OUStringBuffer& rBuffer,
- sal_Bool bValue )
-{
- rBuffer.append( GetXMLToken( bValue ? XML_TRUE : XML_FALSE ) );
-}
-
-/** convert string to percent */
-sal_Bool SvXMLUnitConverter::convertPercent( sal_Int32& rPercent,
- const OUString& rString )
-{
- return convertMeasure( rPercent, rString, MAP_RELATIVE );
-}
-
-/** convert percent to string */
-void SvXMLUnitConverter::convertPercent( OUStringBuffer& rBuffer,
- sal_Int32 nValue )
-{
- rBuffer.append( nValue );
- rBuffer.append( sal_Unicode('%' ) );
-}
-
-/** convert string to pixel measure */
-sal_Bool SvXMLUnitConverter::convertMeasurePx( sal_Int32& rPixel,
- const OUString& rString )
-{
- return convertMeasure( rPixel, rString, MAP_PIXEL );
-}
-
-/** convert pixel measure to string */
-void SvXMLUnitConverter::convertMeasurePx( OUStringBuffer& rBuffer,
- sal_Int32 nValue )
-{
- rBuffer.append( nValue );
- rBuffer.append( sal_Unicode('p' ) );
- rBuffer.append( sal_Unicode('x' ) );
-}
-
-/** convert string to enum using given enum map, if the enum is
- not found in the map, this method will return false
-*/
-sal_Bool SvXMLUnitConverter::convertEnum( sal_uInt16& rEnum,
- const OUString& rValue,
- const SvXMLEnumStringMapEntry *pMap )
-{
- while( pMap->pName )
- {
- if( rValue.equalsAsciiL( pMap->pName, pMap->nNameLength ) )
- {
- rEnum = pMap->nValue;
- return sal_True;
- }
- pMap++;
- }
-
- return sal_False;
-}
-
-/** convert string to enum using given token map, if the enum is
- not found in the map, this method will return false */
-sal_Bool SvXMLUnitConverter::convertEnum(
- sal_uInt16& rEnum,
- const OUString& rValue,
- const SvXMLEnumMapEntry *pMap )
-{
- while( pMap->eToken != XML_TOKEN_INVALID )
- {
- if( IsXMLToken( rValue, pMap->eToken ) )
- {
- rEnum = pMap->nValue;
- return sal_True;
- }
- pMap++;
- }
- return sal_False;
-}
-
-/** convert enum to string using given token map with an optional
- default token. If the enum is not found in the map,
- this method will either use the given default or return
- false if no default is set */
-sal_Bool SvXMLUnitConverter::convertEnum(
- OUStringBuffer& rBuffer,
- sal_uInt16 nValue,
- const SvXMLEnumMapEntry *pMap,
- enum XMLTokenEnum eDefault)
-{
- enum XMLTokenEnum eTok = eDefault;
-
- while( pMap->eToken != XML_TOKEN_INVALID )
- {
- if( pMap->nValue == nValue )
- {
- eTok = pMap->eToken;
- break;
- }
- pMap++;
- }
-
- // the map may have contained XML_TOKEN_INVALID
- if( eTok == XML_TOKEN_INVALID )
- eTok = eDefault;
-
- if( eTok != XML_TOKEN_INVALID )
- rBuffer.append( GetXMLToken(eTok) );
-
- return (eTok != XML_TOKEN_INVALID);
-}
-
-int lcl_gethex( int nChar )
-{
- if( nChar >= '0' && nChar <= '9' )
- return nChar - '0';
- else if( nChar >= 'a' && nChar <= 'f' )
- return nChar - 'a' + 10;
- else if( nChar >= 'A' && nChar <= 'F' )
- return nChar - 'A' + 10;
- else
- return 0;
-}
-
-/** convert string to color */
-sal_Bool SvXMLUnitConverter::convertColor( Color& rColor,
- const OUString& rValue )
-{
- if( rValue.getLength() != 7 || rValue[0] != '#' )
- return sal_False;
-
- rColor.SetRed( lcl_gethex( rValue[1] ) * 16 +
- lcl_gethex( rValue[2] ) );
-
- rColor.SetGreen( lcl_gethex( rValue[3] ) * 16 +
- lcl_gethex( rValue[4] ) );
-
- rColor.SetBlue( lcl_gethex( rValue[5] ) * 16 +
- lcl_gethex( rValue[6] ) );
-
- return sal_True;
-}
-
-static sal_Char aHexTab[] = "0123456789abcdef";
-
-/** convert color to string */
-void SvXMLUnitConverter::convertColor( OUStringBuffer& rBuffer,
- const Color& rCol )
-{
- rBuffer.append( sal_Unicode( '#' ) );
-
- sal_uInt8 nCol = rCol.GetRed();
- rBuffer.append( sal_Unicode( aHexTab[ nCol >> 4 ] ) );
- rBuffer.append( sal_Unicode( aHexTab[ nCol & 0xf ] ) );
-
- nCol = rCol.GetGreen();
- rBuffer.append( sal_Unicode( aHexTab[ nCol >> 4 ] ) );
- rBuffer.append( sal_Unicode( aHexTab[ nCol & 0xf ] ) );
-
- nCol = rCol.GetBlue();
- rBuffer.append( sal_Unicode( aHexTab[ nCol >> 4 ] ) );
- rBuffer.append( sal_Unicode( aHexTab[ nCol & 0xf ] ) );
-}
-
-/** convert number to string */
-void SvXMLUnitConverter::convertNumber( OUStringBuffer& rBuffer,
- sal_Int32 nNumber )
-{
- rBuffer.append( sal_Int32( nNumber ) );
-}
-
-/** convert string to number with optional min and max values */
-sal_Bool SvXMLUnitConverter::convertNumber( sal_Int32& rValue,
- const OUString& rString,
- sal_Int32 nMin, sal_Int32 nMax )
-{
- sal_Bool bNeg = sal_False;
- rValue = 0;
-
- sal_Int32 nPos = 0L;
- sal_Int32 nLen = rString.getLength();
-
- // skip white space
- while( nPos < nLen && sal_Unicode(' ') == rString[nPos] )
- nPos++;
-
- if( nPos < nLen && sal_Unicode('-') == rString[nPos] )
- {
- bNeg = sal_True;
- nPos++;
- }
-
- // get number
- while( nPos < nLen &&
- sal_Unicode('0') <= rString[nPos] &&
- sal_Unicode('9') >= rString[nPos] )
- {
- // TODO: check overflow!
- rValue *= 10;
- rValue += (rString[nPos] - sal_Unicode('0'));
- nPos++;
- }
-
- if( bNeg )
- rValue *= -1;
-
- return nPos == nLen;
-}
-
-/** convert double number to string (using ::rtl::math) */
-void SvXMLUnitConverter::convertDouble(::rtl::OUStringBuffer& rBuffer,
- double fNumber, BOOL bWriteUnits) const
-{
- SvXMLUnitConverter::convertDouble(rBuffer, fNumber,
- bWriteUnits, meCoreMeasureUnit, meXMLMeasureUnit);
-}
-
-/** convert double number to string (using ::rtl::math) */
-void SvXMLUnitConverter::convertDouble( ::rtl::OUStringBuffer& rBuffer,
- double fNumber, BOOL bWriteUnits, MapUnit eCoreUnit, MapUnit eDstUnit)
-{
- if(MAP_RELATIVE == eCoreUnit)
- {
- DBG_ASSERT(eDstUnit == MAP_RELATIVE, "MAP_RELATIVE only maps to MAP_RELATIVE!" );
- ::rtl::math::doubleToUStringBuffer( rBuffer, fNumber, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, '.', sal_True);
- if(bWriteUnits)
- rBuffer.append(sal_Unicode('%'));
- }
- else
- {
- OUStringBuffer sUnit;
- double fFactor = SvXMLExportHelper::GetConversionFactor(sUnit, eCoreUnit, eDstUnit);
- if(fFactor != 1.0)
- fNumber *= fFactor;
- ::rtl::math::doubleToUStringBuffer( rBuffer, fNumber, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, '.', sal_True);
- if(bWriteUnits)
- rBuffer.append(sUnit);
- }
-}
-
-/** convert double number to string (using ::rtl::math) */
-void SvXMLUnitConverter::convertDouble( ::rtl::OUStringBuffer& rBuffer, double fNumber)
-{
- ::rtl::math::doubleToUStringBuffer( rBuffer, fNumber, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, '.', sal_True);
-}
-
-/** convert string to double number (using ::rtl::math) */
-sal_Bool SvXMLUnitConverter::convertDouble(double& rValue,
- const ::rtl::OUString& rString, BOOL bLookForUnits) const
-{
- if(bLookForUnits)
- {
- MapUnit eSrcUnit = SvXMLExportHelper::GetUnitFromString(rString, meCoreMeasureUnit);
-
- return SvXMLUnitConverter::convertDouble(rValue, rString,
- eSrcUnit, meCoreMeasureUnit);
- }
- else
- {
- return SvXMLUnitConverter::convertDouble(rValue, rString);
- }
-}
-
-/** convert string to double number (using ::rtl::math) */
-sal_Bool SvXMLUnitConverter::convertDouble(double& rValue,
- const ::rtl::OUString& rString, MapUnit eSrcUnit, MapUnit eCoreUnit)
-{
- rtl_math_ConversionStatus eStatus;
- rValue = ::rtl::math::stringToDouble( rString, (sal_Unicode)('.'), (sal_Unicode)(','), &eStatus, NULL );
-
- if(eStatus == rtl_math_ConversionStatus_Ok)
- {
- OUStringBuffer sUnit;
- double fFactor = SvXMLExportHelper::GetConversionFactor(sUnit, eCoreUnit, eSrcUnit);
- if(fFactor != 1.0 && fFactor != 0.0)
- rValue /= fFactor;
- }
-
- return ( eStatus == rtl_math_ConversionStatus_Ok );
-}
-
-/** convert string to double number (using ::rtl::math) */
-sal_Bool SvXMLUnitConverter::convertDouble(double& rValue, const ::rtl::OUString& rString)
-{
- rtl_math_ConversionStatus eStatus;
- rValue = ::rtl::math::stringToDouble( rString, (sal_Unicode)('.'), (sal_Unicode)(','), &eStatus, NULL );
- return ( eStatus == rtl_math_ConversionStatus_Ok );
-}
-
-/** get the Null Date of the XModel and set it to the UnitConverter */
-sal_Bool SvXMLUnitConverter::setNullDate(const ::com::sun::star::uno::Reference < ::com::sun::star::frame::XModel>& xModel)
-{
- ::com::sun::star::uno::Reference < ::com::sun::star::util::XNumberFormatsSupplier> xNumberFormatsSupplier (xModel, ::com::sun::star::uno::UNO_QUERY);
- if (xNumberFormatsSupplier.is())
- {
- ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet> xPropertySet = xNumberFormatsSupplier->getNumberFormatSettings();
- if (xPropertySet.is() )
- {
- ::com::sun::star::uno::Any aAnyNullDate = xPropertySet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_NULLDATE)));
- if (aAnyNullDate >>= aNullDate)
- {
- return sal_True;
- }
- }
- }
- return sal_False;
-}
-
-/** convert double to ISO Time String; negative durations allowed */
-void SvXMLUnitConverter::convertTime( ::rtl::OUStringBuffer& rBuffer,
- const double& fTime)
-{
-
- double fValue = fTime;
-
- // take care of negative durations as specified in:
- // XML Schema, W3C Working Draft 07 April 2000, section 3.2.6.1
- if (fValue < 0.0)
- {
- rBuffer.append(sal_Unicode('-'));
- fValue = - fValue;
- }
-
- rBuffer.appendAscii(RTL_CONSTASCII_STRINGPARAM( "PT" ));
- fValue *= 24;
- double fHoursValue = ::rtl::math::approxFloor (fValue);
- fValue -= fHoursValue;
- fValue *= 60;
- double fMinsValue = ::rtl::math::approxFloor (fValue);
- fValue -= fMinsValue;
- fValue *= 60;
- double fSecsValue = ::rtl::math::approxFloor (fValue);
- fValue -= fSecsValue;
- double f100SecsValue;
- if (fValue > 0.00001)
- f100SecsValue = ::rtl::math::round( fValue, XML_MAXDIGITSCOUNT_TIME - 5);
- else
- f100SecsValue = 0.0;
-
- if (f100SecsValue == 1.0)
- {
- f100SecsValue = 0.0;
- fSecsValue += 1.0;
- }
- if (fSecsValue >= 60.0)
- {
- fSecsValue -= 60.0;
- fMinsValue += 1.0;
- }
- if (fMinsValue >= 60.0)
- {
- fMinsValue -= 60.0;
- fHoursValue += 1.0;
- }
-
- if (fHoursValue < 10)
- rBuffer.append( sal_Unicode('0'));
- rBuffer.append( sal_Int32( fHoursValue));
- rBuffer.append( sal_Unicode('H'));
- if (fMinsValue < 10)
- rBuffer.append( sal_Unicode('0'));
- rBuffer.append( sal_Int32( fMinsValue));
- rBuffer.append( sal_Unicode('M'));
- if (fSecsValue < 10)
- rBuffer.append( sal_Unicode('0'));
- rBuffer.append( sal_Int32( fSecsValue));
- if (f100SecsValue > 0.0)
- {
- ::rtl::OUString a100th( ::rtl::math::doubleToUString( fValue,
- rtl_math_StringFormat_F, XML_MAXDIGITSCOUNT_TIME - 5, '.',
- sal_True));
- if ( a100th.getLength() > 2 )
- {
- rBuffer.append( sal_Unicode(','));
- rBuffer.append( a100th.copy( 2 ) ); // strip 0.
- }
- }
- rBuffer.append( sal_Unicode('S'));
-}
-
-/** convert ISO Time String to double; negative durations allowed */
-sal_Bool SvXMLUnitConverter::convertTime( double& fTime,
- const ::rtl::OUString& rString)
-{
- ::rtl::OUString aTrimmed = rString.trim().toAsciiUpperCase();
- const sal_Unicode* pStr = aTrimmed.getStr();
-
- // negative time duration?
- sal_Bool bIsNegativeDuration = sal_False;
- if ( sal_Unicode('-') == (*pStr) )
- {
- bIsNegativeDuration = sal_True;
- pStr++;
- }
-
- if ( *(pStr++) != sal_Unicode('P') ) // duration must start with "P"
- return sal_False;
-
- ::rtl::OUString sDoubleStr;
- sal_Bool bSuccess = sal_True;
- sal_Bool bDone = sal_False;
- sal_Bool bTimePart = sal_False;
- sal_Bool bIsFraction = sal_False;
- sal_Int32 nDays = 0;
- sal_Int32 nHours = 0;
- sal_Int32 nMins = 0;
- sal_Int32 nSecs = 0;
- sal_Int32 nTemp = 0;
-
- while ( bSuccess && !bDone )
- {
- sal_Unicode c = *(pStr++);
- if ( !c ) // end
- bDone = sal_True;
- else if ( sal_Unicode('0') <= c && sal_Unicode('9') >= c )
- {
- if ( nTemp >= SAL_MAX_INT32 / 10 )
- bSuccess = sal_False;
- else
- {
- if ( !bIsFraction )
- {
- nTemp *= 10;
- nTemp += (c - sal_Unicode('0'));
- }
- else
- {
- sDoubleStr += OUString::valueOf(c);
- }
- }
- }
- else if ( bTimePart )
- {
- if ( c == sal_Unicode('H') )
- {
- nHours = nTemp;
- nTemp = 0;
- }
- else if ( c == sal_Unicode('M') )
- {
- nMins = nTemp;
- nTemp = 0;
- }
- else if ( c == sal_Unicode(',') )
- {
- nSecs = nTemp;
- nTemp = 0;
- bIsFraction = sal_True;
- sDoubleStr = OUString(RTL_CONSTASCII_USTRINGPARAM("0."));
- }
- else if ( c == sal_Unicode('S') )
- {
- if ( !bIsFraction )
- {
- nSecs = nTemp;
- nTemp = 0;
- sDoubleStr = OUString(RTL_CONSTASCII_USTRINGPARAM("0.0"));
- }
- }
- else
- bSuccess = sal_False; // invalid character
- }
- else
- {
- if ( c == sal_Unicode('T') ) // "T" starts time part
- bTimePart = sal_True;
- else if ( c == sal_Unicode('D') )
- {
- nDays = nTemp;
- nTemp = 0;
- }
- else if ( c == sal_Unicode('Y') || c == sal_Unicode('M') )
- {
- //! how many days is a year or month?
-
- DBG_ERROR("years or months in duration: not implemented");
- bSuccess = sal_False;
- }
- else
- bSuccess = sal_False; // invalid character
- }
- }
-
- if ( bSuccess )
- {
- if ( nDays )
- nHours += nDays * 24; // add the days to the hours part
- double fTempTime = 0.0;
- double fHour = nHours;
- double fMin = nMins;
- double fSec = nSecs;
- double fSec100 = 0.0;
- double fFraction = sDoubleStr.toDouble();
- fTempTime = fHour / 24;
- fTempTime += fMin / (24 * 60);
- fTempTime += fSec / (24 * 60 * 60);
- fTempTime += fSec100 / (24 * 60 * 60 * 60);
- fTempTime += fFraction / (24 * 60 * 60);
-
- // negative duration?
- if ( bIsNegativeDuration )
- {
- fTempTime = -fTempTime;
- }
-
- fTime = fTempTime;
- }
- return bSuccess;
-}
-
-/** convert util::DateTime to ISO Time String */
-void SvXMLUnitConverter::convertTime( ::rtl::OUStringBuffer& rBuffer,
- const ::com::sun::star::util::DateTime& rDateTime )
-{
- double fHour = rDateTime.Hours;
- double fMin = rDateTime.Minutes;
- double fSec = rDateTime.Seconds;
- double fSec100 = rDateTime.HundredthSeconds;
- double fTempTime = fHour / 24;
- fTempTime += fMin / (24 * 60);
- fTempTime += fSec / (24 * 60 * 60);
- fTempTime += fSec100 / (24 * 60 * 60 * 100);
- convertTime( rBuffer, fTempTime );
-}
-
-/** convert ISO Time String to util::DateTime */
-sal_Bool SvXMLUnitConverter::convertTime( ::com::sun::star::util::DateTime& rDateTime,
- const ::rtl::OUString& rString )
-{
- double fCalculatedTime = 0.0;
- if( convertTime( fCalculatedTime, rString ) )
- {
- // #101357# declare as volatile to prevent optimization
- // (gcc 3.0.1 Linux)
- volatile double fTempTime = fCalculatedTime;
- fTempTime *= 24;
- double fHoursValue = ::rtl::math::approxFloor (fTempTime);
- fTempTime -= fHoursValue;
- fTempTime *= 60;
- double fMinsValue = ::rtl::math::approxFloor (fTempTime);
- fTempTime -= fMinsValue;
- fTempTime *= 60;
- double fSecsValue = ::rtl::math::approxFloor (fTempTime);
- fTempTime -= fSecsValue;
- double f100SecsValue = 0.0;
-
- if( fTempTime > 0.00001 )
- f100SecsValue = fTempTime;
-
- rDateTime.Year = 0;
- rDateTime.Month = 0;
- rDateTime.Day = 0;
- rDateTime.Hours = static_cast < sal_uInt16 > ( fHoursValue );
- rDateTime.Minutes = static_cast < sal_uInt16 > ( fMinsValue );
- rDateTime.Seconds = static_cast < sal_uInt16 > ( fSecsValue );
- rDateTime.HundredthSeconds = static_cast < sal_uInt16 > ( f100SecsValue * 100.0 );
-
- return sal_True;
- }
- return sal_False;
-}
-
-/** convert double to ISO Date Time String */
-void SvXMLUnitConverter::convertDateTime( ::rtl::OUStringBuffer& rBuffer,
- const double& fDateTime, const ::com::sun::star::util::Date& aTempNullDate)
-{
- double fValue = fDateTime;
- sal_Int32 nValue = static_cast <sal_Int32> (::rtl::math::approxFloor (fValue));
- Date aDate (aTempNullDate.Day, aTempNullDate.Month, aTempNullDate.Year);
- aDate += nValue;
- fValue -= nValue;
- double fCount;
- if (nValue > 0)
- fCount = ::rtl::math::approxFloor (log10((double) nValue)) + 1;
- else if (nValue < 0)
- fCount = ::rtl::math::approxFloor (log10((double)(nValue * -1))) + 1;
- else
- fCount = 0.0;
- sal_Int16 nCount = sal_Int16(fCount);
- sal_Bool bHasTime(sal_False);
- double fHoursValue;
- double fMinsValue;
- double fSecsValue;
- double f100SecsValue;
- if (fValue > 0.0)
- {
- bHasTime = sal_True;
- fValue *= 24;
- fHoursValue = ::rtl::math::approxFloor (fValue);
- fValue -= fHoursValue;
- fValue *= 60;
- fMinsValue = ::rtl::math::approxFloor (fValue);
- fValue -= fMinsValue;
- fValue *= 60;
- fSecsValue = ::rtl::math::approxFloor (fValue);
- fValue -= fSecsValue;
- if (fValue > 0.0)
- f100SecsValue = ::rtl::math::round( fValue, XML_MAXDIGITSCOUNT_TIME - nCount);
- else
- f100SecsValue = 0.0;
-
- if (f100SecsValue == 1.0)
- {
- f100SecsValue = 0.0;
- fSecsValue += 1.0;
- }
- if (fSecsValue >= 60.0)
- {
- fSecsValue -= 60.0;
- fMinsValue += 1.0;
- }
- if (fMinsValue >= 60.0)
- {
- fMinsValue -= 60.0;
- fHoursValue += 1.0;
- }
- if (fHoursValue >= 24.0)
- {
- fHoursValue -= 24.0;
- aDate += 1;
- }
- }
- rBuffer.append( sal_Int32( aDate.GetYear()));
- rBuffer.append( sal_Unicode('-'));
- USHORT nTemp = aDate.GetMonth();
- if (nTemp < 10)
- rBuffer.append( sal_Unicode('0'));
- rBuffer.append( sal_Int32( nTemp));
- rBuffer.append( sal_Unicode('-'));
- nTemp = aDate.GetDay();
- if (nTemp < 10)
- rBuffer.append( sal_Unicode('0'));
- rBuffer.append( sal_Int32( nTemp));
- if(bHasTime)
- {
- rBuffer.append( sal_Unicode('T'));
- if (fHoursValue < 10)
- rBuffer.append( sal_Unicode('0'));
- rBuffer.append( sal_Int32( fHoursValue));
- rBuffer.append( sal_Unicode(':'));
- if (fMinsValue < 10)
- rBuffer.append( sal_Unicode('0'));
- rBuffer.append( sal_Int32( fMinsValue));
- rBuffer.append( sal_Unicode(':'));
- if (fSecsValue < 10)
- rBuffer.append( sal_Unicode('0'));
- rBuffer.append( sal_Int32( fSecsValue));
- if (f100SecsValue > 0.0)
- {
- ::rtl::OUString a100th( ::rtl::math::doubleToUString( fValue,
- rtl_math_StringFormat_F,
- XML_MAXDIGITSCOUNT_TIME - nCount, '.', sal_True));
- if ( a100th.getLength() > 2 )
- {
- rBuffer.append( sal_Unicode(','));
- rBuffer.append( a100th.copy( 2 ) ); // strip 0.
- }
- }
- }
-}
-
-/** convert ISO Date Time String to double */
-sal_Bool SvXMLUnitConverter::convertDateTime( double& fDateTime,
- const ::rtl::OUString& rString, const ::com::sun::star::util::Date& aTempNullDate)
-{
- sal_Bool bSuccess = sal_True;
-
- ::rtl::OUString aDateStr, aTimeStr, sDoubleStr;
- sal_Int32 nPos = rString.indexOf( (sal_Unicode) 'T' );
- sal_Int32 nPos2 = rString.indexOf( (sal_Unicode) ',' );
- if ( nPos >= 0 )
- {
- aDateStr = rString.copy( 0, nPos );
- if ( nPos2 >= 0 )
- {
- aTimeStr = rString.copy( nPos + 1, nPos2 - nPos - 1 );
- sDoubleStr = OUString(RTL_CONSTASCII_USTRINGPARAM("0."));
- sDoubleStr += rString.copy( nPos2 + 1 );
- }
- else
- {
- aTimeStr = rString.copy(nPos + 1);
- sDoubleStr = OUString(RTL_CONSTASCII_USTRINGPARAM("0.0"));
- }
- }
- else
- aDateStr = rString; // no separator: only date part
-
- sal_Int32 nYear = 1899;
- sal_Int32 nMonth = 12;
- sal_Int32 nDay = 30;
- sal_Int32 nHour = 0;
- sal_Int32 nMin = 0;
- sal_Int32 nSec = 0;
-
- const sal_Unicode* pStr = aDateStr.getStr();
- sal_Int32 nDateTokens = 1;
- while ( *pStr )
- {
- if ( *pStr == '-' )
- nDateTokens++;
- pStr++;
- }
- if ( nDateTokens > 3 || aDateStr.getLength() == 0 )
- bSuccess = sal_False;
- else
- {
- sal_Int32 n = 0;
- if ( !convertNumber( nYear, aDateStr.getToken( 0, '-', n ), 0, 9999 ) )
- bSuccess = sal_False;
- if ( nDateTokens >= 2 )
- if ( !convertNumber( nMonth, aDateStr.getToken( 0, '-', n ), 0, 12 ) )
- bSuccess = sal_False;
- if ( nDateTokens >= 3 )
- if ( !convertNumber( nDay, aDateStr.getToken( 0, '-', n ), 0, 31 ) )
- bSuccess = sal_False;
- }
-
- if ( aTimeStr.getLength() > 0 ) // time is optional
- {
- pStr = aTimeStr.getStr();
- sal_Int32 nTimeTokens = 1;
- while ( *pStr )
- {
- if ( *pStr == ':' )
- nTimeTokens++;
- pStr++;
- }
- if ( nTimeTokens > 3 )
- bSuccess = sal_False;
- else
- {
- sal_Int32 n = 0;
- if ( !convertNumber( nHour, aTimeStr.getToken( 0, ':', n ), 0, 23 ) )
- bSuccess = sal_False;
- if ( nTimeTokens >= 2 )
- if ( !convertNumber( nMin, aTimeStr.getToken( 0, ':', n ), 0, 59 ) )
- bSuccess = sal_False;
- if ( nTimeTokens >= 3 )
- if ( !convertNumber( nSec, aTimeStr.getToken( 0, ':', n ), 0, 59 ) )
- bSuccess = sal_False;
- }
- }
-
- if (bSuccess)
- {
- double fTempDateTime = 0.0;
- Date aTmpNullDate(aTempNullDate.Day, aTempNullDate.Month, aTempNullDate.Year);
- Date aTempDate((sal_uInt16)nDay, (sal_uInt16)nMonth, (sal_uInt16)nYear);
- sal_Int32 nTage = aTempDate - aTmpNullDate;
- fTempDateTime = nTage;
- double Hour = nHour;
- double Min = nMin;
- double Sec = nSec;
- double Sec100 = 0.0;
- double fFraction = sDoubleStr.toDouble();
- fTempDateTime += Hour / 24;
- fTempDateTime += Min / (24 * 60);
- fTempDateTime += Sec / (24 * 60 * 60);
- fTempDateTime += Sec100 / (24 * 60 * 60 * 60);
- fTempDateTime += fFraction / (24 * 60 * 60);
- fDateTime = fTempDateTime;
- }
- return bSuccess;
-}
-
-/** convert util::DateTime to ISO Date String */
-void SvXMLUnitConverter::convertDateTime( ::rtl::OUStringBuffer& rBuffer,
- const ::com::sun::star::util::DateTime& rDateTime )
-{
- String aString( String::CreateFromInt32( rDateTime.Year ) );
- aString += '-';
- if( rDateTime.Month < 10 )
- aString += '0';
- aString += String::CreateFromInt32( rDateTime.Month );
- aString += '-';
- if( rDateTime.Day < 10 )
- aString += '0';
- aString += String::CreateFromInt32( rDateTime.Day );
-
- if( rDateTime.Seconds != 0 ||
- rDateTime.Minutes != 0 ||
- rDateTime.Hours != 0 )
- {
- aString += 'T';
- if( rDateTime.Hours < 10 )
- aString += '0';
- aString += String::CreateFromInt32( rDateTime.Hours );
- aString += ':';
- if( rDateTime.Minutes < 10 )
- aString += '0';
- aString += String::CreateFromInt32( rDateTime.Minutes );
- aString += ':';
- if( rDateTime.Seconds < 10 )
- aString += '0';
- aString += String::CreateFromInt32( rDateTime.Seconds );
- if ( rDateTime.HundredthSeconds > 0)
- {
- aString += ',';
- if (rDateTime.HundredthSeconds < 10)
- aString += '0';
- aString += String::CreateFromInt32( rDateTime.HundredthSeconds );
- }
- }
-
- rBuffer.append( aString );
-}
-
-/** convert ISO Date String to util::DateTime */
-sal_Bool SvXMLUnitConverter::convertDateTime( ::com::sun::star::util::DateTime& rDateTime,
- const ::rtl::OUString& rString )
-{
- sal_Bool bSuccess = sal_True;
-
- ::rtl::OUString aDateStr, aTimeStr, sDoubleStr;
- sal_Int32 nPos = rString.indexOf( (sal_Unicode) 'T' );
- sal_Int32 nPos2 = rString.indexOf( (sal_Unicode) ',' );
- if ( nPos >= 0 )
- {
- aDateStr = rString.copy( 0, nPos );
- if ( nPos2 >= 0 )
- {
- aTimeStr = rString.copy( nPos + 1, nPos2 - nPos - 1 );
- sDoubleStr = OUString(RTL_CONSTASCII_USTRINGPARAM("0."));
- sDoubleStr += rString.copy( nPos2 + 1 );
- }
- else
- {
- aTimeStr = rString.copy(nPos + 1);
- sDoubleStr = OUString(RTL_CONSTASCII_USTRINGPARAM("0.0"));
- }
- }
- else
- aDateStr = rString; // no separator: only date part
-
- sal_Int32 nYear = 1899;
- sal_Int32 nMonth = 12;
- sal_Int32 nDay = 30;
- sal_Int32 nHour = 0;
- sal_Int32 nMin = 0;
- sal_Int32 nSec = 0;
-
- const sal_Unicode* pStr = aDateStr.getStr();
- sal_Int32 nDateTokens = 1;
- while ( *pStr )
- {
- if ( *pStr == '-' )
- nDateTokens++;
- pStr++;
- }
- if ( nDateTokens > 3 || aDateStr.getLength() == 0 )
- bSuccess = sal_False;
- else
- {
- sal_Int32 n = 0;
- if ( !convertNumber( nYear, aDateStr.getToken( 0, '-', n ), 0, 9999 ) )
- bSuccess = sal_False;
- if ( nDateTokens >= 2 )
- if ( !convertNumber( nMonth, aDateStr.getToken( 0, '-', n ), 0, 12 ) )
- bSuccess = sal_False;
- if ( nDateTokens >= 3 )
- if ( !convertNumber( nDay, aDateStr.getToken( 0, '-', n ), 0, 31 ) )
- bSuccess = sal_False;
- }
-
- if ( aTimeStr.getLength() > 0 ) // time is optional
- {
- pStr = aTimeStr.getStr();
- sal_Int32 nTimeTokens = 1;
- while ( *pStr )
- {
- if ( *pStr == ':' )
- nTimeTokens++;
- pStr++;
- }
- if ( nTimeTokens > 3 )
- bSuccess = sal_False;
- else
- {
- sal_Int32 n = 0;
- if ( !convertNumber( nHour, aTimeStr.getToken( 0, ':', n ), 0, 23 ) )
- bSuccess = sal_False;
- if ( nTimeTokens >= 2 )
- if ( !convertNumber( nMin, aTimeStr.getToken( 0, ':', n ), 0, 59 ) )
- bSuccess = sal_False;
- if ( nTimeTokens >= 3 )
- if ( !convertNumber( nSec, aTimeStr.getToken( 0, ':', n ), 0, 59 ) )
- bSuccess = sal_False;
- }
- }
-
- if (bSuccess)
- {
- rDateTime.Year = (sal_uInt16)nYear;
- rDateTime.Month = (sal_uInt16)nMonth;
- rDateTime.Day = (sal_uInt16)nDay;
- rDateTime.Hours = (sal_uInt16)nHour;
- rDateTime.Minutes = (sal_uInt16)nMin;
- rDateTime.Seconds = (sal_uInt16)nSec;
- rDateTime.HundredthSeconds = sDoubleStr.toDouble() * 100;
- }
- return bSuccess;
-}
-
-/** gets the position of the first comma after npos in the string
- rStr. Commas inside '"' pairs are not matched */
-sal_Int32 SvXMLUnitConverter::indexOfComma( const OUString& rStr,
- sal_Int32 nPos )
-{
- sal_Unicode cQuote = 0;
- sal_Int32 nLen = rStr.getLength();
- for( ; nPos < nLen; nPos++ )
- {
- sal_Unicode c = rStr[nPos];
- switch( c )
- {
- case sal_Unicode('\''):
- if( 0 == cQuote )
- cQuote = c;
- else if( '\'' == cQuote )
- cQuote = 0;
- break;
-
- case sal_Unicode('"'):
- if( 0 == cQuote )
- cQuote = c;
- else if( '\"' == cQuote )
- cQuote = 0;
- break;
-
- case sal_Unicode(','):
- if( 0 == cQuote )
- return nPos;
- break;
- }
- }
-
- return -1;
-}
-
-// ---
-
-SvXMLTokenEnumerator::SvXMLTokenEnumerator( const OUString& rString, sal_Unicode cSeperator /* = sal_Unicode(' ') */ )
-: maTokenString( rString ), mnNextTokenPos(0), mcSeperator( cSeperator )
-{
-}
-
-sal_Bool SvXMLTokenEnumerator::getNextToken( OUString& rToken )
-{
- if( -1 == mnNextTokenPos )
- return sal_False;
-
- int nTokenEndPos = maTokenString.indexOf( mcSeperator, mnNextTokenPos );
- if( nTokenEndPos != -1 )
- {
- rToken = maTokenString.copy( mnNextTokenPos,
- nTokenEndPos - mnNextTokenPos );
- mnNextTokenPos = nTokenEndPos + 1;
-
- // if the mnNextTokenPos is at the end of the string, we have
- // to deliver an empty token
- if( mnNextTokenPos > maTokenString.getLength() )
- mnNextTokenPos = -1;
- }
- else
- {
- rToken = maTokenString.copy( mnNextTokenPos );
- mnNextTokenPos = -1;
- }
-
- return sal_True;
-}
-
-// ---
-
-/** convert string to vector3D */
-sal_Bool SvXMLUnitConverter::convertVector3D( Vector3D& rVector,
- const OUString& rValue )
-{
- if(!rValue.getLength() || rValue[0] != '(')
- return sal_False;
-
- sal_Int32 nPos(1L);
- sal_Int32 nFound = rValue.indexOf(sal_Unicode(' '), nPos);
-
- if(nFound == -1 || nFound <= nPos)
- return sal_False;
-
- OUString aContentX = rValue.copy(nPos, nFound - nPos);
-
- nPos = nFound + 1;
- nFound = rValue.indexOf(sal_Unicode(' '), nPos);
-
- if(nFound == -1 || nFound <= nPos)
- return sal_False;
-
- OUString aContentY = rValue.copy(nPos, nFound - nPos);
-
- nPos = nFound + 1;
- nFound = rValue.indexOf(sal_Unicode(')'), nPos);
-
- if(nFound == -1 || nFound <= nPos)
- return sal_False;
-
- OUString aContentZ = rValue.copy(nPos, nFound - nPos);
-
- rtl_math_ConversionStatus eStatus;
-
- rVector.X() = ::rtl::math::stringToDouble(aContentX, sal_Unicode('.'),
- sal_Unicode(','), &eStatus, NULL);
-
- if( eStatus != rtl_math_ConversionStatus_Ok )
- return sal_False;
-
- rVector.Y() = ::rtl::math::stringToDouble(aContentY, sal_Unicode('.'),
- sal_Unicode(','), &eStatus, NULL);
-
- if( eStatus != rtl_math_ConversionStatus_Ok )
- return sal_False;
-
- rVector.Z() = ::rtl::math::stringToDouble(aContentZ, sal_Unicode('.'),
- sal_Unicode(','), &eStatus, NULL);
-
-
- return ( eStatus != rtl_math_ConversionStatus_Ok );
-}
-
-/** convert vector3D to string */
-void SvXMLUnitConverter::convertVector3D( OUStringBuffer &rBuffer,
- const Vector3D& rVector )
-{
- rBuffer.append(sal_Unicode('('));
- convertDouble(rBuffer, rVector.X());
- rBuffer.append(sal_Unicode(' '));
- convertDouble(rBuffer, rVector.Y());
- rBuffer.append(sal_Unicode(' '));
- convertDouble(rBuffer, rVector.Z());
- rBuffer.append(sal_Unicode(')'));
-}
-
-const
- sal_Char aBase64EncodeTable[] =
- { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
- 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
- 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
- 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
- '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' };
-
-const
- sal_uInt8 aBase64DecodeTable[] =
- { 62,255,255,255, 63, // 43-47
-// + /
-
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,255,255,255, 0,255,255, // 48-63
-// 0 1 2 3 4 5 6 7 8 9 =
-
- 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, // 64-79
-// A B C D E F G H I J K L M N O
-
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,255,255,255,255,255, // 80-95
-// P Q R S T U V W X Y Z
-
- 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, // 96-111
-// a b c d e f g h i j k l m n o
-
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 }; // 112-123
-// p q r s t u v w x y z
-
-
-
-void ThreeByteToFourByte (const sal_Int8* pBuffer, const sal_Int32 nStart, const sal_Int32 nFullLen, ::rtl::OUStringBuffer& sBuffer)
-{
- sal_Int32 nLen(nFullLen - nStart);
- if (nLen > 3)
- nLen = 3;
- if (nLen == 0)
- {
- sBuffer.setLength(0);
- return;
- }
-
- sal_Int32 nBinaer;
- switch (nLen)
- {
- case 1:
- {
- nBinaer = ((sal_uInt8)pBuffer[nStart + 0]) << 16;
- }
- break;
- case 2:
- {
- nBinaer = (((sal_uInt8)pBuffer[nStart + 0]) << 16) +
- (((sal_uInt8)pBuffer[nStart + 1]) << 8);
- }
- break;
- default:
- {
- nBinaer = (((sal_uInt8)pBuffer[nStart + 0]) << 16) +
- (((sal_uInt8)pBuffer[nStart + 1]) << 8) +
- ((sal_uInt8)pBuffer[nStart + 2]);
- }
- break;
- }
-
- sBuffer.appendAscii("====");
-
- sal_uInt8 nIndex ((nBinaer & 0xFC0000) >> 18);
- sBuffer.setCharAt(0, aBase64EncodeTable [nIndex]);
-
- nIndex = (nBinaer & 0x3F000) >> 12;
- sBuffer.setCharAt(1, aBase64EncodeTable [nIndex]);
- if (nLen == 1)
- return;
-
- nIndex = (nBinaer & 0xFC0) >> 6;
- sBuffer.setCharAt(2, aBase64EncodeTable [nIndex]);
- if (nLen == 2)
- return;
-
- nIndex = (nBinaer & 0x3F);
- sBuffer.setCharAt(3, aBase64EncodeTable [nIndex]);
-}
-
-void SvXMLUnitConverter::encodeBase64( ::rtl::OUStringBuffer& aStrBuffer, const uno::Sequence<sal_Int8>& aPass)
-{
- sal_Int32 i(0);
- sal_Int32 nBufferLength(aPass.getLength());
- const sal_Int8* pBuffer = aPass.getConstArray();
- while (i < nBufferLength)
- {
- ::rtl::OUStringBuffer sBuffer;
- ThreeByteToFourByte (pBuffer, i, nBufferLength, sBuffer);
- aStrBuffer.append(sBuffer);
- i += 3;
- }
-}
-
-void SvXMLUnitConverter::decodeBase64(uno::Sequence<sal_Int8>& aBuffer, const ::rtl::OUString& sBuffer)
-{
- sal_Int32 nCharsDecoded = decodeBase64SomeChars( aBuffer, sBuffer );
- OSL_ENSURE( nCharsDecoded == sBuffer.getLength(),
- "some bytes left in base64 decoding!" );
-}
-
-sal_Int32 SvXMLUnitConverter::decodeBase64SomeChars(
- uno::Sequence<sal_Int8>& rOutBuffer,
- const ::rtl::OUString& rInBuffer)
-{
- sal_Int32 nInBufferLen = rInBuffer.getLength();
- sal_Int32 nMinOutBufferLen = (nInBufferLen / 4) * 3;
- if( rOutBuffer.getLength() < nMinOutBufferLen )
- rOutBuffer.realloc( nMinOutBufferLen );
-
- const sal_Unicode *pInBuffer = rInBuffer.getStr();
- sal_Int8 *pOutBuffer = rOutBuffer.getArray();
- sal_Int8 *pOutBufferStart = pOutBuffer;
- sal_Int32 nCharsDecoded = 0;
-
- sal_uInt8 aDecodeBuffer[4];
- sal_Int32 nBytesToDecode = 0;
- sal_Int32 nBytesGotFromDecoding = 3;
- sal_Int32 nInBufferPos= 0;
- while( nInBufferPos < nInBufferLen )
- {
- sal_Unicode cChar = *pInBuffer;
- if( cChar >= '+' && cChar <= 'z' )
- {
- sal_uInt8 nByte = aBase64DecodeTable[cChar-'+'];
- if( nByte != 255 )
- {
- // We have found a valid character!
- aDecodeBuffer[nBytesToDecode++] = nByte;
-
- // One '=' character at the end means 2 out bytes
- // Two '=' characters at the end mean 1 out bytes
- if( '=' == cChar && nBytesToDecode > 2 )
- nBytesGotFromDecoding--;
- if( 4 == nBytesToDecode )
- {
- // Four characters found, so we may convert now!
- sal_uInt32 nOut = (aDecodeBuffer[0] << 18) +
- (aDecodeBuffer[1] << 12) +
- (aDecodeBuffer[2] << 6) +
- aDecodeBuffer[3];
-
- *pOutBuffer++ = (sal_Int8)((nOut & 0xff0000) >> 16);
- if( nBytesGotFromDecoding > 1 )
- *pOutBuffer++ = (sal_Int8)((nOut & 0xff00) >> 8);
- if( nBytesGotFromDecoding > 2 )
- *pOutBuffer++ = (sal_Int8)(nOut & 0xff);
- nCharsDecoded = nInBufferPos + 1;
- nBytesToDecode = 0;
- nBytesGotFromDecoding = 3;
- }
- }
- else
- {
- nCharsDecoded++;
- }
- }
- else
- {
- nCharsDecoded++;
- }
-
- nInBufferPos++;
- pInBuffer++;
- }
- if( (pOutBuffer - pOutBufferStart) != rOutBuffer.getLength() )
- rOutBuffer.realloc( pOutBuffer - pOutBufferStart );
-
- return nCharsDecoded;
-}
-
-sal_Bool SvXMLUnitConverter::convertNumFormat(
- sal_Int16& rType,
- const OUString& rNumFmt,
- const OUString& rNumLetterSync,
- sal_Bool bNumberNone ) const
-{
- sal_Bool bRet = sal_True;
- sal_Bool bExt = sal_False;
-
- sal_Int32 nLen = rNumFmt.getLength();
- if( 0 == nLen )
- {
- if( bNumberNone )
- rType = NumberingType::NUMBER_NONE;
- else
- bRet = sal_False;
- }
- else if( 1 == nLen )
- {
- switch( rNumFmt[0] )
- {
- case sal_Unicode('1'): rType = NumberingType::ARABIC; break;
- case sal_Unicode('a'): rType = NumberingType::CHARS_LOWER_LETTER; break;
- case sal_Unicode('A'): rType = NumberingType::CHARS_UPPER_LETTER; break;
- case sal_Unicode('i'): rType = NumberingType::ROMAN_LOWER; break;
- case sal_Unicode('I'): rType = NumberingType::ROMAN_UPPER; break;
- default: bExt = sal_True; break;
- }
- if( !bExt && IsXMLToken( rNumLetterSync, XML_TRUE ) )
- {
- switch( rType )
- {
- case NumberingType::CHARS_LOWER_LETTER:
- rType = NumberingType::CHARS_LOWER_LETTER_N;
- break;
- case NumberingType::CHARS_UPPER_LETTER:
- rType = NumberingType::CHARS_UPPER_LETTER_N;
- break;
- }
- }
- }
- else
- {
- bExt = sal_True;
- }
- if( bExt )
- {
- Reference < XNumberingTypeInfo > xInfo = getNumTypeInfo();
- if( xInfo.is() && xInfo->hasNumberingType( rNumFmt ) )
- {
- rType = xInfo->getNumberingType( rNumFmt );
- }
- else
- {
- rType = NumberingType::ARABIC;
- }
- }
-
- return bRet;
-}
-
-void SvXMLUnitConverter::convertNumFormat( OUStringBuffer& rBuffer,
- sal_Int16 nType ) const
-{
- enum XMLTokenEnum eFormat = XML_TOKEN_INVALID;
- sal_Bool bExt = sal_False;
- switch( nType )
- {
- case NumberingType::CHARS_UPPER_LETTER: eFormat = XML_A_UPCASE; break;
- case NumberingType::CHARS_LOWER_LETTER: eFormat = XML_A; break;
- case NumberingType::ROMAN_UPPER: eFormat = XML_I_UPCASE; break;
- case NumberingType::ROMAN_LOWER: eFormat = XML_I; break;
- case NumberingType::ARABIC: eFormat = XML_1; break;
- case NumberingType::CHARS_UPPER_LETTER_N: eFormat = XML_A_UPCASE; break;
- case NumberingType::CHARS_LOWER_LETTER_N: eFormat = XML_A; break;
- case NumberingType::NUMBER_NONE: eFormat = XML__EMPTY; break;
-
- case NumberingType::CHAR_SPECIAL:
- case NumberingType::PAGE_DESCRIPTOR:
- case NumberingType::BITMAP:
- DBG_ASSERT( eFormat != XML_TOKEN_INVALID, "invalid number format" );
- break;
- default:
- bExt = sal_True;
- break;
- }
-
- if( eFormat != XML_TOKEN_INVALID )
- {
- rBuffer.append( GetXMLToken(eFormat) );
- }
- else
- {
- Reference < XNumberingTypeInfo > xInfo = getNumTypeInfo();
- if( xInfo.is() )
- rBuffer.append( xInfo->getNumberingIdentifier( nType ) );
- }
-}
-
-void SvXMLUnitConverter::convertNumLetterSync( OUStringBuffer& rBuffer,
- sal_Int16 nType ) const
-{
- enum XMLTokenEnum eSync = XML_TOKEN_INVALID;
- switch( nType )
- {
- case NumberingType::CHARS_UPPER_LETTER:
- case NumberingType::CHARS_LOWER_LETTER:
- case NumberingType::ROMAN_UPPER:
- case NumberingType::ROMAN_LOWER:
- case NumberingType::ARABIC:
- case NumberingType::NUMBER_NONE:
- // default
- // eSync = XML_FALSE;
- break;
-
- case NumberingType::CHARS_UPPER_LETTER_N:
- case NumberingType::CHARS_LOWER_LETTER_N:
- eSync = XML_TRUE;
- break;
-
- case NumberingType::CHAR_SPECIAL:
- case NumberingType::PAGE_DESCRIPTOR:
- case NumberingType::BITMAP:
- DBG_ASSERT( eSync != XML_TOKEN_INVALID, "invalid number format" );
- break;
- }
- if( eSync != XML_TOKEN_INVALID )
- rBuffer.append( GetXMLToken(eSync) );
-}
-
-void SvXMLUnitConverter::convertPropertySet(uno::Sequence<beans::PropertyValue>& rProps,
- const uno::Reference<beans::XPropertySet>& aProperties)
-{
- uno::Reference< beans::XPropertySetInfo > xPropertySetInfo = aProperties->getPropertySetInfo();
- if (xPropertySetInfo.is())
- {
- uno::Sequence< beans::Property > aProps = xPropertySetInfo->getProperties();
- sal_Int32 nCount(aProps.getLength());
- if (nCount)
- {
- rProps.realloc(nCount);
- beans::PropertyValue* pProps = rProps.getArray();
- if (pProps)
- {
- for (sal_Int32 i = 0; i < nCount; i++, pProps++)
- {
- pProps->Name = aProps[i].Name;
- pProps->Value = aProperties->getPropertyValue(aProps[i].Name);
- }
- }
- }
- }
-}
-
-void SvXMLUnitConverter::convertPropertySet(uno::Reference<beans::XPropertySet>& rProperties,
- const uno::Sequence<beans::PropertyValue>& aProps)
-{
- sal_Int32 nCount(aProps.getLength());
- if (nCount)
- {
- uno::Reference< beans::XPropertySetInfo > xPropertySetInfo = rProperties->getPropertySetInfo();
- if (xPropertySetInfo.is())
- {
- for (sal_Int32 i = 0; i < nCount; i++)
- {
- if (xPropertySetInfo->hasPropertyByName(aProps[i].Name))
- rProperties->setPropertyValue(aProps[i].Name, aProps[i].Value);
- }
- }
- }
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/XMLNumberStylesExport.hxx b/binfilter/bf_xmloff/source/draw/XMLNumberStylesExport.hxx
deleted file mode 100644
index 64ab45bd9777..000000000000
--- a/binfilter/bf_xmloff/source/draw/XMLNumberStylesExport.hxx
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_NUMBERSTYLESEXPORT_HXX
-#define _XMLOFF_NUMBERSTYLESEXPORT_HXX
-
-#include <sal/types.h>
-
-#include "rtl/ustring.hxx"
-namespace binfilter {
-
-class SdXMLExport;
-
-const sal_Int16 SdXMLDateFormatCount = 8;
-const sal_Int16 SdXMLTimeFormatCount = 7;
-
-class SdXMLNumberStylesExporter
-{
-public:
- static void exportTimeStyle( SdXMLExport& rExport, sal_Int32 nStyle );
- static void exportDateStyle( SdXMLExport& rExport, sal_Int32 nStyle );
-
- static sal_Int32 getDateStyleCount() { return SdXMLDateFormatCount; }
- static sal_Int32 getTimeStyleCount() { return SdXMLTimeFormatCount; }
-
- static ::rtl::OUString getTimeStyleName(const sal_Int32 nTimeFormat );
- static ::rtl::OUString getDateStyleName(const sal_Int32 nDateFormat );
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_NUMBERSTYLESEXPORT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/eventimp.hxx b/binfilter/bf_xmloff/source/draw/eventimp.hxx
deleted file mode 100644
index c0587b53086a..000000000000
--- a/binfilter/bf_xmloff/source/draw/eventimp.hxx
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_EVENTIMP_HXX
-#define _XMLOFF_EVENTIMP_HXX
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/drawing/XShape.hpp>
-namespace binfilter {
-
-//////////////////////////////////////////////////////////////////////////////
-// office:events inside a shape
-
-class SdXMLEventsContext : public SvXMLImportContext
-{
-private:
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxShape;
-
-public:
- TYPEINFO();
-
- SdXMLEventsContext( SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape );
- virtual ~SdXMLEventsContext();
-
- virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_EVENTIMP_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/layerexp.hxx b/binfilter/bf_xmloff/source/draw/layerexp.hxx
deleted file mode 100644
index 7e6193089336..000000000000
--- a/binfilter/bf_xmloff/source/draw/layerexp.hxx
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-namespace binfilter {
-
-#ifndef _XMLOFF_LAYEREXP_HXX
-#define _XMLOFF_LAYEREXP_HXX
-
-class SvXMLExport;
-
-class SdXMLayerExporter
-{
-public:
- static void exportLayer( SvXMLExport& rExport );
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_ANIMEXP_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/layerimp.hxx b/binfilter/bf_xmloff/source/draw/layerimp.hxx
deleted file mode 100644
index a431e9a08354..000000000000
--- a/binfilter/bf_xmloff/source/draw/layerimp.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_LAYERIMP_HXX
-#define _XMLOFF_LAYERIMP_HXX
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/container/XNameAccess.hpp>
-namespace binfilter {
-
-class AnimImpImpl;
-
-//////////////////////////////////////////////////////////////////////////////
-// presentations:animations
-
-class SdXMLLayerSetContext : public SvXMLImportContext
-{
-private:
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > mxLayerManager;
-
-public:
- TYPEINFO();
-
- SdXMLLayerSetContext( SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
- virtual ~SdXMLLayerSetContext();
-
- virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_ANIMIMP_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/makefile.mk b/binfilter/bf_xmloff/source/draw/makefile.mk
deleted file mode 100644
index 02952e60a881..000000000000
--- a/binfilter/bf_xmloff/source/draw/makefile.mk
+++ /dev/null
@@ -1,79 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
-
-PRJ=..$/..$/..
-PRJNAME=binfilter
-TARGET=xmloff_draw
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-INC+= -I$(PRJ)$/inc$/bf_xmloff
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/xmloff_XMLNumberStyles.obj\
- $(SLO)$/xmloff_XMLGraphicsDefaultStyle.obj\
- $(SLO)$/xmloff_viewcontext.obj\
- $(SLO)$/xmloff_eventimp.obj\
- $(SLO)$/xmloff_layerexp.obj\
- $(SLO)$/xmloff_layerimp.obj\
- $(SLO)$/xmloff_ximpshow.obj\
- $(SLO)$/xmloff_animimp.obj\
- $(SLO)$/xmloff_animexp.obj\
- $(SLO)$/xmloff_numithdl.obj\
- $(SLO)$/xmloff_sdxmlimp.obj \
- $(SLO)$/xmloff_sdxmlexp.obj \
- $(SLO)$/xmloff_ximpstyl.obj \
- $(SLO)$/xmloff_ximpbody.obj \
- $(SLO)$/xmloff_ximpshap.obj \
- $(SLO)$/xmloff_ximpgrp.obj \
- $(SLO)$/xmloff_ximp3dscene.obj \
- $(SLO)$/xmloff_ximp3dobject.obj \
- $(SLO)$/xmloff_ximpnote.obj \
- $(SLO)$/xmloff_sdpropls.obj \
- $(SLO)$/xmloff_propimp0.obj \
- $(SLO)$/xmloff_xexptran.obj \
- $(SLO)$/xmloff_shapeexport.obj \
- $(SLO)$/xmloff_shapeexport2.obj \
- $(SLO)$/xmloff_shapeexport3.obj \
- $(SLO)$/xmloff_shapeimport.obj \
- $(SLO)$/xmloff_XMLImageMapExport.obj \
- $(SLO)$/xmloff_XMLImageMapContext.obj \
- $(SLO)$/xmloff_XMLShapePropertySetContext.obj \
- $(SLO)$/xmloff_XMLShapeStyleContext.obj \
- $(SLO)$/xmloff_ximppage.obj
-
-# --- Targets --------------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/binfilter/bf_xmloff/source/draw/numithdl.hxx b/binfilter/bf_xmloff/source/draw/numithdl.hxx
deleted file mode 100644
index 2f912ae36adc..000000000000
--- a/binfilter/bf_xmloff/source/draw/numithdl.hxx
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_NUMRULE_HXX
-#define _XMLOFF_PROPERTYHANDLER_NUMRULE_HXX
-
-#include <com/sun/star/ucb/XAnyCompare.hpp>
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the list-style
-*/
-class XMLNumRulePropHdl : public XMLPropertyHandler
-{
-private:
- ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XAnyCompare > mxNumRuleCompare;
-public:
- XMLNumRulePropHdl( ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XAnyCompare > xNumRuleCompare );
- virtual ~XMLNumRulePropHdl();
-
- virtual sal_Bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
-
- /// NumRules will be imported/exported as XML-Elements. So the Import/Export-work must be done at another place.
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_NUMRULE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/propimp0.hxx b/binfilter/bf_xmloff/source/draw/propimp0.hxx
deleted file mode 100644
index 14e2ee5af3c5..000000000000
--- a/binfilter/bf_xmloff/source/draw/propimp0.hxx
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _PROPIMP0_HXX
-#define _PROPIMP0_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-//////////////////////////////////////////////////////////////////////////////
-// graphic property Stroke
-
-class XMLDurationPropertyHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLDurationPropertyHdl();
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-class XMLOpacityPropertyHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLOpacityPropertyHdl();
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-class XMLTextAnimationStepPropertyHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLTextAnimationStepPropertyHdl();
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _PROPIMP0_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/sdpropls.hxx b/binfilter/bf_xmloff/source/draw/sdpropls.hxx
deleted file mode 100644
index 79464cc3d63c..000000000000
--- a/binfilter/bf_xmloff/source/draw/sdpropls.hxx
+++ /dev/null
@@ -1,277 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SDPROPLS_HXX
-#define _SDPROPLS_HXX
-
-#include <com/sun/star/frame/XModel.hpp>
-
-#include "xmlnume.hxx"
-
-#include "maptype.hxx"
-
-#include "xmltypes.hxx"
-
-#include "xmlement.hxx"
-
-#include <prhdlfac.hxx>
-
-#include "xmlprmap.hxx"
-
-#include "XMLTextListAutoStylePool.hxx"
-
-#include "xmlexppr.hxx"
-namespace binfilter {
-
-//////////////////////////////////////////////////////////////////////////////
-// entry list for graphic properties
-
-extern const XMLPropertyMapEntry aXMLSDProperties[];
-
-//////////////////////////////////////////////////////////////////////////////
-// entry list for presentation page properties
-
-extern const XMLPropertyMapEntry aXMLSDPresPageProps[];
-
-//////////////////////////////////////////////////////////////////////////////
-// types of own properties
-
-#define XML_SD_TYPE_STROKE (XML_SD_TYPES_START + 0)
-#define XML_SD_TYPE_PRESPAGE_TYPE (XML_SD_TYPES_START + 1)
-#define XML_SD_TYPE_PRESPAGE_STYLE (XML_SD_TYPES_START + 2)
-#define XML_SD_TYPE_PRESPAGE_SPEED (XML_SD_TYPES_START + 3)
-#define XML_SD_TYPE_PRESPAGE_DURATION (XML_SD_TYPES_START + 4)
-#define XML_SD_TYPE_PRESPAGE_VISIBILITY (XML_SD_TYPES_START + 5)
-#define XML_SD_TYPE_MARKER (XML_SD_TYPES_START + 6 )
-#define XML_SD_TYPE_OPACITY (XML_SD_TYPES_START + 7 )
-#define XML_SD_TYPE_LINEJOIN (XML_SD_TYPES_START + 8 )
-#define XML_SD_TYPE_FILLSTYLE (XML_SD_TYPES_START + 9 )
-#define XML_SD_TYPE_GRADIENT (XML_SD_TYPES_START + 10 )
-#define XML_SD_TYPE_GRADIENT_STEPCOUNT (XML_SD_TYPES_START + 11 )
-#define XML_SD_TYPE_SHADOW (XML_SD_TYPES_START + 12 )
-#define XML_SD_TYPE_TEXT_CROSSEDOUT (XML_SD_TYPES_START + 13 )
-#define XML_SD_TYPE_NUMBULLET (XML_SD_TYPES_START + 14 )
-#define XML_SD_TYPE_WRITINGMODE (XML_SD_TYPES_START + 15 )
-#define XML_SD_TYPE_BITMAP_MODE (XML_SD_TYPES_START + 16 )
-#define XML_SD_TYPE_BITMAPREPOFFSETX (XML_SD_TYPES_START + 17 )
-#define XML_SD_TYPE_BITMAPREPOFFSETY (XML_SD_TYPES_START + 18 )
-#define XML_SD_TYPE_FILLBITMAPSIZE (XML_SD_TYPES_START + 19 )
-#define XML_SD_TYPE_LOGICAL_SIZE (XML_SD_TYPES_START + 20 )
-#define XML_SD_TYPE_BITMAP_REFPOINT (XML_SD_TYPES_START + 21 )
-#define XML_SD_TYPE_PRESPAGE_BACKSIZE (XML_SD_TYPES_START + 22 )
-#define XML_TYPE_TEXT_ANIMATION_BLINKING (XML_SD_TYPES_START + 23 )
-#define XML_TYPE_TEXT_ANIMATION_STEPS (XML_SD_TYPES_START + 24 )
-#define XML_SD_TYPE_TEXT_ALIGN (XML_SD_TYPES_START + 25 )
-#define XML_SD_TYPE_VERTICAL_ALIGN (XML_SD_TYPES_START + 26 )
-#define XML_SD_TYPE_FITTOSIZE (XML_SD_TYPES_START + 27 )
-#define XML_SD_TYPE_MEASURE_HALIGN (XML_SD_TYPES_START + 28 )
-#define XML_SD_TYPE_MEASURE_VALIGN (XML_SD_TYPES_START + 29 )
-#define XML_SD_TYPE_MEASURE_UNIT (XML_SD_TYPES_START + 30 )
-#define XML_SD_TYPE_MEASURE_PLACING (XML_SD_TYPES_START + 31 )
-#define XML_SD_TYPE_CONTROL_BORDER (XML_SD_TYPES_START + 32 )
-
-// 3D property types
-#define XML_SD_TYPE_BACKFACE_CULLING (XML_SD_TYPES_START + 40 )
-#define XML_SD_TYPE_NORMALS_KIND (XML_SD_TYPES_START + 41 )
-#define XML_SD_TYPE_NORMALS_DIRECTION (XML_SD_TYPES_START + 42 )
-#define XML_SD_TYPE_TEX_GENERATION_MODE_X (XML_SD_TYPES_START + 43 )
-#define XML_SD_TYPE_TEX_GENERATION_MODE_Y (XML_SD_TYPES_START + 44 )
-#define XML_SD_TYPE_TEX_KIND (XML_SD_TYPES_START + 45 )
-#define XML_SD_TYPE_TEX_MODE (XML_SD_TYPES_START + 46 )
-
-//////////////////////////////////////////////////////////////////////////////
-// #FontWork# types
-#define XML_SD_TYPE_FONTWORK_STYLE (XML_SD_TYPES_START + 47 )
-#define XML_SD_TYPE_FONTWORK_ADJUST (XML_SD_TYPES_START + 48 )
-#define XML_SD_TYPE_FONTWORK_SHADOW (XML_SD_TYPES_START + 49 )
-#define XML_SD_TYPE_FONTWORK_FORM (XML_SD_TYPES_START + 50 )
-
-//////////////////////////////////////////////////////////////////////////////
-// Caption types
-#define XML_SD_TYPE_CAPTION_ANGLE_TYPE (XML_SD_TYPES_START + 60 )
-#define XML_SD_TYPE_CAPTION_IS_ESC_REL (XML_SD_TYPES_START + 61 )
-#define XML_SD_TYPE_CAPTION_ESC_REL (XML_SD_TYPES_START + 62 )
-#define XML_SD_TYPE_CAPTION_ESC_ABS (XML_SD_TYPES_START + 63 )
-#define XML_SD_TYPE_CAPTION_ESC_DIR (XML_SD_TYPES_START + 64 )
-#define XML_SD_TYPE_CAPTION_TYPE (XML_SD_TYPES_START + 65 )
-
-//////////////////////////////////////////////////////////////////////////////
-
-#define CTF_NUMBERINGRULES 1000
-//#define CTF_NUMBERINGRULES_NAME 1001
-#define CTF_WRITINGMODE 1002
-#define CTF_REPEAT_OFFSET_X 1003
-#define CTF_REPEAT_OFFSET_Y 1004
-#define CTF_PAGE_SOUND_URL 1005
-#define CTF_PAGE_VISIBLE 1006
-#define CTF_PAGE_TRANS_TYPE 1007
-#define CTF_PAGE_TRANS_STYLE 1008
-#define CTF_PAGE_TRANS_SPEED 1009
-#define CTF_PAGE_TRANS_DURATION 1010
-#define CTF_PAGE_BACKSIZE 1011
-#define CTF_DASHNAME 1012
-#define CTF_LINESTARTNAME 1013
-#define CTF_LINEENDNAME 1014
-#define CTF_FILLGRADIENTNAME 1015
-#define CTF_FILLHATCHNAME 1016
-#define CTF_FILLBITMAPNAME 1017
-#define CTF_FILLTRANSNAME 1018
-#define CTF_TEXTANIMATION_BLINKING 1019
-#define CTF_TEXTANIMATION_KIND 1020
-
-//////////////////////////////////////////////////////////////////////////////
-// #FontWork#
-#define CTF_FONTWORK_STYLE 1021
-#define CTF_FONTWORK_ADJUST 1022
-#define CTF_FONTWORK_DISTANCE 1023
-#define CTF_FONTWORK_START 1024
-#define CTF_FONTWORK_MIRROR 1025
-#define CTF_FONTWORK_OUTLINE 1026
-#define CTF_FONTWORK_SHADOW 1027
-#define CTF_FONTWORK_SHADOWCOLOR 1028
-#define CTF_FONTWORK_SHADOWOFFSETX 1029
-#define CTF_FONTWORK_SHADOWOFFSETY 1030
-#define CTF_FONTWORK_FORM 1031
-#define CTF_FONTWORK_HIDEFORM 1032
-#define CTF_FONTWORK_SHADOWTRANSPARENCE 1033
-
-//////////////////////////////////////////////////////////////////////////////
-// OLE
-#define CTF_SD_OLE_VIS_AREA_LEFT 1040
-#define CTF_SD_OLE_VIS_AREA_TOP 1041
-#define CTF_SD_OLE_VIS_AREA_WIDTH 1042
-#define CTF_SD_OLE_VIS_AREA_HEIGHT 1043
-#define CTF_SD_OLE_ISINTERNAL 1044
-
-#define CTF_SD_MOVE_PROTECT 1045
-#define CTF_SD_SIZE_PROTECT 1046
-
-//////////////////////////////////////////////////////////////////////////////
-// caption
-#define CTF_CAPTION_ISESCREL 1047
-#define CTF_CAPTION_ESCREL 1048
-#define CTF_CAPTION_ESCABS 1049
-
-//////////////////////////////////////////////////////////////////////////////
-// enum maps for attributes
-
-extern SvXMLEnumMapEntry aXML_ConnectionKind_EnumMap[];
-extern SvXMLEnumMapEntry aXML_CircleKind_EnumMap[];
-
-//////////////////////////////////////////////////////////////////////////////
-// factory for own graphic properties
-
-class XMLSdPropHdlFactory : public XMLPropertyHandlerFactory
-{
-private:
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
-
-public:
- XMLSdPropHdlFactory( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > );
- virtual ~XMLSdPropHdlFactory();
- virtual const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nType ) const;
-};
-
-class XMLShapePropertySetMapper : public XMLPropertySetMapper
-{
-public:
- XMLShapePropertySetMapper(const UniReference< XMLPropertyHandlerFactory >& rFactoryRef);
- ~XMLShapePropertySetMapper();
-};
-
-class XMLShapeExportPropertyMapper : public SvXMLExportPropertyMapper
-{
-private:
- XMLTextListAutoStylePool *mpListAutoPool;
- SvXMLExport& mrExport;
- SvxXMLNumRuleExport maNumRuleExp;
- sal_Bool mbIsInAutoStyles;
-
- const ::rtl::OUString msCDATA;
- const ::rtl::OUString msTrue;
- const ::rtl::OUString msFalse;
-
-protected:
- virtual void ContextFilter(
- ::std::vector< XMLPropertyState >& rProperties,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet > rPropSet ) const;
-public:
- XMLShapeExportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper, XMLTextListAutoStylePool *pListAutoPool, SvXMLExport& rExport );
- virtual ~XMLShapeExportPropertyMapper();
-
- virtual void handleElementItem(
- SvXMLExport& rExport,
- const XMLPropertyState& rProperty,
- sal_uInt16 nFlags,
- const ::std::vector< XMLPropertyState >* pProperties = 0,
- sal_uInt32 nIdx = 0
- ) const;
-
- void SetAutoStyles( sal_Bool bIsInAutoStyles ) { mbIsInAutoStyles = bIsInAutoStyles; }
-
- virtual void handleSpecialItem(
- SvXMLAttributeList& rAttrList,
- const XMLPropertyState& rProperty,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap,
- const ::std::vector< XMLPropertyState > *pProperties = 0,
- sal_uInt32 nIdx = 0 ) const;
-};
-
-class XMLPageExportPropertyMapper : public SvXMLExportPropertyMapper
-{
-private:
- SvXMLExport& mrExport;
-
- const ::rtl::OUString msCDATA;
- const ::rtl::OUString msTrue;
- const ::rtl::OUString msFalse;
-
-protected:
- virtual void ContextFilter(
- ::std::vector< XMLPropertyState >& rProperties,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet > rPropSet ) const;
-public:
- XMLPageExportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper, SvXMLExport& rExport );
- virtual ~XMLPageExportPropertyMapper();
-
- virtual void handleElementItem(
- SvXMLExport& rExport,
- const XMLPropertyState& rProperty,
- sal_uInt16 nFlags,
- const ::std::vector< XMLPropertyState >* pProperties = 0,
- sal_uInt32 nIdx = 0
- ) const;
-};
-
-}//end of namespace binfilter
-#endif // _SDPROPLS_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/sdxmlexp_impl.hxx b/binfilter/bf_xmloff/source/draw/sdxmlexp_impl.hxx
deleted file mode 100644
index f9a8d8064c3f..000000000000
--- a/binfilter/bf_xmloff/source/draw/sdxmlexp_impl.hxx
+++ /dev/null
@@ -1,197 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SDXMLEXP_IMPL_HXX
-#define _SDXMLEXP_IMPL_HXX
-
-#include "xmlexp.hxx"
-
-
-#include <com/sun/star/frame/XModel.hpp>
-
-#include <com/sun/star/task/XStatusIndicator.hpp>
-
-#include <com/sun/star/container/XNameAccess.hpp>
-
-#include <com/sun/star/drawing/XDrawPage.hpp>
-class Rectangle;
-namespace binfilter {
-class SfxPoolItem;
-class SfxItemSet;
-
-//////////////////////////////////////////////////////////////////////////////
-
-class SvXMLUnitConverter;
-class SvXMLExportItemMapper;
-class OUStrings_Impl;
-class OUStringsSort_Impl;
-
-class ImpPresPageDrawStylePropMapper;
-class ImpXMLEXPPageMasterList;
-class ImpXMLEXPPageMasterInfo;
-class ImpXMLDrawPageInfoList;
-class ImpXMLAutoLayoutInfoList;
-class SvXMLAutoStylePoolP;
-class XMLSdPropHdlFactory;
-class ImpXMLShapeStyleInfo;
-class XMLShapeExportPropertyMapper;
-class XMLPageExportPropertyMapper;
-
-//////////////////////////////////////////////////////////////////////////////
-
-enum XmlPlaceholder
-{
- XmlPlaceholderTitle,
- XmlPlaceholderOutline,
- XmlPlaceholderSubtitle,
- XmlPlaceholderText,
- XmlPlaceholderGraphic,
- XmlPlaceholderObject,
- XmlPlaceholderChart,
- XmlPlaceholderOrgchart,
- XmlPlaceholderTable,
- XmlPlaceholderPage,
- XmlPlaceholderNotes,
- XmlPlaceholderHandout,
- XmlPlaceholderVerticalTitle,
- XmlPlaceholderVerticalOutline
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-class SdXMLExport : public SvXMLExport
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > mxDocStyleFamilies;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > mxDocMasterPages;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > mxDocDrawPages;
- sal_Int32 mnDocMasterPageCount;
- sal_Int32 mnDocDrawPageCount;
- sal_uInt32 mnShapeStyleInfoIndex;
- sal_uInt32 mnObjectCount;
-
- // temporary infos
- ImpXMLEXPPageMasterList* mpPageMasterInfoList;
- ImpXMLEXPPageMasterList* mpPageMasterUsageList;
- ImpXMLEXPPageMasterList* mpNotesPageMasterUsageList;
- ImpXMLEXPPageMasterInfo* mpHandoutPageMaster;
- ImpXMLAutoLayoutInfoList* mpAutoLayoutInfoList;
-
- ::com::sun::star::uno::Sequence< ::rtl::OUString > maDrawPagesAutoLayoutNames;
-
- ::std::vector< ::rtl::OUString > maDrawPagesStyleNames;
- ::std::vector< ::rtl::OUString > maMasterPagesStyleNames;
-
- XMLSdPropHdlFactory* mpSdPropHdlFactory;
- XMLShapeExportPropertyMapper* mpPropertySetMapper;
- XMLPageExportPropertyMapper* mpPresPagePropsMapper;
-
- sal_uInt32 mnUsedDateStyles; // this is a bitfield of the used formatings for date fields
- sal_uInt32 mnUsedTimeStyles; // this is a bitfield of the used formatings for time fields
-
- sal_Bool mbIsDraw;
- sal_Bool mbFamilyGraphicUsed;
- sal_Bool mbFamilyPresentationUsed;
-
- const ::rtl::OUString msZIndex;
- const ::rtl::OUString msEmptyPres;
- const ::rtl::OUString msModel;
- const ::rtl::OUString msStartShape;
- const ::rtl::OUString msEndShape;
- const ::rtl::OUString msPageLayoutNames;
-
- virtual void _ExportStyles(BOOL bUsed);
- virtual void _ExportAutoStyles();
- virtual void _ExportMasterStyles();
- virtual void _ExportContent();
- // #82003#
- virtual void _ExportMeta();
-
- ImpXMLEXPPageMasterInfo* ImpGetOrCreatePageMasterInfo( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > xMasterPage );
- void ImpPrepPageMasterInfos();
- void ImpPrepDrawMasterInfos();
- void ImpWritePageMasterInfos();
- void ImpPrepAutoLayoutInfos();
-
- ImpXMLEXPPageMasterInfo* ImpGetPageMasterInfoByName(const ::rtl::OUString& rName);
-
- void ImpPrepDrawPageInfos();
- void ImpPrepMasterPageInfos();
- void ImpWritePresentationStyles();
-
- BOOL ImpPrepAutoLayoutInfo(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xPage, ::rtl::OUString& rName);
- void ImpWriteAutoLayoutInfos();
- void ImpWriteAutoLayoutPlaceholder(XmlPlaceholder ePl, const Rectangle& rRect);
-
- void exportFormsElement( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > xDrawPage );
- void exportPresentationSettings();
-
- // #82003# helper function for recursive object count
- sal_uInt32 ImpRecursiveObjectCount( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > xShapes);
-
-protected:
- virtual void GetViewSettings( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aProps);
- virtual void GetConfigurationSettings( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aProps);
-
-public:
- // #110680#
- SdXMLExport(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- sal_Bool bIsDraw, sal_uInt16 nExportFlags = EXPORT_ALL );
- virtual ~SdXMLExport();
-
- void SetProgress(sal_Int32 nProg);
-
- // XExporter
- virtual void SAL_CALL setSourceDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
-
- // get factories and mappers
- XMLSdPropHdlFactory* GetSdPropHdlFactory() const { return mpSdPropHdlFactory; }
- XMLShapeExportPropertyMapper* GetPropertySetMapper() const { return mpPropertySetMapper; }
- XMLPageExportPropertyMapper* GetPresPagePropsMapper() const { return mpPresPagePropsMapper; }
-
- BOOL IsDraw() const { return mbIsDraw; }
- BOOL IsImpress() const { return !mbIsDraw; }
-
- BOOL IsFamilyGraphicUsed() const { return mbFamilyGraphicUsed; }
- void SetFamilyGraphicUsed() { mbFamilyGraphicUsed = TRUE; }
- BOOL IsFamilyPresentationUsed() const { return mbFamilyPresentationUsed; }
- void SetFamilyPresentationUsed() { mbFamilyPresentationUsed = TRUE; }
-
- virtual void addDataStyle(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat = sal_False );
- virtual void exportDataStyles();
- virtual void exportAutoDataStyles();
- virtual ::rtl::OUString getDataStyleName(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat = sal_False ) const;
-
- // XServiceInfo ( : SvXMLExport )
- virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
-};
-
-}//end of namespace binfilter
-#endif // _SDXMLEXP_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/sdxmlimp_impl.hxx b/binfilter/bf_xmloff/source/draw/sdxmlimp_impl.hxx
deleted file mode 100644
index 1b622c2a631e..000000000000
--- a/binfilter/bf_xmloff/source/draw/sdxmlimp_impl.hxx
+++ /dev/null
@@ -1,299 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SDXMLIMP_IMPL_HXX
-#define _SDXMLIMP_IMPL_HXX
-
-#include <com/sun/star/drawing/XDrawPage.hpp>
-
-#include <com/sun/star/frame/XModel.hpp>
-
-#include <com/sun/star/task/XStatusIndicator.hpp>
-
-#include "xmltkmap.hxx"
-
-#include <com/sun/star/container/XNameAccess.hpp>
-
-#ifndef __SGI_STL_VECTOR
-#include <vector>
-#endif
-
-#include "xmlimp.hxx"
-namespace binfilter {
-
-//////////////////////////////////////////////////////////////////////////////
-
-enum SdXMLDocElemTokenMap
-{
- XML_TOK_DOC_STYLES,
- XML_TOK_DOC_AUTOSTYLES,
- XML_TOK_DOC_MASTERSTYLES,
- XML_TOK_DOC_META,
- XML_TOK_DOC_BODY,
- XML_TOK_DOC_SCRIPT,
- XML_TOK_DOC_SETTINGS,
- XML_TOK_OFFICE_END = XML_TOK_UNKNOWN
-};
-
-enum SdXMLBodyElemTokenMap
-{
- XML_TOK_BODY_PAGE,
- XML_TOK_BODY_SETTINGS
-};
-
-enum SdXMLStylesElemTokenMap
-{
- XML_TOK_STYLES_MASTER_PAGE,
- XML_TOK_STYLES_STYLE,
- XML_TOK_STYLES_PAGE_MASTER,
- XML_TOK_STYLES_PRESENTATION_PAGE_LAYOUT
-};
-
-enum SdXMLAutoStylesElemTokenMap
-{
- XML_TOK_AUTOSTYLES_STYLE
-};
-
-enum SdXMLMasterPageElemTokenMap
-{
- XML_TOK_MASTERPAGE_STYLE,
- XML_TOK_MASTERPAGE_NOTES
-};
-
-enum SdXMLMasterPageAttrTokenMap
-{
- XML_TOK_MASTERPAGE_NAME,
- XML_TOK_MASTERPAGE_PAGE_MASTER_NAME,
- XML_TOK_MASTERPAGE_STYLE_NAME,
- XML_TOK_MASTERPAGE_PAGE_LAYOUT_NAME
-};
-
-enum SdXMLPageMasterAttrTokenMap
-{
- XML_TOK_PAGEMASTER_NAME
-};
-
-enum SdXMLPageMasterStyleAttrTokenMap
-{
- XML_TOK_PAGEMASTERSTYLE_MARGIN_TOP,
- XML_TOK_PAGEMASTERSTYLE_MARGIN_BOTTOM,
- XML_TOK_PAGEMASTERSTYLE_MARGIN_LEFT,
- XML_TOK_PAGEMASTERSTYLE_MARGIN_RIGHT,
- XML_TOK_PAGEMASTERSTYLE_PAGE_WIDTH,
- XML_TOK_PAGEMASTERSTYLE_PAGE_HEIGHT,
- XML_TOK_PAGEMASTERSTYLE_PAGE_ORIENTATION
-};
-
-enum SdXMLDocStyleAttrTokenMap
-{
- XML_TOK_DOCSTYLE_NAME,
- XML_TOK_DOCSTYLE_FAMILY,
- XML_TOK_DOCSTYLE_PARENT_STYLE_NAME,
- XML_TOK_DOCSTYLE_AUTOMATIC
-};
-
-enum SdXMLDocStyleElemTokenMap
-{
- XML_TOK_DOCSTYLE_PROPERTIES,
- XML_TOK_DOCSTYLE_PRESENTATION_PLACEHOLDER
-};
-
-enum SdXMLDrawPageAttrTokenMap
-{
- XML_TOK_DRAWPAGE_NAME,
- XML_TOK_DRAWPAGE_STYLE_NAME,
- XML_TOK_DRAWPAGE_MASTER_PAGE_NAME,
- XML_TOK_DRAWPAGE_PAGE_LAYOUT_NAME,
- XML_TOK_DRAWPAGE_ID,
- XML_TOK_DRAWPAGE_HREF
-};
-
-enum SdXMLDrawPageElemTokenMap
-{
- XML_TOK_DRAWPAGE_NOTES
-};
-
-enum SdXMLPresentationPlaceholderAttrTokenMap
-{
- XML_TOK_PRESENTATIONPLACEHOLDER_OBJECTNAME,
- XML_TOK_PRESENTATIONPLACEHOLDER_X,
- XML_TOK_PRESENTATIONPLACEHOLDER_Y,
- XML_TOK_PRESENTATIONPLACEHOLDER_WIDTH,
- XML_TOK_PRESENTATIONPLACEHOLDER_HEIGHT
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-struct SdXMLltXDrawPageId
-{
- bool operator()(sal_Int32 nId1, sal_Int32 nId2 ) const
- {
- return nId1 < nId2;
- }
-};
-
-typedef ::std::map< sal_Int32, ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >, SdXMLltXDrawPageId > DrawPageIdMap;
-
-//////////////////////////////////////////////////////////////////////////////
-
-class SvXMLUnitConverter;
-class SvXMLTokenMap;
-class XMLSdPropHdlFactory;
-class XMLPropertySetMapper;
-class XMLPropStyleContext;
-class SdXMLStylesContext;
-class SdXMLMasterStylesContext;
-
-//////////////////////////////////////////////////////////////////////////////
-
-class SdXMLImport: public SvXMLImport
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > mxDocStyleFamilies;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > mxDocMasterPages;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > mxDocDrawPages;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > mxPageLayouts;
-
- // contexts for Style and AutoStyle import
- SdXMLMasterStylesContext* mpMasterStylesContext;
-
- // token map lists
- SvXMLTokenMap* mpDocElemTokenMap;
- SvXMLTokenMap* mpBodyElemTokenMap;
- SvXMLTokenMap* mpStylesElemTokenMap;
- SvXMLTokenMap* mpAutoStylesElemTokenMap;
- SvXMLTokenMap* mpMasterPageElemTokenMap;
- SvXMLTokenMap* mpMasterPageAttrTokenMap;
- SvXMLTokenMap* mpPageMasterAttrTokenMap;
- SvXMLTokenMap* mpPageMasterStyleAttrTokenMap;
- SvXMLTokenMap* mpDocStyleAttrTokenMap;
- SvXMLTokenMap* mpDocStyleElemTokenMap;
- SvXMLTokenMap* mpDrawPageAttrTokenMap;
- SvXMLTokenMap* mpDrawPageElemTokenMap;
- SvXMLTokenMap* mpPresentationPlaceholderAttrTokenMap;
-
- sal_uInt16 mnStyleFamilyMask;
-
- sal_Int32 mnNewPageCount;
- sal_Int32 mnNewMasterPageCount;
-
- sal_Bool mbIsDraw;
- sal_Bool mbLoadDoc;
- sal_Bool mbPreview;
-
- DrawPageIdMap maDrawPageIds;
-
- ::rtl::OUString msPageLayouts;
- ::rtl::OUString msPreview;
-
-protected:
- // This method is called after the namespace map has been updated, but
- // before a context for the current element has been pushed.
- virtual SvXMLImportContext *CreateContext(sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
-
-public:
- // #110680#
- SdXMLImport(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- sal_Bool bIsDraw, sal_uInt16 nImportFlags = IMPORT_ALL );
- ~SdXMLImport() throw ();
-
- // XImporter
- virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
-
- // XInitialization
- virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
-
- virtual void SetViewSettings(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aViewProps);
- virtual void SetConfigurationSettings(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aConfigProps);
-
- // namespace office
- SvXMLImportContext* CreateMetaContext(const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList);
- SvXMLImportContext* CreateScriptContext( const ::rtl::OUString& rLocalName );
- SvXMLImportContext* CreateBodyContext(const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList);
- SvXMLStylesContext* CreateStylesContext(const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList);
- SvXMLStylesContext* CreateAutoStylesContext(const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList);
- SvXMLImportContext* CreateMasterStylesContext(const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList);
-
- // Styles and AutoStyles contexts
- const SdXMLMasterStylesContext* GetMasterStylesContext() const { return mpMasterStylesContext; }
-
- sal_uInt16 GetStyleFamilyMask() const { return mnStyleFamilyMask; }
- sal_Bool IsStylesOnlyMode() const { return !mbLoadDoc; }
-
- const SvXMLTokenMap& GetDocElemTokenMap();
- const SvXMLTokenMap& GetBodyElemTokenMap();
- const SvXMLTokenMap& GetStylesElemTokenMap();
- const SvXMLTokenMap& GetMasterPageElemTokenMap();
- const SvXMLTokenMap& GetMasterPageAttrTokenMap();
- const SvXMLTokenMap& GetPageMasterAttrTokenMap();
- const SvXMLTokenMap& GetPageMasterStyleAttrTokenMap();
- const SvXMLTokenMap& GetDrawPageAttrTokenMap();
- const SvXMLTokenMap& GetDrawPageElemTokenMap();
- const SvXMLTokenMap& GetPresentationPlaceholderAttrTokenMap();
-
- // export local parameters concerning page access and similar
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XNameAccess >& GetLocalDocStyleFamilies() const { return mxDocStyleFamilies; }
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XIndexAccess >& GetLocalMasterPages() const { return mxDocMasterPages; }
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XIndexAccess >& GetLocalDrawPages() const { return mxDocDrawPages; }
-
- sal_Int32 GetNewPageCount() const { return mnNewPageCount; }
- void IncrementNewPageCount() { mnNewPageCount++; }
- sal_Int32 GetNewMasterPageCount() const { return mnNewMasterPageCount; }
- void IncrementNewMasterPageCount() { mnNewMasterPageCount++; }
-
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > getPageLayouts() const { return mxPageLayouts; }
-
- sal_Bool IsDraw() const { return mbIsDraw; }
- sal_Bool IsImpress() const { return !mbIsDraw; }
-
- void setDrawPageId( sal_Int32 nId, ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > );
-
- // #80365#
- virtual void SetStatisticAttributes(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs);
-
- sal_Bool IsPreview() const { return mbPreview; }
-
- // XServiceInfo ( : SvXMLExport )
- virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
-};
-
-}//end of namespace binfilter
-#endif // _SDXMLIMP_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/viewcontext.hxx b/binfilter/bf_xmloff/source/draw/viewcontext.hxx
deleted file mode 100644
index d5f41f470397..000000000000
--- a/binfilter/bf_xmloff/source/draw/viewcontext.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SD_XMLVIEWSETTINGSCONTEXT_HXX
-#define _SD_XMLVIEWSETTINGSCONTEXT_HXX
-
-
-#include <com/sun/star/awt/Rectangle.hpp>
-
-#include "xmlictxt.hxx"
-namespace binfilter {
-
-class SdXMLImport;
-
-class SdXMLViewSettingsContext : public SvXMLImportContext
-{
- ::com::sun::star::awt::Rectangle maVisArea;
-
-public:
- SdXMLViewSettingsContext( SdXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
- virtual ~SdXMLViewSettingsContext();
-
- virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
- virtual void EndElement();
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/ximp3dobject.hxx b/binfilter/bf_xmloff/source/draw/ximp3dobject.hxx
deleted file mode 100644
index 3363afce7916..000000000000
--- a/binfilter/bf_xmloff/source/draw/ximp3dobject.hxx
+++ /dev/null
@@ -1,188 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XIMP3DOBJECT_HXX
-#define _XIMP3DOBJECT_HXX
-
-#include "xmlictxt.hxx"
-
-#include "sdxmlimp_impl.hxx"
-
-#include "nmspmap.hxx"
-
-#include <com/sun/star/drawing/XShapes.hpp>
-
-#include <tools/rtti.hxx>
-
-#include <com/sun/star/drawing/HomogenMatrix.hpp>
-
-#include <bf_goodies/vector3d.hxx>
-
-#include <com/sun/star/drawing/Direction3D.hpp>
-
-#include <com/sun/star/drawing/Position3D.hpp>
-
-#include "ximpshap.hxx"
-namespace binfilter {
-
-//////////////////////////////////////////////////////////////////////////////
-// common shape context
-
-class SdXML3DObjectContext : public SdXMLShapeContext
-{
-protected:
- // the shape group this object should be created inside
-
- ::com::sun::star::drawing::HomogenMatrix mxHomMat;
- BOOL mbSetTransform;
-
-/*
- void SetStyle();
- void AddShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape);
-*/
-public:
- TYPEINFO();
-
- SdXML3DObjectContext( SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXML3DObjectContext();
-
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
- virtual void EndElement();
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// dr3d:3dcube context
-
-class SdXML3DCubeObjectShapeContext : public SdXML3DObjectContext
-{
- Vector3D maMinEdge;
- Vector3D maMaxEdge;
- BOOL mbMinEdgeUsed;
- BOOL mbMaxEdgeUsed;
-
-public:
- TYPEINFO();
-
- SdXML3DCubeObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXML3DCubeObjectShapeContext();
-
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
- virtual void EndElement();
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// dr3d:3dsphere context
-
-class SdXML3DSphereObjectShapeContext : public SdXML3DObjectContext
-{
- Vector3D maCenter;
- Vector3D maSize;
- BOOL mbCenterUsed;
- BOOL mbSizeUsed;
-
-public:
- TYPEINFO();
-
- SdXML3DSphereObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXML3DSphereObjectShapeContext();
-
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
- virtual void EndElement();
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// polygonbased context
-
-class SdXML3DPolygonBasedShapeContext : public SdXML3DObjectContext
-{
- ::rtl::OUString maPoints;
- ::rtl::OUString maViewBox;
-
-public:
- TYPEINFO();
-
- SdXML3DPolygonBasedShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXML3DPolygonBasedShapeContext();
-
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
- virtual void EndElement();
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// dr3d:3dlathe context
-
-class SdXML3DLatheObjectShapeContext : public SdXML3DPolygonBasedShapeContext
-{
-public:
- TYPEINFO();
-
- SdXML3DLatheObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXML3DLatheObjectShapeContext();
-
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
- virtual void EndElement();
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// dr3d:3dextrude context
-
-class SdXML3DExtrudeObjectShapeContext : public SdXML3DPolygonBasedShapeContext
-{
-public:
- TYPEINFO();
-
- SdXML3DExtrudeObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXML3DExtrudeObjectShapeContext();
-
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
- virtual void EndElement();
-};
-
-}//end of namespace binfilter
-#endif // _XIMP3DOBJECT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/ximp3dscene.hxx b/binfilter/bf_xmloff/source/draw/ximp3dscene.hxx
deleted file mode 100644
index 104275b18b91..000000000000
--- a/binfilter/bf_xmloff/source/draw/ximp3dscene.hxx
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XIMP3DSCENE_HXX
-#define _XIMP3DSCENE_HXX
-
-#include "xmlictxt.hxx"
-
-#include "sdxmlimp_impl.hxx"
-
-#include "nmspmap.hxx"
-
-#include <com/sun/star/drawing/XShapes.hpp>
-
-#include <tools/rtti.hxx>
-
-#include <tools/color.hxx>
-
-#include <ximpshap.hxx>
-namespace binfilter {
-
-//////////////////////////////////////////////////////////////////////////////
-// dr3d:3dscene context
-
-class SdXML3DSceneShapeContext : public SdXMLShapeContext, public SdXML3DSceneAttributesHelper
-{
- // the shape group this group is working on
- // this is the scene at the same time
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxChilds;
-
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
-
-protected:
- void SetLocalShapesContext( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rNew)
- { mxChilds = rNew; }
-
-public:
- TYPEINFO();
-
- SdXML3DSceneShapeContext(
- SvXMLImport& rImport,
- USHORT nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXML3DSceneShapeContext();
-
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
- virtual void EndElement();
-
- virtual SvXMLImportContext *CreateChildContext(
- USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
-
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& GetLocalShapesContext() const
- { return mxShapes; }
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& GetLocalShapesContext()
- { return mxShapes; }
-};
-
-
-}//end of namespace binfilter
-#endif // _XIMPGROUP_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/ximpbody.hxx b/binfilter/bf_xmloff/source/draw/ximpbody.hxx
deleted file mode 100644
index 7080445f818d..000000000000
--- a/binfilter/bf_xmloff/source/draw/ximpbody.hxx
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XIMPBODY_HXX
-#define _XIMPBODY_HXX
-
-#include "xmlictxt.hxx"
-
-#include "sdxmlimp_impl.hxx"
-
-#include "nmspmap.hxx"
-
-#include "ximppage.hxx"
-namespace binfilter {
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:page context
-
-class SdXMLDrawPageContext : public SdXMLGenericPageContext
-{
- ::rtl::OUString maName;
- ::rtl::OUString maStyleName;
- ::rtl::OUString maMasterPageName;
- ::rtl::OUString maHREF;
-
-public:
- SdXMLDrawPageContext( SdXMLImport& rImport, USHORT nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLDrawPageContext();
-
- virtual SvXMLImportContext *CreateChildContext(
- USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
- virtual void EndElement();
-
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// office:body context
-
-class SdXMLBodyContext : public SvXMLImportContext
-{
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
-
-public:
- SdXMLBodyContext( SdXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLocalName );
- virtual ~SdXMLBodyContext();
-
- virtual SvXMLImportContext *CreateChildContext(
- USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
-};
-
-
-}//end of namespace binfilter
-#endif // _XIMPBODY_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/ximpgrp.hxx b/binfilter/bf_xmloff/source/draw/ximpgrp.hxx
deleted file mode 100644
index b37cde6e00b6..000000000000
--- a/binfilter/bf_xmloff/source/draw/ximpgrp.hxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XIMPGROUP_HXX
-#define _XIMPGROUP_HXX
-
-#include "xmlictxt.hxx"
-
-#include "sdxmlimp_impl.hxx"
-
-#include "nmspmap.hxx"
-
-#include <com/sun/star/drawing/XShapes.hpp>
-
-#include <tools/rtti.hxx>
-
-#include "ximpshap.hxx"
-namespace binfilter {
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:g context (RECURSIVE)
-
-class SdXMLGroupShapeContext : public SdXMLShapeContext
-{
- // the shape group this group is working on
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxChilds;
-
-protected:
- void SetLocalShapesContext( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rNew)
- { mxShapes = rNew; }
-
-public:
- TYPEINFO();
-
- SdXMLGroupShapeContext( SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLGroupShapeContext();
-
- virtual SvXMLImportContext *CreateChildContext(
- USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
- virtual void EndElement();
-
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& GetLocalShapesContext() const
- { return mxShapes; }
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& GetLocalShapesContext()
- { return mxShapes; }
-};
-
-
-}//end of namespace binfilter
-#endif // _XIMPGROUP_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/ximpnote.hxx b/binfilter/bf_xmloff/source/draw/ximpnote.hxx
deleted file mode 100644
index 3d1e6439929a..000000000000
--- a/binfilter/bf_xmloff/source/draw/ximpnote.hxx
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XIMPNOTES_HXX
-#define _XIMPNOTES_HXX
-
-#include "xmlictxt.hxx"
-
-#include "sdxmlimp_impl.hxx"
-
-#include "nmspmap.hxx"
-
-#include "ximppage.hxx"
-namespace binfilter {
-
-//////////////////////////////////////////////////////////////////////////////
-// presentation:notes context
-
-class SdXMLNotesContext : public SdXMLGenericPageContext
-{
-private:
- ::rtl::OUString msPageMasterName;
-
-public:
- SdXMLNotesContext( SdXMLImport& rImport, USHORT nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLNotesContext();
-
- virtual SvXMLImportContext *CreateChildContext(
- USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
- virtual void EndElement();
-};
-
-
-}//end of namespace binfilter
-#endif // _XIMPNOTES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/ximppage.hxx b/binfilter/bf_xmloff/source/draw/ximppage.hxx
deleted file mode 100644
index 911057e57151..000000000000
--- a/binfilter/bf_xmloff/source/draw/ximppage.hxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XIMPPAGE_HXX
-#define _XIMPPAGE_HXX
-
-#include "xmlictxt.hxx"
-
-#include "sdxmlimp_impl.hxx"
-
-#include "nmspmap.hxx"
-
-#include <com/sun/star/drawing/XShapes.hpp>
-
-#include <tools/rtti.hxx>
-
-#include "ximpshap.hxx"
-namespace binfilter {
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:g context (RECURSIVE)
-
-class SdXMLGenericPageContext : public SvXMLImportContext
-{
- // the shape group this group is working on
- ::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(); }
-
- /** sets the properties from a page master style with the given name on this contexts page */
- void SetPageMaster( ::rtl::OUString& rsPageMasterName );
-
-public:
- TYPEINFO();
-
- SdXMLGenericPageContext( SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLGenericPageContext();
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual SvXMLImportContext *CreateChildContext(
- USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
- virtual void EndElement();
-
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& GetLocalShapesContext() const
- { return mxShapes; }
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& GetLocalShapesContext()
- { return mxShapes; }
-};
-
-
-}//end of namespace binfilter
-#endif // _XIMPGROUP_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/ximpshap.hxx b/binfilter/bf_xmloff/source/draw/ximpshap.hxx
deleted file mode 100644
index 6001284fb7ec..000000000000
--- a/binfilter/bf_xmloff/source/draw/ximpshap.hxx
+++ /dev/null
@@ -1,560 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XIMPSHAPE_HXX
-#define _XIMPSHAPE_HXX
-
-#include <com/sun/star/io/XOutputStream.hpp>
-
-#include <com/sun/star/document/XActionLockable.hpp>
-
-#include <com/sun/star/container/XIdentifierContainer.hpp>
-
-#include "xmlictxt.hxx"
-
-#include "sdxmlimp_impl.hxx"
-
-#include "nmspmap.hxx"
-
-#include <com/sun/star/drawing/XShapes.hpp>
-
-#include <com/sun/star/text/XTextCursor.hpp>
-
-#include <com/sun/star/awt/Point.hpp>
-
-#include <tools/rtti.hxx>
-
-#include "xexptran.hxx"
-namespace binfilter {
-
-//////////////////////////////////////////////////////////////////////////////
-// common shape context
-
-class SdXMLShapeContext : public SvXMLImportContext
-{
-protected:
- // the shape group this object should be created inside
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxShapes;
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxShape;
- ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > mxCursor;
- ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > mxOldCursor;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList> mxAttrList;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XIdentifierContainer > mxGluePoints;
- ::com::sun::star::uno::Reference< ::com::sun::star::document::XActionLockable > mxLockable;
-
- ::rtl::OUString maDrawStyleName;
- ::rtl::OUString maTextStyleName;
- ::rtl::OUString maPresentationClass;
- ::rtl::OUString maShapeName;
- ::rtl::OUString maThumbnailURL;
-
- /// old list item and block (#91964#)
- SvXMLImportContextRef mxOldListBlock;
- SvXMLImportContextRef mxOldListItem;
-
- sal_uInt16 mnStyleFamily;
- sal_uInt16 mnClass;
- sal_Bool mbIsPlaceholder;
- sal_Bool mbIsUserTransformed;
- sal_Int32 mnZOrder;
- sal_Int32 mnShapeId;
- ::rtl::OUString maLayerName;
-
- SdXMLImExTransform2D mnTransform;
- ::com::sun::star::awt::Size maSize;
- ::com::sun::star::awt::Point maPosition;
-
- /** if bSupportsStyle is false, auto styles will be set but not a style */
- void SetStyle( bool bSupportsStyle = true );
- void SetLayer();
- void SetThumbnail();
-
- void AddShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape);
- void AddShape(const char* pServiceName );
- void SetTransformation();
-
- SvXMLImport& GetImport() { return SvXMLImportContext::GetImport(); }
- const SvXMLImport& GetImport() const { return SvXMLImportContext::GetImport(); }
-
- void addGluePoint( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
-
- sal_Bool isPresentationShape() const;
-
-public:
- TYPEINFO();
-
- SdXMLShapeContext( SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLShapeContext();
-
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
-
- virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
-
- // this is called from the parent group for each unparsed attribute in the attribute list
- virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:rect context
-
-class SdXMLRectShapeContext : public SdXMLShapeContext
-{
- sal_Int32 mnRadius;
-
-public:
- TYPEINFO();
-
- SdXMLRectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLRectShapeContext();
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
-
- // this is called from the parent group for each unparsed attribute in the attribute list
- virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:line context
-
-class SdXMLLineShapeContext : public SdXMLShapeContext
-{
- sal_Int32 mnX1;
- sal_Int32 mnY1;
- sal_Int32 mnX2;
- sal_Int32 mnY2;
-
-public:
- TYPEINFO();
-
- SdXMLLineShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLLineShapeContext();
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
-
- // this is called from the parent group for each unparsed attribute in the attribute list
- virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:ellipse and draw:circle context
-
-class SdXMLEllipseShapeContext : public SdXMLShapeContext
-{
- sal_Int32 mnCX;
- sal_Int32 mnCY;
- sal_Int32 mnRX;
- sal_Int32 mnRY;
-
- USHORT meKind;
- sal_Int32 mnStartAngle;
- sal_Int32 mnEndAngle;
-public:
- TYPEINFO();
-
- SdXMLEllipseShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLEllipseShapeContext();
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
-
- // this is called from the parent group for each unparsed attribute in the attribute list
- virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:polyline and draw:polygon context
-
-class SdXMLPolygonShapeContext : public SdXMLShapeContext
-{
- ::rtl::OUString maPoints;
- ::rtl::OUString maViewBox;
- sal_Bool mbClosed;
-
-public:
- TYPEINFO();
-
- SdXMLPolygonShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes, sal_Bool bClosed);
- virtual ~SdXMLPolygonShapeContext();
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
-
- // this is called from the parent group for each unparsed attribute in the attribute list
- virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:path context
-
-class SdXMLPathShapeContext : public SdXMLShapeContext
-{
- ::rtl::OUString maD;
- ::rtl::OUString maViewBox;
- sal_Bool mbClosed;
-
-public:
- TYPEINFO();
-
- SdXMLPathShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLPathShapeContext();
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
-
- // this is called from the parent group for each unparsed attribute in the attribute list
- virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:text-box context
-
-class SdXMLTextBoxShapeContext : public SdXMLShapeContext
-{
- sal_Int32 mnRadius;
-
-public:
- TYPEINFO();
-
- SdXMLTextBoxShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLTextBoxShapeContext();
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
-
- // this is called from the parent group for each unparsed attribute in the attribute list
- virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:control context
-
-class SdXMLControlShapeContext : public SdXMLShapeContext
-{
-private:
- ::rtl::OUString maFormId;
-
-public:
- TYPEINFO();
-
- SdXMLControlShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLControlShapeContext();
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
-
- // this is called from the parent group for each unparsed attribute in the attribute list
- virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:connector context
-
-class SdXMLConnectorShapeContext : public SdXMLShapeContext
-{
-private:
- ::com::sun::star::awt::Point maStart;
- ::com::sun::star::awt::Point maEnd;
-
- USHORT mnType;
-
- sal_Int32 mnStartShapeId;
- sal_Int32 mnStartGlueId;
- sal_Int32 mnEndShapeId;
- sal_Int32 mnEndGlueId;
-
- sal_Int32 mnDelta1;
- sal_Int32 mnDelta2;
- sal_Int32 mnDelta3;
-public:
- TYPEINFO();
-
- SdXMLConnectorShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLConnectorShapeContext();
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
-
- // this is called from the parent group for each unparsed attribute in the attribute list
- virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:measure context
-
-class SdXMLMeasureShapeContext : public SdXMLShapeContext
-{
-private:
- ::com::sun::star::awt::Point maStart;
- ::com::sun::star::awt::Point maEnd;
-
-public:
- TYPEINFO();
-
- SdXMLMeasureShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLMeasureShapeContext();
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
- virtual void EndElement();
-
- // this is called from the parent group for each unparsed attribute in the attribute list
- virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:page context
-
-class SdXMLPageShapeContext : public SdXMLShapeContext
-{
-private:
- sal_Int32 mnPageNumber;
-public:
- TYPEINFO();
-
- SdXMLPageShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLPageShapeContext();
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
-
- // this is called from the parent group for each unparsed attribute in the attribute list
- virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:caption context
-
-class SdXMLCaptionShapeContext : public SdXMLShapeContext
-{
-private:
- ::com::sun::star::awt::Point maCaptionPoint;
- sal_Int32 mnRadius;
-
-public:
- TYPEINFO();
-
- SdXMLCaptionShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLCaptionShapeContext();
- virtual void StartElement(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
-
- // this is called from the parent group for each unparsed attribute in the attribute list
- virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// office:image context
-
-class SdXMLGraphicObjectShapeContext : public SdXMLShapeContext
-{
-private:
- ::rtl::OUString maURL;
- ::com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > mxBase64Stream;
-
-public:
- TYPEINFO();
-
- SdXMLGraphicObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLGraphicObjectShapeContext();
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual void EndElement();
- virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
-
- // this is called from the parent group for each unparsed attribute in the attribute list
- virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// chart:chart context
-
-class SdXMLChartShapeContext : public SdXMLShapeContext
-{
- SvXMLImportContext* mpChartContext;
-
-public:
- TYPEINFO();
-
- SdXMLChartShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLChartShapeContext();
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual void EndElement();
- virtual void Characters( const ::rtl::OUString& rChars );
- virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:object and draw:object_ole context
-
-class SdXMLObjectShapeContext : public SdXMLShapeContext
-{
-private:
- ::rtl::OUString maCLSID;
- ::rtl::OUString maHref;
-
- // #100592#
- ::com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > mxBase64Stream;
-
-public:
- TYPEINFO();
-
- SdXMLObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLObjectShapeContext();
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual void EndElement();
-
- // #100592#
- virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
-
- // this is called from the parent group for each unparsed attribute in the attribute list
- virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:applet
-
-class SdXMLAppletShapeContext : public SdXMLShapeContext
-{
-private:
- ::rtl::OUString maAppletName;
- ::rtl::OUString maAppletCode;
- ::rtl::OUString maHref;
- sal_Bool mbIsScript;
-
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > maParams;
-
-public:
- TYPEINFO();
-
- SdXMLAppletShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLAppletShapeContext();
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual void EndElement();
-
- virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
-
- // this is called from the parent group for each unparsed attribute in the attribute list
- virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:plugin
-
-class SdXMLPluginShapeContext : public SdXMLShapeContext
-{
-private:
- ::rtl::OUString maMimeType;
- ::rtl::OUString maHref;
-
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > maParams;
-
-public:
- TYPEINFO();
-
- SdXMLPluginShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLPluginShapeContext();
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual void EndElement();
-
- virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
-
- // this is called from the parent group for each unparsed attribute in the attribute list
- virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:frame
-
-class SdXMLFrameShapeContext : public SdXMLShapeContext
-{
-private:
- ::rtl::OUString maFrameName;
- ::rtl::OUString maHref;
-
-public:
- TYPEINFO();
-
- SdXMLFrameShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLFrameShapeContext();
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual void EndElement();
-
- // this is called from the parent group for each unparsed attribute in the attribute list
- virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-};
-}//end of namespace binfilter
-#endif // _XIMPSHAPE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/ximpshow.hxx b/binfilter/bf_xmloff/source/draw/ximpshow.hxx
deleted file mode 100644
index 1dc70a4a599e..000000000000
--- a/binfilter/bf_xmloff/source/draw/ximpshow.hxx
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XIMPSHOW_HXX
-#define _XMLOFF_XIMPSHOW_HXX
-
-#include "xmlictxt.hxx"
-
-#include "sdxmlimp_impl.hxx"
-namespace binfilter {
-
-class ShowsImpImpl;
-
-//////////////////////////////////////////////////////////////////////////////
-// presentations:animations
-
-class SdXMLShowsContext : public SvXMLImportContext
-{
- ShowsImpImpl* mpImpl;
-
-public:
- TYPEINFO();
-
- SdXMLShowsContext( SdXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList);
- virtual ~SdXMLShowsContext();
-
- virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_XIMPSHOW_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/ximpstyl.hxx b/binfilter/bf_xmloff/source/draw/ximpstyl.hxx
deleted file mode 100644
index 0e89c4a95be4..000000000000
--- a/binfilter/bf_xmloff/source/draw/ximpstyl.hxx
+++ /dev/null
@@ -1,286 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XIMPSTYLE_HXX
-#define _XIMPSTYLE_HXX
-
-#include "xmlictxt.hxx"
-
-#include "sdxmlimp_impl.hxx"
-
-#include "ximppage.hxx"
-
-#include "xmlstyle.hxx"
-
-#include <com/sun/star/view/PaperOrientation.hpp>
-namespace binfilter {
-
-class SvNumberFormatter;
-class SvXMLNumFmtHelper;
-
-//////////////////////////////////////////////////////////////////////////////
-// special style:style context inside style:page-master context
-
-class SdXMLPageMasterStyleContext: public SvXMLStyleContext
-{
- sal_Int32 mnBorderBottom;
- sal_Int32 mnBorderLeft;
- sal_Int32 mnBorderRight;
- sal_Int32 mnBorderTop;
- sal_Int32 mnWidth;
- sal_Int32 mnHeight;
- ::com::sun::star::view::PaperOrientation meOrientation;
-
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
-
-public:
- TYPEINFO();
-
- SdXMLPageMasterStyleContext(
- SdXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList);
- virtual ~SdXMLPageMasterStyleContext();
-
- sal_Int32 GetBorderBottom() const { return mnBorderBottom; }
- sal_Int32 GetBorderLeft() const { return mnBorderLeft; }
- sal_Int32 GetBorderRight() const { return mnBorderRight; }
- sal_Int32 GetBorderTop() const { return mnBorderTop; }
- sal_Int32 GetWidth() const { return mnWidth; }
- sal_Int32 GetHeight() const { return mnHeight; }
- ::com::sun::star::view::PaperOrientation GetOrientation() const { return meOrientation; }
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// style:page-master context
-
-class SdXMLPageMasterContext: public SvXMLStyleContext
-{
- ::rtl::OUString msName;
- SdXMLPageMasterStyleContext*mpPageMasterStyle;
-
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
-
-public:
- TYPEINFO();
-
- SdXMLPageMasterContext(
- SdXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList);
- virtual ~SdXMLPageMasterContext();
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
- const ::rtl::OUString& GetName() const { return msName; }
- const SdXMLPageMasterStyleContext* GetPageMasterStyle() const { return mpPageMasterStyle; }
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// style:masterpage context
-
-class SdXMLMasterPageContext: public SdXMLGenericPageContext
-{
- ::rtl::OUString msPageMasterName;
- ::rtl::OUString msName;
- ::rtl::OUString msStyleName;
-
-public:
- TYPEINFO();
-
- SdXMLMasterPageContext(
- SdXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes);
- virtual ~SdXMLMasterPageContext();
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
- virtual void EndElement();
-
- const ::rtl::OUString& GetPageMasterName() const { return msPageMasterName; }
- const ::rtl::OUString& GetName() const { return msName; }
-};
-DECLARE_LIST(ImpMasterPageList, SdXMLMasterPageContext*)//STRIP008 ;
-
-//////////////////////////////////////////////////////////////////////////////
-// presentation:placeholder context
-
-class SdXMLPresentationPlaceholderContext: public SvXMLImportContext
-{
- ::rtl::OUString msName;
- sal_Int32 mnX;
- sal_Int32 mnY;
- sal_Int32 mnWidth;
- sal_Int32 mnHeight;
-
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
-
-public:
- SdXMLPresentationPlaceholderContext(
- SdXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList);
- virtual ~SdXMLPresentationPlaceholderContext();
-
- const ::rtl::OUString& GetName() const { return msName; }
- sal_Int32 GetX() const { return mnX; }
- sal_Int32 GetY() const { return mnY; }
- sal_Int32 GetWidth() const { return mnWidth; }
- sal_Int32 GetHeight() const { return mnHeight; }
-};
-DECLARE_LIST(ImpPlaceholderList, SdXMLPresentationPlaceholderContext*)//STRIP008 ;
-
-//////////////////////////////////////////////////////////////////////////////
-// style:presentation-page-layout context
-
-class SdXMLPresentationPageLayoutContext: public SvXMLStyleContext
-{
- ::rtl::OUString msName;
- ImpPlaceholderList maList;
- sal_uInt16 mnTypeId;
-
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
-
-public:
- TYPEINFO();
-
- SdXMLPresentationPageLayoutContext(
- SdXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList);
- virtual ~SdXMLPresentationPageLayoutContext();
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
- virtual void EndElement();
- sal_uInt16 GetTypeId() const { return mnTypeId; }
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// office:styles context
-
-class SdXMLStylesContext : public SvXMLStylesContext
-{
- UniReference< SvXMLImportPropertyMapper > xPresImpPropMapper;
- sal_Bool mbIsAutoStyle;
- SvXMLNumFmtHelper* mpNumFmtHelper;
- SvNumberFormatter* mpNumFormatter;
-
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
-
- void ImpSetGraphicStyles() const;
- void ImpSetGraphicStyles( ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& xPageStyles,
- sal_uInt16 nFamily, const UniString& rPrefix) const;
-
-protected:
- virtual SvXMLStyleContext* CreateStyleChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList);
-
- virtual SvXMLStyleContext *CreateStyleStyleChildContext(
- sal_uInt16 nFamily,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList);
-
- virtual SvXMLStyleContext *CreateDefaultStyleStyleChildContext(
- sal_uInt16 nFamily, sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
-public:
- TYPEINFO();
-
- SdXMLStylesContext(
- SdXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
- sal_Bool bIsAutoStyle);
- virtual ~SdXMLStylesContext();
-
- virtual sal_uInt16 GetFamily( const ::rtl::OUString& rFamily ) const;
- virtual void EndElement();
- virtual UniReference< SvXMLImportPropertyMapper > GetImportPropertyMapper(sal_uInt16 nFamily) const;
-
- void SetMasterPageStyles(SdXMLMasterPageContext& rMaster) const;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > getPageLayouts() const;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// office:master-styles context
-//
-class SdXMLMasterStylesContext : public SvXMLImportContext
-{
- ImpMasterPageList maMasterPageList;
-
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
-
-public:
- TYPEINFO();
-
- SdXMLMasterStylesContext(
- SdXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName);
- virtual ~SdXMLMasterStylesContext();
-
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
- const ImpMasterPageList& GetMasterPageList() const { return maMasterPageList; }
-};
-
-
-}//end of namespace binfilter
-#endif // _XIMPSTYLE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_XMLGraphicsDefaultStyle.cxx b/binfilter/bf_xmloff/source/draw/xmloff_XMLGraphicsDefaultStyle.cxx
deleted file mode 100644
index 61d98fee06fb..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_XMLGraphicsDefaultStyle.cxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-
-#include "xmlimp.hxx"
-
-
-#include "xmlnmspe.hxx"
-
-
-
-#include "XMLShapePropertySetContext.hxx"
-
-#include "XMLGraphicsDefaultStyle.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::xml::sax;
-
-using rtl::OUString;
-
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_PROPERTIES;
-
-// ---------------------------------------------------------------------
-
-TYPEINIT1( XMLGraphicsDefaultStyle, XMLPropStyleContext );
-
-XMLGraphicsDefaultStyle::XMLGraphicsDefaultStyle( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList >& xAttrList, SvXMLStylesContext& rStyles )
-: XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, XML_STYLE_FAMILY_SD_GRAPHICS_ID, sal_True )
-{
-}
-
-XMLGraphicsDefaultStyle::~XMLGraphicsDefaultStyle()
-{
-}
-
-SvXMLImportContext *XMLGraphicsDefaultStyle::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
-
- if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken( rLocalName, XML_PROPERTIES ) )
- {
- UniReference < SvXMLImportPropertyMapper > xImpPrMap = GetStyles()->GetImportPropertyMapper( GetFamily() );
- if( xImpPrMap.is() )
- pContext = new XMLShapePropertySetContext( GetImport(), nPrefix, rLocalName, xAttrList, GetProperties(), xImpPrMap );
- }
-
- if( !pContext )
- pContext = XMLPropStyleContext::CreateChildContext( nPrefix, rLocalName, xAttrList );
-
- return pContext;
-}
-
-// This method is called for every default style
-void XMLGraphicsDefaultStyle::SetDefaults()
-{
- Reference< XMultiServiceFactory > xFact( GetImport().GetModel(), UNO_QUERY );
- if( !xFact.is() )
- return;
-
- Reference< XPropertySet > xDefaults( xFact->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Defaults") ) ), UNO_QUERY );
- if( !xDefaults.is() )
- return;
-
- FillPropertySet( xDefaults );
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_XMLImageMapContext.cxx b/binfilter/bf_xmloff/source/draw/xmloff_XMLImageMapContext.cxx
deleted file mode 100644
index 4bf5f00f0a19..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_XMLImageMapContext.cxx
+++ /dev/null
@@ -1,726 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLImageMapContext.hxx"
-
-
-#include <com/sun/star/uno/Reference.h>
-
-
-
-#include <com/sun/star/container/XIndexContainer.hpp>
-
-
-
-#include <com/sun/star/document/XEventsSupplier.hpp>
-
-
-
-#include "xmlimp.hxx"
-
-
-#include "xmlnmspe.hxx"
-
-#include "nmspmap.hxx"
-
-#include "xmluconv.hxx"
-
-#include "xexptran.hxx"
-
-#include "xmlerror.hxx"
-
-#include "XMLEventsImportContext.hxx"
-
-#include "XMLStringBufferImportContext.hxx"
-
-#include <tools/debug.hxx>
-namespace binfilter {
-
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::container::XIndexContainer;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::com::sun::star::uno::XInterface;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::drawing::PointSequenceSequence;
-using ::com::sun::star::document::XEventsSupplier;
-
-
-enum XMLImageMapToken
-{
- XML_TOK_IMAP_URL,
- XML_TOK_IMAP_DESCRIPTION,
- XML_TOK_IMAP_X,
- XML_TOK_IMAP_Y,
- XML_TOK_IMAP_CENTER_X,
- XML_TOK_IMAP_CENTER_Y,
- XML_TOK_IMAP_WIDTH,
- XML_TOK_IMAP_HEIGTH,
- XML_TOK_IMAP_POINTS,
- XML_TOK_IMAP_VIEWBOX,
- XML_TOK_IMAP_NOHREF,
- XML_TOK_IMAP_NAME,
- XML_TOK_IMAP_RADIUS,
- XML_TOK_IMAP_TARGET
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aImageMapObjectTokenMap[] =
-{
- { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_IMAP_URL },
- { XML_NAMESPACE_OFFICE, XML_NAME, XML_TOK_IMAP_NAME },
- { XML_NAMESPACE_DRAW, XML_NOHREF, XML_TOK_IMAP_NOHREF },
- { XML_NAMESPACE_SVG, XML_X, XML_TOK_IMAP_X },
- { XML_NAMESPACE_SVG, XML_Y, XML_TOK_IMAP_Y },
- { XML_NAMESPACE_SVG, XML_CX, XML_TOK_IMAP_CENTER_X },
- { XML_NAMESPACE_SVG, XML_CY, XML_TOK_IMAP_CENTER_Y },
- { XML_NAMESPACE_SVG, XML_WIDTH, XML_TOK_IMAP_WIDTH },
- { XML_NAMESPACE_SVG, XML_HEIGHT, XML_TOK_IMAP_HEIGTH },
- { XML_NAMESPACE_SVG, XML_R, XML_TOK_IMAP_RADIUS },
- { XML_NAMESPACE_SVG, XML_VIEWBOX, XML_TOK_IMAP_VIEWBOX },
- { XML_NAMESPACE_SVG, XML_POINTS, XML_TOK_IMAP_POINTS },
- { XML_NAMESPACE_OFFICE, XML_TARGET_FRAME_NAME, XML_TOK_IMAP_TARGET },
- XML_TOKEN_MAP_END
-};
-
-
-
-class XMLImageMapObjectContext : public SvXMLImportContext
-{
-
-protected:
-
- const ::rtl::OUString sBoundary;
- const ::rtl::OUString sCenter;
- const ::rtl::OUString sDescription;
- const ::rtl::OUString sImageMap;
- const ::rtl::OUString sIsActive;
- const ::rtl::OUString sName;
- const ::rtl::OUString sPolygon;
- const ::rtl::OUString sRadius;
- const ::rtl::OUString sTarget;
- const ::rtl::OUString sURL;
-
- ::rtl::OUString sServiceName;
-
- Reference<XIndexContainer> xImageMap; /// the image map
- Reference<XPropertySet> xMapEntry; /// one map-entry (one area)
-
- ::rtl::OUString sUrl;
- ::rtl::OUString sTargt;
- ::rtl::OUStringBuffer sDescriptionBuffer;
- ::rtl::OUString sNam;
- sal_Bool bIsActive;
-
- sal_Bool bValid;
-
-public:
- TYPEINFO();
-
- XMLImageMapObjectContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XIndexContainer> xMap,
- const sal_Char* pServiceName);
-
- void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
- void EndElement();
-
- SvXMLImportContext *CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-
-protected:
-
- virtual void ProcessAttribute(
- enum XMLImageMapToken eToken,
- const ::rtl::OUString& rValue);
-
- virtual void Prepare(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropertySet);
-};
-
-
-TYPEINIT1( XMLImageMapObjectContext, SvXMLImportContext );
-
-XMLImageMapObjectContext::XMLImageMapObjectContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- Reference<XIndexContainer> xMap,
- const sal_Char* pServiceName) :
- SvXMLImportContext(rImport, nPrefix, rLocalName),
- xImageMap(xMap),
- bIsActive(sal_True),
- bValid(sal_False),
- sBoundary(RTL_CONSTASCII_USTRINGPARAM("Boundary")),
- sCenter(RTL_CONSTASCII_USTRINGPARAM("Center")),
- sDescription(RTL_CONSTASCII_USTRINGPARAM("Description")),
- sImageMap(RTL_CONSTASCII_USTRINGPARAM("ImageMap")),
- sIsActive(RTL_CONSTASCII_USTRINGPARAM("IsActive")),
- sName(RTL_CONSTASCII_USTRINGPARAM("Name")),
- sPolygon(RTL_CONSTASCII_USTRINGPARAM("Polygon")),
- sRadius(RTL_CONSTASCII_USTRINGPARAM("Radius")),
- sTarget(RTL_CONSTASCII_USTRINGPARAM("Target")),
- sURL(RTL_CONSTASCII_USTRINGPARAM("URL"))
-{
- DBG_ASSERT(NULL != pServiceName,
- "Please supply the image map object service name");
-
- Reference<XMultiServiceFactory> xFactory(GetImport().GetModel(),UNO_QUERY);
- if( xFactory.is() )
- {
- Reference<XInterface> xIfc = xFactory->createInstance(
- OUString::createFromAscii(pServiceName));
- DBG_ASSERT(xIfc.is(), "can't create image map object!");
- if( xIfc.is() )
- {
- Reference<XPropertySet> xPropertySet( xIfc, UNO_QUERY );
-
- xMapEntry = xPropertySet;
- }
- // else: can't create service -> ignore
- }
- // else: can't even get factory -> ignore
-}
-
-void XMLImageMapObjectContext::StartElement(
- const Reference<XAttributeList >& xAttrList )
-{
- SvXMLTokenMap aMap(aImageMapObjectTokenMap);
-
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
- OUString sValue = xAttrList->getValueByIndex(nAttr);
-
- ProcessAttribute(
- (enum XMLImageMapToken)aMap.Get(nPrefix, sLocalName), sValue);
- }
-}
-
-void XMLImageMapObjectContext::EndElement()
-{
- // only create and insert image map object if validity flag is set
- // (and we actually have an image map)
- if ( bValid && xImageMap.is() && xMapEntry.is() )
- {
- // set values
- Prepare( xMapEntry );
-
- // insert into image map
- Any aAny;
- aAny <<= xMapEntry;
- xImageMap->insertByIndex( xImageMap->getCount(), aAny );
- }
- // else: not valid -> don't create and insert
-}
-
-SvXMLImportContext* XMLImageMapObjectContext::CreateChildContext(
- USHORT nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- if ( (XML_NAMESPACE_OFFICE == nPrefix) &&
- IsXMLToken(rLocalName, XML_EVENTS) )
- {
- Reference<XEventsSupplier> xEvents( xMapEntry, UNO_QUERY );
- return new XMLEventsImportContext(
- GetImport(), nPrefix, rLocalName, xEvents);
- }
- else if ( (XML_NAMESPACE_SVG == nPrefix) &&
- IsXMLToken(rLocalName, XML_DESC) )
- {
- return new XMLStringBufferImportContext(
- GetImport(), nPrefix, rLocalName, sDescriptionBuffer);
- }
- else
- return SvXMLImportContext::CreateChildContext(nPrefix, rLocalName,
- xAttrList);
-
-}
-
-void XMLImageMapObjectContext::ProcessAttribute(
- enum XMLImageMapToken eToken,
- const OUString& rValue)
-{
- switch (eToken)
- {
- case XML_TOK_IMAP_URL:
- sUrl = GetImport().GetAbsoluteReference(rValue);
- break;
-
- case XML_TOK_IMAP_TARGET:
- sTargt = rValue;
- break;
-
- case XML_TOK_IMAP_NOHREF:
- bIsActive = ! IsXMLToken(rValue, XML_NOHREF);
- break;
-
- case XML_TOK_IMAP_NAME:
- sNam = rValue;
- break;
- }
-}
-
-void XMLImageMapObjectContext::Prepare(
- Reference<XPropertySet> & rPropertySet)
-{
- Any aAny;
-
- aAny <<= sUrl;
- rPropertySet->setPropertyValue( sURL, aAny );
-
- aAny <<= sDescriptionBuffer.makeStringAndClear();
- rPropertySet->setPropertyValue( sDescription, aAny );
-
- aAny <<= sTargt;
- rPropertySet->setPropertyValue( sTarget, aAny );
-
- aAny.setValue( &bIsActive, ::getBooleanCppuType() );
- rPropertySet->setPropertyValue( sIsActive, aAny );
-
- aAny <<= sNam;
- rPropertySet->setPropertyValue( sName, aAny );
-}
-
-
-
-class XMLImageMapRectangleContext : public XMLImageMapObjectContext
-{
- awt::Rectangle aRectangle;
-
- sal_Bool bXOK;
- sal_Bool bYOK;
- sal_Bool bWidthOK;
- sal_Bool bHeightOK;
-
-public:
- TYPEINFO();
-
- XMLImageMapRectangleContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XIndexContainer> xMap);
-
- virtual ~XMLImageMapRectangleContext();
-
-protected:
- virtual void ProcessAttribute(
- enum XMLImageMapToken eToken,
- const ::rtl::OUString& rValue);
-
- virtual void Prepare(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropertySet);
-};
-
-
-
-TYPEINIT1(XMLImageMapRectangleContext, XMLImageMapObjectContext);
-
-XMLImageMapRectangleContext::XMLImageMapRectangleContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- Reference<XIndexContainer> xMap) :
- XMLImageMapObjectContext(rImport, nPrefix, rLocalName, xMap,
- "com.sun.star.image.ImageMapRectangleObject"),
- bXOK(sal_False),
- bYOK(sal_False),
- bWidthOK(sal_False),
- bHeightOK(sal_False)
-{
-}
-
-XMLImageMapRectangleContext::~XMLImageMapRectangleContext()
-{
-}
-
-void XMLImageMapRectangleContext::ProcessAttribute(
- enum XMLImageMapToken eToken,
- const OUString& rValue)
-{
- sal_Int32 nTmp;
- switch (eToken)
- {
- case XML_TOK_IMAP_X:
- if (GetImport().GetMM100UnitConverter().convertMeasure(nTmp,
- rValue))
- {
- aRectangle.X = nTmp;
- bXOK = sal_True;
- }
- break;
- case XML_TOK_IMAP_Y:
- if (GetImport().GetMM100UnitConverter().convertMeasure(nTmp,
- rValue))
- {
- aRectangle.Y = nTmp;
- bYOK = sal_True;
- }
- break;
- case XML_TOK_IMAP_WIDTH:
- if (GetImport().GetMM100UnitConverter().convertMeasure(nTmp,
- rValue))
- {
- aRectangle.Width = nTmp;
- bWidthOK = sal_True;
- }
- break;
- case XML_TOK_IMAP_HEIGTH:
- if (GetImport().GetMM100UnitConverter().convertMeasure(nTmp,
- rValue))
- {
- aRectangle.Height = nTmp;
- bHeightOK = sal_True;
- }
- break;
- default:
- XMLImageMapObjectContext::ProcessAttribute(eToken, rValue);
- }
-
- bValid = bHeightOK && bXOK && bYOK && bWidthOK;
-}
-
-void XMLImageMapRectangleContext::Prepare(
- Reference<XPropertySet> & rPropertySet)
-{
- Any aAny;
- aAny <<= aRectangle;
- rPropertySet->setPropertyValue( sBoundary, aAny );
-
- // common properties handled by super class
- XMLImageMapObjectContext::Prepare(rPropertySet);
-}
-
-
-class XMLImageMapPolygonContext : public XMLImageMapObjectContext
-{
- ::rtl::OUString sViewBoxString;
- ::rtl::OUString sPointsString;
-
- sal_Bool bViewBoxOK;
- sal_Bool bPointsOK;
-
-public:
- TYPEINFO();
-
- XMLImageMapPolygonContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XIndexContainer> xMap);
-
- virtual ~XMLImageMapPolygonContext();
-
-protected:
- virtual void ProcessAttribute(
- enum XMLImageMapToken eToken,
- const ::rtl::OUString& rValue);
-
- virtual void Prepare(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropertySet);
-};
-
-
-
-TYPEINIT1(XMLImageMapPolygonContext, XMLImageMapObjectContext);
-
-XMLImageMapPolygonContext::XMLImageMapPolygonContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- Reference<XIndexContainer> xMap) :
- XMLImageMapObjectContext(rImport, nPrefix, rLocalName, xMap,
- "com.sun.star.image.ImageMapPolygonObject"),
- bViewBoxOK(sal_False),
- bPointsOK(sal_False)
-{
-}
-
-XMLImageMapPolygonContext::~XMLImageMapPolygonContext()
-{
-}
-
-void XMLImageMapPolygonContext::ProcessAttribute(
- enum XMLImageMapToken eToken,
- const OUString& rValue)
-{
- switch (eToken)
- {
- case XML_TOK_IMAP_POINTS:
- sPointsString = rValue;
- bPointsOK = sal_True;
- break;
- case XML_TOK_IMAP_VIEWBOX:
- sViewBoxString = rValue;
- bViewBoxOK = sal_True;
- break;
- default:
- XMLImageMapObjectContext::ProcessAttribute(eToken, rValue);
- break;
- }
-
- bValid = bViewBoxOK && bPointsOK;
-}
-
-void XMLImageMapPolygonContext::Prepare(
- Reference<XPropertySet> & rPropertySet)
-{
- // process view box
- SdXMLImExViewBox aViewBox(sViewBoxString,
- GetImport().GetMM100UnitConverter());
-
- // get polygon sequence
- awt::Point aPoint(aViewBox.GetX(), aViewBox.GetY());
- awt::Size aSize(aViewBox.GetWidth(), aViewBox.GetHeight());
- SdXMLImExPointsElement aPoints( sPointsString, aViewBox, aPoint, aSize,
- GetImport().GetMM100UnitConverter() );
- PointSequenceSequence aPointSeqSeq = aPoints.GetPointSequenceSequence();
-
- // only use first element of sequence-sequence
- if (aPointSeqSeq.getLength() > 0)
- {
- Any aAny;
- aAny <<= aPointSeqSeq[0];
- rPropertySet->setPropertyValue(sPolygon, aAny);
- }
-
- // parent properties
- XMLImageMapObjectContext::Prepare(rPropertySet);
-}
-
-
-
-class XMLImageMapCircleContext : public XMLImageMapObjectContext
-{
- awt::Point aCenter;
- sal_Int32 nRadius;
-
- sal_Bool bXOK;
- sal_Bool bYOK;
- sal_Bool bRadiusOK;
-
-public:
- TYPEINFO();
-
- XMLImageMapCircleContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XIndexContainer> xMap);
-
- virtual ~XMLImageMapCircleContext();
-
-protected:
- virtual void ProcessAttribute(
- enum XMLImageMapToken eToken,
- const ::rtl::OUString& rValue);
-
- virtual void Prepare(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropertySet);
-};
-
-TYPEINIT1(XMLImageMapCircleContext, XMLImageMapObjectContext);
-
-XMLImageMapCircleContext::XMLImageMapCircleContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- Reference<XIndexContainer> xMap) :
- XMLImageMapObjectContext(rImport, nPrefix, rLocalName, xMap,
- "com.sun.star.image.ImageMapCircleObject"),
- bXOK(sal_False),
- bYOK(sal_False),
- bRadiusOK(sal_False)
-{
-}
-
-XMLImageMapCircleContext::~XMLImageMapCircleContext()
-{
-}
-
-void XMLImageMapCircleContext::ProcessAttribute(
- enum XMLImageMapToken eToken,
- const OUString& rValue)
-{
- sal_Int32 nTmp;
- switch (eToken)
- {
- case XML_TOK_IMAP_CENTER_X:
- if (GetImport().GetMM100UnitConverter().convertMeasure(nTmp,
- rValue))
- {
- aCenter.X = nTmp;
- bXOK = sal_True;
- }
- break;
- case XML_TOK_IMAP_CENTER_Y:
- if (GetImport().GetMM100UnitConverter().convertMeasure(nTmp,
- rValue))
- {
- aCenter.Y = nTmp;
- bYOK = sal_True;
- }
- break;
- case XML_TOK_IMAP_RADIUS:
- if (GetImport().GetMM100UnitConverter().convertMeasure(nTmp,
- rValue))
- {
- nRadius = nTmp;
- bRadiusOK = sal_True;
- }
- break;
- default:
- XMLImageMapObjectContext::ProcessAttribute(eToken, rValue);
- }
-
- bValid = bRadiusOK && bXOK && bYOK;
-}
-
-void XMLImageMapCircleContext::Prepare(
- Reference<XPropertySet> & rPropertySet)
-{
- // center (x,y)
- Any aAny;
- aAny <<= aCenter;
- rPropertySet->setPropertyValue( sCenter, aAny );
-
- // radius
- aAny <<= nRadius;
- rPropertySet->setPropertyValue( sRadius, aAny );
-
- // common properties handled by super class
- XMLImageMapObjectContext::Prepare(rPropertySet);
-}
-
-
-
-
-
-
-
-
-
-
-TYPEINIT1(XMLImageMapContext, SvXMLImportContext);
-
-XMLImageMapContext::XMLImageMapContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- Reference<XPropertySet> & rPropertySet) :
- SvXMLImportContext(rImport, nPrefix, rLocalName),
- sImageMap(RTL_CONSTASCII_USTRINGPARAM("ImageMap")),
- xPropertySet(rPropertySet)
-
-{
- try
- {
- xPropertySet->getPropertyValue(sImageMap) >>= xImageMap;
- }
- catch( ::com::sun::star::uno::Exception e )
- {
- uno::Sequence<OUString> aSeq(0);
- rImport.SetError( XMLERROR_FLAG_WARNING | XMLERROR_API, aSeq, e.Message, NULL );
- }
-}
-
-XMLImageMapContext::~XMLImageMapContext()
-{
-}
-
-SvXMLImportContext *XMLImageMapContext::CreateChildContext(
- USHORT nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
-
- if ( XML_NAMESPACE_DRAW == nPrefix )
- {
- if ( IsXMLToken(rLocalName, XML_AREA_RECTANGLE) )
- {
- pContext = new XMLImageMapRectangleContext(
- GetImport(), nPrefix, rLocalName, xImageMap);
- }
- else if ( IsXMLToken(rLocalName, XML_AREA_POLYGON) )
- {
- pContext = new XMLImageMapPolygonContext(
- GetImport(), nPrefix, rLocalName, xImageMap);
- }
- else if ( IsXMLToken(rLocalName, XML_AREA_CIRCLE) )
- {
- pContext = new XMLImageMapCircleContext(
- GetImport(), nPrefix, rLocalName, xImageMap);
- }
- }
- else
- pContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName,
- xAttrList);
-
- return pContext;
-}
-
-void XMLImageMapContext::EndElement()
-{
- Any aAny;
- aAny <<= xImageMap;
- xPropertySet->setPropertyValue(sImageMap, aAny);
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_XMLImageMapExport.cxx b/binfilter/bf_xmloff/source/draw/xmloff_XMLImageMapExport.cxx
deleted file mode 100644
index ce5cb5173692..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_XMLImageMapExport.cxx
+++ /dev/null
@@ -1,384 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLImageMapExport.hxx"
-
-
-
-#include <tools/debug.hxx>
-
-#include <com/sun/star/uno/Reference.h>
-
-#include <com/sun/star/uno/Sequence.h>
-
-
-
-#include <com/sun/star/container/XIndexContainer.hpp>
-
-#include <com/sun/star/document/XEventsSupplier.hpp>
-
-
-
-
-
-#include "xmlexp.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "XMLEventExport.hxx"
-
-#include "xmluconv.hxx"
-
-#include "xexptran.hxx"
-namespace binfilter {
-
-
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::container::XIndexContainer;
-using ::com::sun::star::document::XEventsSupplier;
-using ::com::sun::star::lang::XServiceInfo;
-using ::com::sun::star::drawing::PointSequence;
-
-
-const sal_Char sAPI_ImageMapRectangleObject[] = "com.sun.star.image.ImageMapRectangleObject";
-const sal_Char sAPI_ImageMapCircleObject[] = "com.sun.star.image.ImageMapCircleObject";
-const sal_Char sAPI_ImageMapPolygonObject[] = "com.sun.star.image.ImageMapPolygonObject";
-
-XMLImageMapExport::XMLImageMapExport(SvXMLExport& rExp) :
- rExport(rExp),
- bWhiteSpace(sal_True),
- sBoundary(RTL_CONSTASCII_USTRINGPARAM("Boundary")),
- sCenter(RTL_CONSTASCII_USTRINGPARAM("Center")),
- sDescription(RTL_CONSTASCII_USTRINGPARAM("Description")),
- sImageMap(RTL_CONSTASCII_USTRINGPARAM("ImageMap")),
- sIsActive(RTL_CONSTASCII_USTRINGPARAM("IsActive")),
- sName(RTL_CONSTASCII_USTRINGPARAM("Name")),
- sPolygon(RTL_CONSTASCII_USTRINGPARAM("Polygon")),
- sRadius(RTL_CONSTASCII_USTRINGPARAM("Radius")),
- sTarget(RTL_CONSTASCII_USTRINGPARAM("Target")),
- sURL(RTL_CONSTASCII_USTRINGPARAM("URL"))
-{
-}
-
-XMLImageMapExport::~XMLImageMapExport()
-{
-
-}
-
-void XMLImageMapExport::Export(
- const Reference<XPropertySet> & rPropertySet)
-{
- if (rPropertySet->getPropertySetInfo()->hasPropertyByName(sImageMap))
- {
- Any aAny = rPropertySet->getPropertyValue(sImageMap);
- Reference<XIndexContainer> aContainer;
- aAny >>= aContainer;
-
- Export(aContainer);
- }
- // else: no ImageMap property -> nothing to do
-}
-
-void XMLImageMapExport::Export(
- const Reference<XIndexContainer> & rContainer)
-{
- if (rContainer.is())
- {
- if (rContainer->hasElements())
- {
- // image map container element
- SvXMLElementExport aImageMapElement(
- rExport, XML_NAMESPACE_DRAW, XML_IMAGE_MAP,
- bWhiteSpace, bWhiteSpace);
-
- // iterate over image map elements and call ExportMapEntry(...)
- // for each
- sal_Int32 nLength = rContainer->getCount();
- for(sal_Int32 i = 0; i < nLength; i++)
- {
- Any aAny = rContainer->getByIndex(i);
- Reference<XPropertySet> rElement;
- aAny >>= rElement;
-
- DBG_ASSERT(rElement.is(), "Image map element is empty!");
- if (rElement.is())
- {
- ExportMapEntry(rElement);
- }
- }
- }
- // else: container is empty -> nothing to do
- }
- // else: no container -> nothign to do
-}
-
-
-void XMLImageMapExport::ExportMapEntry(
- const Reference<XPropertySet> & rPropertySet)
-{
- Reference<XServiceInfo> xServiceInfo(rPropertySet, UNO_QUERY);
- if (xServiceInfo.is())
- {
- enum XMLTokenEnum eType = XML_TOKEN_INVALID;
-
- // distinguish map entries by their service name
- Sequence<OUString> sServiceNames =
- xServiceInfo->getSupportedServiceNames();
- sal_Int32 nLength = sServiceNames.getLength();
- sal_Bool bFound = sal_False;
- for( sal_Int32 i=0; i<nLength; i++ )
- {
- OUString& rName = sServiceNames[i];
-
- if ( rName.equalsAsciiL(sAPI_ImageMapRectangleObject,
- sizeof(sAPI_ImageMapRectangleObject)-1) )
- {
- eType = XML_AREA_RECTANGLE;
- break;
- }
- else if ( rName.equalsAsciiL(sAPI_ImageMapCircleObject,
- sizeof(sAPI_ImageMapCircleObject)-1) )
- {
- eType = XML_AREA_CIRCLE;
- break;
- }
- else if ( rName.equalsAsciiL(sAPI_ImageMapPolygonObject,
- sizeof(sAPI_ImageMapPolygonObject)-1))
- {
- eType = XML_AREA_POLYGON;
- break;
- }
- }
-
- // return from method if no proper service is found!
- DBG_ASSERT(XML_TOKEN_INVALID != eType,
- "Image map element doesn't support appropriate service!");
- if (XML_TOKEN_INVALID == eType)
- return;
-
- // now: handle ImageMapObject properties (those for all types)
-
- // XLINK (URL property)
- Any aAny = rPropertySet->getPropertyValue(sURL);
- OUString sHref;
- aAny >>= sHref;
- if (sHref.getLength() > 0)
- {
- rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, rExport.GetRelativeReference(sHref));
- }
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
-
- // Target property (and xlink:show)
- aAny = rPropertySet->getPropertyValue(sTarget);
- OUString sTargt;
- aAny >>= sTargt;
- if (sTargt.getLength() > 0)
- {
- rExport.AddAttribute(
- XML_NAMESPACE_OFFICE, XML_TARGET_FRAME_NAME, sTargt);
-
- rExport.AddAttribute(
- XML_NAMESPACE_XLINK, XML_SHOW,
- sTargt.equalsAsciiL( "_blank", sizeof("_blank")-1 )
- ? XML_NEW : XML_REPLACE );
- }
-
- // name
- aAny = rPropertySet->getPropertyValue(sName);
- OUString sItemName;
- aAny >>= sItemName;
- if (sItemName.getLength() > 0)
- {
- rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_NAME, sItemName);
- }
-
- // is-active
- aAny = rPropertySet->getPropertyValue(sIsActive);
- if (! *(sal_Bool*)aAny.getValue())
- {
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_NOHREF, XML_NOHREF);
- }
-
- // call specific rectangle/circle/... method
- // also prepare element name
- switch (eType)
- {
- case XML_AREA_RECTANGLE:
- ExportRectangle(rPropertySet);
- break;
- case XML_AREA_CIRCLE:
- ExportCircle(rPropertySet);
- break;
- case XML_AREA_POLYGON:
- ExportPolygon(rPropertySet);
- break;
- }
-
- // write element
- DBG_ASSERT(XML_TOKEN_INVALID != eType,
- "No name?! How did this happen?");
- SvXMLElementExport aAreaElement(rExport, XML_NAMESPACE_DRAW, eType,
- bWhiteSpace, bWhiteSpace);
-
- // description property (as <svg:desc> element)
- aAny = rPropertySet->getPropertyValue(sDescription);
- OUString sDescription;
- aAny >>= sDescription;
- if (sDescription.getLength() > 0)
- {
- SvXMLElementExport aDesc(rExport, XML_NAMESPACE_SVG, XML_DESC,
- bWhiteSpace, sal_False);
- rExport.GetDocHandler()->characters(sDescription);
- }
-
- // export events attached to this
- Reference<XEventsSupplier> xSupplier(rPropertySet, UNO_QUERY);
- rExport.GetEventExport().Export(xSupplier, bWhiteSpace);
- }
- // else: no service info -> can't determine type -> ignore entry
-}
-
-void XMLImageMapExport::ExportRectangle(
- const Reference<XPropertySet> & rPropertySet)
-{
- // get boundary rectangle
- Any aAny = rPropertySet->getPropertyValue(sBoundary);
- awt::Rectangle aRectangle;
- aAny >>= aRectangle;
-
- // parameters svg:x, svg:y, svg:width, svg:height
- OUStringBuffer aBuffer;
- rExport.GetMM100UnitConverter().convertMeasure(aBuffer, aRectangle.X);
- rExport.AddAttribute( XML_NAMESPACE_SVG, XML_X,
- aBuffer.makeStringAndClear() );
- rExport.GetMM100UnitConverter().convertMeasure(aBuffer, aRectangle.Y);
- rExport.AddAttribute( XML_NAMESPACE_SVG, XML_Y,
- aBuffer.makeStringAndClear() );
- rExport.GetMM100UnitConverter().convertMeasure(aBuffer, aRectangle.Width);
- rExport.AddAttribute( XML_NAMESPACE_SVG, XML_WIDTH,
- aBuffer.makeStringAndClear() );
- rExport.GetMM100UnitConverter().convertMeasure(aBuffer, aRectangle.Height);
- rExport.AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT,
- aBuffer.makeStringAndClear() );
-}
-
-void XMLImageMapExport::ExportCircle(
- const Reference<XPropertySet> & rPropertySet)
-{
- // get boundary rectangle
- Any aAny = rPropertySet->getPropertyValue(sCenter);
- awt::Point aCenter;
- aAny >>= aCenter;
-
- // parameters svg:cx, svg:cy
- OUStringBuffer aBuffer;
- rExport.GetMM100UnitConverter().convertMeasure(aBuffer, aCenter.X);
- rExport.AddAttribute( XML_NAMESPACE_SVG, XML_CX,
- aBuffer.makeStringAndClear() );
- rExport.GetMM100UnitConverter().convertMeasure(aBuffer, aCenter.Y);
- rExport.AddAttribute( XML_NAMESPACE_SVG, XML_CY,
- aBuffer.makeStringAndClear() );
-
- // radius
- aAny = rPropertySet->getPropertyValue(sRadius);
- sal_Int32 nRadius;
- aAny >>= nRadius;
- rExport.GetMM100UnitConverter().convertMeasure(aBuffer, nRadius);
- rExport.AddAttribute( XML_NAMESPACE_SVG, XML_R,
- aBuffer.makeStringAndClear() );
-}
-
-void XMLImageMapExport::ExportPolygon(
- const Reference<XPropertySet> & rPropertySet)
-{
- // polygons get exported as bounding box, viewbox, and coordinate
- // pair sequence. The bounding box is always the entire image.
-
- // get polygon point sequence
- Any aAny = rPropertySet->getPropertyValue(sPolygon);
- PointSequence aPoly;
- aAny >>= aPoly;
-
- // get bounding box (assume top-left to be 0,0)
- sal_Int32 nWidth = 0;
- sal_Int32 nHeight = 0;
- sal_Int32 nLength = aPoly.getLength();
- const struct awt::Point* pPointPtr = aPoly.getConstArray();
- for ( sal_Int32 i = 0; i < nLength; i++ )
- {
- sal_Int32 nPolyX = pPointPtr->X;
- sal_Int32 nPolyY = pPointPtr->Y;
-
- if ( nPolyX > nWidth )
- nWidth = nPolyX;
- if ( nPolyY > nHeight )
- nHeight = nPolyY;
-
- pPointPtr++;
- }
- DBG_ASSERT(nWidth > 0, "impossible Polygon found");
- DBG_ASSERT(nHeight > 0, "impossible Polygon found");
-
- // parameters svg:x, svg:y, svg:width, svg:height
- OUStringBuffer aBuffer;
- rExport.AddAttribute( XML_NAMESPACE_SVG, XML_X, XML_0 );
- rExport.AddAttribute( XML_NAMESPACE_SVG, XML_Y, XML_0 );
- rExport.GetMM100UnitConverter().convertMeasure(aBuffer, nWidth);
- rExport.AddAttribute( XML_NAMESPACE_SVG, XML_WIDTH,
- aBuffer.makeStringAndClear() );
- rExport.GetMM100UnitConverter().convertMeasure(aBuffer, nHeight);
- rExport.AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT,
- aBuffer.makeStringAndClear() );
-
- // svg:viewbox
- SdXMLImExViewBox aViewBox(0, 0, nWidth, nHeight);
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_VIEWBOX,
- aViewBox.GetExportString(rExport.GetMM100UnitConverter()));
-
- // export point sequence
- awt::Point aPoint(0, 0);
- awt::Size aSize(nWidth, nHeight);
- SdXMLImExPointsElement aPoints( &aPoly, aViewBox, aPoint, aSize,
- rExport.GetMM100UnitConverter() );
- rExport.AddAttribute( XML_NAMESPACE_SVG, XML_POINTS,
- aPoints.GetExportString());
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_XMLNumberStyles.cxx b/binfilter/bf_xmloff/source/draw/xmloff_XMLNumberStyles.cxx
deleted file mode 100644
index 6ed14f8f25d6..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_XMLNumberStyles.cxx
+++ /dev/null
@@ -1,647 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include <XMLNumberStylesExport.hxx>
-
-#include <XMLNumberStylesImport.hxx>
-
-#include "xmlnmspe.hxx"
-
-
-#include "nmspmap.hxx"
-
-
-#include "sdxmlexp_impl.hxx"
-#include "sdxmlimp_impl.hxx"
-namespace binfilter {
-
-using namespace rtl;
-using namespace ::binfilter::xmloff::token;
-
-struct SdXMLDataStyleNumber
-{
- enum XMLTokenEnum meNumberStyle;
- sal_Bool mbLong;
- sal_Bool mbTextual;
- sal_Bool mbDecimal02;
- const char* mpText;
-}
- aSdXMLDataStyleNumbers[] =
-{
- { XML_DAY, sal_False, sal_False, sal_False, NULL },
- { XML_DAY, sal_True, sal_False, sal_False, NULL },
- { XML_MONTH, sal_True, sal_False, sal_False, NULL },
- { XML_MONTH, sal_False, sal_True, sal_False, NULL },
- { XML_MONTH, sal_True, sal_True, sal_False, NULL },
- { XML_YEAR, sal_False, sal_False, sal_False, NULL },
- { XML_YEAR, sal_True, sal_False, sal_False, NULL },
- { XML_DAY_OF_WEEK, sal_False, sal_False, sal_False, NULL },
- { XML_DAY_OF_WEEK, sal_True, sal_False, sal_False, NULL },
- { XML_TEXT, sal_False, sal_False, sal_False, "." },
- { XML_TEXT, sal_False, sal_False, sal_False, " " },
- { XML_TEXT, sal_False, sal_False, sal_False, ", " },
- { XML_TEXT, sal_False, sal_False, sal_False, ". " },
- { XML_HOURS, sal_False, sal_False, sal_False, NULL },
- { XML_MINUTES, sal_False, sal_False, sal_False, NULL },
- { XML_TEXT, sal_False, sal_False, sal_False, ":" },
- { XML_AM_PM, sal_False, sal_False, sal_False, NULL },
- { XML_SECONDS, sal_False, sal_False, sal_False, NULL },
- { XML_SECONDS, sal_False, sal_False, sal_True, NULL },
- { XML_TOKEN_INVALID, NULL }
-};
-
-// date
-
-#define DATA_STYLE_NUMBER_END 0
-#define DATA_STYLE_NUMBER_DAY 1 // <number:day/>
-#define DATA_STYLE_NUMBER_DAY_LONG 2 // <number:day number:style="long"/>
-#define DATA_STYLE_NUMBER_MONTH_LONG 3 // <number:month number:style="long"/>
-#define DATA_STYLE_NUMBER_MONTH_TEXT 4 // <number:month number:textual="true"/>
-#define DATA_STYLE_NUMBER_MONTH_LONG_TEXT 5 // <number:month number:style="long" number:textual="true"/>
-#define DATA_STYLE_NUMBER_YEAR 6 // <number:year/>
-#define DATA_STYLE_NUMBER_YEAR_LONG 7 // <number:year number:style="long"/>
-#define DATA_STYLE_NUMBER_DAYOFWEEK 8 // <number:day-of-week/>
-#define DATA_STYLE_NUMBER_DAYOFWEEK_LONG 9 // <number:day-of-week number:style="long"/>
-#define DATA_STYLE_NUMBER_TEXT_POINT 10 // <number:text>.</number:text>
-#define DATA_STYLE_NUMBER_TEXT_SPACE 11 // <number:text> </number:text>
-#define DATA_STYLE_NUMBER_TEXT_COMMASPACE 12 // <number:text>, </number:text>
-#define DATA_STYLE_NUMBER_TEXT_POINTSPACE 13 // <number:text>. </number:text>
-#define DATA_STYLE_NUMBER_HOURS 14 // <number:hours/>
-#define DATA_STYLE_NUMBER_MINUTES 15 // <number:minutes/>
-#define DATA_STYLE_NUMBER_TEXT_COLON 16 // <number:text>:</number:text>
-#define DATA_STYLE_NUMBER_AMPM 17 // <number:am-pm/>
-#define DATA_STYLE_NUMBER_SECONDS 18 // <number:seconds/>
-#define DATA_STYLE_NUMBER_SECONDS_02 19 // <number:seconds number:/>
-
-
-struct SdXMLFixedDataStyle
-{
- const char* mpName;
- sal_Bool mbAutomatic;
- sal_Bool mbDateStyle;
- sal_uInt8 mpFormat[8];
-};
-
-const SdXMLFixedDataStyle aSdXML_Standard_Short =
-{
- "D1", sal_True, sal_True,
- {
- DATA_STYLE_NUMBER_DAY_LONG,
- DATA_STYLE_NUMBER_TEXT_POINT,
- DATA_STYLE_NUMBER_MONTH_LONG,
- DATA_STYLE_NUMBER_TEXT_POINT,
- DATA_STYLE_NUMBER_YEAR_LONG,
- 0, 0, 0
- }
-};
-
-const SdXMLFixedDataStyle aSdXML_Standard_Long =
-{
- "D2", sal_True, sal_True,
- {
- DATA_STYLE_NUMBER_DAYOFWEEK_LONG,
- DATA_STYLE_NUMBER_TEXT_COMMASPACE,
- DATA_STYLE_NUMBER_DAY,
- DATA_STYLE_NUMBER_TEXT_POINTSPACE,
- DATA_STYLE_NUMBER_MONTH_LONG_TEXT,
- DATA_STYLE_NUMBER_TEXT_SPACE,
- DATA_STYLE_NUMBER_YEAR_LONG,
- 0
- }
-};
-
-const SdXMLFixedDataStyle aSdXML_DateStyle_1 =
-{
- "D3", sal_False, sal_True,
- {
- DATA_STYLE_NUMBER_DAY_LONG,
- DATA_STYLE_NUMBER_TEXT_POINT,
- DATA_STYLE_NUMBER_MONTH_LONG,
- DATA_STYLE_NUMBER_TEXT_POINT,
- DATA_STYLE_NUMBER_YEAR,
- 0, 0, 0
- }
-};
-
-const SdXMLFixedDataStyle aSdXML_DateStyle_2 =
-{
- "D4", sal_False, sal_True,
- {
- DATA_STYLE_NUMBER_DAY_LONG,
- DATA_STYLE_NUMBER_TEXT_POINT,
- DATA_STYLE_NUMBER_MONTH_LONG,
- DATA_STYLE_NUMBER_TEXT_POINT,
- DATA_STYLE_NUMBER_YEAR_LONG,
- 0, 0, 0
- }
-};
-
-const SdXMLFixedDataStyle aSdXML_DateStyle_3 =
-{
- "D5", sal_False, sal_True,
- {
- DATA_STYLE_NUMBER_DAY,
- DATA_STYLE_NUMBER_TEXT_POINTSPACE,
- DATA_STYLE_NUMBER_MONTH_TEXT,
- DATA_STYLE_NUMBER_TEXT_SPACE,
- DATA_STYLE_NUMBER_YEAR_LONG,
- 0, 0, 0
- }
-};
-
-const SdXMLFixedDataStyle aSdXML_DateStyle_4 =
-{
- "D6", sal_False, sal_True,
- {
- DATA_STYLE_NUMBER_DAY,
- DATA_STYLE_NUMBER_TEXT_POINTSPACE,
- DATA_STYLE_NUMBER_MONTH_LONG_TEXT,
- DATA_STYLE_NUMBER_TEXT_SPACE,
- DATA_STYLE_NUMBER_YEAR_LONG,
- 0, 0, 0
- }
-};
-
-const SdXMLFixedDataStyle aSdXML_DateStyle_5 =
-{
- "D7", sal_False, sal_True,
- {
- DATA_STYLE_NUMBER_DAYOFWEEK,
- DATA_STYLE_NUMBER_TEXT_COMMASPACE,
- DATA_STYLE_NUMBER_DAY,
- DATA_STYLE_NUMBER_TEXT_POINTSPACE,
- DATA_STYLE_NUMBER_MONTH_LONG_TEXT,
- DATA_STYLE_NUMBER_TEXT_SPACE,
- DATA_STYLE_NUMBER_YEAR_LONG,
- 0
- }
-};
-
-const SdXMLFixedDataStyle aSdXML_DateStyle_6 =
-{
- "D8", sal_False, sal_True,
- {
- DATA_STYLE_NUMBER_DAYOFWEEK_LONG,
- DATA_STYLE_NUMBER_TEXT_COMMASPACE,
- DATA_STYLE_NUMBER_DAY,
- DATA_STYLE_NUMBER_TEXT_POINTSPACE,
- DATA_STYLE_NUMBER_MONTH_LONG_TEXT,
- DATA_STYLE_NUMBER_TEXT_SPACE,
- DATA_STYLE_NUMBER_YEAR_LONG,
- 0
- }
-};
-
-const SdXMLFixedDataStyle aSdXML_TimeStyle_1 =
-{ "T1", sal_True, sal_False,
- {
- DATA_STYLE_NUMBER_HOURS,
- DATA_STYLE_NUMBER_TEXT_COLON,
- DATA_STYLE_NUMBER_MINUTES,
- DATA_STYLE_NUMBER_TEXT_COLON,
- DATA_STYLE_NUMBER_SECONDS,
- DATA_STYLE_NUMBER_AMPM,
- 0, 0,
- }
-};
-
-const SdXMLFixedDataStyle aSdXML_TimeStyle_2 =
-{ "T2", sal_False, sal_False,
- {
- DATA_STYLE_NUMBER_HOURS,
- DATA_STYLE_NUMBER_TEXT_COLON,
- DATA_STYLE_NUMBER_MINUTES,
- 0, 0, 0, 0, 0
- }
-};
-
-const SdXMLFixedDataStyle aSdXML_TimeStyle_3 =
-{ "T3", sal_False, sal_False,
- {
- DATA_STYLE_NUMBER_HOURS,
- DATA_STYLE_NUMBER_TEXT_COLON,
- DATA_STYLE_NUMBER_MINUTES,
- DATA_STYLE_NUMBER_TEXT_COLON,
- DATA_STYLE_NUMBER_SECONDS,
- 0, 0, 0
- }
-};
-
-const SdXMLFixedDataStyle aSdXML_TimeStyle_4 =
-{ "T4", sal_False, sal_False,
- {
- DATA_STYLE_NUMBER_HOURS,
- DATA_STYLE_NUMBER_TEXT_COLON,
- DATA_STYLE_NUMBER_MINUTES,
- DATA_STYLE_NUMBER_TEXT_COLON,
- DATA_STYLE_NUMBER_SECONDS_02,
- 0, 0, 0
- }
-};
-
-const SdXMLFixedDataStyle aSdXML_TimeStyle_5 =
-{ "T5", sal_False, sal_False,
- {
- DATA_STYLE_NUMBER_HOURS,
- DATA_STYLE_NUMBER_TEXT_COLON,
- DATA_STYLE_NUMBER_MINUTES,
- DATA_STYLE_NUMBER_AMPM,
- 0, 0, 0, 0
- }
-};
-
-const SdXMLFixedDataStyle aSdXML_TimeStyle_6 =
-{ "T6", sal_False, sal_False,
- {
- DATA_STYLE_NUMBER_HOURS,
- DATA_STYLE_NUMBER_TEXT_COLON,
- DATA_STYLE_NUMBER_MINUTES,
- DATA_STYLE_NUMBER_TEXT_COLON,
- DATA_STYLE_NUMBER_SECONDS,
- DATA_STYLE_NUMBER_AMPM,
- 0, 0
- }
-};
-
-const SdXMLFixedDataStyle aSdXML_TimeStyle_7 =
-{ "T7", sal_False, sal_False,
- {
- DATA_STYLE_NUMBER_HOURS,
- DATA_STYLE_NUMBER_TEXT_COLON,
- DATA_STYLE_NUMBER_MINUTES,
- DATA_STYLE_NUMBER_TEXT_COLON,
- DATA_STYLE_NUMBER_SECONDS_02,
- DATA_STYLE_NUMBER_AMPM,
- 0, 0
- }
-};
-
-const SdXMLFixedDataStyle* aSdXMLFixedDateFormats[SdXMLDateFormatCount] =
-{
- &aSdXML_Standard_Short,
- &aSdXML_Standard_Long,
- &aSdXML_DateStyle_1,
- &aSdXML_DateStyle_2,
- &aSdXML_DateStyle_3,
- &aSdXML_DateStyle_4,
- &aSdXML_DateStyle_5,
- &aSdXML_DateStyle_6,
-};
-
-const SdXMLFixedDataStyle* aSdXMLFixedTimeFormats[SdXMLTimeFormatCount] =
-{
- &aSdXML_TimeStyle_1,
- &aSdXML_TimeStyle_2,
- &aSdXML_TimeStyle_3,
- &aSdXML_TimeStyle_4,
- &aSdXML_TimeStyle_5,
- &aSdXML_TimeStyle_6,
- &aSdXML_TimeStyle_7
-};
-
-
-///////////////////////////////////////////////////////////////////////
-// export
-
-#ifndef SVX_LIGHT
-
-static void SdXMLExportStyle( SdXMLExport& rExport, const SdXMLFixedDataStyle* pStyle )
-{
- OUString sAttrValue;
-
- // name
- sAttrValue = OUString::createFromAscii( pStyle->mpName );
- rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_NAME, sAttrValue );
-
- // family
- sAttrValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("data-style"));
- rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_FAMILY, sAttrValue );
-
- if( pStyle->mbAutomatic )
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_AUTOMATIC_ORDER, XML_TRUE );
- }
-
- SvXMLElementExport aElement( rExport, XML_NAMESPACE_NUMBER, pStyle->mbDateStyle ? XML_DATE_STYLE : XML_TIME_STYLE, sal_True, sal_True );
-
- const sal_uInt8* pElements = (const sal_uInt8*)&pStyle->mpFormat[0];
-
- while( *pElements )
- {
- SdXMLDataStyleNumber& rElement = aSdXMLDataStyleNumbers[ (*pElements++) - 1 ];
-
- if( rElement.mbDecimal02 )
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_DECIMAL_PLACES, XML_2 );
- }
-
- if( rElement.mbLong )
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_STYLE, XML_LONG );
- }
-
- if( rElement.mbTextual )
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_TEXTUAL, XML_TRUE );
- }
-
- SvXMLElementExport aNumberStyle( rExport, XML_NAMESPACE_NUMBER, rElement.meNumberStyle, sal_True, sal_False );
- if( rElement.mpText )
- {
- sAttrValue = OUString::createFromAscii( rElement.mpText );
- rExport.GetDocHandler()->characters( sAttrValue );
- }
- }
-}
-
-void SdXMLNumberStylesExporter::exportTimeStyle( SdXMLExport& rExport, sal_Int32 nStyle )
-{
- DBG_ASSERT( (nStyle >= 0) && (nStyle < SdXMLTimeFormatCount), "Unknown time style!" );
- SdXMLExportStyle( rExport, aSdXMLFixedTimeFormats[ nStyle ] );
-}
-
-void SdXMLNumberStylesExporter::exportDateStyle( SdXMLExport& rExport, sal_Int32 nStyle )
-{
- DBG_ASSERT( (nStyle >= 0) && (nStyle < SdXMLDateFormatCount), "Unknown date style!" );
- SdXMLExportStyle( rExport, aSdXMLFixedDateFormats[ nStyle ] );
-}
-
-OUString SdXMLNumberStylesExporter::getTimeStyleName(const sal_Int32 nTimeFormat )
-{
- sal_Int32 nFormat = nTimeFormat;
- if( nFormat > 1 )
- nFormat -= 2;
-
- if( (nFormat >= 0) && (nFormat < SdXMLTimeFormatCount) )
- {
- return OUString::createFromAscii(aSdXMLFixedTimeFormats[nFormat]->mpName );
- }
- else
- {
- return OUString();
- }
-}
-
-OUString SdXMLNumberStylesExporter::getDateStyleName(const sal_Int32 nDateFormat )
-{
- sal_Int32 nFormat = nDateFormat;
- if( nFormat > 1 )
- nFormat -= 2;
-
- if( (nFormat >= 0) && (nFormat < SdXMLDateFormatCount) )
- {
- return OUString::createFromAscii(aSdXMLFixedDateFormats[nFormat]->mpName );
- }
- else
- {
- return OUString();
- }
-}
-
-#endif // #ifndef SVX_LIGHT
-
-
-///////////////////////////////////////////////////////////////////////
-// import
-
-class SdXMLNumberFormatMemberImportContext : public SvXMLImportContext
-{
-private:
- SdXMLNumberFormatImportContext* mpParent;
-
- OUString maNumberStyle;
- sal_Bool mbLong;
- sal_Bool mbTextual;
- sal_Bool mbDecimal02;
- OUString maText;
- SvXMLImportContext* mpSlaveContext;
-
-public:
- TYPEINFO();
-
- SdXMLNumberFormatMemberImportContext( SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- SdXMLNumberFormatImportContext* pParent,
- SvXMLImportContext* pSlaveContext );
- virtual ~SdXMLNumberFormatMemberImportContext();
-
- virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
- virtual void EndElement();
-
- virtual void Characters( const ::rtl::OUString& rChars );
-};
-
-TYPEINIT1( SdXMLNumberFormatMemberImportContext, SvXMLImportContext );
-
-SdXMLNumberFormatMemberImportContext::SdXMLNumberFormatMemberImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList, SdXMLNumberFormatImportContext* pParent, SvXMLImportContext* pSlaveContext )
-: SvXMLImportContext(rImport, nPrfx, rLocalName),
- mpParent( pParent ),
- maNumberStyle( rLocalName ),
- mpSlaveContext( pSlaveContext )
-{
- mbLong = sal_False;
- mbTextual = sal_False;
- mbDecimal02 = sal_False;
-
- const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- OUString sValue = xAttrList->getValueByIndex( i );
-
- if( nPrefix == XML_NAMESPACE_NUMBER )
- {
- if( IsXMLToken( aLocalName, XML_DECIMAL_PLACES ) )
- {
- mbDecimal02 = IsXMLToken( sValue, XML_2 );
- }
- else if( IsXMLToken( aLocalName, XML_STYLE ) )
- {
- mbLong = IsXMLToken( sValue, XML_LONG );
- }
- else if( IsXMLToken( aLocalName, XML_TEXTUAL ) )
- {
- mbTextual = IsXMLToken( sValue, XML_TRUE );
- }
- }
- }
-
-}
-
-SdXMLNumberFormatMemberImportContext::~SdXMLNumberFormatMemberImportContext()
-{
-}
-
-SvXMLImportContext *SdXMLNumberFormatMemberImportContext::CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList )
-{
- return mpSlaveContext->CreateChildContext( nPrefix, rLocalName, xAttrList );
-}
-
-void SdXMLNumberFormatMemberImportContext::StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList )
-{
- mpSlaveContext->StartElement( xAttrList );
-}
-
-void SdXMLNumberFormatMemberImportContext::EndElement()
-{
- mpSlaveContext->EndElement();
-
- if( mpParent )
- mpParent->add( maNumberStyle, mbLong, mbTextual, mbDecimal02, maText );
-}
-
-void SdXMLNumberFormatMemberImportContext::Characters( const ::rtl::OUString& rChars )
-{
- mpSlaveContext->Characters( rChars );
- maText += rChars;
-}
-
-TYPEINIT1( SdXMLNumberFormatImportContext, SvXMLImportContext );
-
-
-SdXMLNumberFormatImportContext::SdXMLNumberFormatImportContext( SdXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLocalName, SvXMLNumImpData* pNewData, sal_uInt16 nNewType, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList, SvXMLStylesContext& rStyles)
-: SvXMLNumFormatContext(rImport, nPrfx, rLocalName, pNewData, nNewType, xAttrList, rStyles),
- mbAutomatic( sal_False ), mnIndex(0), mrImport( rImport ), mnKey( -1 )
-{
- mbTimeStyle = IsXMLToken( rLocalName, XML_TIME_STYLE );
-
- const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- OUString sValue = xAttrList->getValueByIndex( i );
-
- if( nPrefix == XML_NAMESPACE_NUMBER )
- {
- if( IsXMLToken( aLocalName, XML_AUTOMATIC_ORDER ) )
- {
- mbAutomatic = IsXMLToken( sValue, XML_TRUE );
- }
- }
- }
-}
-
-SdXMLNumberFormatImportContext::~SdXMLNumberFormatImportContext()
-{
-}
-
-void SdXMLNumberFormatImportContext::add( OUString& rNumberStyle, sal_Bool bLong, sal_Bool bTextual, sal_Bool bDecimal02, OUString& rText )
-{
- if( mnIndex == -1 || mnIndex == 8 )
- {
- mnIndex = -1;
- return;
- }
-
- const SdXMLDataStyleNumber* pStyleMember = aSdXMLDataStyleNumbers;
- for( sal_uInt8 nIndex = 0; pStyleMember->meNumberStyle != XML_TOKEN_INVALID; nIndex++, pStyleMember++ )
- {
- if( (IsXMLToken(rNumberStyle, pStyleMember->meNumberStyle) &&
- (pStyleMember->mbLong == bLong) &&
- (pStyleMember->mbTextual == bTextual) &&
- (pStyleMember->mbDecimal02 == bDecimal02) &&
- ( ( (pStyleMember->mpText == NULL) && (rText.getLength() == 0) ) ||
- ( pStyleMember->mpText && (rText.compareToAscii( pStyleMember->mpText ) == 0 )) ) ) )
- {
- mnElements[mnIndex++] = nIndex + 1;
- return;
- }
- }
-}
-
-sal_Bool SdXMLNumberFormatImportContext::compareStyle( const SdXMLFixedDataStyle* pStyle ) const
-{
- if( pStyle->mbAutomatic != mbAutomatic )
- return sal_False;
-
- for( sal_Int16 nIndex = 0; nIndex < 8; nIndex++ )
- {
- if( pStyle->mpFormat[nIndex] != mnElements[nIndex] )
- return sal_False;
- }
-
- return sal_True;
-}
-
-void SdXMLNumberFormatImportContext::EndElement()
-{
- SvXMLNumFormatContext::EndElement();
-
- for( ; mnIndex < 8; mnIndex++ )
- {
- mnElements[mnIndex] = 0;
- }
-
- if( mbTimeStyle )
- {
- // compare import with all time styles
- for( sal_Int16 nFormat = 0; nFormat < SdXMLTimeFormatCount; nFormat++ )
- {
- if( compareStyle( aSdXMLFixedTimeFormats[nFormat] ) )
- {
- mnKey = nFormat + 2;
- break;
- }
- }
- }
- else
- {
- // compare import with all date styles
- for( sal_Int16 nFormat = 0; nFormat < SdXMLDateFormatCount; nFormat++ )
- {
- if( compareStyle( aSdXMLFixedDateFormats[nFormat] ) )
- {
- mnKey = nFormat + 2;
- break;
- }
- }
- }
-}
-
-SvXMLImportContext * SdXMLNumberFormatImportContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
-{
- return new SdXMLNumberFormatMemberImportContext( GetImport(), nPrefix, rLocalName, xAttrList, this, SvXMLNumFormatContext::CreateChildContext( nPrefix, rLocalName, xAttrList ) );
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_XMLShapePropertySetContext.cxx b/binfilter/bf_xmloff/source/draw/xmloff_XMLShapePropertySetContext.cxx
deleted file mode 100644
index de374ebc5c97..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_XMLShapePropertySetContext.cxx
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include "XMLShapePropertySetContext.hxx"
-#include "xmlimp.hxx"
-#include "xmlnumi.hxx"
-#include "xmltabi.hxx"
-#include "txtprmap.hxx"
-
-#include "sdpropls.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-
-using rtl::OUString;
-
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( XMLShapePropertySetContext, SvXMLPropertySetContext );
-
-XMLShapePropertySetContext::XMLShapePropertySetContext(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- ::std::vector< XMLPropertyState > &rProps,
- const UniReference < SvXMLImportPropertyMapper > &rMap ) :
- SvXMLPropertySetContext( rImport, nPrfx, rLName, xAttrList, rProps, rMap ),
- mnBulletIndex(-1)
-{
-}
-
-XMLShapePropertySetContext::~XMLShapePropertySetContext()
-{
-}
-
-void XMLShapePropertySetContext::EndElement()
-{
- Reference< container::XIndexReplace > xNumRule;
- if( mxBulletStyle.Is() )
- {
- SvxXMLListStyleContext* pBulletStyle = (SvxXMLListStyleContext*)&mxBulletStyle;
- xNumRule = pBulletStyle->CreateNumRule( GetImport().GetModel() );
- pBulletStyle->FillUnoNumRule(xNumRule, NULL /* const SvI18NMap * ??? */ );
- }
-
- Any aAny;
- aAny <<= xNumRule;
-
- XMLPropertyState aPropState( mnBulletIndex, aAny );
- rProperties.push_back( aPropState );
-
- SvXMLPropertySetContext::EndElement();
-}
-
-SvXMLImportContext *XMLShapePropertySetContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- ::std::vector< XMLPropertyState > &rProperties,
- const XMLPropertyState& rProp )
-{
- SvXMLImportContext *pContext = 0;
-
- switch( xMapper->getPropertySetMapper()->GetEntryContextId( rProp.mnIndex ) )
- {
- case CTF_NUMBERINGRULES:
- mnBulletIndex = rProp.mnIndex;
- mxBulletStyle = pContext = new SvxXMLListStyleContext( GetImport(), nPrefix, rLocalName, xAttrList );
- break;
- case CTF_TABSTOP:
- pContext = new SvxXMLTabStopImportContext( GetImport(), nPrefix,
- rLocalName, rProp,
- rProperties );
- break;
- }
-
- if( !pContext )
- pContext = SvXMLPropertySetContext::CreateChildContext( nPrefix, rLocalName,
- xAttrList,
- rProperties, rProp );
-
- return pContext;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_XMLShapeStyleContext.cxx b/binfilter/bf_xmloff/source/draw/xmloff_XMLShapeStyleContext.cxx
deleted file mode 100644
index 7c214a0bdd65..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_XMLShapeStyleContext.cxx
+++ /dev/null
@@ -1,205 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include "XMLShapeStyleContext.hxx"
-#include "XMLShapePropertySetContext.hxx"
-
-#include "contextid.hxx"
-
-#include <com/sun/star/drawing/XControlShape.hpp>
-
-#include "xmlimp.hxx"
-
-#include "xmlnumi.hxx"
-
-#include <xmlnmspe.hxx>
-
-
-
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_PROPERTIES;
-
-using rtl::OUString;
-
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( XMLShapeStyleContext, XMLPropStyleContext );
-
-XMLShapeStyleContext::XMLShapeStyleContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList,
- SvXMLStylesContext& rStyles,
- sal_uInt16 nFamily)
-: XMLPropStyleContext(rImport, nPrfx, rLName, xAttrList, rStyles, nFamily ),
- m_bIsNumRuleAlreadyConverted( sal_False )
-{
-}
-
-XMLShapeStyleContext::~XMLShapeStyleContext()
-{
-}
-
-void XMLShapeStyleContext::SetAttribute( sal_uInt16 nPrefixKey, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- if ((0 == m_sControlDataStyleName.getLength()) && (::binfilter::xmloff::token::GetXMLToken(::binfilter::xmloff::token::XML_DATA_STYLE_NAME) == rLocalName))
- {
- m_sControlDataStyleName = rValue;
- }
- else if( (XML_NAMESPACE_STYLE == nPrefixKey) && IsXMLToken( rLocalName, ::binfilter::xmloff::token::XML_LIST_STYLE_NAME ) )
- {
- m_sListStyleName = rValue;
- }
- else
- {
- XMLPropStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue );
- }
-}
-
-SvXMLImportContext *XMLShapeStyleContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
-
- if( XML_NAMESPACE_STYLE == nPrefix &&
- IsXMLToken( rLocalName, XML_PROPERTIES ) )
- {
- UniReference < SvXMLImportPropertyMapper > xImpPrMap =
- GetStyles()->GetImportPropertyMapper( GetFamily() );
- if( xImpPrMap.is() )
- pContext = new XMLShapePropertySetContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- GetProperties(),
- xImpPrMap );
- }
-
- if( !pContext )
- pContext = XMLPropStyleContext::CreateChildContext( nPrefix, rLocalName,
- xAttrList );
-
- return pContext;
-}
-
-void XMLShapeStyleContext::FillPropertySet( const Reference< beans::XPropertySet > & rPropSet )
-{
- if( !m_bIsNumRuleAlreadyConverted )
- {
- m_bIsNumRuleAlreadyConverted = sal_True;
-
- // for compatibility to beta files, search for CTF_SD_NUMBERINGRULES_NAME to
- // import numbering rules from the style:properties element
- const UniReference< XMLPropertySetMapper >&rMapper = GetStyles()->GetImportPropertyMapper( GetFamily() )->getPropertySetMapper();
-
- ::std::vector< XMLPropertyState > &rProperties = GetProperties();
- ::std::vector< XMLPropertyState >::iterator end( rProperties.end() );
- ::std::vector< XMLPropertyState >::iterator property;
-
- // first, look for the old format, where we had a text:list-style-name
- // attribute in the style:properties element
- for( property = rProperties.begin(); property != end; property++ )
- {
- // find properties with context
- if( rMapper->GetEntryContextId( property->mnIndex ) == CTF_SD_NUMBERINGRULES_NAME )
- break;
- }
-
- // if we did not find an old list-style-name in the properties, and we need one
- // because we got a style:list-style attribute in the style-style element
- // we generate one
- if( (property == end) && ( 0 != m_sListStyleName.getLength() ) )
- {
- sal_Int32 nIndex = rMapper->FindEntryIndex( CTF_SD_NUMBERINGRULES_NAME );
- DBG_ASSERT( -1 != nIndex, "can't find numbering rules property entry, can't set numbering rule!" );
-
- XMLPropertyState aNewState( nIndex );
- rProperties.push_back( aNewState );
- end = rProperties.end();
- property = end - 1;
- }
-
- // so, if we have an old or a new list style name, we set its value to
- // a numbering rule
- if( property != end )
- {
- if( 0 == m_sListStyleName.getLength() )
- {
- property->maValue >>= m_sListStyleName;
- }
-
- const SvxXMLListStyleContext *pListStyle = GetImport().GetTextImport()->FindAutoListStyle( m_sListStyleName );
-
- DBG_ASSERT( pListStyle, "list-style not found for shape style" );
- if( pListStyle )
- {
- uno::Reference< container::XIndexReplace > xNumRule( pListStyle->CreateNumRule( GetImport().GetModel() ) );
- pListStyle->FillUnoNumRule(xNumRule, NULL /* const SvI18NMap * ??? */ );
- property->maValue <<= xNumRule;
- }
- else
- {
- property->mnIndex = -1;
- }
- }
- }
-
- XMLPropStyleContext::FillPropertySet(rPropSet);
-
- if (m_sControlDataStyleName.getLength())
- { // we had a data-style-name attribute
-
- // set the formatting on the control model of the control shape
- uno::Reference< drawing::XControlShape > xControlShape(rPropSet, uno::UNO_QUERY);
- DBG_ASSERT(xControlShape.is(), "XMLShapeStyleContext::FillPropertySet: data style for a non-control shape!");
- if (xControlShape.is())
- {
- uno::Reference< beans::XPropertySet > xControlModel(xControlShape->getControl(), uno::UNO_QUERY);
- DBG_ASSERT(xControlModel.is(), "XMLShapeStyleContext::FillPropertySet: no control model for the shape!");
- if (xControlModel.is())
- {
- GetImport().GetFormImport()->applyControlNumberStyle(xControlModel, m_sControlDataStyleName);
- }
- }
- }
-}
-
-void XMLShapeStyleContext::Finish( sal_Bool bOverwrite )
-{
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_animexp.cxx b/binfilter/bf_xmloff/source/draw/xmloff_animexp.cxx
deleted file mode 100644
index 0bc088000725..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_animexp.cxx
+++ /dev/null
@@ -1,552 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include <com/sun/star/presentation/AnimationSpeed.hpp>
-
-#include <list>
-
-#include <comphelper/extract.hxx>
-
-
-
-#include "xmlnmspe.hxx"
-
-#include "xmluconv.hxx"
-
-#include "xmlexp.hxx"
-
-
-
-
-#include "anim.hxx"
-namespace binfilter {
-
-using namespace ::std;
-using namespace ::cppu;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::drawing;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::presentation;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-
-const struct Effect
-{
- XMLEffect meKind;
- XMLEffectDirection meDirection;
- sal_Int16 mnStartScale;
- sal_Bool mbIn;
-}
- AnimationEffectMap[] =
-{
- { EK_none, ED_none, -1, sal_True }, // AnimationEffect_NONE
- { EK_fade, ED_from_left, -1, sal_True }, // AnimationEffect_FADE_FROM_LEFT
- { EK_fade, ED_from_top, -1, sal_True }, // AnimationEffect_FADE_FROM_TOP
- { EK_fade, ED_from_right, -1, sal_True }, // AnimationEffect_FADE_FROM_RIGHT
- { EK_fade, ED_from_bottom, -1, sal_True }, // AnimationEffect_FADE_FROM_BOTTOM
- { EK_fade, ED_to_center, -1, sal_True }, // AnimationEffect_FADE_TO_CENTER
- { EK_fade, ED_from_center, -1, sal_True }, // AnimationEffect_FADE_FROM_CENTER
- { EK_move, ED_from_left, -1, sal_True }, // AnimationEffect_MOVE_FROM_LEFT
- { EK_move, ED_from_top, -1, sal_True }, // AnimationEffect_MOVE_FROM_TOP
- { EK_move, ED_from_right, -1, sal_True }, // AnimationEffect_MOVE_FROM_RIGHT
- { EK_move, ED_from_bottom, -1, sal_True }, // AnimationEffect_MOVE_FROM_BOTTOM
- { EK_stripes, ED_vertical, -1, sal_True }, // AnimationEffect_VERTICAL_STRIPES
- { EK_stripes, ED_horizontal, -1, sal_True }, // AnimationEffect_HORIZONTAL_STRIPES
- { EK_fade, ED_clockwise, -1, sal_True }, // AnimationEffect_CLOCKWISE
- { EK_fade, ED_cclockwise, -1, sal_True }, // AnimationEffect_COUNTERCLOCKWISE
- { EK_fade, ED_from_upperleft, -1, sal_True }, // AnimationEffect_FADE_FROM_UPPERLEFT
- { EK_fade, ED_from_upperright, -1, sal_True }, // AnimationEffect_FADE_FROM_UPPERRIGHT
- { EK_fade, ED_from_lowerleft, -1, sal_True }, // AnimationEffect_FADE_FROM_LOWERLEFT
- { EK_fade, ED_from_lowerright, -1, sal_True }, // AnimationEffect_FADE_FROM_LOWERRIGHT
- { EK_close,ED_vertical, -1, sal_True }, // AnimationEffect_CLOSE_VERTICAL
- { EK_close,ED_horizontal, -1, sal_True }, // AnimationEffect_CLOSE_HORIZONTAL
- { EK_open, ED_vertical, -1, sal_True }, // AnimationEffect_OPEN_VERTICAL
- { EK_open, ED_horizontal, -1, sal_True }, // AnimationEffect_OPEN_HORIZONTAL
- { EK_move, ED_path, -1, sal_True }, // AnimationEffect_PATH
- { EK_move, ED_to_left, -1, sal_False },// AnimationEffect_MOVE_TO_LEFT
- { EK_move, ED_to_top, -1, sal_False },// AnimationEffect_MOVE_TO_TOP
- { EK_move, ED_to_right, -1, sal_False },// AnimationEffect_MOVE_TO_RIGHT
- { EK_move, ED_to_bottom, -1, sal_False },// AnimationEffect_MOVE_TO_BOTTOM
- { EK_fade, ED_spiral_inward_left, -1, sal_True }, // AnimationEffect_SPIRALIN_LEFT
- { EK_fade, ED_spiral_inward_right, -1, sal_True }, // AnimationEffect_SPIRALIN_RIGHT
- { EK_fade, ED_spiral_outward_left, -1, sal_True }, // AnimationEffect_SPIRALOUT_LEFT
- { EK_fade, ED_spiral_outward_right, -1, sal_True }, // AnimationEffect_SPIRALOUT_RIGHT
- { EK_dissolve, ED_none, -1, sal_True }, // AnimationEffect_DISSOLVE
- { EK_wavyline, ED_from_left, -1, sal_True }, // AnimationEffect_WAVYLINE_FROM_LEFT
- { EK_wavyline, ED_from_top, -1, sal_True }, // AnimationEffect_WAVYLINE_FROM_TOP
- { EK_wavyline, ED_from_right, -1, sal_True }, // AnimationEffect_WAVYLINE_FROM_RIGHT
- { EK_wavyline, ED_from_bottom, -1, sal_True }, // AnimationEffect_WAVYLINE_FROM_BOTTOM
- { EK_random, ED_none, -1, sal_True }, // AnimationEffect_RANDOM
- { EK_lines, ED_vertical, -1, sal_True }, // AnimationEffect_VERTICAL_LINES
- { EK_lines, ED_horizontal, -1, sal_True }, // AnimationEffect_HORIZONTAL_LINES
- { EK_laser, ED_from_left, -1, sal_True }, // AnimationEffect_LASER_FROM_LEFT
- { EK_laser, ED_from_top, -1, sal_True }, // AnimationEffect_LASER_FROM_TOP
- { EK_laser, ED_from_right, -1, sal_True }, // AnimationEffect_LASER_FROM_RIGHT
- { EK_laser, ED_from_bottom, -1, sal_True }, // AnimationEffect_LASER_FROM_BOTTOM
- { EK_laser, ED_from_upperleft, -1, sal_True }, // AnimationEffect_LASER_FROM_UPPERLEFT
- { EK_laser, ED_from_upperright, -1, sal_True }, // AnimationEffect_LASER_FROM_UPPERRIGHT
- { EK_laser, ED_from_lowerleft, -1, sal_True }, // AnimationEffect_LASER_FROM_LOWERLEFT
- { EK_laser, ED_from_lowerright, -1, sal_True }, // AnimationEffect_LASER_FROM_LOWERRIGHT
- { EK_appear,ED_none, -1, sal_True }, // AnimationEffect_APPEAR
- { EK_hide, ED_none, -1, sal_False },// AnimationEffect_HIDE
- { EK_move, ED_from_upperleft, -1, sal_True }, // AnimationEffect_MOVE_FROM_UPPERLEFT
- { EK_move, ED_from_upperright, -1, sal_True }, // AnimationEffect_MOVE_FROM_UPPERRIGHT
- { EK_move, ED_from_lowerright, -1, sal_True }, // AnimationEffect_MOVE_FROM_LOWERRIGHT
- { EK_move, ED_from_lowerleft, -1, sal_True }, // AnimationEffect_MOVE_FROM_LOWERLEFT
- { EK_move, ED_to_upperleft, -1, sal_False },// AnimationEffect_MOVE_TO_UPPERLEFT
- { EK_move, ED_to_upperright, -1, sal_False },// AnimationEffect_MOVE_TO_UPPERRIGHT
- { EK_move, ED_to_lowerright, -1, sal_False },// AnimationEffect_MOVE_TO_LOWERRIGHT
- { EK_move, ED_to_lowerleft, -1, sal_False },// AnimationEffect_MOVE_TO_LOWERLEFT
- { EK_move_short, ED_from_left, -1, sal_True }, // AnimationEffect_MOVE_SHORT_FROM_LEFT
- { EK_move_short, ED_from_upperleft, -1, sal_True }, // AnimationEffect_MOVE_SHORT_FROM_UPPERLEFT
- { EK_move_short, ED_from_top, -1, sal_True }, // AnimationEffect_MOVE_SHORT_FROM_TOP
- { EK_move_short, ED_from_upperright,-1, sal_True }, // AnimationEffect_MOVE_SHORT_FROM_UPPERRIGHT
- { EK_move_short, ED_from_right, -1, sal_True }, // AnimationEffect_MOVE_SHORT_FROM_RIGHT
- { EK_move_short, ED_from_lowerright,-1, sal_True }, // AnimationEffect_MOVE_SHORT_FROM_LOWERRIGHT
- { EK_move_short, ED_from_bottom, -1, sal_True }, // AnimationEffect_MOVE_SHORT_FROM_BOTTOM
- { EK_move_short, ED_from_lowerleft, -1, sal_True }, // AnimationEffect_MOVE_SHORT_FROM_LOWERLEFT
- { EK_move_short, ED_to_left, -1, sal_False },// AnimationEffect_MOVE_SHORT_TO_LEFT
- { EK_move_short, ED_to_upperleft, -1, sal_False },// AnimationEffect_MOVE_SHORT_TO_UPPERLEFT
- { EK_move_short, ED_to_top, -1, sal_False },// AnimationEffect_MOVE_SHORT_TO_TOP
- { EK_move_short, ED_to_upperright, -1, sal_False },// AnimationEffect_MOVE_SHORT_TO_UPPERRIGHT
- { EK_move_short, ED_to_right, -1, sal_False },// AnimationEffect_MOVE_SHORT_TO_RIGHT
- { EK_move_short, ED_to_lowerright, -1, sal_False },// AnimationEffect_MOVE_SHORT_TO_LOWERRIGHT
- { EK_move_short, ED_to_bottom, -1, sal_False },// AnimationEffect_MOVE_SHORT_TO_BOTTOM
- { EK_move_short, ED_to_lowerleft, -1, sal_False },// AnimationEffect_MOVE_SHORT_TO_LOWERLEFT
- { EK_checkerboard, ED_vertical, -1, sal_True }, // AnimationEffect_VERTICAL_CHECKERBOARD
- { EK_checkerboard, ED_horizontal, -1, sal_True }, // AnimationEffect_HORIZONTAL_CHECKERBOARD
- { EK_rotate, ED_horizontal, -1, sal_True }, // AnimationEffect_HORIZONTAL_ROTATE
- { EK_rotate, ED_vertical, -1, sal_True }, // AnimationEffect_VERTICAL_ROTATE
- { EK_stretch,ED_horizontal, -1, sal_True }, // AnimationEffect_HORIZONTAL_STRETCH
- { EK_stretch,ED_vertical, -1, sal_True }, // AnimationEffect_VERTICAL_STRETCH
- { EK_stretch,ED_from_left, -1, sal_True }, // AnimationEffect_STRETCH_FROM_LEFT
- { EK_stretch,ED_from_upperleft, -1, sal_True }, // AnimationEffect_STRETCH_FROM_UPPERLEFT
- { EK_stretch,ED_from_top, -1, sal_True }, // AnimationEffect_STRETCH_FROM_TOP
- { EK_stretch,ED_from_upperright,-1, sal_True }, // AnimationEffect_STRETCH_FROM_UPPERRIGHT
- { EK_stretch,ED_from_right, -1, sal_True }, // AnimationEffect_STRETCH_FROM_RIGHT
- { EK_stretch,ED_from_lowerright,-1, sal_True }, // AnimationEffect_STRETCH_FROM_LOWERRIGHT
- { EK_stretch,ED_from_bottom, -1, sal_True }, // AnimationEffect_STRETCH_FROM_BOTTOM
- { EK_stretch,ED_from_lowerleft, -1, sal_True }, // AnimationEffect_STRETCH_FROM_LOWERLEFT
- { EK_move, ED_none, 0, sal_True }, // AnimationEffect_ZOOM_IN
- { EK_move, ED_none, 50, sal_True }, // AnimationEffect_ZOOM_IN_SMALL
- { EK_move, ED_spiral_inward_left, 0, sal_True }, // AnimationEffect_ZOOM_IN_SPIRAL
- { EK_move, ED_none, 400, sal_True }, // AnimationEffect_ZOOM_OUT
- { EK_move, ED_none, 200, sal_True }, // AnimationEffect_ZOOM_OUT_SMALL
- { EK_move, ED_spiral_inward_left, 400, sal_True }, // AnimationEffect_ZOOM_OUT_SPIRAL
- { EK_move, ED_from_left, 0, sal_True }, // AnimationEffect_ZOOM_IN_FROM_LEFT
- { EK_move, ED_from_upperleft, 0, sal_True }, // AnimationEffect_ZOOM_IN_FROM_UPPERLEFT
- { EK_move, ED_from_top, 0, sal_True }, // AnimationEffect_ZOOM_IN_FROM_TOP
- { EK_move, ED_from_upperright, 0, sal_True }, // AnimationEffect_ZOOM_IN_FROM_UPPERRIGHT
- { EK_move, ED_from_right, 0, sal_True }, // AnimationEffect_ZOOM_IN_FROM_RIGHT
- { EK_move, ED_from_lowerright, 0, sal_True }, // AnimationEffect_ZOOM_IN_FROM_LOWERRIGHT
- { EK_move, ED_from_bottom, 0, sal_True }, // AnimationEffect_ZOOM_IN_FROM_BOTTOM
- { EK_move, ED_from_lowerleft, 0, sal_True }, // AnimationEffect_ZOOM_IN_FROM_LOWERLEFT
- { EK_move, ED_from_center, 0, sal_True }, // AnimationEffect_ZOOM_IN_FROM_CENTER
- { EK_move, ED_from_left, 400, sal_True }, // AnimationEffect_ZOOM_OUT_FROM_LEFT
- { EK_move, ED_from_upperleft, 400, sal_True }, // AnimationEffect_ZOOM_OUT_FROM_UPPERLEFT
- { EK_move, ED_from_top, 400, sal_True }, // AnimationEffect_ZOOM_OUT_FROM_TOP
- { EK_move, ED_from_upperright,400, sal_True }, // AnimationEffect_ZOOM_OUT_FROM_UPPERRIGHT
- { EK_move, ED_from_right, 400, sal_True }, // AnimationEffect_ZOOM_OUT_FROM_RIGHT
- { EK_move, ED_from_lowerright,400, sal_True }, // AnimationEffect_ZOOM_OUT_FROM_LOWERRIGHT
- { EK_move, ED_from_bottom, 400, sal_True }, // AnimationEffect_ZOOM_OUT_FROM_BOTTOM
- { EK_move, ED_from_lowerleft, 400, sal_True }, // AnimationEffect_ZOOM_OUT_FROM_LOWERLEFT
- { EK_move, ED_from_center, 400, sal_True } // AnimationEffect_ZOOM_OUT_FROM_CENTER
-};
-
-void SdXMLImplSetEffect( AnimationEffect eEffect, XMLEffect& eKind, XMLEffectDirection& eDirection, sal_Int16& nStartScale, sal_Bool& bIn )
-{
- if( eEffect < AnimationEffect_NONE || eEffect > AnimationEffect_ZOOM_OUT_FROM_CENTER )
- {
- DBG_ERROR( "unknown animation effect!" );
- eEffect = AnimationEffect_NONE;
- }
-
- const Effect& rEffect = AnimationEffectMap[eEffect];
- eKind = rEffect.meKind;
- eDirection = rEffect.meDirection;
- nStartScale = rEffect.mnStartScale;
- bIn = rEffect.mbIn;
-}
-
-enum XMLActionKind
-{
- XMLE_SHOW,
- XMLE_HIDE,
- XMLE_DIM,
- XMLE_PLAY
-};
-
-struct XMLEffectHint
-{
- XMLActionKind meKind;
- sal_Bool mbTextEffect;
- sal_Int32 mnShapeId;
-
- XMLEffect meEffect;
- XMLEffectDirection meDirection;
- sal_Int16 mnStartScale;
-
- AnimationSpeed meSpeed;
- Color maDimColor;
- OUString maSoundURL;
- sal_Bool mbPlayFull;
- sal_Int32 mnPresId;
- sal_Int32 mnPathShapeId;
-
- int operator<(const XMLEffectHint& rComp) const { return mnPresId < rComp.mnPresId; }
-
- XMLEffectHint()
- : meKind( XMLE_SHOW ), mbTextEffect( sal_False ), mnShapeId( -1 ),
- meEffect( EK_none ), meDirection( ED_none ), mnStartScale( -1 ),
- meSpeed( AnimationSpeed_SLOW ), maDimColor(0), mbPlayFull( sal_False ),
- mnPresId( 0 ), mnPathShapeId( -1 )
- {}
-};
-
-class AnimExpImpl
-{
-public:
- list<XMLEffectHint> maEffects;
- UniReference< XMLShapeExport > mxShapeExp;
-
- OUString msDimColor;
- OUString msDimHide;
- OUString msDimPrev;
- OUString msEffect;
- OUString msPlayFull;
- OUString msPresOrder;
- OUString msSound;
- OUString msSoundOn;
- OUString msSpeed;
- OUString msTextEffect;
- OUString msIsAnimation;
- OUString msAnimPath;
-
- AnimExpImpl()
- : msDimColor( RTL_CONSTASCII_USTRINGPARAM( "DimColor" ) ),
- msDimHide( RTL_CONSTASCII_USTRINGPARAM( "DimHide" ) ),
- msDimPrev( RTL_CONSTASCII_USTRINGPARAM( "DimPrevious" ) ),
- msEffect( RTL_CONSTASCII_USTRINGPARAM( "Effect" ) ),
- msPlayFull( RTL_CONSTASCII_USTRINGPARAM( "PlayFull" ) ),
- msPresOrder( RTL_CONSTASCII_USTRINGPARAM( "PresentationOrder" ) ),
- msSound( RTL_CONSTASCII_USTRINGPARAM( "Sound" ) ),
- msSoundOn( RTL_CONSTASCII_USTRINGPARAM( "SoundOn" ) ),
- msSpeed( RTL_CONSTASCII_USTRINGPARAM( "Speed" ) ),
- msTextEffect( RTL_CONSTASCII_USTRINGPARAM( "TextEffect" ) ),
- msAnimPath( RTL_CONSTASCII_USTRINGPARAM( "AnimationPath" ) ),
- msIsAnimation( RTL_CONSTASCII_USTRINGPARAM( "IsAnimation" ) )
- {}
-};
-
-XMLAnimationsExporter::XMLAnimationsExporter( XMLShapeExport* pShapeExp )
-{
- mpImpl = new AnimExpImpl;
- mpImpl->mxShapeExp = pShapeExp;
-}
-
-XMLAnimationsExporter::~XMLAnimationsExporter()
-{
- delete mpImpl;
- mpImpl = NULL;
-}
-
-void XMLAnimationsExporter::prepare( Reference< XShape > xShape )
-{
- try
- {
- // check for presentation shape service
- {
- Reference< XServiceInfo > xServiceInfo( xShape, UNO_QUERY );
- if( !xServiceInfo.is() || !xServiceInfo->supportsService( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.Shape" ) ) ) )
- return;
- }
-
- Reference< XPropertySet > xProps( xShape, UNO_QUERY );
- if( xProps.is() )
- {
- AnimationEffect eEffect;
- xProps->getPropertyValue( mpImpl->msEffect ) >>= eEffect;
- if( eEffect == AnimationEffect_PATH )
- {
- Reference< XShape > xPath;
- xProps->getPropertyValue( mpImpl->msAnimPath ) >>= xPath;
- if( xPath.is() )
- mpImpl->mxShapeExp->createShapeId( xPath );
- }
- }
- }
- catch( Exception e )
- {
- DBG_ERROR("exception catched while collection animation information!");
- }
-}
-
-void XMLAnimationsExporter::collect( Reference< XShape > xShape )
-{
- try
- {
- // check for presentation shape service
- {
- Reference< XServiceInfo > xServiceInfo( xShape, UNO_QUERY );
- if( !xServiceInfo.is() || !xServiceInfo->supportsService( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.Shape" ) ) ) )
- return;
- }
-
- Reference< XPropertySet > xProps( xShape, UNO_QUERY );
- if( xProps.is() )
- {
- const OUString aEmptyStr;
-
- Reference< XPropertySetInfo > xInfo( xProps->getPropertySetInfo() );
- AnimationEffect eEffect;
- XMLEffectHint aEffect;
-
- if( any2bool( xProps->getPropertyValue( mpImpl->msSoundOn ) ) )
- {
- xProps->getPropertyValue( mpImpl->msSound ) >>= aEffect.maSoundURL;
- xProps->getPropertyValue( mpImpl->msPlayFull ) >>= aEffect.mbPlayFull;
- }
-
- xProps->getPropertyValue( mpImpl->msPresOrder ) >>= aEffect.mnPresId;
- xProps->getPropertyValue( mpImpl->msSpeed ) >>= aEffect.meSpeed;
-
-
- sal_Bool bIsAnimation;
- xProps->getPropertyValue( mpImpl->msIsAnimation ) >>= bIsAnimation;
- if( bIsAnimation )
- {
- aEffect.meKind = XMLE_PLAY;
-
- mpImpl->mxShapeExp->createShapeId( xShape );
- aEffect.mnShapeId = mpImpl->mxShapeExp->getShapeId( xShape );
-
- mpImpl->maEffects.push_back( aEffect );
- }
-
- {
-
- xProps->getPropertyValue( mpImpl->msEffect ) >>= eEffect;
- if( eEffect != AnimationEffect_NONE )
- {
- sal_Bool bIn = sal_True;
- SdXMLImplSetEffect( eEffect, aEffect.meEffect, aEffect.meDirection, aEffect.mnStartScale, bIn );
-
- aEffect.meKind = bIn ? XMLE_SHOW : XMLE_HIDE;
-
- mpImpl->mxShapeExp->createShapeId( xShape );
- aEffect.mnShapeId = mpImpl->mxShapeExp->getShapeId( xShape );
-
- if( eEffect == AnimationEffect_PATH )
- {
- Reference< XShape > xPath;
- xProps->getPropertyValue( mpImpl->msAnimPath ) >>= xPath;
- if( xPath.is() )
- {
- mpImpl->mxShapeExp->createShapeId( xPath );
- aEffect.mnPathShapeId = mpImpl->mxShapeExp->getShapeId( xPath );
- }
- }
- mpImpl->maEffects.push_back( aEffect );
-
- aEffect.mnPathShapeId = -1;
- aEffect.maSoundURL = aEmptyStr;
- }
-
- xProps->getPropertyValue( mpImpl->msTextEffect ) >>= eEffect;
- if( eEffect != AnimationEffect_NONE )
- {
- sal_Bool bIn = sal_True;
- SdXMLImplSetEffect( eEffect, aEffect.meEffect, aEffect.meDirection, aEffect.mnStartScale, bIn );
- aEffect.meKind = bIn ? XMLE_SHOW : XMLE_HIDE;
- aEffect.mbTextEffect = sal_True;
-
- if( aEffect.mnShapeId == -1 )
- {
- mpImpl->mxShapeExp->createShapeId( xShape );
- aEffect.mnShapeId = mpImpl->mxShapeExp->getShapeId( xShape );
- }
-
- mpImpl->maEffects.push_back( aEffect );
- aEffect.mbTextEffect = sal_False;
- aEffect.maSoundURL = aEmptyStr;
- }
-
- sal_Bool bDimPrev;
- sal_Bool bDimHide;
- xProps->getPropertyValue( mpImpl->msDimPrev ) >>= bDimPrev;
- xProps->getPropertyValue( mpImpl->msDimHide ) >>= bDimHide;
- if( bDimPrev || bDimHide )
- {
- aEffect.meKind = bDimPrev ? XMLE_DIM : XMLE_HIDE;
- aEffect.meEffect = EK_none;
- aEffect.meDirection = ED_none;
- aEffect.meSpeed = AnimationSpeed_MEDIUM;
- if( bDimPrev )
- {
- sal_Int32 nColor;
- xProps->getPropertyValue( mpImpl->msDimColor ) >>= nColor;
- aEffect.maDimColor.SetColor( nColor );
- }
-
- if( aEffect.mnShapeId == -1 )
- {
- mpImpl->mxShapeExp->createShapeId( xShape );
- aEffect.mnShapeId = mpImpl->mxShapeExp->getShapeId( xShape );
- }
-
- mpImpl->maEffects.push_back( aEffect );
- aEffect.maSoundURL = aEmptyStr;
- }
- }
- }
- }
- catch( Exception e )
- {
- DBG_ERROR("exception catched while collection animation information!");
- }
-}
-
-void XMLAnimationsExporter::exportAnimations( SvXMLExport& rExport )
-{
- mpImpl->maEffects.sort();
-
- list<XMLEffectHint>::iterator aIter = mpImpl->maEffects.begin();
- const list<XMLEffectHint>::iterator aEnd = mpImpl->maEffects.end();
-
- OUStringBuffer sTmp;
-
- if( aIter != aEnd )
- {
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_PRESENTATION, XML_ANIMATIONS, sal_True, sal_True );
-
- do
- {
- XMLEffectHint& rEffect = *aIter;
-
- DBG_ASSERT( rEffect.mnShapeId != -1, "shape id creation failed for animation effect?" );
-
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_SHAPE_ID, OUString::valueOf( rEffect.mnShapeId ) );
-
- if( rEffect.meKind == XMLE_DIM )
- {
- // export a dim action;
-
- SvXMLUnitConverter::convertColor( sTmp, rEffect.maDimColor );
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_COLOR, sTmp.makeStringAndClear() );
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_PRESENTATION, XML_DIM, sal_True, sal_True );
- }
- else if( rEffect.meKind == XMLE_PLAY )
- {
- if( rEffect.meSpeed != AnimationSpeed_MEDIUM )
- {
- SvXMLUnitConverter::convertEnum( sTmp, rEffect.meSpeed, aXML_AnimationSpeed_EnumMap );
- rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_SPEED, sTmp.makeStringAndClear() );
- }
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_PRESENTATION, XML_PLAY, sal_True, sal_True );
- }
- else
- {
-
- if( rEffect.meEffect != EK_none )
- {
- SvXMLUnitConverter::convertEnum( sTmp, rEffect.meEffect, aXML_AnimationEffect_EnumMap );
- rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_EFFECT, sTmp.makeStringAndClear() );
- }
-
- if( rEffect.meDirection != ED_none )
- {
- SvXMLUnitConverter::convertEnum( sTmp, rEffect.meDirection, aXML_AnimationDirection_EnumMap );
- rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_DIRECTION, sTmp.makeStringAndClear() );
- }
-
- if( rEffect.mnStartScale != -1 )
- {
- SvXMLUnitConverter::convertPercent( sTmp, rEffect.mnStartScale );
- rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_START_SCALE, sTmp.makeStringAndClear() );
- }
-
- if( rEffect.meSpeed != AnimationSpeed_MEDIUM )
- {
- SvXMLUnitConverter::convertEnum( sTmp, rEffect.meSpeed, aXML_AnimationSpeed_EnumMap );
- rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_SPEED, sTmp.makeStringAndClear() );
- }
-
- if( rEffect.mnPathShapeId != -1 )
- {
- rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_PATH_ID, OUString::valueOf( rEffect.mnPathShapeId ) );
- }
-
- enum XMLTokenEnum eLocalName;
- if( rEffect.meKind == XMLE_SHOW )
- {
- if( rEffect.mbTextEffect )
- eLocalName = XML_SHOW_TEXT;
- else
- eLocalName = XML_SHOW_SHAPE;
- }
- else
- {
- if( rEffect.mbTextEffect )
- eLocalName = XML_HIDE_TEXT;
- else
- eLocalName = XML_HIDE_SHAPE;
- }
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_PRESENTATION, eLocalName, sal_True, sal_True );
- if( rEffect.maSoundURL.getLength() != 0 )
- {
- rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, rExport.GetRelativeReference(rEffect.maSoundURL) );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_NEW );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONREQUEST );
- if( rEffect.mbPlayFull )
- rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_PLAY_FULL, XML_TRUE );
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_PRESENTATION, XML_SOUND, sal_True, sal_True );
- }
- }
-
- aIter++;
- }
- while( aIter != aEnd );
- }
-
- mpImpl->maEffects.clear();
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_animimp.cxx b/binfilter/bf_xmloff/source/draw/xmloff_animimp.cxx
deleted file mode 100644
index b85cefb6bf1d..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_animimp.cxx
+++ /dev/null
@@ -1,699 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include <com/sun/star/presentation/AnimationSpeed.hpp>
-
-#include <list>
-
-
-#include <comphelper/extract.hxx>
-
-
-#include "xmlimp.hxx"
-
-#include "xmlnmspe.hxx"
-
-#include "xmluconv.hxx"
-/*
-*/
-
-#include "nmspmap.hxx"
-
-#include "anim.hxx"
-
-#include "animimp.hxx"
-namespace binfilter {
-
-using namespace ::std;
-using namespace ::cppu;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::xml;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::drawing;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::presentation;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-SvXMLEnumMapEntry aXML_AnimationEffect_EnumMap[] =
-{
- { XML_NONE, EK_none },
- { XML_FADE, EK_fade },
- { XML_MOVE, EK_move },
- { XML_STRIPES, EK_stripes },
- { XML_OPEN, EK_open },
- { XML_CLOSE, EK_close },
- { XML_DISSOLVE, EK_dissolve },
- { XML_WAVYLINE, EK_wavyline },
- { XML_RANDOM, EK_random },
- { XML_LINES, EK_lines },
- { XML_LASER, EK_laser },
- { XML_APPEAR, EK_appear },
- { XML_HIDE, EK_hide },
- { XML_MOVE_SHORT, EK_move_short },
- { XML_CHECKERBOARD, EK_checkerboard },
- { XML_ROTATE, EK_rotate },
- { XML_STRETCH, EK_stretch },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXML_AnimationDirection_EnumMap[] =
-{
- { XML_NONE, ED_none },
- { XML_FROM_LEFT, ED_from_left },
- { XML_FROM_TOP, ED_from_top },
- { XML_FROM_RIGHT, ED_from_right },
- { XML_FROM_BOTTOM, ED_from_bottom },
- { XML_FROM_CENTER, ED_from_center },
- { XML_FROM_UPPER_LEFT, ED_from_upperleft },
- { XML_FROM_UPPER_RIGHT, ED_from_upperright },
- { XML_FROM_LOWER_LEFT, ED_from_lowerleft },
- { XML_FROM_LOWER_RIGHT, ED_from_lowerright },
- { XML_TO_LEFT, ED_to_left },
- { XML_TO_TOP, ED_to_top },
- { XML_TO_RIGHT, ED_to_right },
- { XML_TO_BOTTOM, ED_to_bottom },
- { XML_TO_UPPER_LEFT, ED_to_upperleft },
- { XML_TO_UPPER_RIGHT, ED_to_upperright },
- { XML_TO_LOWER_RIGHT, ED_to_lowerright },
- { XML_TO_LOWER_LEFT, ED_to_lowerleft },
- { XML_PATH, ED_path },
- { XML_SPIRAL_INWARD_LEFT, ED_spiral_inward_left },
- { XML_SPIRAL_INWARD_RIGHT,ED_spiral_inward_right },
- { XML_SPIRAL_OUTWARD_LEFT, ED_spiral_outward_left },
- { XML_SPIRAL_OUTWARD_RIGHT, ED_spiral_outward_right },
- { XML_VERTICAL, ED_vertical },
- { XML_HORIZONTAL, ED_horizontal },
- { XML_TO_CENTER, ED_to_center },
- { XML_CLOCKWISE, ED_clockwise },
- { XML_COUNTER_CLOCKWISE,ED_cclockwise },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXML_AnimationSpeed_EnumMap[] =
-{
- { XML_SLOW, AnimationSpeed_SLOW },
- { XML_MEDIUM, AnimationSpeed_MEDIUM },
- { XML_FAST, AnimationSpeed_FAST },
- { XML_TOKEN_INVALID, 0 }
-};
-
-AnimationEffect ImplSdXMLgetEffect( XMLEffect eKind, XMLEffectDirection eDirection, sal_Int16 nStartScale, sal_Bool bIn )
-{
- switch( eKind )
- {
- case EK_fade:
- switch( eDirection )
- {
- case ED_from_left: return AnimationEffect_FADE_FROM_LEFT;
- case ED_from_top: return AnimationEffect_FADE_FROM_TOP;
- case ED_from_right: return AnimationEffect_FADE_FROM_RIGHT;
- case ED_from_bottom: return AnimationEffect_FADE_FROM_BOTTOM;
- case ED_from_center: return AnimationEffect_FADE_FROM_CENTER;
- case ED_from_upperleft: return AnimationEffect_FADE_FROM_UPPERLEFT;
- case ED_from_upperright: return AnimationEffect_FADE_FROM_UPPERRIGHT;
- case ED_from_lowerleft: return AnimationEffect_FADE_FROM_LOWERLEFT;
- case ED_from_lowerright: return AnimationEffect_FADE_FROM_LOWERRIGHT;
- case ED_to_center: return AnimationEffect_FADE_TO_CENTER;
- case ED_clockwise: return AnimationEffect_CLOCKWISE;
- case ED_cclockwise: return AnimationEffect_COUNTERCLOCKWISE;
- case ED_spiral_inward_left: return AnimationEffect_SPIRALIN_LEFT;
- case ED_spiral_inward_right:return AnimationEffect_SPIRALIN_RIGHT;
- case ED_spiral_outward_left:return AnimationEffect_SPIRALOUT_LEFT;
- case ED_spiral_outward_right:return AnimationEffect_SPIRALOUT_RIGHT;
- }
- return AnimationEffect_FADE_FROM_LEFT;
- case EK_move:
- if( nStartScale == 200 )
- {
- return AnimationEffect_ZOOM_OUT_SMALL;
- }
- else if( nStartScale == 50 )
- {
- return AnimationEffect_ZOOM_IN_SMALL;
- }
- else if( nStartScale < 100 )
- {
- switch( eDirection )
- {
- case ED_from_left: return AnimationEffect_ZOOM_IN_FROM_LEFT;
- case ED_from_top: return AnimationEffect_ZOOM_IN_FROM_TOP;
- case ED_from_right: return AnimationEffect_ZOOM_IN_FROM_RIGHT;
- case ED_from_bottom: return AnimationEffect_ZOOM_IN_FROM_BOTTOM;
- case ED_from_upperleft: return AnimationEffect_ZOOM_IN_FROM_UPPERLEFT;
- case ED_from_upperright: return AnimationEffect_ZOOM_IN_FROM_UPPERRIGHT;
- case ED_from_lowerleft: return AnimationEffect_ZOOM_IN_FROM_LOWERLEFT;
- case ED_from_lowerright: return AnimationEffect_ZOOM_IN_FROM_LOWERRIGHT;
- case ED_from_center: return AnimationEffect_ZOOM_IN_FROM_CENTER;
- case ED_spiral_inward_left: return AnimationEffect_ZOOM_IN_SPIRAL;
- case ED_to_left: return AnimationEffect_MOVE_TO_LEFT;
- case ED_to_top: return AnimationEffect_MOVE_TO_TOP;
- case ED_to_right: return AnimationEffect_MOVE_TO_RIGHT;
- case ED_to_bottom: return AnimationEffect_MOVE_TO_BOTTOM;
- case ED_to_upperleft: return AnimationEffect_MOVE_TO_UPPERLEFT;
- case ED_to_upperright: return AnimationEffect_MOVE_TO_UPPERRIGHT;
- case ED_to_lowerright: return AnimationEffect_MOVE_TO_LOWERRIGHT;
- case ED_to_lowerleft: return AnimationEffect_MOVE_TO_LOWERLEFT;
- }
- return AnimationEffect_ZOOM_IN;
- }
- else if( nStartScale > 100 )
- {
- switch( eDirection )
- {
- case ED_from_left: return AnimationEffect_ZOOM_OUT_FROM_LEFT;
- case ED_from_top: return AnimationEffect_ZOOM_OUT_FROM_TOP;
- case ED_from_right: return AnimationEffect_ZOOM_OUT_FROM_RIGHT;
- case ED_from_bottom: return AnimationEffect_ZOOM_OUT_FROM_BOTTOM;
- case ED_from_upperleft: return AnimationEffect_ZOOM_OUT_FROM_UPPERLEFT;
- case ED_from_upperright: return AnimationEffect_ZOOM_OUT_FROM_UPPERRIGHT;
- case ED_from_lowerleft: return AnimationEffect_ZOOM_OUT_FROM_LOWERLEFT;
- case ED_from_lowerright: return AnimationEffect_ZOOM_OUT_FROM_LOWERRIGHT;
- case ED_from_center: return AnimationEffect_ZOOM_OUT_FROM_CENTER;
- case ED_spiral_inward_left: return AnimationEffect_ZOOM_OUT_SPIRAL;
- }
- return AnimationEffect_ZOOM_OUT;
- }
- else
- {
- switch( eDirection )
- {
- case ED_from_left: return AnimationEffect_MOVE_FROM_LEFT;
- case ED_from_top: return AnimationEffect_MOVE_FROM_TOP;
- case ED_from_right: return AnimationEffect_MOVE_FROM_RIGHT;
- case ED_from_bottom: return AnimationEffect_MOVE_FROM_BOTTOM;
- case ED_from_upperleft: return AnimationEffect_MOVE_FROM_UPPERLEFT;
- case ED_from_upperright: return AnimationEffect_MOVE_FROM_UPPERRIGHT;
- case ED_from_lowerleft: return AnimationEffect_MOVE_FROM_LOWERLEFT;
- case ED_from_lowerright: return AnimationEffect_MOVE_FROM_LOWERRIGHT;
- case ED_path: return AnimationEffect_PATH;
- case ED_to_top: return AnimationEffect_MOVE_TO_TOP;
- case ED_to_right: return AnimationEffect_MOVE_TO_RIGHT;
- case ED_to_bottom: return AnimationEffect_MOVE_TO_BOTTOM;
- case ED_to_upperleft: return AnimationEffect_MOVE_TO_UPPERLEFT;
- case ED_to_upperright: return AnimationEffect_MOVE_TO_UPPERRIGHT;
- case ED_to_lowerright: return AnimationEffect_MOVE_TO_LOWERRIGHT;
- case ED_to_lowerleft: return AnimationEffect_MOVE_TO_LOWERLEFT;
- }
- }
- return AnimationEffect_MOVE_FROM_LEFT;
- case EK_stripes:
- if( eDirection == ED_vertical )
- return AnimationEffect_VERTICAL_STRIPES;
- else
- return AnimationEffect_HORIZONTAL_STRIPES;
- case EK_open:
- if( eDirection == ED_vertical )
- return AnimationEffect_OPEN_VERTICAL;
- else
- return AnimationEffect_OPEN_HORIZONTAL;
- case EK_close:
- if( eDirection == ED_vertical )
- return AnimationEffect_CLOSE_VERTICAL;
- else
- return AnimationEffect_CLOSE_HORIZONTAL;
- case EK_dissolve:
- return AnimationEffect_DISSOLVE;
- case EK_wavyline:
- switch( eDirection )
- {
- case ED_from_left: return AnimationEffect_WAVYLINE_FROM_LEFT;
- case ED_from_top: return AnimationEffect_WAVYLINE_FROM_TOP;
- case ED_from_right: return AnimationEffect_WAVYLINE_FROM_RIGHT;
- case ED_from_bottom: return AnimationEffect_WAVYLINE_FROM_BOTTOM;
- }
- return AnimationEffect_WAVYLINE_FROM_LEFT;
- case EK_random:
- return AnimationEffect_RANDOM;
- case EK_lines:
- if( eDirection == ED_vertical )
- return AnimationEffect_VERTICAL_LINES;
- else
- return AnimationEffect_HORIZONTAL_LINES;
- case EK_laser:
- switch( eDirection )
- {
- case ED_from_left: return AnimationEffect_LASER_FROM_LEFT;
- case ED_from_top: return AnimationEffect_LASER_FROM_TOP;
- case ED_from_right: return AnimationEffect_LASER_FROM_RIGHT;
- case ED_from_bottom: return AnimationEffect_LASER_FROM_BOTTOM;
- case ED_from_upperleft: return AnimationEffect_LASER_FROM_UPPERLEFT;
- case ED_from_upperright: return AnimationEffect_LASER_FROM_UPPERRIGHT;
- case ED_from_lowerleft: return AnimationEffect_LASER_FROM_LOWERLEFT;
- case ED_from_lowerright: return AnimationEffect_LASER_FROM_LOWERRIGHT;
- }
- return AnimationEffect_LASER_FROM_LEFT;
- case EK_appear:
- return AnimationEffect_APPEAR;
- case EK_hide:
- return AnimationEffect_HIDE;
- case EK_move_short:
- switch( eDirection )
- {
- case ED_from_left: return AnimationEffect_MOVE_SHORT_FROM_LEFT;
- case ED_from_top: return AnimationEffect_MOVE_SHORT_FROM_TOP;
- case ED_from_right: return AnimationEffect_MOVE_SHORT_FROM_RIGHT;
- case ED_from_bottom: return AnimationEffect_MOVE_SHORT_FROM_BOTTOM;
- case ED_from_upperleft: return AnimationEffect_MOVE_SHORT_FROM_UPPERLEFT;
- case ED_from_upperright: return AnimationEffect_MOVE_SHORT_FROM_UPPERRIGHT;
- case ED_from_lowerleft: return AnimationEffect_MOVE_SHORT_FROM_LOWERLEFT;
- case ED_from_lowerright: return AnimationEffect_MOVE_SHORT_FROM_LOWERRIGHT;
- case ED_to_left: return AnimationEffect_MOVE_SHORT_TO_LEFT;
- case ED_to_upperleft: return AnimationEffect_MOVE_SHORT_TO_UPPERLEFT;
- case ED_to_top: return AnimationEffect_MOVE_SHORT_TO_TOP;
- case ED_to_upperright: return AnimationEffect_MOVE_SHORT_TO_UPPERRIGHT;
- case ED_to_right: return AnimationEffect_MOVE_SHORT_TO_RIGHT;
- case ED_to_lowerright: return AnimationEffect_MOVE_SHORT_TO_LOWERRIGHT;
- case ED_to_bottom: return AnimationEffect_MOVE_SHORT_TO_BOTTOM;
- case ED_to_lowerleft: return AnimationEffect_MOVE_SHORT_TO_LOWERLEFT;
- }
- return AnimationEffect_MOVE_SHORT_FROM_LEFT;
- case EK_checkerboard:
- if( eDirection == ED_vertical )
- return AnimationEffect_VERTICAL_CHECKERBOARD;
- else
- return AnimationEffect_HORIZONTAL_CHECKERBOARD;
- case EK_rotate:
- if( eDirection == ED_vertical )
- return AnimationEffect_VERTICAL_ROTATE;
- else
- return AnimationEffect_HORIZONTAL_ROTATE;
- case EK_stretch:
- switch( eDirection )
- {
- case ED_from_left: return AnimationEffect_STRETCH_FROM_LEFT;
- case ED_from_top: return AnimationEffect_STRETCH_FROM_TOP;
- case ED_from_right: return AnimationEffect_STRETCH_FROM_RIGHT;
- case ED_from_bottom: return AnimationEffect_STRETCH_FROM_BOTTOM;
- case ED_from_upperleft: return AnimationEffect_STRETCH_FROM_UPPERLEFT;
- case ED_from_upperright: return AnimationEffect_STRETCH_FROM_UPPERRIGHT;
- case ED_from_lowerleft: return AnimationEffect_STRETCH_FROM_LOWERLEFT;
- case ED_from_lowerright: return AnimationEffect_STRETCH_FROM_LOWERRIGHT;
- case ED_vertical: return AnimationEffect_VERTICAL_STRETCH;
- case ED_horizontal: return AnimationEffect_HORIZONTAL_STRETCH;
- }
- return AnimationEffect_STRETCH_FROM_LEFT;
- }
-
- return AnimationEffect_NONE;
-}
-
-///////////////////////////////////////////////////////////////////////
-
-class AnimImpImpl
-{
-public:
- Reference< XPropertySet > mxLastShape;
- sal_Int32 mnPresOrder;
- sal_Int32 mnLastShapeId;
-
- OUString msDimColor;
- OUString msDimHide;
- OUString msDimPrev;
- OUString msEffect;
- OUString msPlayFull;
- OUString msPresOrder;
- OUString msSound;
- OUString msSoundOn;
- OUString msSpeed;
- OUString msTextEffect;
- OUString msPresShapeService;
- OUString msAnimPath;
- OUString msIsAnimation;
-
- AnimImpImpl()
- : mnPresOrder( 0 ),
- mnLastShapeId( -1 ),
- msDimColor( RTL_CONSTASCII_USTRINGPARAM( "DimColor" ) ),
- msDimHide( RTL_CONSTASCII_USTRINGPARAM( "DimHide" ) ),
- msDimPrev( RTL_CONSTASCII_USTRINGPARAM( "DimPrevious" ) ),
- msEffect( RTL_CONSTASCII_USTRINGPARAM( "Effect" ) ),
- msPlayFull( RTL_CONSTASCII_USTRINGPARAM( "PlayFull" ) ),
- msPresOrder( RTL_CONSTASCII_USTRINGPARAM( "PresentationOrder" ) ),
- msSound( RTL_CONSTASCII_USTRINGPARAM( "Sound" ) ),
- msSoundOn( RTL_CONSTASCII_USTRINGPARAM( "SoundOn" ) ),
- msSpeed( RTL_CONSTASCII_USTRINGPARAM( "Speed" ) ),
- msTextEffect( RTL_CONSTASCII_USTRINGPARAM( "TextEffect" ) ),
- msPresShapeService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.Shape" ) ),
- msAnimPath( RTL_CONSTASCII_USTRINGPARAM( "AnimationPath" ) ),
- msIsAnimation( RTL_CONSTASCII_USTRINGPARAM( "IsAnimation" ) )
- {}
-};
-
-///////////////////////////////////////////////////////////////////////
-
-enum XMLActionKind
-{
- XMLE_SHOW,
- XMLE_HIDE,
- XMLE_DIM,
- XMLE_PLAY
-};
-
-class XMLAnimationsEffectContext : public SvXMLImportContext
-{
-public:
- AnimImpImpl* mpImpl;
-
- XMLActionKind meKind;
- sal_Bool mbTextEffect;
- sal_Int32 mnShapeId;
-
- XMLEffect meEffect;
- XMLEffectDirection meDirection;
- sal_Int16 mnStartScale;
-
- AnimationSpeed meSpeed;
- Color maDimColor;
- OUString maSoundURL;
- sal_Bool mbPlayFull;
- sal_Int32 mnPathShapeId;
-
-public:
- TYPEINFO();
-
- XMLAnimationsEffectContext( SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const Reference< XAttributeList >& xAttrList,
- AnimImpImpl* pImpl);
- virtual ~XMLAnimationsEffectContext();
-
- virtual void EndElement();
-
- virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const OUString& rLocalName,
- const Reference< XAttributeList >& xAttrList );
-};
-
-class XMLAnimationsSoundContext : public SvXMLImportContext
-{
- XMLAnimationsEffectContext* mpParent;
-
-public:
- TYPEINFO();
-
- XMLAnimationsSoundContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, XMLAnimationsEffectContext* pParent );
- virtual ~XMLAnimationsSoundContext();
-};
-
-TYPEINIT1( XMLAnimationsSoundContext, SvXMLImportContext );
-
-XMLAnimationsSoundContext::XMLAnimationsSoundContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, XMLAnimationsEffectContext* pParent )
-: SvXMLImportContext( rImport, nPrfx, rLocalName ), mpParent( pParent )
-{
- if( mpParent && nPrfx == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_SOUND ) )
- {
- const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- OUString sValue = xAttrList->getValueByIndex( i );
-
- switch( nPrefix )
- {
- case XML_NAMESPACE_XLINK:
- if( IsXMLToken( aLocalName, XML_HREF ) )
- {
- mpParent->maSoundURL = rImport.GetAbsoluteReference(sValue);
- }
- break;
- case XML_NAMESPACE_PRESENTATION:
- if( IsXMLToken( aLocalName, XML_PLAY_FULL ) )
- {
- mpParent->mbPlayFull = IsXMLToken( sValue, XML_TRUE );
- }
- }
- }
- }
-}
-
-XMLAnimationsSoundContext::~XMLAnimationsSoundContext()
-{
-}
-
-
-TYPEINIT1( XMLAnimationsEffectContext, SvXMLImportContext );
-
-XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, AnimImpImpl* pImpl )
-: SvXMLImportContext(rImport, nPrfx, rLocalName),
- mpImpl( pImpl ),
- meKind( XMLE_SHOW ), mbTextEffect( sal_False ), mnShapeId( -1 ), mnPathShapeId( -1 ),
- meEffect( EK_none ), meDirection( ED_none ), mnStartScale( 100 ),
- meSpeed( AnimationSpeed_MEDIUM ), maDimColor(0), mbPlayFull( sal_False )
-{
- if( IsXMLToken( rLocalName, XML_SHOW_SHAPE ) )
- {
- meKind = XMLE_SHOW;
- }
- else if( IsXMLToken( rLocalName, XML_SHOW_TEXT ) )
- {
- meKind = XMLE_SHOW;
- mbTextEffect = sal_True;
- }
- else if( IsXMLToken( rLocalName, XML_HIDE_SHAPE ) )
- {
- meKind = XMLE_HIDE;
- }
- else if( IsXMLToken( rLocalName, XML_HIDE_TEXT ) )
- {
- meKind = XMLE_HIDE;
- mbTextEffect = sal_True;
- }
- else if( IsXMLToken( rLocalName, XML_DIM ) )
- {
- meKind = XMLE_DIM;
- }
- else if( IsXMLToken( rLocalName, XML_PLAY ) )
- {
- meKind = XMLE_PLAY;
- }
- else
- {
- // unknown action, overread
- return;
- }
-
- // read attributes
- const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- OUString sValue = xAttrList->getValueByIndex( i );
-
- switch( nPrefix )
- {
- case XML_NAMESPACE_DRAW:
- if( IsXMLToken( aLocalName, XML_SHAPE_ID ) )
- {
- SvXMLUnitConverter::convertNumber(mnShapeId, sValue);
- }
- else if( IsXMLToken( aLocalName, XML_COLOR ) )
- {
- SvXMLUnitConverter::convertColor(maDimColor, sValue);
- }
- break;
-
- case XML_NAMESPACE_PRESENTATION:
- if( IsXMLToken( aLocalName, XML_EFFECT ) )
- {
- USHORT eEnum;
- if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationEffect_EnumMap ) )
- meEffect = (XMLEffect)eEnum;
- }
- else if( IsXMLToken(aLocalName, XML_DIRECTION ) )
- {
- USHORT eEnum;
- if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationDirection_EnumMap ) )
- meDirection = (XMLEffectDirection)eEnum;
- }
- else if( IsXMLToken( aLocalName, XML_START_SCALE ) )
- {
- sal_Int32 nScale;
- if( SvXMLUnitConverter::convertPercent( nScale, sValue ) )
- mnStartScale = (sal_Int16)nScale;
- }
- else if( IsXMLToken( aLocalName, XML_SPEED ) )
- {
- USHORT eEnum;
- if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationSpeed_EnumMap ) )
- meSpeed = (AnimationSpeed)eEnum;
- }
- else if( IsXMLToken( aLocalName, XML_PATH_ID ) )
- {
- SvXMLUnitConverter::convertNumber(mnPathShapeId, sValue);
- }
- break;
- }
- }
-}
-
-XMLAnimationsEffectContext::~XMLAnimationsEffectContext()
-{
-}
-
-SvXMLImportContext * XMLAnimationsEffectContext::CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList )
-{
- return new XMLAnimationsSoundContext( GetImport(), nPrefix, rLocalName, xAttrList, this );
-}
-
-void XMLAnimationsEffectContext::EndElement()
-{
- // set effect on shape
-
- try
- {
- UniReference< XMLShapeImportHelper > xShapeImport( GetImport().GetShapeImport() );
- Any aAny;
-
- if( mnShapeId != -1 )
- {
- Reference< XPropertySet > xSet;
- if( mpImpl->mnLastShapeId != mnShapeId )
- {
- xSet = Reference< XPropertySet >::query( xShapeImport->getShapeFromId( mnShapeId ) );
- if( xSet.is() )
- {
- // check for presentation shape service
- {
- Reference< XServiceInfo > xServiceInfo( xSet, UNO_QUERY );
- if( !xServiceInfo.is() || !xServiceInfo->supportsService( mpImpl->msPresShapeService ) )
- return;
- }
-
- mpImpl->mnLastShapeId = mnShapeId;
- mpImpl->mxLastShape = xSet;
-
- aAny <<= mpImpl->mnPresOrder++;
- xSet->setPropertyValue( mpImpl->msPresOrder, aAny );
- }
- }
- else
- {
- xSet = mpImpl->mxLastShape;
- }
-
- if( xSet.is() )
- {
- if( meKind == XMLE_DIM )
- {
- aAny <<= (sal_Bool)sal_True;
- xSet->setPropertyValue( mpImpl->msDimPrev, aAny );
-
- aAny <<= (sal_Int32)maDimColor.GetColor();
- xSet->setPropertyValue( mpImpl->msDimColor, aAny );
- }
- else if( meKind == XMLE_PLAY )
- {
- aAny <<= (sal_Bool)sal_True;
- xSet->setPropertyValue( mpImpl->msIsAnimation, aAny );
-
- aAny <<= meSpeed;
- xSet->setPropertyValue( mpImpl->msSpeed, aAny );
- }
- else
- {
- if( meKind == XMLE_HIDE && !mbTextEffect && meEffect == EK_none )
- {
- aAny = bool2any( sal_True );
- xSet->setPropertyValue( mpImpl->msDimHide, aAny );
- }
- else
- {
- const AnimationEffect eEffect = ImplSdXMLgetEffect( meEffect, meDirection, mnStartScale, meKind == XMLE_SHOW );
-
- aAny <<= eEffect;
- xSet->setPropertyValue( mbTextEffect ? mpImpl->msTextEffect : mpImpl->msEffect, aAny );
-
- aAny <<= meSpeed;
- xSet->setPropertyValue( mpImpl->msSpeed, aAny );
-
- if( eEffect == AnimationEffect_PATH && mnPathShapeId != -1 )
- {
- Reference< XShape > xPath( xShapeImport->getShapeFromId( mnPathShapeId ) );
- if( xPath.is() )
- {
- aAny <<= xPath;
- xSet->setPropertyValue( mpImpl->msAnimPath, aAny );
- }
- }
- }
- }
- }
-
- if( maSoundURL.getLength() != 0 )
- {
- aAny <<= maSoundURL;
- xSet->setPropertyValue( mpImpl->msSound, aAny );
-
- aAny <<= bool2any( mbPlayFull );
- xSet->setPropertyValue( mpImpl->msPlayFull, aAny );
-
- aAny <<= bool2any( sal_True );
- xSet->setPropertyValue( mpImpl->msSoundOn, aAny );
- }
- }
- }
- catch( Exception e )
- {
- DBG_ERROR( "exception catched while importing animation information!" );
- }
-}
-
-///////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( XMLAnimationsContext, SvXMLImportContext );
-
-XMLAnimationsContext::XMLAnimationsContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList)
-: SvXMLImportContext(rImport, nPrfx, rLocalName)
-{
- mpImpl = new AnimImpImpl();
-}
-
-XMLAnimationsContext::~XMLAnimationsContext()
-{
- delete mpImpl;
-}
-
-SvXMLImportContext * XMLAnimationsContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
-{
- return new XMLAnimationsEffectContext( GetImport(), nPrefix, rLocalName, xAttrList, mpImpl );
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_eventimp.cxx b/binfilter/bf_xmloff/source/draw/xmloff_eventimp.cxx
deleted file mode 100644
index 346c5896a750..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_eventimp.cxx
+++ /dev/null
@@ -1,475 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include <com/sun/star/document/XEventsSupplier.hpp>
-#include <com/sun/star/presentation/AnimationSpeed.hpp>
-#include <com/sun/star/presentation/ClickAction.hpp>
-
-#include <tools/urlobj.hxx>
-
-#include <comphelper/extract.hxx>
-
-
-#include "xmlimp.hxx"
-
-#include "xmlnmspe.hxx"
-
-#include "xmluconv.hxx"
-
-#include "nmspmap.hxx"
-
-#include "eventimp.hxx"
-
-#include "anim.hxx"
-namespace binfilter {
-
-using namespace ::std;
-using namespace ::cppu;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::xml;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::drawing;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::document;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::presentation;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-///////////////////////////////////////////////////////////////////////
-
-SvXMLEnumMapEntry __READONLY_DATA aXML_EventActions_EnumMap[] =
-{
- { XML_NONE, ClickAction_NONE },
- { XML_PREVIOUS_PAGE, ClickAction_PREVPAGE },
- { XML_NEXT_PAGE, ClickAction_NEXTPAGE },
- { XML_FIRST_PAGE, ClickAction_FIRSTPAGE },
- { XML_LAST_PAGE, ClickAction_LASTPAGE },
- { XML_HIDE, ClickAction_INVISIBLE },
- { XML_STOP, ClickAction_STOPPRESENTATION },
- { XML_EXECUTE, ClickAction_PROGRAM },
- { XML_SHOW, ClickAction_BOOKMARK },
- { XML_SHOW, ClickAction_DOCUMENT },
- { XML_EXECUTE_MACRO, ClickAction_MACRO },
- { XML_VERB, ClickAction_VERB },
- { XML_FADE_OUT, ClickAction_VANISH },
- { XML_SOUND, ClickAction_SOUND },
- { XML_TOKEN_INVALID, 0 }
-};
-
-///////////////////////////////////////////////////////////////////////
-
-class SdXMLEventContext : public SvXMLImportContext
-{
-private:
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxShape;
-
-public:
- TYPEINFO();
-
- SdXMLEventContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList, const Reference< XShape >& rxShape );
- virtual ~SdXMLEventContext();
-
- virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList );
- virtual void EndElement();
-
- sal_Bool mbValid;
- sal_Bool mbScript;
- ClickAction meClickAction;
- XMLEffect meEffect;
- XMLEffectDirection meDirection;
- sal_Int16 mnStartScale;
- AnimationSpeed meSpeed;
- sal_Int32 mnVerb;
- OUString msSoundURL;
- sal_Bool mbPlayFull;
- OUString msEventName;
- OUString msLanguage;
- OUString msMacroName;
- OUString msLibrary;
- OUString msBookmark;
-};
-
-///////////////////////////////////////////////////////////////////////
-
-class XMLEventSoundContext : public SvXMLImportContext
-{
- SdXMLEventContext* mpParent;
-
-public:
- TYPEINFO();
-
- XMLEventSoundContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, SdXMLEventContext* pParent );
- virtual ~XMLEventSoundContext();
-};
-
-TYPEINIT1( XMLEventSoundContext, SvXMLImportContext );
-
-XMLEventSoundContext::XMLEventSoundContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, SdXMLEventContext* pParent )
-: SvXMLImportContext( rImport, nPrfx, rLocalName ), mpParent( pParent )
-{
- if( mpParent && nPrfx == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_SOUND ) )
- {
- const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- OUString sValue = xAttrList->getValueByIndex( i );
-
- switch( nPrefix )
- {
- case XML_NAMESPACE_XLINK:
- if( IsXMLToken( aLocalName, XML_HREF ) )
- {
- mpParent->msSoundURL = rImport.GetAbsoluteReference(sValue);
- }
- break;
- case XML_NAMESPACE_PRESENTATION:
- if( IsXMLToken( aLocalName, XML_PLAY_FULL ) )
- {
- mpParent->mbPlayFull = IsXMLToken( sValue, XML_TRUE );
- }
- }
- }
- }
-}
-
-XMLEventSoundContext::~XMLEventSoundContext()
-{
-}
-
-///////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLEventContext, SvXMLImportContext );
-
-SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, const Reference< XShape >& rxShape )
-: SvXMLImportContext(rImport, nPrfx, rLocalName),
- mxShape( rxShape ), mbScript( sal_False ), meClickAction( ClickAction_NONE ),
- meEffect( EK_none ), meDirection( ED_none ), mnStartScale( 100 ),
- meSpeed( AnimationSpeed_MEDIUM ), mnVerb(0), mbPlayFull( sal_False )
-{
- const OUString msXMLEventName( RTL_CONSTASCII_USTRINGPARAM( "on-click" ) );
-
- if( nPrfx == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_EVENT ) )
- {
- mbValid = sal_True;
- }
- else if( nPrfx == XML_NAMESPACE_SCRIPT && IsXMLToken( rLocalName, XML_EVENT ) )
- {
- mbScript = sal_True;
- mbValid = sal_True;
- }
- else
- {
- return;
- }
-
- // read attributes
- const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; (i < nAttrCount) && mbValid; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- OUString sValue = xAttrList->getValueByIndex( i );
-
- switch( nPrefix )
- {
- case XML_NAMESPACE_PRESENTATION:
- if( IsXMLToken( aLocalName, XML_ACTION ) )
- {
- USHORT eEnum;
- if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_EventActions_EnumMap ) )
- meClickAction = (ClickAction)eEnum;
- }
- if( IsXMLToken( aLocalName, XML_EFFECT ) )
- {
- USHORT eEnum;
- if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationEffect_EnumMap ) )
- meEffect = (XMLEffect)eEnum;
- }
- else if( IsXMLToken( aLocalName, XML_DIRECTION ) )
- {
- USHORT eEnum;
- if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationDirection_EnumMap ) )
- meDirection = (XMLEffectDirection)eEnum;
- }
- else if( IsXMLToken( aLocalName, XML_START_SCALE ) )
- {
- sal_Int32 nScale;
- if( SvXMLUnitConverter::convertPercent( nScale, sValue ) )
- mnStartScale = (sal_Int16)nScale;
- }
- else if( IsXMLToken( aLocalName, XML_SPEED ) )
- {
- USHORT eEnum;
- if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationSpeed_EnumMap ) )
- meSpeed = (AnimationSpeed)eEnum;
- }
- else if( IsXMLToken( aLocalName, XML_VERB ) )
- {
- SvXMLUnitConverter::convertNumber( mnVerb, sValue );
- }
- break;
-
- case XML_NAMESPACE_SCRIPT:
- if( IsXMLToken( aLocalName, XML_EVENT_NAME ) )
- {
- msEventName = sValue;
- mbValid = msEventName == msXMLEventName;
- }
- else if( IsXMLToken( aLocalName, XML_LANGUAGE ) )
- {
- msLanguage = sValue;
- }
- else if( IsXMLToken( aLocalName, XML_MACRO_NAME ) )
- {
- msMacroName = sValue;
- }
- else if( IsXMLToken( aLocalName, XML_LIBRARY ) )
- {
- msLibrary = sValue;
- }
- break;
-
- case XML_NAMESPACE_XLINK:
- if( IsXMLToken( aLocalName, XML_HREF ) )
- {
- const rtl::OUString &rTmp( rImport.GetAbsoluteReference(sValue) );
- INetURLObject::translateToInternal( rTmp, msBookmark, INetURLObject::DECODE_UNAMBIGUOUS, RTL_TEXTENCODING_UTF8 );
- }
- break;
- }
- }
-
- if( mbValid )
- mbValid = msEventName.getLength() != 0;
-}
-
-SdXMLEventContext::~SdXMLEventContext()
-{
-}
-
-SvXMLImportContext * SdXMLEventContext::CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList )
-{
- return new XMLEventSoundContext( GetImport(), nPrefix, rLocalName, xAttrList, this );
-}
-
-void SdXMLEventContext::EndElement()
-{
- const OUString msAPIEventName( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) );
-
- if( !mbValid )
- return;
-
- do
- {
- Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY );
- if( !xEventsSupplier.is() )
- break;
-
- Reference< XNameReplace > xEvents( xEventsSupplier->getEvents() );
- DBG_ASSERT( xEvents.is(), "XEventsSupplier::getEvents() returned NULL" );
- if( !xEvents.is() )
- break;
-
- if( !xEvents->hasByName( msAPIEventName ) )
- break;
-
- if( mbScript )
- meClickAction = ClickAction_MACRO;
-
- sal_Int32 nPropertyCount = 2;
- switch( meClickAction )
- {
- case ClickAction_NONE:
- case ClickAction_PREVPAGE:
- case ClickAction_NEXTPAGE:
- case ClickAction_FIRSTPAGE:
- case ClickAction_LASTPAGE:
- case ClickAction_INVISIBLE:
- case ClickAction_STOPPRESENTATION:
- break;
- case ClickAction_PROGRAM:
- case ClickAction_VERB:
- case ClickAction_BOOKMARK:
- case ClickAction_DOCUMENT:
- case ClickAction_MACRO:
- nPropertyCount += 1;
- break;
-
- case ClickAction_SOUND:
- nPropertyCount += 2;
- break;
-
- case ClickAction_VANISH:
- nPropertyCount += 4;
- break;
- }
-
- uno::Sequence< beans::PropertyValue > aProperties( nPropertyCount );
- beans::PropertyValue* pProperties = aProperties.getArray();
-
- if( ClickAction_MACRO == meClickAction )
- {
- pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
- pProperties->Handle = -1;
- pProperties->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM("StarBasic") );
- pProperties->State = beans::PropertyState_DIRECT_VALUE;
- pProperties++;
-
- pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "MacroName" ) );
- pProperties->Handle = -1;
- pProperties->Value <<= msMacroName;
- pProperties->State = beans::PropertyState_DIRECT_VALUE;
- pProperties++;
-
- pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Library" ) );
- pProperties->Handle = -1;
- pProperties->Value <<= msLibrary;
- pProperties->State = beans::PropertyState_DIRECT_VALUE;
- }
- else
- {
- pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
- pProperties->Handle = -1;
- pProperties->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM("Presentation") );
- pProperties->State = beans::PropertyState_DIRECT_VALUE;
- pProperties++;
-
- // ClickAction_BOOKMARK and ClickAction_DOCUMENT share the same xml event
- // so check here if its realy a bookmark or maybe a document
- if( meClickAction == ClickAction_BOOKMARK )
- {
- if( msBookmark.compareToAscii( "#", 1 ) != 0 )
- meClickAction = ClickAction_DOCUMENT;
- }
-
- pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("ClickAction") );
- pProperties->Handle = -1;
- pProperties->Value <<= meClickAction;
- pProperties->State = beans::PropertyState_DIRECT_VALUE;
- pProperties++;
-
- switch( meClickAction )
- {
- case ClickAction_NONE:
- case ClickAction_PREVPAGE:
- case ClickAction_NEXTPAGE:
- case ClickAction_FIRSTPAGE:
- case ClickAction_LASTPAGE:
- case ClickAction_INVISIBLE:
- case ClickAction_STOPPRESENTATION:
- break;
-
- case ClickAction_BOOKMARK:
- msBookmark = msBookmark.copy(1);
-
- // Note: no break here!!!
-
- case ClickAction_DOCUMENT:
- case ClickAction_PROGRAM:
- pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Bookmark") );
- pProperties->Handle = -1;
- pProperties->Value <<= msBookmark;
- pProperties->State = beans::PropertyState_DIRECT_VALUE;
- break;
-
- case ClickAction_VANISH:
- pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Effect") );
- pProperties->Handle = -1;
- pProperties->Value <<= ImplSdXMLgetEffect( meEffect, meDirection, mnStartScale, sal_True );
- pProperties->State = beans::PropertyState_DIRECT_VALUE;
- pProperties++;
-
- pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Speed") );
- pProperties->Handle = -1;
- pProperties->Value <<= meSpeed;
- pProperties->State = beans::PropertyState_DIRECT_VALUE;
- pProperties++;
-
- // NOTE: no break here!!!
-
- case ClickAction_SOUND:
- pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("SoundURL") );
- pProperties->Handle = -1;
- pProperties->Value <<= msSoundURL;
- pProperties->State = beans::PropertyState_DIRECT_VALUE;
- pProperties++;
-
- pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("PlayFull") );
- pProperties->Handle = -1;
- pProperties->Value = ::cppu::bool2any(mbPlayFull);
- pProperties->State = beans::PropertyState_DIRECT_VALUE;
- break;
-
- case ClickAction_VERB:
- pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Verb") );
- pProperties->Handle = -1;
- pProperties->Value <<= mnVerb;
- pProperties->State = beans::PropertyState_DIRECT_VALUE;
- break;
- }
- }
-
- uno::Any aAny;
- aAny <<= aProperties;
- xEvents->replaceByName( msAPIEventName, aAny );
-
- } while(0);
-}
-
-///////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLEventsContext, SvXMLImportContext );
-
-SdXMLEventsContext::SdXMLEventsContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName,
- const Reference< XAttributeList>& xAttrList, const Reference< XShape >& rxShape)
-: SvXMLImportContext(rImport, nPrfx, rLocalName), mxShape( rxShape )
-{
-}
-
-SdXMLEventsContext::~SdXMLEventsContext()
-{
-}
-
-SvXMLImportContext * SdXMLEventsContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
-{
- return new SdXMLEventContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShape );
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_layerexp.cxx b/binfilter/bf_xmloff/source/draw/xmloff_layerexp.cxx
deleted file mode 100644
index 93eaa1b0c43d..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_layerexp.cxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <com/sun/star/drawing/XLayerSupplier.hpp>
-
-
-
-
-#include "xmlnmspe.hxx"
-
-#include "xmlexp.hxx"
-
-
-
-#include "layerexp.hxx"
-namespace binfilter {
-
-using namespace ::cppu;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::drawing;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-void SdXMLayerExporter::exportLayer( SvXMLExport& rExport )
-{
- Reference< XLayerSupplier > xLayerSupplier( rExport.GetModel(), UNO_QUERY );
- if( !xLayerSupplier.is() )
- return;
-
- Reference< XIndexAccess > xLayerManager( xLayerSupplier->getLayerManager(), UNO_QUERY );
- if( !xLayerManager.is() )
- return;
-
- const sal_Int32 nCount = xLayerManager->getCount();
- if( nCount == 0 )
- return;
-
- Reference< XPropertySet> xLayer;
- const OUString strName( RTL_CONSTASCII_USTRINGPARAM( "Name" ) );
-
- OUStringBuffer sTmp;
- OUString aName;
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_DRAW, XML_LAYER_SET, sal_True, sal_True );
-
- for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
- {
- xLayerManager->getByIndex( nIndex ) >>= xLayer;
-
- if( xLayer.is() )
- {
- if( xLayer->getPropertyValue( strName ) >>= aName )
- {
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, aName );
- }
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_DRAW, XML_LAYER, sal_True, sal_True );
- }
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_layerimp.cxx b/binfilter/bf_xmloff/source/draw/xmloff_layerimp.cxx
deleted file mode 100644
index 33166220b978..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_layerimp.cxx
+++ /dev/null
@@ -1,133 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include <com/sun/star/drawing/XLayerManager.hpp>
-#include <com/sun/star/drawing/XLayerSupplier.hpp>
-
-
-
-#include "xmlimp.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "nmspmap.hxx"
-
-#include "layerimp.hxx"
-namespace binfilter {
-
-using namespace ::std;
-using namespace ::cppu;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::xml;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::drawing;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_NAME;
-
-using rtl::OUString;
-
-
-TYPEINIT1( SdXMLLayerSetContext, SvXMLImportContext );
-
-SdXMLLayerSetContext::SdXMLLayerSetContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList)
-: SvXMLImportContext(rImport, nPrfx, rLocalName)
-{
- Reference< XLayerSupplier > xLayerSupplier( rImport.GetModel(), UNO_QUERY );
- DBG_ASSERT( xLayerSupplier.is(), "XModel is not supporting XLayerSupplier!" );
- if( xLayerSupplier.is() )
- mxLayerManager = xLayerSupplier->getLayerManager();
-}
-
-SdXMLLayerSetContext::~SdXMLLayerSetContext()
-{
-}
-
-SvXMLImportContext * SdXMLLayerSetContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
-{
- if( mxLayerManager.is() )
- {
- const OUString strName( RTL_CONSTASCII_USTRINGPARAM( "Name" ) );
-
- OUString aName;
-
- const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString aLocalName;
- if( GetImport().GetNamespaceMap().GetKeyByAttrName( xAttrList->getNameByIndex( i ), &aLocalName ) == XML_NAMESPACE_DRAW )
- {
- const OUString sValue( xAttrList->getValueByIndex( i ) );
-
- if( IsXMLToken( aLocalName, XML_NAME ) )
- {
- aName = sValue;
- }
- }
- }
-
- DBG_ASSERT( aName.getLength(), "draw:layer element without draw:name!" );
- if( aName.getLength() )
- {
- Reference< XPropertySet > xLayer;
-
- if( mxLayerManager->hasByName( aName ) )
- {
- mxLayerManager->getByName( aName ) >>= xLayer;
- DBG_ASSERT( xLayer.is(), "failed to get existing XLayer!" );
- }
- else
- {
- Reference< XLayerManager > xLayerManager( mxLayerManager, UNO_QUERY );
- if( xLayerManager.is() )
- xLayer = Reference< XPropertySet >::query( xLayerManager->insertNewByIndex( xLayerManager->getCount() ) );
- DBG_ASSERT( xLayer.is(), "failed to create new XLayer!" );
-
- if( xLayer.is() )
- {
- Any aAny;
- aAny <<= aName;
- xLayer->setPropertyValue( strName, aAny );
- }
- }
- }
- }
-
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_numithdl.cxx b/binfilter/bf_xmloff/source/draw/xmloff_numithdl.cxx
deleted file mode 100644
index 719521d7ef44..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_numithdl.cxx
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <numithdl.hxx>
-namespace binfilter {
-
-using namespace ::com::sun::star;
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLNumRulePropHdl
-//
-
-XMLNumRulePropHdl::XMLNumRulePropHdl( ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XAnyCompare > xNumRuleCompare )
-: mxNumRuleCompare( xNumRuleCompare )
-{
-}
-
-XMLNumRulePropHdl::~XMLNumRulePropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLNumRulePropHdl::equals( const uno::Any& r1, const uno::Any& r2 ) const
-{
- return mxNumRuleCompare.is() && mxNumRuleCompare->compare( r1, r2 ) == 0;
-}
-
-sal_Bool XMLNumRulePropHdl::importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- return sal_False;
-}
-
-sal_Bool XMLNumRulePropHdl::exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- return sal_False;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_propimp0.cxx b/binfilter/bf_xmloff/source/draw/xmloff_propimp0.cxx
deleted file mode 100644
index 5e4ce044e391..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_propimp0.cxx
+++ /dev/null
@@ -1,223 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include <tools/string.hxx>
-
-#include <rtl/ustrbuf.hxx>
-
-#include "propimp0.hxx"
-
-
-#include <com/sun/star/util/DateTime.hpp>
-
-
-#include <xmluconv.hxx>
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-
-//////////////////////////////////////////////////////////////////////////////
-// implementation of graphic property Stroke
-
-
-//////////////////////////////////////////////////////////////////////////////
-// implementation of presentation page property Change
-
-//////////////////////////////////////////////////////////////////////////////
-// implementation of an effect duration property handler
-
-
-XMLDurationPropertyHdl::~XMLDurationPropertyHdl()
-{
-}
-
-sal_Bool XMLDurationPropertyHdl::importXML(
- const OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- util::DateTime aTime;
- SvXMLUnitConverter::convertTime( aTime, rStrImpValue );
-
- const sal_Int32 nSeconds = ( aTime.Hours * 60 + aTime.Minutes ) * 60 + aTime.Seconds;
- rValue <<= nSeconds;
-
- return sal_True;
-}
-
-sal_Bool XMLDurationPropertyHdl::exportXML(
- OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Int32 nVal;
-
- if(rValue >>= nVal)
- {
- util::DateTime aTime( 0, (sal_uInt16)nVal, 0, 0, 0, 0, 0 );
-
- OUStringBuffer aOut;
- SvXMLUnitConverter::convertTime( aOut, aTime );
- rStrExpValue = aOut.makeStringAndClear();
- return sal_True;
- }
-
- return sal_False;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// implementation of an opacity property handler
-
-
-XMLOpacityPropertyHdl::~XMLOpacityPropertyHdl()
-{
-}
-
-sal_Bool XMLOpacityPropertyHdl::importXML(
- const OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int32 nValue = 0;
-
- if( rStrImpValue.indexOf( sal_Unicode('%') ) != -1 )
- {
- if( rUnitConverter.convertPercent( nValue, rStrImpValue ) )
- {
- rValue <<= sal_uInt16( nValue );
- bRet = sal_True;
- }
- }
- else
- {
- const String aStr( rStrImpValue );
- double fVal = aStr.ToDouble() * 100.0;
- rValue <<= sal_uInt16( fVal );
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-sal_Bool XMLOpacityPropertyHdl::exportXML(
- OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_uInt16 nVal;
-
- if( rValue >>= nVal )
- {
- OUStringBuffer aOut;
-
- rUnitConverter.convertPercent( aOut, nVal );
- rStrExpValue = aOut.makeStringAndClear();
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// implementation of an text animation step amount
-
-XMLTextAnimationStepPropertyHdl::~XMLTextAnimationStepPropertyHdl()
-{
-}
-
-sal_Bool XMLTextAnimationStepPropertyHdl::importXML(
- const OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int32 nValue = 0;
-
- const OUString aPX( RTL_CONSTASCII_USTRINGPARAM( "px" ) );
- sal_Int32 nPos = rStrImpValue.indexOf( aPX );
- if( nPos != -1 )
- {
- if( rUnitConverter.convertNumber( nValue, rStrImpValue.copy( 0, nPos ) ) )
- {
- rValue <<= sal_Int16( -nValue );
- bRet = sal_True;
- }
- }
- else
- {
- if( rUnitConverter.convertMeasure( nValue, rStrImpValue ) )
- {
- rValue <<= sal_Int16( nValue );
- bRet = sal_True;
- }
- }
-
- return bRet;
-}
-
-sal_Bool XMLTextAnimationStepPropertyHdl::exportXML(
- OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int16 nVal;
-
- if( rValue >>= nVal )
- {
- OUStringBuffer aOut;
-
- if( nVal < 0 )
- {
- const OUString aPX( RTL_CONSTASCII_USTRINGPARAM( "px" ) );
- rUnitConverter.convertNumber( aOut, (sal_Int32)-nVal );
- aOut.append( aPX );
- }
- else
- {
- rUnitConverter.convertMeasure( aOut, nVal );
- }
-
- rStrExpValue = aOut.makeStringAndClear();
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_sdpropls.cxx b/binfilter/bf_xmloff/source/draw/xmloff_sdpropls.cxx
deleted file mode 100644
index 8b15d1bcf7d4..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_sdpropls.cxx
+++ /dev/null
@@ -1,1411 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include <com/sun/star/ucb/XAnyCompareFactory.hpp>
-
-#include <com/sun/star/container/XIndexReplace.hpp>
-
-#include <com/sun/star/drawing/LineStyle.hpp>
-
-#include <com/sun/star/drawing/LineJoint.hpp>
-
-#include <com/sun/star/drawing/FillStyle.hpp>
-
-#include <com/sun/star/presentation/AnimationSpeed.hpp>
-
-#include <com/sun/star/presentation/FadeEffect.hpp>
-
-#include <com/sun/star/drawing/ConnectorType.hpp>
-
-#include <com/sun/star/drawing/RectanglePoint.hpp>
-
-#include <com/sun/star/drawing/CircleKind.hpp>
-
-#include <com/sun/star/drawing/BitmapMode.hpp>
-
-#include <com/sun/star/text/WritingMode.hpp>
-
-#include <EnumPropertyHdl.hxx>
-
-#include <NamedBoolPropertyHdl.hxx>
-
-#include "numithdl.hxx"
-
-#include "XMLBitmapRepeatOffsetPropertyHandler.hxx"
-
-#include "XMLFillBitmapSizePropertyHandler.hxx"
-
-#include "XMLBitmapLogicalSizePropertyHandler.hxx"
-
-#include <com/sun/star/drawing/TextAnimationKind.hpp>
-
-#include <com/sun/star/drawing/TextAnimationDirection.hpp>
-
-#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
-
-#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
-
-#include <com/sun/star/drawing/TextFitToSizeType.hpp>
-
-#include <com/sun/star/drawing/MeasureTextHorzPos.hpp>
-
-#include <com/sun/star/drawing/MeasureTextVertPos.hpp>
-
-#include "ControlBorderHandler.hxx"
-
-
-#include "sdpropls.hxx"
-
-#include "propimp0.hxx"
-
-#include "xmlexp.hxx"
-
-#include <xmlnmspe.hxx>
-
-#include <com/sun/star/drawing/NormalsKind.hpp>
-
-#include <com/sun/star/drawing/TextureProjectionMode.hpp>
-
-#include <com/sun/star/drawing/TextureKind.hpp>
-
-#include <com/sun/star/drawing/TextureMode.hpp>
-
-#include "txtprmap.hxx"
-
-#include "XMLClipPropertyHandler.hxx"
-
-#include "XMLIsPercentagePropertyHandler.hxx"
-
-#include "XMLPercentOrMeasurePropertyHandler.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-#define MAP(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context }
-
-//////////////////////////////////////////////////////////////////////////////
-// entry list for graphic properties
-
-const XMLPropertyMapEntry aXMLSDProperties[] =
-{
- // this entry must be first! this is needed for XMLShapeImportHelper::CreateExternalShapePropMapper
- MAP( "UserDefinedAttributes", XML_NAMESPACE_TEXT, XML_XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ),
-
- // stroke attributes
- MAP( "LineStyle", XML_NAMESPACE_DRAW, XML_STROKE, XML_SD_TYPE_STROKE, 0 ),
- MAP( "LineDashName", XML_NAMESPACE_DRAW, XML_STROKE_DASH, XML_TYPE_STRING, CTF_DASHNAME ),
- MAP( "LineWidth", XML_NAMESPACE_SVG, XML_STROKE_WIDTH, XML_TYPE_MEASURE, 0 ),
- MAP( "LineColor", XML_NAMESPACE_SVG, XML_STROKE_COLOR, XML_TYPE_COLOR, 0 ),
- MAP( "LineStartName", XML_NAMESPACE_DRAW, XML_MARKER_START, XML_TYPE_STRING, CTF_LINESTARTNAME ),
- MAP( "LineStartWidth", XML_NAMESPACE_DRAW, XML_MARKER_START_WIDTH, XML_TYPE_MEASURE, 0 ),
- MAP( "LineStartCenter", XML_NAMESPACE_DRAW, XML_MARKER_START_CENTER, XML_TYPE_BOOL, 0 ),
- MAP( "LineEndName", XML_NAMESPACE_DRAW, XML_MARKER_END, XML_TYPE_STRING, CTF_LINEENDNAME ),
- MAP( "LineEndWidth", XML_NAMESPACE_DRAW, XML_MARKER_END_WIDTH, XML_TYPE_MEASURE, 0 ),
- MAP( "LineEndCenter", XML_NAMESPACE_DRAW, XML_MARKER_END_CENTER, XML_TYPE_BOOL, 0 ),
- MAP( "LineTransparence", XML_NAMESPACE_SVG, XML_STROKE_OPACITY, XML_SD_TYPE_OPACITY, 0 ),
- MAP( "LineJoint", XML_NAMESPACE_SVG, XML_STROKE_LINEJOIN, XML_SD_TYPE_LINEJOIN, 0 ),
-
- // fill attributes
- MAP( "FillStyle", XML_NAMESPACE_DRAW, XML_FILL, XML_SD_TYPE_FILLSTYLE, 0 ),
- MAP( "FillColor", XML_NAMESPACE_DRAW, XML_FILL_COLOR, XML_TYPE_COLOR, 0 ),
- MAP( "FillGradientName", XML_NAMESPACE_DRAW, XML_FILL_GRADIENT_NAME, XML_TYPE_STRING, CTF_FILLGRADIENTNAME ),
- MAP( "FillGradientStepCount", XML_NAMESPACE_DRAW, XML_GRADIENT_STEP_COUNT, XML_TYPE_NUMBER, 0 ),
- MAP( "FillHatchName", XML_NAMESPACE_DRAW, XML_FILL_HATCH_NAME, XML_TYPE_STRING, CTF_FILLHATCHNAME ),
- MAP( "FillBackground", XML_NAMESPACE_DRAW, XML_FILL_HATCH_SOLID, XML_TYPE_BOOL, 0 ),
- MAP( "FillBitmapName", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_NAME, XML_TYPE_STRING, CTF_FILLBITMAPNAME ),
- MAP( "FillTransparence", XML_NAMESPACE_DRAW, XML_TRANSPARENCY, XML_TYPE_PERCENT16|MID_FLAG_MULTI_PROPERTY, 0 ), // exists in SW, too
- MAP( "FillTransparenceGradientName", XML_NAMESPACE_DRAW, XML_TRANSPARENCY_NAME, XML_TYPE_STRING, CTF_FILLTRANSNAME ),
-
- MAP( "FillBitmapSizeX", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH, XML_SD_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, 0 ),
- MAP( "FillBitmapLogicalSize", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH, XML_SD_TYPE_LOGICAL_SIZE|MID_FLAG_MULTI_PROPERTY, 0 ),
- MAP( "FillBitmapSizeY", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_HEIGHT, XML_SD_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, 0 ),
- MAP( "FillBitmapLogicalSize", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_HEIGHT, XML_SD_TYPE_LOGICAL_SIZE|MID_FLAG_MULTI_PROPERTY, 0 ),
- MAP( "FillBitmapMode", XML_NAMESPACE_STYLE,XML_REPEAT, XML_SD_TYPE_BITMAP_MODE, 0 ),
- MAP( "FillBitmapPositionOffsetX", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT_X, XML_TYPE_PERCENT, 0 ),
- MAP( "FillBitmapPositionOffsetY", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT_Y, XML_TYPE_PERCENT, 0 ),
- MAP( "FillBitmapRectanglePoint", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT, XML_SD_TYPE_BITMAP_REFPOINT, 0 ),
- MAP( "FillBitmapOffsetX", XML_NAMESPACE_DRAW, XML_TILE_REPEAT_OFFSET, XML_SD_TYPE_BITMAPREPOFFSETX|MID_FLAG_MULTI_PROPERTY, CTF_REPEAT_OFFSET_X ),
- MAP( "FillBitmapOffsetY", XML_NAMESPACE_DRAW, XML_TILE_REPEAT_OFFSET, XML_SD_TYPE_BITMAPREPOFFSETY|MID_FLAG_MULTI_PROPERTY, CTF_REPEAT_OFFSET_Y ),
-
- // text frame attributes
- MAP( "TextHorizontalAdjust", XML_NAMESPACE_DRAW, XML_TEXTAREA_HORIZONTAL_ALIGN, XML_SD_TYPE_TEXT_ALIGN, 0 ),
- MAP( "TextVerticalAdjust", XML_NAMESPACE_DRAW, XML_TEXTAREA_VERTICAL_ALIGN, XML_SD_TYPE_VERTICAL_ALIGN, 0 ),
- MAP( "TextAutoGrowHeight", XML_NAMESPACE_DRAW, XML_AUTO_GROW_WIDTH, XML_TYPE_BOOL, 0 ),
- MAP( "TextAutoGrowWidth", XML_NAMESPACE_DRAW, XML_AUTO_GROW_HEIGHT, XML_TYPE_BOOL, 0 ),
- MAP( "TextFitToSize", XML_NAMESPACE_DRAW, XML_FIT_TO_SIZE, XML_SD_TYPE_FITTOSIZE, 0 ),
- MAP( "TextContourFrame", XML_NAMESPACE_DRAW, XML_FIT_TO_CONTOUR, XML_TYPE_BOOL, 0 ),
- MAP( "TextMaximumFrameHeight", XML_NAMESPACE_FO, XML_MAX_HEIGHT, XML_TYPE_MEASURE, 0 ),
- MAP( "TextMaximumFrameWidth", XML_NAMESPACE_FO, XML_MAX_WIDTH, XML_TYPE_MEASURE, 0 ),
- MAP( "TextMinimumFrameHeight", XML_NAMESPACE_FO, XML_MIN_HEIGHT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, 0 ), // exists in SW, too
- MAP( "TextMinimumFrameWidth", XML_NAMESPACE_FO, XML_MIN_WIDTH, XML_TYPE_MEASURE, 0 ),
- MAP( "TextUpperDistance", XML_NAMESPACE_FO, XML_PADDING_TOP, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, 0 ), // exists in SW, too
- MAP( "TextLowerDistance", XML_NAMESPACE_FO, XML_PADDING_BOTTOM, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, 0 ), // exists in SW, too
- MAP( "TextLeftDistance", XML_NAMESPACE_FO, XML_PADDING_LEFT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, 0 ), // exists in SW, too
- MAP( "TextRightDistance", XML_NAMESPACE_FO, XML_PADDING_RIGHT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, 0 ), // exists in SW, too
- MAP( "TextWritingMode", XML_NAMESPACE_DRAW, XML_WRITING_MODE, XML_SD_TYPE_WRITINGMODE, CTF_WRITINGMODE ),
- MAP( "NumberingRules", XML_NAMESPACE_TEXT, XML_LIST_STYLE, XML_SD_TYPE_NUMBULLET|MID_FLAG_ELEMENT_ITEM, CTF_NUMBERINGRULES ),
- MAP( "NumberingRules", XML_NAMESPACE_TEXT, XML_LIST_STYLE_NAME, XML_TYPE_STRING, CTF_SD_NUMBERINGRULES_NAME ),
- MAP( "FontIndependentLineSpacing", XML_NAMESPACE_DRAW, XML_FONT_INDEPENDENT_LINE_SPACING, XML_TYPE_BOOL, 0 ),
-
- // shadow attributes
- MAP( "Shadow", XML_NAMESPACE_DRAW, XML_SHADOW, XML_SD_TYPE_SHADOW, 0 ),
- MAP( "ShadowXDistance", XML_NAMESPACE_DRAW, XML_SHADOW_OFFSET_X, XML_TYPE_MEASURE, 0 ),
- MAP( "ShadowYDistance", XML_NAMESPACE_DRAW, XML_SHADOW_OFFSET_Y, XML_TYPE_MEASURE, 0 ),
- MAP( "ShadowColor", XML_NAMESPACE_DRAW, XML_SHADOW_COLOR, XML_TYPE_COLOR, 0 ),
- MAP( "ShadowTransparence", XML_NAMESPACE_DRAW, XML_SHADOW_TRANSPARENCY, XML_TYPE_PERCENT, 0 ),
-
- // graphic attributes
- MAP( "GraphicColorMode", XML_NAMESPACE_DRAW, XML_COLOR_MODE, XML_TYPE_COLOR_MODE, 0 ), // exists in SW, too, with same property name
- MAP( "AdjustLuminance", XML_NAMESPACE_DRAW, XML_LUMINANCE, XML_TYPE_PERCENT16, 0 ), // signed? exists in SW, too, with same property name
- MAP( "AdjustContrast", XML_NAMESPACE_DRAW, XML_CONTRAST, XML_TYPE_PERCENT16, 0 ), // signed? exists in SW, too, with same property name
- MAP( "Gamma", XML_NAMESPACE_DRAW, XML_GAMMA, XML_TYPE_DOUBLE, 0 ), // signed? exists in SW, too, with same property name
- MAP( "AdjustRed", XML_NAMESPACE_DRAW, XML_RED, XML_TYPE_PERCENT16, 0 ), // signed? exists in SW, too, with same property name
- MAP( "AdjustGreen", XML_NAMESPACE_DRAW, XML_GREEN, XML_TYPE_PERCENT16, 0 ), // signed? exists in SW, too, with same property name
- MAP( "AdjustBlue", XML_NAMESPACE_DRAW, XML_BLUE, XML_TYPE_PERCENT16, 0 ), // signed? exists in SW, too, with same property name
- MAP( "GraphicCrop", XML_NAMESPACE_FO, XML_CLIP, XML_TYPE_TEXT_CLIP, 0 ), // exists in SW, too, with same property name
- MAP( "Transparency", XML_NAMESPACE_DRAW, XML_TRANSPARENCY, XML_TYPE_PERCENT16|MID_FLAG_MULTI_PROPERTY, 0 ), // exists in SW, too, with same property name
- MAP( "IsMirrored", XML_NAMESPACE_DRAW, XML_MIRROR, XML_TYPE_BOOL, 0 ),
-
- // animation text attributes
- MAP( "TextAnimationKind", XML_NAMESPACE_STYLE,XML_TEXT_BLINKING, XML_TYPE_TEXT_ANIMATION_BLINKING, CTF_TEXTANIMATION_BLINKING ),
- MAP( "TextAnimationKind", XML_NAMESPACE_TEXT, XML_ANIMATION, XML_TYPE_TEXT_ANIMATION, CTF_TEXTANIMATION_KIND ),
- MAP( "TextAnimationDirection", XML_NAMESPACE_TEXT, XML_ANIMATION_DIRECTION, XML_TYPE_TEXT_ANIMATION_DIRECTION, 0 ),
- MAP( "TextAnimationStartInside", XML_NAMESPACE_TEXT, XML_ANIMATION_START_INSIDE, XML_TYPE_BOOL, 0 ),
- MAP( "TextAnimationStopInside", XML_NAMESPACE_TEXT, XML_ANIMATION_STOP_INSIDE, XML_TYPE_BOOL, 0 ),
- MAP( "TextAnimationCount", XML_NAMESPACE_TEXT, XML_ANIMATION_REPEAT, XML_TYPE_NUMBER16, 0 ),
- MAP( "TextAnimationDelay", XML_NAMESPACE_TEXT, XML_ANIMATION_DELAY, XML_TYPE_DURATION16_MS, 0 ),
- MAP( "TextAnimationAmount", XML_NAMESPACE_TEXT, XML_ANIMATION_STEPS, XML_TYPE_TEXT_ANIMATION_STEPS, 0 ),
-
- // connector attributes
- MAP( "EdgeNode1HorzDist", XML_NAMESPACE_DRAW, XML_START_LINE_SPACING_HORIZONTAL, XML_TYPE_MEASURE, 0 ),
- MAP( "EdgeNode1VertDist", XML_NAMESPACE_DRAW, XML_START_LINE_SPACING_VERTICAL, XML_TYPE_MEASURE, 0 ),
- MAP( "EdgeNode2HorzDist", XML_NAMESPACE_DRAW, XML_END_LINE_SPACING_HORIZONTAL, XML_TYPE_MEASURE, 0 ),
- MAP( "EdgeNode2VertDist", XML_NAMESPACE_DRAW, XML_END_LINE_SPACING_VERTICAL, XML_TYPE_MEASURE, 0 ),
-
- // measure attributes
- MAP( "MeasureLineDistance", XML_NAMESPACE_DRAW, XML_LINE_DISTANCE, XML_TYPE_MEASURE, 0 ),
- MAP( "MeasureHelpLineOverhang", XML_NAMESPACE_DRAW, XML_GUIDE_OVERHANG, XML_TYPE_MEASURE, 0 ),
- MAP( "MeasureHelpLineDistance", XML_NAMESPACE_DRAW, XML_GUIDE_DISTANCE, XML_TYPE_MEASURE, 0 ),
- MAP( "MeasureHelpLine1Length", XML_NAMESPACE_DRAW, XML_START_GUIDE, XML_TYPE_MEASURE, 0 ),
- MAP( "MeasureHelpLine2Length", XML_NAMESPACE_DRAW, XML_END_GUIDE, XML_TYPE_MEASURE, 0 ),
- MAP( "MeasureTextHorizontalPosition", XML_NAMESPACE_DRAW, XML_MEASURE_ALIGN, XML_SD_TYPE_MEASURE_HALIGN, 0 ),
- MAP( "MeasureTextVerticalPosition", XML_NAMESPACE_DRAW, XML_MEASURE_VERTICAL_ALIGN, XML_SD_TYPE_MEASURE_VALIGN, 0 ),
- MAP( "MeasureUnit", XML_NAMESPACE_DRAW, XML_UNIT, XML_SD_TYPE_MEASURE_UNIT, 0 ),
- MAP( "MeasureShowUnit", XML_NAMESPACE_DRAW, XML_SHOW_UNIT, XML_TYPE_BOOL, 0 ),
- MAP( "MeasureBelowReferenceEdge", XML_NAMESPACE_DRAW, XML_PLACING, XML_SD_TYPE_MEASURE_PLACING, 0 ),
- MAP( "MeasureTextRotate90", XML_NAMESPACE_DRAW, XML_PARALLEL, XML_TYPE_BOOL, 0 ),
- MAP( "MeasureDecimalPlaces", XML_NAMESPACE_DRAW, XML_DECIMAL_PLACES, XML_TYPE_NUMBER16, 0 ),
-
- // 3D geometry attributes
- MAP( "D3DHorizontalSegments", XML_NAMESPACE_DR3D, XML_HORIZONTAL_SEGMENTS, XML_TYPE_NUMBER, 0 ),
- MAP( "D3DVerticalSegments", XML_NAMESPACE_DR3D, XML_VERTICAL_SEGMENTS, XML_TYPE_NUMBER, 0 ),
- MAP( "D3DPercentDiagonal", XML_NAMESPACE_DR3D, XML_EDGE_ROUNDING, XML_TYPE_PERCENT, 0 ),
- MAP( "D3DBackscale", XML_NAMESPACE_DR3D, XML_BACK_SCALE, XML_TYPE_PERCENT, 0 ),
- MAP( "D3DEndAngle", XML_NAMESPACE_DR3D, XML_END_ANGLE, XML_TYPE_NUMBER, 0 ),
- MAP( "D3DDepth", XML_NAMESPACE_DR3D, XML_DEPTH, XML_TYPE_MEASURE, 0 ),
- MAP( "D3DDoubleSided", XML_NAMESPACE_DR3D, XML_BACKFACE_CULLING, XML_SD_TYPE_BACKFACE_CULLING, 0 ),
-
- // #107245# New 3D properties which are possible for lathe and extrude 3d objects
- MAP( "D3DCloseFront", XML_NAMESPACE_DR3D, XML_CLOSE_FRONT, XML_TYPE_BOOL, 0 ),
- MAP( "D3DCloseBack", XML_NAMESPACE_DR3D, XML_CLOSE_BACK, XML_TYPE_BOOL, 0 ),
-
- // 3D lighting attributes
- MAP( "D3DNormalsKind", XML_NAMESPACE_DR3D, XML_NORMALS_KIND, XML_SD_TYPE_NORMALS_KIND, 0 ),
- MAP( "D3DNormalsInvert", XML_NAMESPACE_DR3D, XML_NORMALS_DIRECTION, XML_SD_TYPE_NORMALS_DIRECTION, 0 ),
-
- // 3D texture attributes
- MAP( "D3DTextureProjectionX", XML_NAMESPACE_DR3D, XML_TEX_GENERATION_MODE_X, XML_SD_TYPE_TEX_GENERATION_MODE_X, 0 ),
- MAP( "D3DTextureProjectionY", XML_NAMESPACE_DR3D, XML_TEX_GENERATION_MODE_Y, XML_SD_TYPE_TEX_GENERATION_MODE_Y, 0 ),
- MAP( "D3DTextureKind", XML_NAMESPACE_DR3D, XML_TEX_KIND, XML_SD_TYPE_TEX_KIND, 0 ),
- MAP( "D3DTextureMode", XML_NAMESPACE_DR3D, XML_TEX_MODE, XML_SD_TYPE_TEX_MODE, 0 ),
- MAP( "D3DTextureFilter", XML_NAMESPACE_DR3D, XML_TEX_FILTER, XML_SD_TYPE_BACKFACE_CULLING, 0 ),
-
- // 3D material attributes
- MAP( "D3DMaterialColor", XML_NAMESPACE_DR3D, XML_DIFFUSE_COLOR, XML_TYPE_COLOR, 0 ),
- MAP( "D3DMaterialEmission", XML_NAMESPACE_DR3D, XML_EMISSIVE_COLOR, XML_TYPE_COLOR, 0 ),
- MAP( "D3DMaterialSpecular", XML_NAMESPACE_DR3D, XML_SPECULAR_COLOR, XML_TYPE_COLOR, 0 ),
- MAP( "D3DMaterialSpecularIntensity", XML_NAMESPACE_DR3D, XML_SHININESS, XML_TYPE_PERCENT, 0 ),
-
- // 3D shadow attributes
- MAP( "D3DShadow3D", XML_NAMESPACE_DR3D, XML_SHADOW, XML_SD_TYPE_SHADOW, 0 ),
-
- // #FontWork# attributes
- MAP( "FontWorkStyle", XML_NAMESPACE_DRAW, XML_FONTWORK_STYLE, XML_SD_TYPE_FONTWORK_STYLE, CTF_FONTWORK_STYLE ),
- MAP( "FontWorkAdjust", XML_NAMESPACE_DRAW, XML_FONTWORK_ADJUST, XML_SD_TYPE_FONTWORK_ADJUST,CTF_FONTWORK_ADJUST ),
- MAP( "FontWorkDistance", XML_NAMESPACE_DRAW, XML_FONTWORK_DISTANCE, XML_TYPE_MEASURE, CTF_FONTWORK_DISTANCE ),
- MAP( "FontWorkStart", XML_NAMESPACE_DRAW, XML_FONTWORK_START, XML_TYPE_MEASURE, CTF_FONTWORK_START ),
- MAP( "FontWorkMirror", XML_NAMESPACE_DRAW, XML_FONTWORK_MIRROR, XML_TYPE_BOOL, CTF_FONTWORK_MIRROR ),
- MAP( "FontWorkOutline", XML_NAMESPACE_DRAW, XML_FONTWORK_OUTLINE, XML_TYPE_BOOL, CTF_FONTWORK_OUTLINE ),
- MAP( "FontWorkShadow", XML_NAMESPACE_DRAW, XML_FONTWORK_SHADOW, XML_SD_TYPE_FONTWORK_SHADOW,CTF_FONTWORK_SHADOW ),
- MAP( "FontWorkShadowColor", XML_NAMESPACE_DRAW, XML_FONTWORK_SHADOW_COLOR, XML_TYPE_COLOR, CTF_FONTWORK_SHADOWCOLOR ),
- MAP( "FontWorkShadowOffsetX", XML_NAMESPACE_DRAW, XML_FONTWORK_SHADOW_OFFSET_X, XML_TYPE_MEASURE, CTF_FONTWORK_SHADOWOFFSETX ),
- MAP( "FontWorkShadowOffsetY", XML_NAMESPACE_DRAW, XML_FONTWORK_SHADOW_OFFSET_Y, XML_TYPE_MEASURE, CTF_FONTWORK_SHADOWOFFSETY ),
- MAP( "FontWorkForm", XML_NAMESPACE_DRAW, XML_FONTWORK_FORM, XML_SD_TYPE_FONTWORK_FORM, CTF_FONTWORK_FORM ),
- MAP( "FontWorkHideForm", XML_NAMESPACE_DRAW, XML_FONTWORK_HIDE_FORM, XML_TYPE_BOOL, CTF_FONTWORK_HIDEFORM ),
- MAP( "FontWorkShadowTransparence", XML_NAMESPACE_DRAW, XML_FONTWORK_SHADOW_TRANSPARENCE, XML_TYPE_PERCENT, CTF_FONTWORK_SHADOWTRANSPARENCE ),
-
- // control attributes (border exists one mor time for the text additions of shapes)
- MAP( "ControlBackground", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_COLOR|MID_FLAG_MULTI_PROPERTY, 0 ),
- MAP( "ControlBorder", XML_NAMESPACE_FO, XML_BORDER, XML_SD_TYPE_CONTROL_BORDER|MID_FLAG_MULTI_PROPERTY, 0 ),
- MAP( "ControlDataStyle", XML_NAMESPACE_STYLE,XML_DATA_STYLE_NAME, XML_TYPE_STRING|MID_FLAG_NO_PROPERTY_EXPORT|MID_FLAG_SPECIAL_ITEM, CTF_SD_CONTROL_SHAPE_DATA_STYLE ),
- MAP( "ControlTextEmphasis", XML_NAMESPACE_STYLE,XML_TEXT_EMPHASIZE, XML_TYPE_CONTROL_TEXT_EMPHASIZE, 0 ),
-
- // special entries for floating frames
- MAP( "FrameIsAutoScroll", XML_NAMESPACE_DRAW, XML_FRAME_DISPLAY_SCROLLBAR, XML_TYPE_BOOL|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_DISPLAY_SCROLLBAR ),
- MAP( "FrameIsBorder", XML_NAMESPACE_DRAW, XML_FRAME_DISPLAY_BORDER, XML_TYPE_BOOL|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_DISPLAY_BORDER ),
- MAP( "FrameMarginWidth", XML_NAMESPACE_DRAW, XML_FRAME_MARGIN_HORIZONTAL, XML_TYPE_MEASURE_PX|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_MARGIN_HORI ),
- MAP( "FrameMarginHeight", XML_NAMESPACE_DRAW, XML_FRAME_MARGIN_VERTICAL, XML_TYPE_MEASURE_PX|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_MARGIN_VERT ),
- MAP( "VisibleArea", XML_NAMESPACE_DRAW, XML_VISIBLE_AREA_LEFT, XML_TYPE_RECTANGLE_LEFT|MID_FLAG_MERGE_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_SD_OLE_VIS_AREA_LEFT ),
- MAP( "VisibleArea", XML_NAMESPACE_DRAW, XML_VISIBLE_AREA_TOP, XML_TYPE_RECTANGLE_TOP|MID_FLAG_MERGE_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_SD_OLE_VIS_AREA_TOP ),
- MAP( "VisibleArea", XML_NAMESPACE_DRAW, XML_VISIBLE_AREA_WIDTH, XML_TYPE_RECTANGLE_WIDTH|MID_FLAG_MERGE_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_SD_OLE_VIS_AREA_WIDTH ),
- MAP( "VisibleArea", XML_NAMESPACE_DRAW, XML_VISIBLE_AREA_HEIGHT, XML_TYPE_RECTANGLE_HEIGHT|MID_FLAG_MERGE_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_SD_OLE_VIS_AREA_HEIGHT ),
- MAP( "IsInternal", XML_NAMESPACE_DRAW, XML__EMPTY, XML_TYPE_BUILDIN_CMP_ONLY, CTF_SD_OLE_ISINTERNAL ),
-
- // caption properties
- MAP( "CaptionType", XML_NAMESPACE_DRAW, XML_CAPTION_TYPE, XML_SD_TYPE_CAPTION_TYPE, 0 ),
- MAP( "CaptionIsFixedAngle", XML_NAMESPACE_DRAW, XML_CAPTION_ANGLE_TYPE, XML_SD_TYPE_CAPTION_ANGLE_TYPE, 0 ),
- MAP( "CaptionAngle", XML_NAMESPACE_DRAW, XML_CAPTION_ANGLE, XML_TYPE_NUMBER, 0 ),
- MAP( "CaptionGap", XML_NAMESPACE_DRAW, XML_CAPTION_GAP, XML_TYPE_MEASURE, 0 ),
- MAP( "CaptionEscapeDirection", XML_NAMESPACE_DRAW, XML_CAPTION_ESCAPE_DIRECTION, XML_SD_TYPE_CAPTION_ESC_DIR, 0 ),
- MAP( "CaptionIsEscapeRelative", XML_NAMESPACE_DRAW, XML_CAPTION_ESCAPE, XML_SD_TYPE_CAPTION_IS_ESC_REL|MID_FLAG_MULTI_PROPERTY, CTF_CAPTION_ISESCREL ),
- MAP( "CaptionEscapeRelative", XML_NAMESPACE_DRAW, XML_CAPTION_ESCAPE, XML_SD_TYPE_CAPTION_ESC_REL|MID_FLAG_MULTI_PROPERTY, CTF_CAPTION_ESCREL ),
- MAP( "CaptionEscapeAbsolute", XML_NAMESPACE_DRAW, XML_CAPTION_ESCAPE, XML_SD_TYPE_CAPTION_ESC_ABS|MID_FLAG_MULTI_PROPERTY, CTF_CAPTION_ESCABS ),
- MAP( "CaptionLineLength", XML_NAMESPACE_DRAW, XML_CAPTION_LINE_LENGTH, XML_TYPE_MEASURE, 0 ),
- MAP( "CaptionIsFitLineLength", XML_NAMESPACE_DRAW, XML_CAPTION_FIT_LINE_LENGTH, XML_TYPE_BOOL, 0 ),
-
- // misc object properties
- MAP( "MoveProtect", XML_NAMESPACE_DRAW, XML_MOVE_PROTECT, XML_TYPE_BOOL, CTF_SD_MOVE_PROTECT ),
- MAP( "SizeProtect", XML_NAMESPACE_DRAW, XML_SIZE_PROTECT, XML_TYPE_BOOL, CTF_SD_SIZE_PROTECT ),
- { 0L }
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// entry list for presentation page properties
-
-const XMLPropertyMapEntry aXMLSDPresPageProps[] =
-{
- MAP( "UserDefinedAttributes", XML_NAMESPACE_TEXT, XML_XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ),
-
- MAP( "Change", XML_NAMESPACE_PRESENTATION, XML_TRANSITION_TYPE, XML_SD_TYPE_PRESPAGE_TYPE, CTF_PAGE_TRANS_TYPE ),
- MAP( "Effect", XML_NAMESPACE_PRESENTATION, XML_TRANSITION_STYLE, XML_SD_TYPE_PRESPAGE_STYLE, CTF_PAGE_TRANS_STYLE ),
- MAP( "Speed", XML_NAMESPACE_PRESENTATION, XML_TRANSITION_SPEED, XML_SD_TYPE_PRESPAGE_SPEED, CTF_PAGE_TRANS_SPEED ),
- MAP( "Duration", XML_NAMESPACE_PRESENTATION, XML_DURATION, XML_SD_TYPE_PRESPAGE_DURATION, CTF_PAGE_TRANS_DURATION ),
- MAP( "Visible", XML_NAMESPACE_PRESENTATION, XML_VISIBILITY, XML_SD_TYPE_PRESPAGE_VISIBILITY, CTF_PAGE_VISIBLE ),
- MAP( "Sound", XML_NAMESPACE_PRESENTATION, XML_SOUND, XML_TYPE_STRING|MID_FLAG_ELEMENT_ITEM, CTF_PAGE_SOUND_URL ),
- MAP( "BackgroundFullSize", XML_NAMESPACE_DRAW, XML_BACKGROUND_SIZE, XML_SD_TYPE_PRESPAGE_BACKSIZE, CTF_PAGE_BACKSIZE ),
-
- MAP( "IsBackgroundVisible", XML_NAMESPACE_PRESENTATION, XML_BACKGROUND_VISIBLE, XML_TYPE_BOOL, 0 ),
- MAP( "IsBackgroundObjectsVisible", XML_NAMESPACE_PRESENTATION, XML_BACKGROUND_OBJECTS_VISIBLE, XML_TYPE_BOOL, 0 ),
-
- MAP( "FillStyle", XML_NAMESPACE_DRAW, XML_FILL, XML_SD_TYPE_FILLSTYLE, 0 ),
- MAP( "FillColor", XML_NAMESPACE_DRAW, XML_FILL_COLOR, XML_TYPE_COLOR, 0 ),
- MAP( "FillGradientName", XML_NAMESPACE_DRAW, XML_FILL_GRADIENT_NAME, XML_TYPE_STRING, 0 ),
- MAP( "FillGradientStepCount", XML_NAMESPACE_DRAW, XML_GRADIENT_STEP_COUNT, XML_TYPE_NUMBER, 0 ),
- MAP( "FillHatchName", XML_NAMESPACE_DRAW, XML_FILL_HATCH_NAME, XML_TYPE_STRING, 0 ),
- MAP( "FillBitmapName", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_NAME, XML_TYPE_STRING, 0 ),
- MAP( "FillTransparenceName", XML_NAMESPACE_DRAW, XML_TRANSPARENCY_NAME, XML_TYPE_STRING, 0 ),
- MAP( "FillBitmapSizeX", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH, XML_SD_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, 0 ),
- MAP( "FillBitmapLogicalSize", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH, XML_SD_TYPE_LOGICAL_SIZE|MID_FLAG_MULTI_PROPERTY, 0 ),
- MAP( "FillBitmapSizeY", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_HEIGHT, XML_SD_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, 0 ),
- MAP( "FillBitmapLogicalSize", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_HEIGHT, XML_SD_TYPE_LOGICAL_SIZE|MID_FLAG_MULTI_PROPERTY, 0 ),
- MAP( "FillBitmapMode", XML_NAMESPACE_STYLE,XML_REPEAT, XML_SD_TYPE_BITMAP_MODE, 0 ),
- MAP( "FillBitmapPositionOffsetX", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT_X, XML_TYPE_PERCENT, 0 ),
- MAP( "FillBitmapPositionOffsetY", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT_Y, XML_TYPE_PERCENT, 0 ),
- MAP( "FillBitmapRectanglePoint", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT, XML_SD_TYPE_BITMAP_REFPOINT, 0 ),
- MAP( "FillBitmapOffsetX", XML_NAMESPACE_DRAW, XML_TILE_REPEAT_OFFSET, XML_SD_TYPE_BITMAPREPOFFSETX|MID_FLAG_MULTI_PROPERTY, CTF_REPEAT_OFFSET_X ),
- MAP( "FillBitmapOffsetY", XML_NAMESPACE_DRAW, XML_TILE_REPEAT_OFFSET, XML_SD_TYPE_BITMAPREPOFFSETY|MID_FLAG_MULTI_PROPERTY, CTF_REPEAT_OFFSET_Y ),
-
- { 0L }
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// implementation of factory for own graphic properties
-
-SvXMLEnumMapEntry aXML_LineStyle_EnumMap[] =
-{
- { XML_NONE, drawing::LineStyle_NONE },
- { XML_SOLID, drawing::LineStyle_SOLID },
- { XML_DASH, drawing::LineStyle_DASH },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXML_LineJoint_EnumMap[] =
-{
- { XML_NONE, drawing::LineJoint_NONE },
- { XML_MITER, drawing::LineJoint_MITER },
- { XML_ROUND, drawing::LineJoint_ROUND },
- { XML_BEVEL, drawing::LineJoint_BEVEL },
- { XML_MIDDLE, drawing::LineJoint_MIDDLE },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXML_FillStyle_EnumMap[] =
-{
- { XML_NONE, drawing::FillStyle_NONE },
- { XML_SOLID, drawing::FillStyle_SOLID },
- { XML_BITMAP, drawing::FillStyle_BITMAP },
- { XML_GRADIENT, drawing::FillStyle_GRADIENT },
- { XML_HATCH, drawing::FillStyle_HATCH },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXML_PresChange_EnumMap[] =
-{
- { XML_MANUAL, 0 },
- { XML_AUTOMATIC, 1 },
- { XML_SEMI_AUTOMATIC, 2 },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXML_TransSpeed_EnumMap[] =
-{
- { XML_FAST, presentation::AnimationSpeed_FAST },
- { XML_MEDIUM, presentation::AnimationSpeed_MEDIUM },
- { XML_SLOW, presentation::AnimationSpeed_SLOW },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXML_FadeEffect_EnumMap[] =
-{
- { XML_NONE, presentation::FadeEffect_NONE },
- { XML_FADE_FROM_LEFT, presentation::FadeEffect_FADE_FROM_LEFT },
- { XML_FADE_FROM_TOP, presentation::FadeEffect_FADE_FROM_TOP },
- { XML_FADE_FROM_RIGHT, presentation::FadeEffect_FADE_FROM_RIGHT },
- { XML_FADE_FROM_BOTTOM, presentation::FadeEffect_FADE_FROM_BOTTOM },
- { XML_FADE_TO_CENTER, presentation::FadeEffect_FADE_TO_CENTER },
- { XML_FADE_FROM_CENTER, presentation::FadeEffect_FADE_FROM_CENTER },
- { XML_MOVE_FROM_LEFT, presentation::FadeEffect_MOVE_FROM_LEFT },
- { XML_MOVE_FROM_TOP, presentation::FadeEffect_MOVE_FROM_TOP },
- { XML_MOVE_FROM_RIGHT, presentation::FadeEffect_MOVE_FROM_RIGHT },
- { XML_MOVE_FROM_BOTTOM, presentation::FadeEffect_MOVE_FROM_BOTTOM },
- { XML_ROLL_FROM_TOP, presentation::FadeEffect_ROLL_FROM_TOP },
- { XML_ROLL_FROM_LEFT, presentation::FadeEffect_ROLL_FROM_LEFT },
- { XML_ROLL_FROM_RIGHT, presentation::FadeEffect_ROLL_FROM_RIGHT },
- { XML_ROLL_FROM_BOTTOM, presentation::FadeEffect_ROLL_FROM_BOTTOM },
- { XML_VERTICAL_STRIPES, presentation::FadeEffect_VERTICAL_STRIPES },
- { XML_HORIZONTAL_STRIPES, presentation::FadeEffect_HORIZONTAL_STRIPES },
- { XML_CLOCKWISE, presentation::FadeEffect_CLOCKWISE },
- { XML_COUNTERCLOCKWISE, presentation::FadeEffect_COUNTERCLOCKWISE },
- { XML_FADE_FROM_UPPERLEFT, presentation::FadeEffect_FADE_FROM_UPPERLEFT },
- { XML_FADE_FROM_UPPERRIGHT, presentation::FadeEffect_FADE_FROM_UPPERRIGHT },
- { XML_FADE_FROM_LOWERLEFT, presentation::FadeEffect_FADE_FROM_LOWERLEFT },
- { XML_FADE_FROM_LOWERRIGHT, presentation::FadeEffect_FADE_FROM_LOWERRIGHT },
- { XML_CLOSE_VERTICAL, presentation::FadeEffect_CLOSE_VERTICAL },
- { XML_CLOSE_HORIZONTAL, presentation::FadeEffect_CLOSE_HORIZONTAL },
- { XML_OPEN_VERTICAL, presentation::FadeEffect_OPEN_VERTICAL },
- { XML_OPEN_HORIZONTAL, presentation::FadeEffect_OPEN_HORIZONTAL },
- { XML_SPIRALIN_LEFT, presentation::FadeEffect_SPIRALIN_LEFT },
- { XML_SPIRALIN_RIGHT, presentation::FadeEffect_SPIRALIN_RIGHT },
- { XML_SPIRALOUT_LEFT, presentation::FadeEffect_SPIRALOUT_LEFT },
- { XML_SPIRALOUT_RIGHT, presentation::FadeEffect_SPIRALOUT_RIGHT },
- { XML_DISSOLVE, presentation::FadeEffect_DISSOLVE },
- { XML_WAVYLINE_FROM_LEFT, presentation::FadeEffect_WAVYLINE_FROM_LEFT },
- { XML_WAVYLINE_FROM_TOP, presentation::FadeEffect_WAVYLINE_FROM_TOP },
- { XML_WAVYLINE_FROM_RIGHT, presentation::FadeEffect_WAVYLINE_FROM_RIGHT },
- { XML_WAVYLINE_FROM_BOTTOM, presentation::FadeEffect_WAVYLINE_FROM_BOTTOM },
- { XML_RANDOM, presentation::FadeEffect_RANDOM },
- { XML_STRETCH_FROM_LEFT, presentation::FadeEffect_STRETCH_FROM_LEFT },
- { XML_STRETCH_FROM_TOP, presentation::FadeEffect_STRETCH_FROM_TOP },
- { XML_STRETCH_FROM_RIGHT, presentation::FadeEffect_STRETCH_FROM_RIGHT },
- { XML_STRETCH_FROM_BOTTOM, presentation::FadeEffect_STRETCH_FROM_BOTTOM },
- { XML_VERTICAL_LINES, presentation::FadeEffect_VERTICAL_LINES },
- { XML_HORIZONTAL_LINES, presentation::FadeEffect_HORIZONTAL_LINES },
- { XML_MOVE_FROM_UPPERLEFT, presentation::FadeEffect_MOVE_FROM_UPPERLEFT },
- { XML_MOVE_FROM_UPPERRIGHT, presentation::FadeEffect_MOVE_FROM_UPPERRIGHT },
- { XML_MOVE_FROM_LOWERRIGHT, presentation::FadeEffect_MOVE_FROM_LOWERRIGHT },
- { XML_MOVE_FROM_LOWERLEFT, presentation::FadeEffect_MOVE_FROM_LOWERLEFT },
- { XML_UNCOVER_TO_LEFT, presentation::FadeEffect_UNCOVER_TO_LEFT },
- { XML_UNCOVER_TO_UPPERLEFT, presentation::FadeEffect_UNCOVER_TO_UPPERLEFT },
- { XML_UNCOVER_TO_TOP, presentation::FadeEffect_UNCOVER_TO_TOP },
- { XML_UNCOVER_TO_UPPERRIGHT,presentation::FadeEffect_UNCOVER_TO_UPPERRIGHT },
- { XML_UNCOVER_TO_RIGHT, presentation::FadeEffect_UNCOVER_TO_RIGHT },
- { XML_UNCOVER_TO_LOWERRIGHT,presentation::FadeEffect_UNCOVER_TO_LOWERRIGHT },
- { XML_UNCOVER_TO_BOTTOM, presentation::FadeEffect_UNCOVER_TO_BOTTOM },
- { XML_UNCOVER_TO_LOWERLEFT, presentation::FadeEffect_UNCOVER_TO_LOWERLEFT },
- { XML_VERTICAL_CHECKERBOARD,presentation::FadeEffect_VERTICAL_CHECKERBOARD },
- { XML_HORIZONTAL_CHECKERBOARD,presentation::FadeEffect_HORIZONTAL_CHECKERBOARD },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXML_ConnectionKind_EnumMap[] =
-{
- { XML_STANDARD, drawing::ConnectorType_STANDARD },
- { XML_CURVE, drawing::ConnectorType_CURVE },
- { XML_LINE, drawing::ConnectorType_LINE },
- { XML_LINES, drawing::ConnectorType_LINES },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXML_BitmapMode_EnumMap[] =
-{
- { XML_REPEAT, drawing::BitmapMode_REPEAT },
- { XML_STRETCH, drawing::BitmapMode_STRETCH },
- { XML_BACKGROUND_NO_REPEAT, drawing::BitmapMode_NO_REPEAT },
- { XML_TOKEN_INVALID, 0 }
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// 3D EnumMaps
-
-SvXMLEnumMapEntry aXML_NormalsKind_EnumMap[] =
-{
- { XML_OBJECT, drawing::NormalsKind_SPECIFIC },
- { XML_FLAT, drawing::NormalsKind_FLAT },
- { XML_SPHERE, drawing::NormalsKind_SPHERE },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXML_TexGenerationX_EnumMap[] =
-{
- { XML_OBJECT, drawing::TextureProjectionMode_OBJECTSPECIFIC },
- { XML_PARALLEL, drawing::TextureProjectionMode_PARALLEL },
- { XML_SPHERE, drawing::TextureProjectionMode_SPHERE },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXML_TexGenerationY_EnumMap[] =
-{
- { XML_OBJECT, drawing::TextureProjectionMode_OBJECTSPECIFIC },
- { XML_PARALLEL, drawing::TextureProjectionMode_PARALLEL },
- { XML_SPHERE, drawing::TextureProjectionMode_SPHERE },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXML_TexKind_EnumMap[] =
-{
- { XML_LUMINANCE, drawing::TextureKind_LUMINANCE },
-// { XML_INTENSITY, drawing::TextureKind_INTENSITY },
- { XML_COLOR, drawing::TextureKind_COLOR },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXML_TexMode_EnumMap[] =
-{
- { XML_REPLACE, drawing::TextureMode_REPLACE },
- { XML_MODULATE, drawing::TextureMode_MODULATE },
- { XML_BLEND, drawing::TextureMode_BLEND },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXML_RefPoint_EnumMap[] =
-{
- { XML_TOP_LEFT, drawing::RectanglePoint_LEFT_TOP },
- { XML_TOP, drawing::RectanglePoint_MIDDLE_TOP },
- { XML_TOP_RIGHT, drawing::RectanglePoint_RIGHT_TOP },
- { XML_LEFT, drawing::RectanglePoint_LEFT_MIDDLE },
- { XML_CENTER, drawing::RectanglePoint_MIDDLE_MIDDLE },
- { XML_RIGHT, drawing::RectanglePoint_RIGHT_MIDDLE },
- { XML_BOTTOM_LEFT, drawing::RectanglePoint_LEFT_BOTTOM },
- { XML_BOTTOM, drawing::RectanglePoint_MIDDLE_BOTTOM },
- { XML_BOTTOM_RIGHT, drawing::RectanglePoint_RIGHT_BOTTOM },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXML_CircleKind_EnumMap[] =
-{
- { XML_FULL, drawing::CircleKind_FULL },
- { XML_SECTION, drawing::CircleKind_SECTION },
- { XML_CUT, drawing::CircleKind_CUT },
- { XML_ARC, drawing::CircleKind_ARC },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXML_WritingMode_EnumMap[] =
-{
- { XML_TB_RL, text::WritingMode_TB_RL },
- { XML_LR_TB, text::WritingMode_LR_TB },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_TextAnimation_Enum[] =
-{
- { XML_NONE, drawing::TextAnimationKind_NONE },
- { XML_BLINKING, drawing::TextAnimationKind_BLINK }, // will be filtered
- { XML_SCROLL, drawing::TextAnimationKind_SCROLL },
- { XML_ALTERNATE, drawing::TextAnimationKind_ALTERNATE },
- { XML_SLIDE, drawing::TextAnimationKind_SLIDE },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_TextAnimation_Blinking_Enum[] =
-{
- { XML_FALSE, drawing::TextAnimationKind_NONE },
- { XML_TRUE, drawing::TextAnimationKind_BLINK },
- { XML_FALSE, drawing::TextAnimationKind_SCROLL },
- { XML_FALSE, drawing::TextAnimationKind_ALTERNATE },
- { XML_FALSE, drawing::TextAnimationKind_SLIDE },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_TextAnimationDirection_Enum[] =
-{
- { XML_LEFT, drawing::TextAnimationDirection_LEFT },
- { XML_RIGHT, drawing::TextAnimationDirection_RIGHT }, // will be filtered
- { XML_UP, drawing::TextAnimationDirection_UP },
- { XML_DOWN, drawing::TextAnimationDirection_DOWN },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_TextAlign_Enum[] =
-{
- { XML_LEFT, drawing::TextHorizontalAdjust_LEFT },
- { XML_CENTER, drawing::TextHorizontalAdjust_CENTER },
- { XML_RIGHT, drawing::TextHorizontalAdjust_RIGHT },
- { XML_JUSTIFY, drawing::TextHorizontalAdjust_BLOCK },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_VerticalAlign_Enum[] =
-{
- { XML_TOP, drawing::TextVerticalAdjust_TOP },
- { XML_MIDDLE, drawing::TextVerticalAdjust_CENTER },
- { XML_BOTTOM, drawing::TextVerticalAdjust_BOTTOM },
- { XML_JUSTIFY, drawing::TextVerticalAdjust_BLOCK },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_FitToSize_Enum[] =
-{
- { XML_FALSE, drawing::TextFitToSizeType_NONE },
- { XML_TRUE, drawing::TextFitToSizeType_PROPORTIONAL },
- { XML_TRUE, drawing::TextFitToSizeType_ALLLINES },
- { XML_TRUE, drawing::TextFitToSizeType_AUTOFIT },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_MeasureUnit_Enum[] =
-{
- { XML_AUTOMATIC, 0 },
- { XML_UNIT_MM, 1 },
- { XML_UNIT_CM, 2 },
- { XML_UNIT_M, 3 },
- { XML_UNIT_KM, 4 },
- { XML_UNIT_PT, 6 },
- { XML_UNIT_PC, 7 },
- { XML_UNIT_INCH, 8 },
- { XML_UNIT_FOOT, 9 },
- { XML_UNIT_MILES, 10 },
- { XML_TOKEN_INVALID,0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_Measure_HAlign_Enum[] =
-{
- { XML_AUTOMATIC, drawing::MeasureTextHorzPos_AUTO },
- { XML_LEFT_OUTSIDE, drawing::MeasureTextHorzPos_LEFTOUTSIDE },
- { XML_INSIDE, drawing::MeasureTextHorzPos_INSIDE },
- { XML_RIGHT_OUTSIDE, drawing::MeasureTextHorzPos_RIGHTOUTSIDE},
- { XML_TOKEN_INVALID,0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_Measure_VAlign_Enum[] =
-{
- { XML_AUTOMATIC, drawing::MeasureTextVertPos_AUTO },
- { XML_ABOVE, drawing::MeasureTextVertPos_EAST },
- { XML_BELOW, drawing::MeasureTextVertPos_WEST },
- { XML_CENTER, drawing::MeasureTextVertPos_CENTERED },
- { XML_TOKEN_INVALID,0 }
-};
-
-// #FontWork#
-SvXMLEnumMapEntry __READONLY_DATA pXML_Fontwork_Style_Enum[] =
-{
- { XML_ROTATE, 0 }, //XFT_ROTATE,
- { XML_UPRIGHT, 1 }, //XFT_UPRIGHT,
- { XML_SLANT_X, 2 }, //XFT_SLANTX,
- { XML_SLANT_Y, 3 }, //XFT_SLANTY,
- { XML_NONE, 4 }, //XFT_NONE
- { XML_TOKEN_INVALID,0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_Fontwork_Adjust_Enum[] =
-{
- { XML_LEFT, 0 }, //XFT_LEFT,
- { XML_RIGHT, 1 }, //XFT_RIGHT,
- { XML_AUTOSIZE, 2 }, //XFT_AUTOSIZE,
- { XML_CENTER, 3 }, //XFT_CENTER
- { XML_TOKEN_INVALID,0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_Fontwork_Shadow_Enum[] =
-{
- { XML_NORMAL, 0 }, //XFTSHADOW_NORMAL,
- { XML_SLANT, 1 }, //XFTSHADOW_SLANT,
- { XML_NONE, 2 }, //XFTSHADOW_NONE
- { XML_TOKEN_INVALID,0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_Fontwork_Form_Enum[] =
-{
- { XML_NONE, 0 }, //XFTFORM_NONE,
- { XML_TOPCIRCLE, 1 }, //XFTFORM_TOPCIRC,
- { XML_BOTTOMCIRCLE, 2 }, //XFTFORM_BOTCIRC,
- { XML_LEFTCIRCLE, 3 }, //XFTFORM_LFTCIRC,
- { XML_RIGHTCIRCLE, 4 }, //XFTFORM_RGTCIRC,
- { XML_TOPARC, 5 }, //XFTFORM_TOPARC,
- { XML_BOTTOMARC, 6 }, //XFTFORM_BOTARC,
- { XML_LEFTARC, 7 }, //XFTFORM_LFTARC,
- { XML_RIGHTARC, 8 }, //XFTFORM_RGTARC,
- { XML_BUTTON1, 9 }, //XFTFORM_BUTTON1,
- { XML_BUTTON2, 10 }, //XFTFORM_BUTTON2,
- { XML_BUTTON3, 11 }, //XFTFORM_BUTTON3,
- { XML_BUTTON4, 12 }, //XFTFORM_BUTTON4
- { XML_TOKEN_INVALID,0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_Caption_Esc_Dir_Enum[] =
-{
- { XML_HORIZONTAL, 0 }, //SDRCAPT_ESCHORIZONTAL,
- { XML_VERTICAL, 1 }, //SDRCAPT_ESCVERTICAL,
- { XML_AUTO, 2 }, //SDRCAPT_ESCBESTFIT,
- { XML_TOKEN_INVALID,0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_Caption_Type_Enum[] =
-{
- { XML_STRAIGHT_LINE, 0 }, //SDRCAPT_TYPE1,
- { XML_ANGLED_LINE, 1 }, //SDRCAPT_TYPE2,
- { XML_ANGLED_CONNECTOR_LINE, 2 }, //SDRCAPT_TYPE3,
- { XML_TOKEN_INVALID,0 }
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-XMLSdPropHdlFactory::XMLSdPropHdlFactory( uno::Reference< frame::XModel > xModel )
-: mxModel( xModel )
-{
-}
-
-XMLSdPropHdlFactory::~XMLSdPropHdlFactory()
-{
-}
-
-const XMLPropertyHandler* XMLSdPropHdlFactory::GetPropertyHandler( sal_Int32 nType ) const
-{
- XMLPropertyHandler* pHdl = (XMLPropertyHandler*)XMLPropertyHandlerFactory::GetPropertyHandler( nType );
- if(!pHdl)
- {
- switch(nType)
- {
- case XML_SD_TYPE_STROKE :
- {
- pHdl = new XMLEnumPropertyHdl( aXML_LineStyle_EnumMap, ::getCppuType((const drawing::LineStyle*)0) );
- break;
- }
- case XML_SD_TYPE_LINEJOIN :
- {
- pHdl = new XMLEnumPropertyHdl( aXML_LineJoint_EnumMap, ::getCppuType((const drawing::LineJoint*)0) );
- break;
- }
- case XML_SD_TYPE_FILLSTYLE :
- {
- pHdl = new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap, ::getCppuType((const drawing::FillStyle*)0) );
- break;
- }
- case XML_SD_TYPE_PRESPAGE_TYPE :
- {
- pHdl = new XMLEnumPropertyHdl( aXML_PresChange_EnumMap, ::getCppuType((const sal_Int32*)0) );
- break;
- }
- case XML_SD_TYPE_SHADOW :
- {
- pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken(XML_VISIBLE), GetXMLToken(XML_HIDDEN) );
- break;
- }
- case XML_SD_TYPE_PRESPAGE_STYLE :
- {
- pHdl = new XMLEnumPropertyHdl( aXML_FadeEffect_EnumMap, ::getCppuType((const presentation::FadeEffect*)0) );
- break;
- }
- case XML_SD_TYPE_PRESPAGE_SPEED :
- {
- pHdl = new XMLEnumPropertyHdl( aXML_TransSpeed_EnumMap, ::getCppuType((const presentation::AnimationSpeed*)0) );
- break;
- }
- case XML_SD_TYPE_PRESPAGE_DURATION :
- {
- pHdl = new XMLDurationPropertyHdl();
- break;
- }
- case XML_SD_TYPE_TEXT_CROSSEDOUT :
- {
- pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken(XML_CROSSEDOUT_SINGLE), GetXMLToken(XML_NONE) );
- break;
- }
- case XML_SD_TYPE_OPACITY :
- {
- pHdl = new XMLOpacityPropertyHdl();
- break;
- }
- case XML_SD_TYPE_WRITINGMODE :
- {
- pHdl = new XMLEnumPropertyHdl( aXML_WritingMode_EnumMap, ::getCppuType((const text::WritingMode*)0) );
- break;
- }
- case XML_SD_TYPE_PRESPAGE_VISIBILITY :
- {
- pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken(XML_VISIBLE), GetXMLToken(XML_HIDDEN) );
- break;
- }
- case XML_SD_TYPE_PRESPAGE_BACKSIZE:
- {
- pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken(XML_FULL), GetXMLToken(XML_BORDER) );
- break;
- }
-
- //////////////////////////////////////////////////////////////////
- // 3D Properties
-
- case XML_SD_TYPE_BACKFACE_CULLING:
- {
- // #87922# DoubleSided -> BackfaceCulling
- // This BOOL needs to be flipped, DoubleSided TRUE -> NO Backface culling
- // and vice versa.
- pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken(XML_DISABLED), GetXMLToken(XML_ENABLED) );
- break;
- }
-
- case XML_SD_TYPE_NORMALS_KIND:
- {
- pHdl = new XMLEnumPropertyHdl( aXML_NormalsKind_EnumMap, ::getCppuType((const drawing::NormalsKind*)0) );
- break;
- }
- case XML_SD_TYPE_NORMALS_DIRECTION:
- {
- pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken(XML_NORMAL), GetXMLToken(XML_INVERSE) );
- break;
- }
- case XML_SD_TYPE_TEX_GENERATION_MODE_X:
- {
- pHdl = new XMLEnumPropertyHdl( aXML_TexGenerationX_EnumMap, ::getCppuType((const drawing::TextureProjectionMode*)0) );
- break;
- }
- case XML_SD_TYPE_TEX_GENERATION_MODE_Y:
- {
- pHdl = new XMLEnumPropertyHdl( aXML_TexGenerationY_EnumMap, ::getCppuType((const drawing::TextureProjectionMode*)0) );
- break;
- }
- case XML_SD_TYPE_TEX_KIND:
- {
- pHdl = new XMLEnumPropertyHdl( aXML_TexKind_EnumMap, ::getCppuType((const drawing::TextureKind*)0) );
- break;
- }
- case XML_SD_TYPE_TEX_MODE:
- {
- pHdl = new XMLEnumPropertyHdl( aXML_TexMode_EnumMap, ::getCppuType((const drawing::TextureMode*)0) );
- break;
- }
- case XML_SD_TYPE_NUMBULLET:
- {
- uno::Reference<ucb::XAnyCompareFactory> xCompareFac( mxModel, uno::UNO_QUERY );
- uno::Reference<ucb::XAnyCompare> xCompare;
- if( xCompareFac.is() )
- xCompare = xCompareFac->createAnyCompareByName( OUString( RTL_CONSTASCII_USTRINGPARAM( "NumberingRules" ) ) );
-
- pHdl = new XMLNumRulePropHdl( xCompare );
- break;
- }
- case XML_SD_TYPE_BITMAP_MODE:
- {
- pHdl = new XMLEnumPropertyHdl( aXML_BitmapMode_EnumMap, getCppuType((const drawing::BitmapMode*)0) );
- break;
- }
- case XML_SD_TYPE_BITMAPREPOFFSETX:
- case XML_SD_TYPE_BITMAPREPOFFSETY:
- {
- pHdl = new XMLBitmapRepeatOffsetPropertyHandler( nType == XML_SD_TYPE_BITMAPREPOFFSETX );
- break;
- }
- case XML_SD_TYPE_FILLBITMAPSIZE:
- {
- pHdl = new XMLFillBitmapSizePropertyHandler();
- break;
- }
- case XML_SD_TYPE_LOGICAL_SIZE:
- {
- pHdl = new XMLBitmapLogicalSizePropertyHandler();
- break;
- }
- case XML_SD_TYPE_BITMAP_REFPOINT:
- {
- pHdl = new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap, getCppuType((const ::com::sun::star::drawing::RectanglePoint*)0) );
- break;
- }
- case XML_TYPE_TEXT_ANIMATION:
- pHdl = new XMLEnumPropertyHdl( pXML_TextAnimation_Enum, ::getCppuType((const ::com::sun::star::drawing::TextAnimationKind*)0) );
- break;
- case XML_TYPE_TEXT_ANIMATION_BLINKING:
- pHdl = new XMLEnumPropertyHdl( pXML_TextAnimation_Blinking_Enum, ::getCppuType((const ::com::sun::star::drawing::TextAnimationKind*)0) );
- break;
- case XML_TYPE_TEXT_ANIMATION_DIRECTION:
- pHdl = new XMLEnumPropertyHdl( pXML_TextAnimationDirection_Enum, ::getCppuType((const ::com::sun::star::drawing::TextAnimationDirection*)0) );
- break;
- case XML_TYPE_TEXT_ANIMATION_STEPS:
- pHdl = new XMLTextAnimationStepPropertyHdl;
- break;
- case XML_SD_TYPE_TEXT_ALIGN:
- pHdl = new XMLEnumPropertyHdl( pXML_TextAlign_Enum, ::getCppuType((const ::com::sun::star::drawing::TextHorizontalAdjust*)0) );
- break;
- case XML_SD_TYPE_VERTICAL_ALIGN:
- pHdl = new XMLEnumPropertyHdl( pXML_VerticalAlign_Enum, ::getCppuType((const ::com::sun::star::drawing::TextVerticalAdjust*)0) );
- break;
- case XML_SD_TYPE_FITTOSIZE:
- pHdl = new XMLEnumPropertyHdl( pXML_FitToSize_Enum, ::getCppuType((const ::com::sun::star::drawing::TextFitToSizeType*)0) );
- break;
- case XML_SD_TYPE_MEASURE_UNIT:
- pHdl = new XMLEnumPropertyHdl( pXML_MeasureUnit_Enum, ::getCppuType((const sal_Int32*)0) );
- break;
- case XML_SD_TYPE_MEASURE_HALIGN:
- pHdl = new XMLEnumPropertyHdl( pXML_Measure_HAlign_Enum, ::getCppuType((const ::com::sun::star::drawing::MeasureTextHorzPos*)0) );
- break;
- case XML_SD_TYPE_MEASURE_VALIGN:
- pHdl = new XMLEnumPropertyHdl( pXML_Measure_VAlign_Enum, ::getCppuType((const ::com::sun::star::drawing::MeasureTextVertPos*)0) );
- break;
- case XML_SD_TYPE_MEASURE_PLACING:
- {
- pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken(XML_BELOW), GetXMLToken(XML_ABOVE) );
- }
- break;
- case XML_TYPE_TEXT_CLIP:
- pHdl = new XMLClipPropertyHandler;
- break;
-
- // #FontWork#
- case XML_SD_TYPE_FONTWORK_STYLE :
- pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Style_Enum , ::getCppuType((const sal_Int32*)0));
- break;
- case XML_SD_TYPE_FONTWORK_ADJUST :
- pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Adjust_Enum , ::getCppuType((const sal_Int32*)0));
- break;
- case XML_SD_TYPE_FONTWORK_SHADOW :
- pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Shadow_Enum , ::getCppuType((const sal_Int32*)0));
- break;
- case XML_SD_TYPE_FONTWORK_FORM :
- pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Form_Enum , ::getCppuType((const sal_Int32*)0));
- break;
-
- case XML_SD_TYPE_CONTROL_BORDER:
- pHdl = new xmloff::OControlBorderHandler;
- break;
- case XML_TYPE_CONTROL_TEXT_EMPHASIZE:
- pHdl = new ::binfilter::xmloff::OControlTextEmphasisHandler;
- break;
-
- case XML_SD_TYPE_CAPTION_ANGLE_TYPE:
- {
- pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken(XML_FIXED), GetXMLToken(XML_FREE) );
- break;
- }
- case XML_SD_TYPE_CAPTION_IS_ESC_REL:
- pHdl = new XMLIsPercentagePropertyHandler();
- break;
- case XML_SD_TYPE_CAPTION_ESC_REL:
- pHdl = new XMLPercentOrMeasurePropertyHandler( sal_True );
- break;
- case XML_SD_TYPE_CAPTION_ESC_ABS:
- pHdl = new XMLPercentOrMeasurePropertyHandler( sal_False );
- break;
- case XML_SD_TYPE_CAPTION_ESC_DIR:
- pHdl = new XMLEnumPropertyHdl( pXML_Caption_Esc_Dir_Enum , ::getCppuType((const sal_Int32*)0));
- break;
- case XML_SD_TYPE_CAPTION_TYPE:
- pHdl = new XMLEnumPropertyHdl( pXML_Caption_Type_Enum , ::getCppuType((const sal_Int32*)0));
- break;
- }
-
- if(pHdl)
- PutHdlCache(nType, pHdl);
- }
-
- return pHdl;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-XMLShapePropertySetMapper::XMLShapePropertySetMapper(const UniReference< XMLPropertyHandlerFactory >& rFactoryRef)
-: XMLPropertySetMapper( aXMLSDProperties, rFactoryRef )
-{
-}
-
-XMLShapePropertySetMapper::~XMLShapePropertySetMapper()
-{
-}
-
-#ifndef SVX_LIGHT
-// ----------------------------------------
-
-XMLShapeExportPropertyMapper::XMLShapeExportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper, XMLTextListAutoStylePool *pListAutoPool, SvXMLExport& rExport ) :
- SvXMLExportPropertyMapper( rMapper ),
- mpListAutoPool( pListAutoPool ),
- mrExport( rExport ),
- maNumRuleExp( rExport ),
- msCDATA( GetXMLToken(XML_CDATA)),
- msTrue( GetXMLToken(XML_TRUE)),
- msFalse( GetXMLToken(XML_FALSE)),
- mbIsInAutoStyles( sal_True )
-{
-}
-
-XMLShapeExportPropertyMapper::~XMLShapeExportPropertyMapper()
-{
-}
-
-void XMLShapeExportPropertyMapper::ContextFilter(
- std::vector< XMLPropertyState >& rProperties,
- uno::Reference< beans::XPropertySet > rPropSet ) const
-{
- XMLPropertyState* pRepeatOffsetX = NULL;
- XMLPropertyState* pRepeatOffsetY = NULL;
- XMLPropertyState* pTextAnimationBlinking = NULL;
- XMLPropertyState* pTextAnimationKind = NULL;
-
- // #FontWork#
- XMLPropertyState* pFontWorkStyle = NULL;
- XMLPropertyState* pFontWorkAdjust = NULL;
- XMLPropertyState* pFontWorkDistance = NULL;
- XMLPropertyState* pFontWorkStart = NULL;
- XMLPropertyState* pFontWorkMirror = NULL;
- XMLPropertyState* pFontWorkOutline = NULL;
- XMLPropertyState* pFontWorkShadow = NULL;
- XMLPropertyState* pFontWorkShadowColor = NULL;
- XMLPropertyState* pFontWorkShadowOffsetx = NULL;
- XMLPropertyState* pFontWorkShadowOffsety = NULL;
- XMLPropertyState* pFontWorkForm = NULL;
- XMLPropertyState* pFontWorkHideform = NULL;
- XMLPropertyState* pFontWorkShadowTransparence = NULL;
-
- // OLE
- XMLPropertyState* pOLEVisAreaLeft = NULL;
- XMLPropertyState* pOLEVisAreaTop = NULL;
- XMLPropertyState* pOLEVisAreaWidth = NULL;
- XMLPropertyState* pOLEVisAreaHeight = NULL;
- XMLPropertyState* pOLEIsInternal = NULL;
-
- // caption
- XMLPropertyState* pCaptionIsEscRel = NULL;
- XMLPropertyState* pCaptionEscRel = NULL;
- XMLPropertyState* pCaptionEscAbs = NULL;
-
- // filter properties
- for( ::std::vector< XMLPropertyState >::iterator aIter = rProperties.begin();
- aIter != rProperties.end();
- ++aIter )
- {
- XMLPropertyState *property = &(*aIter);
- // find properties with context
- // to prevent writing this property set mnIndex member to -1
- switch( getPropertySetMapper()->GetEntryContextId( property->mnIndex ))
- {
- case CTF_NUMBERINGRULES:
- {
- if( mbIsInAutoStyles )
- property->mnIndex = -1;
- }
- break;
- case CTF_SD_NUMBERINGRULES_NAME:
- {
- // this property is not exported in the style:properties element
- // because its an XIndexAccess and not a string.
- // This will be handled in SvXMLAutoStylePoolP::exportStyleAttributes
- // This is suboptimal
- if( !mbIsInAutoStyles )
- property->mnIndex = -1;
- }
- break;
- case CTF_WRITINGMODE:
- {
- text::WritingMode eWritingMode;
- if( property->maValue >>= eWritingMode )
- {
- if( text::WritingMode_LR_TB == eWritingMode )
- property->mnIndex = -1;
- }
- }
- break;
- case CTF_REPEAT_OFFSET_X:
- pRepeatOffsetX = property;
- break;
-
- case CTF_REPEAT_OFFSET_Y:
- pRepeatOffsetY = property;
- break;
-
- case CTF_DASHNAME:
- case CTF_LINESTARTNAME:
- case CTF_LINEENDNAME:
- case CTF_FILLGRADIENTNAME:
- case CTF_FILLHATCHNAME:
- case CTF_FILLBITMAPNAME:
-// #85953# take out this case to allow writing empty
-// XML_TRANSPARENCY_NAME entries. This is used to represent
-// disabled FillTransparencyItems.
-// case CTF_FILLTRANSNAME:
- {
- if( !mbIsInAutoStyles )
- {
- OUString aStr;
- if( (property->maValue >>= aStr) && 0 == aStr.getLength() )
- property->mnIndex = -1;
- }
- }
- break;
- case CTF_TEXTANIMATION_BLINKING:
- pTextAnimationBlinking = property;
- break;
- case CTF_TEXTANIMATION_KIND:
- pTextAnimationKind = property;
- break;
-
- // #FontWork#
- case CTF_FONTWORK_STYLE: pFontWorkStyle = property; break;
- case CTF_FONTWORK_ADJUST: pFontWorkAdjust = property; break;
- case CTF_FONTWORK_DISTANCE: pFontWorkDistance = property; break;
- case CTF_FONTWORK_START: pFontWorkStart = property; break;
- case CTF_FONTWORK_MIRROR: pFontWorkMirror = property; break;
- case CTF_FONTWORK_OUTLINE: pFontWorkOutline = property; break;
- case CTF_FONTWORK_SHADOW: pFontWorkShadow = property; break;
- case CTF_FONTWORK_SHADOWCOLOR: pFontWorkShadowColor = property; break;
- case CTF_FONTWORK_SHADOWOFFSETX: pFontWorkShadowOffsetx = property; break;
- case CTF_FONTWORK_SHADOWOFFSETY: pFontWorkShadowOffsety = property; break;
- case CTF_FONTWORK_FORM: pFontWorkForm = property; break;
- case CTF_FONTWORK_HIDEFORM: pFontWorkHideform = property; break;
- case CTF_FONTWORK_SHADOWTRANSPARENCE: pFontWorkShadowTransparence = property; break;
-
- // OLE
- case CTF_SD_OLE_VIS_AREA_LEFT: pOLEVisAreaLeft = property; break;
- case CTF_SD_OLE_VIS_AREA_TOP: pOLEVisAreaTop = property; break;
- case CTF_SD_OLE_VIS_AREA_WIDTH: pOLEVisAreaWidth = property; break;
- case CTF_SD_OLE_VIS_AREA_HEIGHT: pOLEVisAreaHeight = property; break;
- case CTF_SD_OLE_ISINTERNAL: pOLEIsInternal = property; break;
- case CTF_FRAME_DISPLAY_SCROLLBAR:
- {
- if( !property->maValue.hasValue() )
- property->mnIndex = -1;
- }
- break;
- case CTF_SD_MOVE_PROTECT:
- {
- sal_Bool bProtected;
- property->maValue >>= bProtected;
- if( !bProtected )
- property->mnIndex = -1;
- }
- break;
- case CTF_SD_SIZE_PROTECT:
- {
- sal_Bool bProtected;
- property->maValue >>= bProtected;
- if( !bProtected )
- property->mnIndex = -1;
- }
- break;
- case CTF_CAPTION_ISESCREL: pCaptionIsEscRel = property; break;
- case CTF_CAPTION_ESCREL: pCaptionEscRel = property; break;
- case CTF_CAPTION_ESCABS: pCaptionEscAbs = property; break;
- }
- }
-
- // do not export visual area for internal ole objects
- if( pOLEIsInternal )
- {
- sal_Bool bInternal;
- if( (pOLEIsInternal->maValue >>= bInternal) && bInternal )
- {
- if( pOLEVisAreaLeft ) pOLEVisAreaLeft->mnIndex = -1;
- if( pOLEVisAreaTop ) pOLEVisAreaTop->mnIndex = -1;
- if( pOLEVisAreaWidth ) pOLEVisAreaWidth->mnIndex = -1;
- if( pOLEVisAreaHeight ) pOLEVisAreaHeight->mnIndex = -1;
- }
-
- pOLEIsInternal->mnIndex = -1;
- }
-
- if( pTextAnimationBlinking && pTextAnimationKind )
- {
- drawing::TextAnimationKind eKind;
- if( (pTextAnimationKind->maValue >>= eKind) && eKind != drawing::TextAnimationKind_BLINK )
- {
- pTextAnimationBlinking->mnIndex = -1;
- }
- else
- {
- pTextAnimationKind->mnIndex = -1;
- }
- }
-
- if( pRepeatOffsetX && pRepeatOffsetY )
- {
- sal_Int32 nOffset;
- if( ( pRepeatOffsetX->maValue >>= nOffset ) && ( nOffset == 0 ) )
- pRepeatOffsetX->mnIndex = -1;
- else
- pRepeatOffsetY->mnIndex = -1;
- }
-
- if(pFontWorkStyle)
- {
- // #FontWork#
- sal_Int32 nStyle;
-
- if(pFontWorkStyle->maValue >>= nStyle)
- {
- if(/*XFT_NONE*/4 == nStyle)
- {
- pFontWorkStyle->mnIndex = -1;
- if(pFontWorkAdjust)
- pFontWorkAdjust->mnIndex = -1;
- if(pFontWorkDistance)
- pFontWorkDistance->mnIndex = -1;
- if(pFontWorkStart)
- pFontWorkStart->mnIndex = -1;
- if(pFontWorkMirror)
- pFontWorkMirror->mnIndex = -1;
- if(pFontWorkOutline)
- pFontWorkOutline->mnIndex = -1;
- if(pFontWorkShadow)
- pFontWorkShadow->mnIndex = -1;
- if(pFontWorkShadowColor)
- pFontWorkShadowColor->mnIndex = -1;
- if(pFontWorkShadowOffsetx)
- pFontWorkShadowOffsetx->mnIndex = -1;
- if(pFontWorkShadowOffsety)
- pFontWorkShadowOffsety->mnIndex = -1;
- if(pFontWorkForm)
- pFontWorkForm->mnIndex = -1;
- if(pFontWorkHideform)
- pFontWorkHideform->mnIndex = -1;
- if(pFontWorkShadowTransparence)
- pFontWorkShadowTransparence->mnIndex = -1;
- }
- }
- }
-
- if( pCaptionIsEscRel )
- {
- sal_Bool bIsRel;
- pCaptionIsEscRel->maValue >>= bIsRel;
-
- if( bIsRel )
- {
- if( pCaptionEscAbs )
- pCaptionEscAbs->mnIndex = -1;
- }
- else
- {
- if( pCaptionEscRel )
- pCaptionEscRel->mnIndex = -1;
- }
-
- pCaptionIsEscRel->mnIndex = -1;
- }
-
- SvXMLExportPropertyMapper::ContextFilter(rProperties, rPropSet);
-}
-
-void XMLShapeExportPropertyMapper::handleSpecialItem(
- SvXMLAttributeList& rAttrList,
- const XMLPropertyState& rProperty,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap,
- const ::std::vector< XMLPropertyState > *pProperties,
- sal_uInt32 nIdx ) const
-{
- switch( getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ) )
- {
- case CTF_SD_CONTROL_SHAPE_DATA_STYLE:
- // not to be handled by the base class
- break;
-
- default:
- SvXMLExportPropertyMapper::handleSpecialItem( rAttrList, rProperty, rUnitConverter, rNamespaceMap, pProperties, nIdx );
- break;
- }
-}
-
-void XMLShapeExportPropertyMapper::handleElementItem(
- SvXMLExport& rExport,
- const XMLPropertyState& rProperty,
- sal_uInt16 nFlags,
- const ::std::vector< XMLPropertyState > *pProperties,
- sal_uInt32 nIdx) const
-{
- switch( getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ) )
- {
- case CTF_NUMBERINGRULES:
- {
- // only export list-styles as elements in styles section
- if( !mbIsInAutoStyles )
- {
- OUString sName;
- uno::Reference< container::XIndexReplace > xNumRule;
- if( rProperty.maValue >>= xNumRule )
- ((XMLShapeExportPropertyMapper*)this)->maNumRuleExp.exportNumberingRule( sName, xNumRule );
- }
- }
- break;
- default:
- SvXMLExportPropertyMapper::handleElementItem( rExport, rProperty, nFlags, pProperties, nIdx );
- break;
- }
-}
-
-// ----------------------------------------
-
-XMLPageExportPropertyMapper::XMLPageExportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper, SvXMLExport& rExport ) :
- SvXMLExportPropertyMapper( rMapper ),
- mrExport( rExport ),
- msCDATA( GetXMLToken(XML_CDATA))
-{
-}
-
-XMLPageExportPropertyMapper::~XMLPageExportPropertyMapper()
-{
-}
-
-void XMLPageExportPropertyMapper::ContextFilter(
- std::vector< XMLPropertyState >& rProperties,
- uno::Reference< beans::XPropertySet > rPropSet ) const
-{
- XMLPropertyState* pRepeatOffsetX = NULL;
- XMLPropertyState* pRepeatOffsetY = NULL;
- XMLPropertyState* pTransType = NULL;
- XMLPropertyState* pTransDuration = NULL;
-
- // filter properties
- for( ::std::vector< XMLPropertyState >::iterator aIter = rProperties.begin();
- aIter != rProperties.end();
- ++aIter )
- {
- XMLPropertyState*property = &(*aIter);
- // find properties with context
- // to prevent writing this property set mnIndex member to -1
- switch( getPropertySetMapper()->GetEntryContextId( property->mnIndex ))
- {
-
- case CTF_REPEAT_OFFSET_X:
- pRepeatOffsetX = property;
- break;
-
- case CTF_REPEAT_OFFSET_Y:
- pRepeatOffsetY = property;
- break;
- case CTF_PAGE_TRANS_TYPE:
- pTransType = property;
- break;
- case CTF_PAGE_TRANS_STYLE:
- {
- presentation::FadeEffect aEnum;
- if( ((*property).maValue >>= aEnum) && aEnum == presentation::FadeEffect_NONE )
- (*property).mnIndex = -1;
- }
- break;
- case CTF_PAGE_TRANS_SPEED:
- {
- presentation::AnimationSpeed aEnum;
- if( ((*property).maValue >>= aEnum) && aEnum == presentation::AnimationSpeed_MEDIUM )
- (*property).mnIndex = -1;
- }
- break;
- case CTF_PAGE_VISIBLE:
- {
- sal_Bool bVisible;
- (*property).maValue >>= bVisible;
- if( bVisible )
- (*property).mnIndex = -1;
- }
- break;
- case CTF_PAGE_TRANS_DURATION:
- pTransDuration = property;
- break;
- }
- }
-
- if( pRepeatOffsetX && pRepeatOffsetY )
- {
- sal_Int32 nOffset;
- if( ( pRepeatOffsetX->maValue >>= nOffset ) && ( nOffset == 0 ) )
- pRepeatOffsetX->mnIndex = -1;
- else
- pRepeatOffsetY->mnIndex = -1;
- }
-
- if( pTransType && pTransDuration )
- {
- sal_Int32 nChange = 0;
- pTransType->maValue >>= nChange;
-
- // only export duration for automatic
- if( nChange != 1 )
- pTransDuration->mnIndex = -1;
-
- // do not export default transition change
- if( nChange == 0 )
- pTransType->mnIndex = -1;
- }
-
- SvXMLExportPropertyMapper::ContextFilter(rProperties, rPropSet);
-}
-
-void XMLPageExportPropertyMapper::handleElementItem(
- SvXMLExport& rExport,
- const XMLPropertyState& rProperty,
- sal_uInt16 nFlags,
- const ::std::vector< XMLPropertyState > *pProperties,
- sal_uInt32 nIdx) const
-{
- switch( getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ) )
- {
- case CTF_PAGE_SOUND_URL:
- {
- OUString aSoundURL;
- if( (rProperty.maValue >>= aSoundURL) && aSoundURL.getLength() != 0 )
- {
- mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, mrExport.GetRelativeReference(aSoundURL) );
- mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
- mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_NEW );
- mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONREQUEST );
- SvXMLElementExport aElem( mrExport, XML_NAMESPACE_PRESENTATION, XML_SOUND, sal_True, sal_True );
- }
- }
- break;
- default:
- SvXMLExportPropertyMapper::handleElementItem( rExport, rProperty, nFlags, pProperties, nIdx );
- break;
- }
-}
-
-#endif // #ifndef SVX_LIGHT
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_sdxmlexp.cxx b/binfilter/bf_xmloff/source/draw/xmloff_sdxmlexp.cxx
deleted file mode 100644
index 2a1ed9ece707..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_sdxmlexp.cxx
+++ /dev/null
@@ -1,2641 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-#include "xmluconv.hxx"
-
-
-
-#include "xmlmetae.hxx"
-
-
-#include <com/sun/star/presentation/XPresentationSupplier.hpp>
-
-#include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
-
-
-
-
-
-#include "sdxmlexp.hxx"
-
-#include "sdxmlexp_impl.hxx"
-
-#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
-
-#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
-
-#include <com/sun/star/presentation/XHandoutMasterSupplier.hpp>
-
-#include <com/sun/star/view/PaperOrientation.hpp>
-
-#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-
-
-#include <com/sun/star/form/XFormsSupplier.hpp>
-
-#include <com/sun/star/presentation/XPresentationPage.hpp>
-
-#include <com/sun/star/drawing/XMasterPageTarget.hpp>
-
-
-
-
-
-
-#include <tools/debug.hxx>
-
-
-
-
-#include "sdpropls.hxx"
-
-
-#include <com/sun/star/beans/XPropertyState.hpp>
-
-#include "xexptran.hxx"
-
-
-#include <cppuhelper/implbase1.hxx>
-
-
-
-#include "PropertySetMerger.hxx"
-
-#include "layerexp.hxx"
-
-
-
-#include "XMLNumberStylesExport.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::drawing;
-using namespace ::com::sun::star::presentation;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-class ImpXMLEXPPageMasterInfo
-{
- sal_Int32 mnBorderBottom;
- sal_Int32 mnBorderLeft;
- sal_Int32 mnBorderRight;
- sal_Int32 mnBorderTop;
- sal_Int32 mnWidth;
- sal_Int32 mnHeight;
- view::PaperOrientation meOrientation;
- OUString msName;
- OUString msMasterPageName;
-
-public:
- ImpXMLEXPPageMasterInfo(const SdXMLExport& rExp, const uno::Reference<drawing::XDrawPage>& xPage);
- BOOL operator==(const ImpXMLEXPPageMasterInfo& rInfo) const;
- void SetName(const OUString& rStr);
-
- const OUString& GetName() const { return msName; }
- const OUString& GetMasterPageName() const { return msMasterPageName; }
-
- sal_Int32 GetBorderBottom() const { return mnBorderBottom; }
- sal_Int32 GetBorderLeft() const { return mnBorderLeft; }
- sal_Int32 GetBorderRight() const { return mnBorderRight; }
- sal_Int32 GetBorderTop() const { return mnBorderTop; }
- sal_Int32 GetWidth() const { return mnWidth; }
- sal_Int32 GetHeight() const { return mnHeight; }
- view::PaperOrientation GetOrientation() const { return meOrientation; }
-};
-
-ImpXMLEXPPageMasterInfo::ImpXMLEXPPageMasterInfo(
- const SdXMLExport& rExp,
- const uno::Reference<drawing::XDrawPage>& xPage)
-: mnBorderBottom(0),
- mnBorderLeft(0),
- mnBorderRight(0),
- mnBorderTop(0),
- mnWidth(0),
- mnHeight(0),
- meOrientation(rExp.IsDraw() ? view::PaperOrientation_PORTRAIT : view::PaperOrientation_LANDSCAPE)
-{
- uno::Reference <beans::XPropertySet> xPropSet(xPage, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- uno::Any aAny;
-
- uno::Reference< beans::XPropertySetInfo > xPropsInfo( xPropSet->getPropertySetInfo() );
- if( xPropsInfo.is() && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderBottom") )))
- {
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderBottom")));
- aAny >>= mnBorderBottom;
-
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderLeft")));
- aAny >>= mnBorderLeft;
-
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderRight")));
- aAny >>= mnBorderRight;
-
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderTop")));
- aAny >>= mnBorderTop;
- }
-
- if( xPropsInfo.is() && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("Width") )))
- {
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Width")));
- aAny >>= mnWidth;
-
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Height")));
- aAny >>= mnHeight;
- }
-
- if( xPropsInfo.is() && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("Orientation") )))
- {
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Orientation")));
- aAny >>= meOrientation;
- }
- }
-
- uno::Reference <container::XNamed> xMasterNamed(xPage, uno::UNO_QUERY);
- if(xMasterNamed.is())
- {
- msMasterPageName = xMasterNamed->getName();
- }
-}
-
-BOOL ImpXMLEXPPageMasterInfo::operator==(const ImpXMLEXPPageMasterInfo& rInfo) const
-{
- return ((mnBorderBottom == rInfo.mnBorderBottom)
- && (mnBorderLeft == rInfo.mnBorderLeft)
- && (mnBorderRight == rInfo.mnBorderRight)
- && (mnBorderTop == rInfo.mnBorderTop)
- && (mnWidth == rInfo.mnWidth)
- && (mnHeight == rInfo.mnHeight)
- && (meOrientation == rInfo.meOrientation));
-}
-
-void ImpXMLEXPPageMasterInfo::SetName(const OUString& rStr)
-{
- msName = rStr;
-}
-
-DECLARE_LIST(ImpXMLEXPPageMasterList, ImpXMLEXPPageMasterInfo*)//STRIP007;
-
-//////////////////////////////////////////////////////////////////////////////
-
-#define IMP_AUTOLAYOUT_INFO_MAX (31L)
-
-class ImpXMLAutoLayoutInfo
-{
- sal_uInt16 mnType;
- ImpXMLEXPPageMasterInfo* mpPageMasterInfo;
- OUString msLayoutName;
- Rectangle maTitleRect;
- Rectangle maPresRect;
- sal_Int32 mnGapX;
- sal_Int32 mnGapY;
-
-public:
- ImpXMLAutoLayoutInfo(sal_uInt16 nTyp, ImpXMLEXPPageMasterInfo* pInf);
-
- BOOL operator==(const ImpXMLAutoLayoutInfo& rInfo) const;
-
- sal_uInt16 GetLayoutType() const { return mnType; }
- sal_Int32 GetGapX() const { return mnGapX; }
- sal_Int32 GetGapY() const { return mnGapY; }
-
- const OUString& GetLayoutName() const { return msLayoutName; }
- void SetLayoutName(const OUString& rNew) { msLayoutName = rNew; }
-
- const Rectangle& GetTitleRectangle() const { return maTitleRect; }
- const Rectangle& GetPresRectangle() const { return maPresRect; }
-
- static BOOL IsCreateNecessary(sal_uInt16 nTyp);
-};
-
-BOOL ImpXMLAutoLayoutInfo::IsCreateNecessary(sal_uInt16 nTyp)
-{
- if(nTyp == 5 /* AUTOLAYOUT_ORG */
- || nTyp == 20 /* AUTOLAYOUT_NONE */
- || nTyp >= IMP_AUTOLAYOUT_INFO_MAX)
- return FALSE;
- return TRUE;
-}
-
-BOOL ImpXMLAutoLayoutInfo::operator==(const ImpXMLAutoLayoutInfo& rInfo) const
-{
- return ((mnType == rInfo.mnType
- && mpPageMasterInfo == rInfo.mpPageMasterInfo));
-}
-
-ImpXMLAutoLayoutInfo::ImpXMLAutoLayoutInfo(sal_uInt16 nTyp, ImpXMLEXPPageMasterInfo* pInf)
-: mnType(nTyp),
- mpPageMasterInfo(pInf)
-{
- // create full info (initialze with typical values)
- Point aPagePos(0,0);
- Size aPageSize(28000, 21000);
- Size aPageInnerSize(28000, 21000);
-
- if(mpPageMasterInfo)
- {
- aPagePos = Point(mpPageMasterInfo->GetBorderLeft(), mpPageMasterInfo->GetBorderTop());
- aPageSize = Size(mpPageMasterInfo->GetWidth(), mpPageMasterInfo->GetHeight());
- aPageInnerSize = aPageSize;
- aPageInnerSize.Width() -= mpPageMasterInfo->GetBorderLeft() + mpPageMasterInfo->GetBorderRight();
- aPageInnerSize.Height() -= mpPageMasterInfo->GetBorderTop() + mpPageMasterInfo->GetBorderBottom();
- }
-
- // title rectangle aligning
- Point aTitlePos(aPagePos);
- Size aTitleSize(aPageInnerSize);
-
- if(mnType == 21 /* AUTOLAYOUT_NOTES */)
- {
- aTitleSize.Height() = (long) (aTitleSize.Height() / 2.5);
- Point aPos = aTitlePos;
- aPos.Y() += long( aTitleSize.Height() * 0.083 );
- Size aPartArea = aTitleSize;
- Size aSize;
-
- // tatsaechliche Seitengroesse in das Handout-Rechteck skalieren
- double fH = (double) aPartArea.Width() / aPageSize.Width();
- double fV = (double) aPartArea.Height() / aPageSize.Height();
-
- if ( fH > fV )
- fH = fV;
- aSize.Width() = (long) (fH * aPageSize.Width());
- aSize.Height() = (long) (fH * aPageSize.Height());
-
- aPos.X() += (aPartArea.Width() - aSize.Width()) / 2;
- aPos.Y() += (aPartArea.Height()- aSize.Height())/ 2;
-
- aTitlePos = aPos;
- aTitleSize = aSize;
- }
- else if(mnType == 27 || mnType == 28)
- {
- // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART or
- // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
- Point aClassicTPos(
- aTitlePos.X() + long( aTitleSize.Width() * 0.0735 ),
- aTitlePos.Y() + long( aTitleSize.Height() * 0.083 ));
- Size aClassicTSize(
- long( aTitleSize.Width() * 0.854 ),
- long( aTitleSize.Height() * 0.167 ));
- Point aLPos(aPagePos);
- Size aLSize(aPageInnerSize);
- Point aClassicLPos(
- aLPos.X() + long( aLSize.Width() * 0.0735 ),
- aLPos.Y() + long( aLSize.Height() * 0.472 ));
- Size aClassicLSize(
- long( aLSize.Width() * 0.854 ),
- long( aLSize.Height() * 0.444 ));
-
- aTitlePos.X() = (aClassicTPos.X() + aClassicTSize.Width()) - aClassicTSize.Height();
- aTitlePos.Y() = aClassicTPos.Y();
- aTitleSize.Width() = aClassicTSize.Height();
- aTitleSize.Height() = (aClassicLPos.Y() + aClassicLSize.Height()) - aClassicTPos.Y();
- }
- else
- {
- aTitlePos.X() += long( aTitleSize.Width() * 0.0735 );
- aTitlePos.Y() += long( aTitleSize.Height() * 0.083 );
- aTitleSize.Width() = long( aTitleSize.Width() * 0.854 );
- aTitleSize.Height() = long( aTitleSize.Height() * 0.167 );
- }
-
- maTitleRect.SetPos(aTitlePos);
- maTitleRect.SetSize(aTitleSize);
-
- // layout rectangle aligning
- Point aLayoutPos(aPagePos);
- Size aLayoutSize(aPageInnerSize);
-
- if(mnType == 21 /* AUTOLAYOUT_NOTES */)
- {
- aLayoutPos.X() += long( aLayoutSize.Width() * 0.0735 );
- aLayoutPos.Y() += long( aLayoutSize.Height() * 0.472 );
- aLayoutSize.Width() = long( aLayoutSize.Width() * 0.854 );
- aLayoutSize.Height() = long( aLayoutSize.Height() * 0.444 );
- }
- else if(mnType >= 22 && mnType <= 26) // AUTOLAYOUT_HANDOUT
- {
- // keep info for inner area in maPresRect, put info for gap size
- // to maTitleRect position
- mnGapX = (aPageSize.Width() - aPageInnerSize.Width()) / 2;
- mnGapY = (aPageSize.Height() - aPageInnerSize.Height()) / 2;
-
- if(!mnGapX)
- mnGapX = aPageSize.Width() / 10;
-
- if(!mnGapY)
- mnGapY = aPageSize.Height() / 10;
-
- if(mnGapX < aPageInnerSize.Width() / 10)
- mnGapX = aPageInnerSize.Width() / 10;
-
- if(mnGapY < aPageInnerSize.Height() / 10)
- mnGapY = aPageInnerSize.Height() / 10;
- }
- else if(mnType == 27 || mnType == 28)
- {
- // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART or
- // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
- Point aClassicTPos(
- aTitlePos.X() + long( aTitleSize.Width() * 0.0735 ),
- aTitlePos.Y() + long( aTitleSize.Height() * 0.083 ));
- Size aClassicTSize(
- long( aTitleSize.Width() * 0.854 ),
- long( aTitleSize.Height() * 0.167 ));
- Point aClassicLPos(
- aLayoutPos.X() + long( aLayoutSize.Width() * 0.0735 ),
- aLayoutPos.Y() + long( aLayoutSize.Height() * 0.472 ));
- Size aClassicLSize(
- long( aLayoutSize.Width() * 0.854 ),
- long( aLayoutSize.Height() * 0.444 ));
-
- aLayoutPos.X() = aClassicLPos.X();
- aLayoutPos.Y() = aClassicTPos.Y();
- aLayoutSize.Width() = (aClassicLPos.X() + aClassicLSize.Width())
- - (aClassicTSize.Height() + (aClassicLPos.Y() - (aClassicTPos.Y() + aClassicTSize.Height())));
- aLayoutSize.Height() = (aClassicLPos.Y() + aClassicLSize.Height()) - aClassicTPos.Y();
- }
- else
- {
- aLayoutPos.X() += long( aLayoutSize.Width() * 0.0735 );
- aLayoutPos.Y() += long( aLayoutSize.Height() * 0.278 );
- aLayoutSize.Width() = long( aLayoutSize.Width() * 0.854 );
- aLayoutSize.Height() = long( aLayoutSize.Height() * 0.630 );
- }
-
- maPresRect.SetPos(aLayoutPos);
- maPresRect.SetSize(aLayoutSize);
-}
-
-DECLARE_LIST(ImpXMLAutoLayoutInfoList, ImpXMLAutoLayoutInfo*)//STRIP007;
-
-//////////////////////////////////////////////////////////////////////////////
-
-// #110680#
-SdXMLExport::SdXMLExport(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- sal_Bool bIsDraw, sal_uInt16 nExportFlags )
-: SvXMLExport( xServiceFactory, MAP_CM, bIsDraw ? XML_DRAWING : XML_PRESENTATION, nExportFlags ),
- mpPageMasterInfoList(new ImpXMLEXPPageMasterList(1, 4, 4)),
- mpPageMasterUsageList(new ImpXMLEXPPageMasterList(1, 4, 4)),
- mpNotesPageMasterUsageList(new ImpXMLEXPPageMasterList(1, 4, 4)),
- mpHandoutPageMaster(NULL),
- mpAutoLayoutInfoList(new ImpXMLAutoLayoutInfoList(1, 4, 4)),
- mpSdPropHdlFactory(0L),
- mpPropertySetMapper(0L),
- mpPresPagePropsMapper(0L),
- mnDocMasterPageCount(0L),
- mnDocDrawPageCount(0L),
- mnShapeStyleInfoIndex(0L),
- mnObjectCount(0L),
- mbIsDraw(bIsDraw),
- mbFamilyGraphicUsed(FALSE),
- mbFamilyPresentationUsed(FALSE),
- msZIndex( GetXMLToken(XML_ZINDEX) ),
- msEmptyPres( RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ),
- msModel( RTL_CONSTASCII_USTRINGPARAM("Model") ),
- msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ),
- msEndShape( RTL_CONSTASCII_USTRINGPARAM("EndShape") ),
- msPageLayoutNames( RTL_CONSTASCII_USTRINGPARAM("PageLayoutNames") ),
- mnUsedDateStyles( 0 ),
- mnUsedTimeStyles( 0 )
-{
-
-
-}
-
-// XExporter
-void SAL_CALL SdXMLExport::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc )
- throw(lang::IllegalArgumentException, uno::RuntimeException)
-{
- SvXMLExport::setSourceDocument( xDoc );
-
- const OUString aEmpty;
-
- // prepare factory parts
- mpSdPropHdlFactory = new XMLSdPropHdlFactory( GetModel() );
- if(mpSdPropHdlFactory)
- {
- // set lock to avoid deletion
- mpSdPropHdlFactory->acquire();
-
- // build one ref
- const UniReference< XMLPropertyHandlerFactory > aFactoryRef = mpSdPropHdlFactory;
-
- // construct PropertySetMapper
- UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( aFactoryRef);
-
- mpPropertySetMapper = new XMLShapeExportPropertyMapper( xMapper, (XMLTextListAutoStylePool*)&GetTextParagraphExport()->GetListAutoStylePool(), *this );
- // set lock to avoid deletion
- mpPropertySetMapper->acquire();
-
- // chain text attributes
- mpPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this));
-
- // construct PresPagePropsMapper
- xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, aFactoryRef);
-
- mpPresPagePropsMapper = new XMLPageExportPropertyMapper( xMapper, *this );
- if(mpPresPagePropsMapper)
- {
- // set lock to avoid deletion
- mpPresPagePropsMapper->acquire();
- }
- }
-
- // add family name
- GetAutoStylePool()->AddFamily(
- XML_STYLE_FAMILY_SD_GRAPHICS_ID,
- OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)),
- GetPropertySetMapper(),
- OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX)));
- GetAutoStylePool()->AddFamily(
- XML_STYLE_FAMILY_SD_PRESENTATION_ID,
- OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME)),
- GetPropertySetMapper(),
- OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX)));
- GetAutoStylePool()->AddFamily(
- XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID,
- OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)),
- GetPresPagePropsMapper(),
- OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_DRAWINGPAGE_PREFIX)));
-
- // prepare access to styles
- uno::Reference< style::XStyleFamiliesSupplier > xFamSup( GetModel(), uno::UNO_QUERY );
- if(xFamSup.is())
- {
- mxDocStyleFamilies = xFamSup->getStyleFamilies();
- }
-
- // prepare access to master pages
- uno::Reference < drawing::XMasterPagesSupplier > xMasterPagesSupplier(GetModel(), uno::UNO_QUERY);
- if(xMasterPagesSupplier.is())
- {
- mxDocMasterPages = mxDocMasterPages.query( xMasterPagesSupplier->getMasterPages() );
- if(mxDocMasterPages.is())
- {
- mnDocMasterPageCount = mxDocMasterPages->getCount();
- maMasterPagesStyleNames.insert( maMasterPagesStyleNames.begin(), mnDocMasterPageCount, aEmpty );
- }
- }
-
- // prepare access to draw pages
- uno::Reference <drawing::XDrawPagesSupplier> xDrawPagesSupplier(GetModel(), uno::UNO_QUERY);
- if(xDrawPagesSupplier.is())
- {
- mxDocDrawPages = mxDocDrawPages.query( xDrawPagesSupplier->getDrawPages() );
- if(mxDocDrawPages.is())
- {
- mnDocDrawPageCount = mxDocDrawPages->getCount();
- maDrawPagesStyleNames.insert( maDrawPagesStyleNames.begin(), mnDocDrawPageCount, aEmpty );
- if( !mbIsDraw )
- maDrawPagesAutoLayoutNames.realloc( mnDocDrawPageCount + 1 );
- }
- }
-
- // #82003# count all draw objects for use with progress bar.
- // #88245# init mnObjectCount once, use counter itself as flag. It
- // is initialized to 0.
- if(!mnObjectCount)
- {
- // #91587# add handout master count
- 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())
- {
- mnObjectCount += ImpRecursiveObjectCount(xShapes);
- }
- }
- }
-
- if(mxDocMasterPages.is())
- {
- for(sal_Int32 a(0); a < mnDocMasterPageCount; a++)
- {
- uno::Any aAny(mxDocMasterPages->getByIndex(a));
- uno::Reference< drawing::XShapes > xMasterPage;
-
- if((aAny >>= xMasterPage) && xMasterPage.is())
- {
- mnObjectCount += ImpRecursiveObjectCount(xMasterPage);
- }
-
- // #91587# take notes pages from master pages into account
- uno::Reference<presentation::XPresentationPage> xPresPage;
- if((aAny >>= xPresPage) && xPresPage.is())
- {
- uno::Reference<drawing::XDrawPage> xNotesPage(xPresPage->getNotesPage());
- if(xNotesPage.is())
- {
- uno::Reference<drawing::XShapes> xShapes(xNotesPage, uno::UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- {
- mnObjectCount += ImpRecursiveObjectCount(xShapes);
- }
- }
- }
- }
- }
-
- if(mxDocDrawPages.is())
- {
- for(sal_Int32 a(0); a < mnDocDrawPageCount; a++)
- {
- uno::Any aAny(mxDocDrawPages->getByIndex(a));
- uno::Reference< drawing::XShapes > xPage;
-
- if((aAny >>= xPage) && xPage.is())
- {
- mnObjectCount += ImpRecursiveObjectCount(xPage);
- }
-
- // #91587# take notes pages from draw pages into account
- uno::Reference<presentation::XPresentationPage> xPresPage;
- if((aAny >>= xPresPage) && xPresPage.is())
- {
- uno::Reference<drawing::XDrawPage> xNotesPage(xPresPage->getNotesPage());
- if(xNotesPage.is())
- {
- uno::Reference<drawing::XShapes> xShapes(xNotesPage, uno::UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- {
- mnObjectCount += ImpRecursiveObjectCount(xShapes);
- }
- }
- }
- }
- }
-
- // #82003# init progress bar
- GetProgressBarHelper()->SetReference(mnObjectCount);
- }
-
- // add namespaces
- _GetNamespaceMap().Add(
- GetXMLToken(XML_NP_PRESENTATION),
- GetXMLToken(XML_N_PRESENTATION),
- XML_NAMESPACE_PRESENTATION);
-
- GetShapeExport()->enableLayerExport();
-
- // #88546# enable progress bar increments
- GetShapeExport()->enableHandleProgressBar();
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// #82003# helper function for recursive object count
-sal_uInt32 SdXMLExport::ImpRecursiveObjectCount(uno::Reference< drawing::XShapes > xShapes)
-{
- sal_uInt32 nRetval(0L);
-
- if(xShapes.is())
- {
- sal_Int32 nCount = xShapes->getCount();
-
- for(sal_Int32 a(0L); a < nCount; a++)
- {
- uno::Any aAny(xShapes->getByIndex(a));
- uno::Reference< drawing::XShapes > xGroup;
-
- if((aAny >>= xGroup) && xGroup.is())
- {
- // #93180# count group objects, too.
- nRetval += 1 + ImpRecursiveObjectCount(xGroup);
- }
- else
- {
- nRetval++;
- }
- }
- }
-
- return nRetval;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-__EXPORT SdXMLExport::~SdXMLExport()
-{
- // cleanup factory, decrease refcount. Should lead to destruction.
- if(mpSdPropHdlFactory)
- {
- mpSdPropHdlFactory->release();
- mpSdPropHdlFactory = 0L;
- }
-
- // cleanup mapper, decrease refcount. Should lead to destruction.
- if(mpPropertySetMapper)
- {
- mpPropertySetMapper->release();
- mpPropertySetMapper = 0L;
- }
-
- // cleanup presPage mapper, decrease refcount. Should lead to destruction.
- if(mpPresPagePropsMapper)
- {
- mpPresPagePropsMapper->release();
- mpPresPagePropsMapper = 0L;
- }
-
- // clear evtl. temporary page master infos
- if(mpPageMasterInfoList)
- {
- while(mpPageMasterInfoList->Count())
- delete mpPageMasterInfoList->Remove(mpPageMasterInfoList->Count() - 1L);
- delete mpPageMasterInfoList;
- mpPageMasterInfoList = 0L;
- }
- if(mpPageMasterUsageList)
- {
- delete mpPageMasterUsageList;
- mpPageMasterUsageList = 0L;
- }
- if(mpNotesPageMasterUsageList)
- {
- delete mpNotesPageMasterUsageList;
- mpNotesPageMasterUsageList = 0L;
- }
-
- // clear auto-layout infos
- if(mpAutoLayoutInfoList)
- {
- while(mpAutoLayoutInfoList->Count())
- delete mpAutoLayoutInfoList->Remove(mpAutoLayoutInfoList->Count() - 1L);
- delete mpAutoLayoutInfoList;
- mpAutoLayoutInfoList = 0L;
- }
-
-// #82003# status indicator stop is called exclusively
-// from SdXMLFilter::Export() now.
-//
-// stop progress view
-// if(GetStatusIndicator().is())
-// {
-// GetStatusIndicator()->end();
-// GetStatusIndicator()->reset();
-// }
-}
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-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++)
- {
- uno::Any aAny(mxDocDrawPages->getByIndex(nCnt));
- uno::Reference<drawing::XDrawPage> xDrawPage;
-
- if((aAny >>= xDrawPage) && xDrawPage.is())
- {
- if(ImpPrepAutoLayoutInfo(xDrawPage, aStr))
- maDrawPagesAutoLayoutNames[nCnt+1] = aStr;
- }
- }
- }
-}
-
-BOOL SdXMLExport::ImpPrepAutoLayoutInfo(const uno::Reference<drawing::XDrawPage>& xPage, OUString& rName)
-{
- rName = OUString();
- BOOL bRetval(FALSE);
-
- uno::Reference <beans::XPropertySet> xPropSet(xPage, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- sal_uInt16 nType;
- uno::Any aAny;
-
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Layout")));
- if(aAny >>= nType)
- {
- if(ImpXMLAutoLayoutInfo::IsCreateNecessary(nType))
- {
- ImpXMLEXPPageMasterInfo* pInfo = 0L;
-
- // get master-page info
- uno::Reference < drawing::XMasterPageTarget > xMasterPageInt(xPage, uno::UNO_QUERY);
- if(xMasterPageInt.is())
- {
- uno::Reference<drawing::XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage());
- if(xUsedMasterPage.is())
- {
- uno::Reference < container::XNamed > xMasterNamed(xUsedMasterPage, uno::UNO_QUERY);
- if(xMasterNamed.is())
- {
- OUString sMasterPageName = xMasterNamed->getName();
- pInfo = ImpGetPageMasterInfoByName(sMasterPageName);
- }
- }
- }
-
- // create entry and look for existance
- ImpXMLAutoLayoutInfo* pNew = new ImpXMLAutoLayoutInfo(nType, pInfo);
- BOOL bDidExist(FALSE);
-
- for(sal_uInt32 nCnt = 0L; !bDidExist && nCnt < mpAutoLayoutInfoList->Count(); nCnt++)
- {
- if(*mpAutoLayoutInfoList->GetObject(nCnt) == *pNew)
- {
- delete pNew;
- pNew = mpAutoLayoutInfoList->GetObject(nCnt);
- bDidExist = TRUE;
- }
- }
-
- if(!bDidExist)
- {
- mpAutoLayoutInfoList->Insert(pNew, LIST_APPEND);
- OUString sNewName = OUString(RTL_CONSTASCII_USTRINGPARAM("AL"));
- sNewName += OUString::valueOf(sal_Int32(mpAutoLayoutInfoList->Count() - 1));
- sNewName += OUString(RTL_CONSTASCII_USTRINGPARAM("T"));
- sNewName += OUString::valueOf(sal_Int32(nType));
- pNew->SetLayoutName(sNewName);
- }
-
- rName = pNew->GetLayoutName();
- bRetval = TRUE;
- }
- }
- }
-
- return bRetval;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLExport::ImpWriteAutoLayoutInfos()
-{
- if(mpAutoLayoutInfoList->Count())
- {
- for(sal_uInt32 nCnt = 0L; nCnt < mpAutoLayoutInfoList->Count(); nCnt++)
- {
- ImpXMLAutoLayoutInfo* pInfo = mpAutoLayoutInfoList->GetObject(nCnt);
- if(pInfo)
- {
- // prepare presentation-page layout attributes, style-name
- AddAttribute(XML_NAMESPACE_STYLE, XML_NAME, pInfo->GetLayoutName());
-
- // write draw-style attributes
- SvXMLElementExport aDSE(*this, XML_NAMESPACE_STYLE, XML_PRESENTATION_PAGE_LAYOUT, sal_True, sal_True);
-
- // write presentation placeholders
- switch(pInfo->GetLayoutType())
- {
- case 0 : // AUTOLAYOUT_TITLE
- {
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderSubtitle, pInfo->GetPresRectangle());
- break;
- }
- case 1 : // AUTOLAYOUT_ENUM
- {
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, pInfo->GetPresRectangle());
- break;
- }
- case 2 : // AUTOLAYOUT_CHART
- {
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, pInfo->GetPresRectangle());
- break;
- }
- case 3 : // AUTOLAYOUT_2TEXT
- {
- Rectangle aLeft(pInfo->GetPresRectangle());
- aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
- Rectangle aRight(aLeft);
- aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
-
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
- break;
- }
- case 4 : // AUTOLAYOUT_TEXTCHART
- {
- Rectangle aLeft(pInfo->GetPresRectangle());
- aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
- Rectangle aRight(aLeft);
- aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
-
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, aRight);
- break;
- }
- case 6 : // AUTOLAYOUT_TEXTCLIP
- {
- Rectangle aLeft(pInfo->GetPresRectangle());
- aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
- Rectangle aRight(aLeft);
- aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
-
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aRight);
- break;
- }
- case 7 : // AUTOLAYOUT_CHARTTEXT
- {
- Rectangle aLeft(pInfo->GetPresRectangle());
- aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
- Rectangle aRight(aLeft);
- aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
-
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, aLeft);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
- break;
- }
- case 8 : // AUTOLAYOUT_TAB
- {
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTable, pInfo->GetPresRectangle());
- break;
- }
- case 9 : // AUTOLAYOUT_CLIPTEXT
- {
- Rectangle aLeft(pInfo->GetPresRectangle());
- aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
- Rectangle aRight(aLeft);
- aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
-
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aLeft);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
- break;
- }
- case 10 : // AUTOLAYOUT_TEXTOBJ
- {
- Rectangle aLeft(pInfo->GetPresRectangle());
- aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
- Rectangle aRight(aLeft);
- aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
-
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aRight);
- break;
- }
- case 11 : // AUTOLAYOUT_OBJ
- {
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, pInfo->GetPresRectangle());
- break;
- }
- case 12 : // AUTOLAYOUT_TEXT2OBJ
- {
- Rectangle aLeft(pInfo->GetPresRectangle());
- aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
- Rectangle aRightTop(aLeft);
- aRightTop.Left() = long(aRightTop.Left() + aRightTop.GetWidth() * 1.05);
- aRightTop.setHeight(long(aRightTop.GetHeight() * 0.477));
- Rectangle aRightBottom(aRightTop);
- aRightBottom.Top() = long(aRightBottom.Top() + aRightBottom.GetHeight() * 1.095);
-
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aRightTop);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aRightBottom);
- break;
- }
- case 13 : // AUTOLAYOUT_OBJTEXT
- {
- Rectangle aLeft(pInfo->GetPresRectangle());
- aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
- Rectangle aRight(aLeft);
- aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
-
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aLeft);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
- break;
- }
- case 14 : // AUTOLAYOUT_OBJOVERTEXT
- {
- Rectangle aTop(pInfo->GetPresRectangle());
- aTop.setHeight(long(aTop.GetHeight() * 0.477));
- Rectangle aBottom(aTop);
- aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.095);
-
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTop);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aBottom);
- break;
- }
- case 15 : // AUTOLAYOUT_2OBJTEXT
- {
- Rectangle aLeftTop(pInfo->GetPresRectangle());
- aLeftTop.setWidth(long(aLeftTop.GetWidth() * 0.488));
- Rectangle aRight(aLeftTop);
- aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
- aLeftTop.setHeight(long(aLeftTop.GetHeight() * 0.477));
- Rectangle aLeftBottom(aLeftTop);
- aLeftBottom.Top() = long(aLeftBottom.Top() + aLeftBottom.GetHeight() * 1.095);
-
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aLeftTop);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aLeftBottom);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
- break;
- }
- case 16 : // AUTOLAYOUT_2OBJOVERTEXT
- {
- Rectangle aTopLeft(pInfo->GetPresRectangle());
- aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477));
- Rectangle aBottom(aTopLeft);
- aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.095);
- aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.488));
- Rectangle aTopRight(aTopLeft);
- aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 1.05);
-
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopLeft);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopRight);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aBottom);
- break;
- }
- case 17 : // AUTOLAYOUT_TEXTOVEROBJ
- {
- Rectangle aTop(pInfo->GetPresRectangle());
- aTop.setHeight(long(aTop.GetHeight() * 0.477));
- Rectangle aBottom(aTop);
- aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.095);
-
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aTop);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aBottom);
- break;
- }
- case 18 : // AUTOLAYOUT_4OBJ
- {
- Rectangle aTopLeft(pInfo->GetPresRectangle());
- aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477));
- aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.488));
- Rectangle aBottomLeft(aTopLeft);
- aBottomLeft.Top() = long(aBottomLeft.Top() + aBottomLeft.GetHeight() * 1.095);
- Rectangle aTopRight(aTopLeft);
- aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 1.05);
- Rectangle aBottomRight(aTopRight);
- aBottomRight.Top() = long(aBottomRight.Top() + aBottomRight.GetHeight() * 1.095);
-
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopLeft);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopRight);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aBottomLeft);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aBottomRight);
- break;
- }
- case 19 : // AUTOLAYOUT_ONLY_TITLE
- {
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- break;
- }
- case 21 : // AUTOLAYOUT_NOTES
- {
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderPage, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderNotes, pInfo->GetPresRectangle());
- break;
- }
- case 22 : // AUTOLAYOUT_HANDOUT1
- case 23 : // AUTOLAYOUT_HANDOUT2
- case 24 : // AUTOLAYOUT_HANDOUT3
- case 25 : // AUTOLAYOUT_HANDOUT4
- case 26 : // AUTOLAYOUT_HANDOUT6
- {
- sal_Int32 nColCnt, nRowCnt;
- sal_Int32 nGapX = pInfo->GetGapX();
- sal_Int32 nGapY = pInfo->GetGapY();
-
- switch(pInfo->GetLayoutType())
- {
- case 22 : nColCnt = 1; nRowCnt = 1; break;
- case 23 : nColCnt = 1; nRowCnt = 2; break;
- case 24 : nColCnt = 1; nRowCnt = 3; break;
- case 25 : nColCnt = 2; nRowCnt = 2; break;
- case 26 : nColCnt = 3; nRowCnt = 3; break;
- default: nColCnt = 0; nRowCnt = 0; break; // FIXME - What is correct values?
- }
-
- Size aPartSize(pInfo->GetTitleRectangle().GetSize());
- Point aPartPos(pInfo->GetTitleRectangle().TopLeft());
-
- if(aPartSize.Width() > aPartSize.Height())
- {
- sal_Int32 nZwi(nColCnt);
- nColCnt = nRowCnt;
- nRowCnt = nZwi;
- }
-
- aPartSize.Width() = (aPartSize.Width() - ((nColCnt - 1) * nGapX)) / nColCnt;
- aPartSize.Height() = (aPartSize.Height() - ((nRowCnt - 1) * nGapY)) / nRowCnt;
-
- Point aTmpPos(aPartPos);
-
- for(sal_Int32 a = 0L; a < nRowCnt; a++)
- {
- aTmpPos.X() = aPartPos.X();
-
- for(sal_Int32 b = 0L; b < nColCnt; b++)
- {
- Rectangle aTmpRect(aTmpPos, aPartSize);
-
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderHandout, aTmpRect);
- aTmpPos.X() += aPartSize.Width() + nGapX;
- }
-
- aTmpPos.Y() += aPartSize.Height() + nGapY;
- }
- break;
- }
- case 27 : // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART
- {
- Rectangle aTop(pInfo->GetPresRectangle());
- aTop.setHeight(long(aTop.GetHeight() * 0.488));
- Rectangle aBottom(aTop);
- aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.05);
-
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, aTop);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, aBottom);
- break;
- }
- case 28 : // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
- {
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, pInfo->GetPresRectangle());
- break;
- }
- case 29 : // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE
- {
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, pInfo->GetPresRectangle());
- break;
- }
- case 30 : // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE_CLIPART
- {
- Rectangle aLeft(pInfo->GetPresRectangle());
- aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
- Rectangle aRight(aLeft);
- aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
-
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aLeft);
- ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, aRight);
- break;
- }
- default:
- {
- DBG_ERROR("XMLEXP: unknown autolayout export");
- break;
- }
- }
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLExport::ImpWriteAutoLayoutPlaceholder(XmlPlaceholder ePl, const Rectangle& rRect)
-{
- OUString aStr;
- OUStringBuffer sStringBuffer;
-
- // prepare presentation-placeholder attributes, presentation:object
- switch(ePl)
- {
- case XmlPlaceholderTitle: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("title")); break;
- case XmlPlaceholderOutline: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("outline")); break;
- case XmlPlaceholderSubtitle: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("subtitle")); break;
- case XmlPlaceholderText: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("text")); break;
- case XmlPlaceholderGraphic: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("graphic")); break;
- case XmlPlaceholderObject: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("object")); break;
- case XmlPlaceholderChart: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("chart")); break;
- case XmlPlaceholderOrgchart: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("orgchart")); break;
- case XmlPlaceholderTable: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("table")); break;
- case XmlPlaceholderPage: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("page")); break;
- case XmlPlaceholderNotes: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("notes")); break;
- case XmlPlaceholderHandout: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("handout")); break;
- case XmlPlaceholderVerticalTitle: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_title")); break;
- case XmlPlaceholderVerticalOutline: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_outline")); break;
- }
-
- AddAttribute(XML_NAMESPACE_PRESENTATION, XML_OBJECT, aStr);
-
- // svg:x,y,width,height
- GetMM100UnitConverter().convertMeasure(sStringBuffer, rRect.Left());
- aStr = sStringBuffer.makeStringAndClear();
- AddAttribute(XML_NAMESPACE_SVG, XML_X, aStr);
-
- GetMM100UnitConverter().convertMeasure(sStringBuffer, rRect.Top());
- aStr = sStringBuffer.makeStringAndClear();
- AddAttribute(XML_NAMESPACE_SVG, XML_Y, aStr);
-
- GetMM100UnitConverter().convertMeasure(sStringBuffer, rRect.GetWidth());
- aStr = sStringBuffer.makeStringAndClear();
- AddAttribute(XML_NAMESPACE_SVG, XML_WIDTH, aStr);
-
- GetMM100UnitConverter().convertMeasure(sStringBuffer, rRect.GetHeight());
- aStr = sStringBuffer.makeStringAndClear();
- AddAttribute(XML_NAMESPACE_SVG, XML_HEIGHT, aStr);
-
- // write presentation-placeholder
- SvXMLElementExport aPPL(*this, XML_NAMESPACE_PRESENTATION, XML_PLACEHOLDER, sal_True, sal_True);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-ImpXMLEXPPageMasterInfo* SdXMLExport::ImpGetOrCreatePageMasterInfo( uno::Reference< drawing::XDrawPage > xMasterPage )
-{
- bool bDoesExist = false;
-
- ImpXMLEXPPageMasterInfo* pNewInfo = new ImpXMLEXPPageMasterInfo(*this, xMasterPage);
-
- // compare with prev page-master infos
- for(sal_uInt32 a = 0; !bDoesExist && a < mpPageMasterInfoList->Count(); a++)
- {
- if(mpPageMasterInfoList->GetObject(a)
- && *mpPageMasterInfoList->GetObject(a) == *pNewInfo)
- {
- delete pNewInfo;
- pNewInfo = mpPageMasterInfoList->GetObject(a);
- bDoesExist = true;
- }
- }
- // add entry when not found same page-master infos
- if(!bDoesExist)
- mpPageMasterInfoList->Insert(pNewInfo, LIST_APPEND);
-
- return pNewInfo;
-}
-
-void SdXMLExport::ImpPrepPageMasterInfos()
-{
- // create page master info for handout master page
- uno::Reference< drawing::XDrawPage > xMasterPage;
-
- uno::Reference< XHandoutMasterSupplier > xHMS( GetModel(), uno::UNO_QUERY );
- if( xHMS.is() )
- xMasterPage = xHMS->getHandoutMasterPage();
-
- if( xMasterPage.is() )
- mpHandoutPageMaster = ImpGetOrCreatePageMasterInfo(xMasterPage);
-
- // create page master infos for master pages
- if(mnDocMasterPageCount)
- {
- // look for needed page-masters, create these
- for(sal_Int32 nMPageId = 0L; nMPageId < mnDocMasterPageCount; nMPageId++)
- {
- mxDocMasterPages->getByIndex(nMPageId) >>= xMasterPage;
- ImpXMLEXPPageMasterInfo* pNewInfo = 0L;
-
- if(xMasterPage.is())
- pNewInfo = ImpGetOrCreatePageMasterInfo(xMasterPage);
-
- mpPageMasterUsageList->Insert(pNewInfo, LIST_APPEND);
-
- // look for page master of handout page
- if(IsImpress())
- {
- pNewInfo = NULL;
- uno::Reference< presentation::XPresentationPage > xPresPage(xMasterPage, uno::UNO_QUERY);
- if(xPresPage.is())
- {
- uno::Reference< drawing::XDrawPage > xNotesPage(xPresPage->getNotesPage());
- if(xNotesPage.is())
- {
- pNewInfo = ImpGetOrCreatePageMasterInfo(xNotesPage);
- }
- }
- mpNotesPageMasterUsageList->Insert( pNewInfo, LIST_APPEND );
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLExport::ImpWritePageMasterInfos()
-{
- // write created page-masters, create names for these
- for(sal_uInt32 nCnt = 0L; nCnt < mpPageMasterInfoList->Count(); nCnt++)
- {
- ImpXMLEXPPageMasterInfo* pInfo = mpPageMasterInfoList->GetObject(nCnt);
- if(pInfo)
- {
- // create name
- OUString sNewName = OUString(RTL_CONSTASCII_USTRINGPARAM("PM"));
-
- sNewName += OUString::valueOf((sal_Int32)nCnt);
- pInfo->SetName(sNewName);
-
- // prepare page-master attributes
- OUString sString;
- OUStringBuffer sStringBuffer;
-
- sString = sNewName;
- AddAttribute(XML_NAMESPACE_STYLE, XML_NAME, sString);
-
- // write page-master
- SvXMLElementExport aPME(*this, XML_NAMESPACE_STYLE, XML_PAGE_MASTER, sal_True, sal_True);
-
- // prepare style:properties inside page-master
- GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetBorderTop());
- sString = sStringBuffer.makeStringAndClear();
- AddAttribute(XML_NAMESPACE_FO, XML_MARGIN_TOP, sString);
-
- GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetBorderBottom());
- sString = sStringBuffer.makeStringAndClear();
- AddAttribute(XML_NAMESPACE_FO, XML_MARGIN_BOTTOM, sString);
-
- GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetBorderLeft());
- sString = sStringBuffer.makeStringAndClear();
- AddAttribute(XML_NAMESPACE_FO, XML_MARGIN_LEFT, sString);
-
- GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetBorderRight());
- sString = sStringBuffer.makeStringAndClear();
- AddAttribute(XML_NAMESPACE_FO, XML_MARGIN_RIGHT, sString);
-
- GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetWidth());
- sString = sStringBuffer.makeStringAndClear();
- AddAttribute(XML_NAMESPACE_FO, XML_PAGE_WIDTH, sString);
-
- GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetHeight());
- sString = sStringBuffer.makeStringAndClear();
- AddAttribute(XML_NAMESPACE_FO, XML_PAGE_HEIGHT, sString);
-
- if(pInfo->GetOrientation() == view::PaperOrientation_PORTRAIT)
- AddAttribute(XML_NAMESPACE_STYLE, XML_PRINT_ORIENTATION, XML_PORTRAIT);
- else
- AddAttribute(XML_NAMESPACE_STYLE, XML_PRINT_ORIENTATION, XML_LANDSCAPE);
-
- // write style:properties
- SvXMLElementExport aPMF(*this, XML_NAMESPACE_STYLE, XML_PROPERTIES, sal_True, sal_True);
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-ImpXMLEXPPageMasterInfo* SdXMLExport::ImpGetPageMasterInfoByName(const OUString& rName)
-{
- if(rName.getLength() && mpPageMasterInfoList->Count())
- {
- for(sal_uInt32 nCnt = 0L; nCnt < mpPageMasterInfoList->Count(); nCnt++)
- {
- ImpXMLEXPPageMasterInfo* pInfo = mpPageMasterInfoList->GetObject(nCnt);
- if(pInfo)
- {
- if(pInfo->GetMasterPageName().getLength() && rName.equals(pInfo->GetMasterPageName()))
- {
- return pInfo;
- }
- }
- }
- }
- return 0L;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLExport::ImpPrepDrawPageInfos()
-{
- // create draw:style-name entries for page export
- // containing presentation page attributes AND background attributes
- // fixed family for page-styles is "drawing-page" (XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)
- if(mnDocDrawPageCount)
- {
- // prepare name creation
- for(sal_Int32 nCnt = 0L; nCnt < mnDocDrawPageCount; nCnt++)
- {
- uno::Any aAny(mxDocDrawPages->getByIndex(nCnt));
- uno::Reference<drawing::XDrawPage> xDrawPage;
-
- if(aAny >>= xDrawPage)
- {
- // create name
- OUString sStyleName;
-
- // create style for this page and add to auto style pool
-
- uno::Reference< beans::XPropertySet > xPropSet1(xDrawPage, uno::UNO_QUERY);
- if(xPropSet1.is())
- {
- // since the background items are in a different propertyset
- // which itself is a property of the pages property set
- // we now merge these two propertysets if possible to simulate
- // a single propertyset with all draw page properties
- 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::Any aAny( xPropSet1->getPropertyValue( aBackground ) );
- aAny >>= xPropSet2;
- }
-
- uno::Reference< beans::XPropertySet > xPropSet;
- if( xPropSet2.is() )
- xPropSet = PropertySetMerger_CreateInstance( xPropSet1, xPropSet2 );
- else
- xPropSet = xPropSet1;
-
- const UniReference< SvXMLExportPropertyMapper > aMapperRef( GetPresPagePropsMapper() );
- std::vector< XMLPropertyState > xPropStates( aMapperRef->Filter( xPropSet ) );
-
- if( !xPropStates.empty() )
- {
- // there are filtered properties -> hard attributes
- // try to find this style in AutoStylePool
- sStyleName = GetAutoStylePool()->Find(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, sStyleName, xPropStates);
-
- if(!sStyleName.getLength())
- {
- // Style did not exist, add it to AutoStalePool
- sStyleName = GetAutoStylePool()->Add(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, sStyleName, xPropStates);
- }
-
- maDrawPagesStyleNames[nCnt] = sStyleName;
- }
- }
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLExport::ImpPrepMasterPageInfos()
-{
- // create draw:style-name entries for master page export
- // containing only background attributes
- // fixed family for page-styles is "drawing-page" (XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)
- if(mnDocMasterPageCount)
- {
- // prepare name creation
- for(sal_Int32 nCnt = 0L; nCnt < mnDocMasterPageCount; nCnt++)
- {
- uno::Any aAny(mxDocMasterPages->getByIndex(nCnt));
- uno::Reference<drawing::XDrawPage> xDrawPage;
-
- if(aAny >>= xDrawPage)
- {
- // create name
- OUString sStyleName;
-
- // create style for this page and add to auto style pool
- uno::Reference< beans::XPropertySet > xPropSet1(xDrawPage, uno::UNO_QUERY);
- if(xPropSet1.is())
- {
- // since the background items are in a different propertyset
- // which itself is a property of the pages property set
- // we now merge these two propertysets if possible to simulate
- // a single propertyset with all draw page properties
- 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::Any aAny( xPropSet1->getPropertyValue( aBackground ) );
- aAny >>= xPropSet2;
- }
-
- uno::Reference< beans::XPropertySet > xPropSet;
- if( xPropSet2.is() )
- xPropSet = PropertySetMerger_CreateInstance( xPropSet1, xPropSet2 );
- else
- xPropSet = xPropSet1;
-
- if( xPropSet.is() )
- {
- const UniReference< SvXMLExportPropertyMapper > aMapperRef( GetPresPagePropsMapper() );
- std::vector< XMLPropertyState > xPropStates( aMapperRef->Filter( xPropSet ) );
-
- if( !xPropStates.empty() )
- {
- // there are filtered properties -> hard attributes
- // try to find this style in AutoStylePool
- sStyleName = GetAutoStylePool()->Find(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, sStyleName, xPropStates);
-
- if(!sStyleName.getLength())
- {
- // Style did not exist, add it to AutoStalePool
- sStyleName = GetAutoStylePool()->Add(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, sStyleName, xPropStates);
- }
-
- maMasterPagesStyleNames[nCnt] = sStyleName;
- }
- }
- }
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-void SdXMLExport::ImpWritePresentationStyles()
-{
- if(IsImpress())
- {
- for(sal_Int32 nCnt = 0L; nCnt < mnDocMasterPageCount; nCnt++)
- {
- uno::Any aAny(mxDocMasterPages->getByIndex(nCnt));
- uno::Reference<container::XNamed> xNamed;
-
- if(aAny >>= xNamed)
- {
- // write presentation styles (ONLY if presentation)
- if(IsImpress() && mxDocStyleFamilies.is() && xNamed.is())
- {
- XMLStyleExport aStEx(*this, OUString(), GetAutoStylePool().get());
- const UniReference< SvXMLExportPropertyMapper > aMapperRef( GetPropertySetMapper() );
-
- OUString aPrefix = xNamed->getName();
- aPrefix += OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
- aStEx.exportStyleFamily(xNamed->getName(),
- OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME)),
- aMapperRef, FALSE,
- XML_STYLE_FAMILY_SD_PRESENTATION_ID, &aPrefix);
- }
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLExport::SetProgress(sal_Int32 nProg)
-{
- // set progress view
- if(GetStatusIndicator().is())
- GetStatusIndicator()->setValue(nProg);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// #82003#
-
-void SdXMLExport::_ExportMeta()
-{
- // call parent
- SvXMLExport::_ExportMeta();
-
- // prepare export statistic info (mainly for progress bar at reload)
- sal_Bool bContentUsed(FALSE);
- ::rtl::OUStringBuffer sBuffer;
-
- // export shape count info
- if(mnObjectCount)
- {
- GetMM100UnitConverter().convertNumber(sBuffer, mnObjectCount);
- AddAttribute(XML_NAMESPACE_META, XML_OBJECT_COUNT, sBuffer.makeStringAndClear());
- bContentUsed = TRUE;
- }
-
- // when there is data, export it
- if(bContentUsed)
- SvXMLElementExport aElemStat(*this, XML_NAMESPACE_META, XML_DOCUMENT_STATISTIC, sal_True, sal_True);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLExport::_ExportContent()
-{
- // page export
- for(sal_Int32 nPageInd(0); nPageInd < mnDocDrawPageCount; nPageInd++)
- {
- uno::Any aAny(mxDocDrawPages->getByIndex(nPageInd));
- uno::Reference<drawing::XDrawPage> xDrawPage;
-
- SetProgress(((nPageInd + 1) * 100) / mnDocDrawPageCount);
-
- if(aAny >>= xDrawPage)
- {
- // prepare page attributes, name of page
- uno::Reference < container::XNamed > xNamed(xDrawPage, uno::UNO_QUERY);
- if(xNamed.is())
- AddAttribute(XML_NAMESPACE_DRAW, XML_NAME, xNamed->getName());
-
- // draw:style-name (presentation page attributes AND background attributes)
- if( maDrawPagesStyleNames[nPageInd].getLength() )
- AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME, maDrawPagesStyleNames[nPageInd]);
-
- if( IsImpress() )
- AddAttribute(XML_NAMESPACE_DRAW, XML_ID, OUString::valueOf( sal_Int32( nPageInd + 1 ) ) );
-
- // draw:master-page-name
- uno::Reference < drawing::XMasterPageTarget > xMasterPageInt(xDrawPage, uno::UNO_QUERY);
- if(xMasterPageInt.is())
- {
- uno::Reference<drawing::XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage());
- if(xUsedMasterPage.is())
- {
- uno::Reference < container::XNamed > xMasterNamed(xUsedMasterPage, uno::UNO_QUERY);
- if(xMasterNamed.is())
- {
- AddAttribute(XML_NAMESPACE_DRAW, XML_MASTER_PAGE_NAME, xMasterNamed->getName());
- }
- }
- }
-
- // presentation:page-layout-name
- if( IsImpress() && maDrawPagesAutoLayoutNames[nPageInd+1].getLength())
- {
- AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PRESENTATION_PAGE_LAYOUT_NAME, maDrawPagesAutoLayoutNames[nPageInd+1]);
- }
-
- uno::Reference< beans::XPropertySet > xProps( xDrawPage, uno::UNO_QUERY );
- if( xProps.is() )
- {
- OUString aBookmarkURL;
- xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "BookmarkURL" ) ) ) >>= aBookmarkURL;
-
- if( aBookmarkURL.getLength() )
- {
- sal_Int32 nIndex = aBookmarkURL.lastIndexOf( (sal_Unicode)'#' );
- if( nIndex != -1 )
- {
- OUString aFileName( aBookmarkURL.copy( 0, nIndex ) );
- OUString aBookmarkName( aBookmarkURL.copy( nIndex+1 ) );
-
- aBookmarkURL = GetRelativeReference( aFileName );
- aBookmarkURL += OUString( (sal_Unicode)'#' );
- aBookmarkURL += aBookmarkName;
- }
-
- AddAttribute ( XML_NAMESPACE_XLINK, XML_HREF, aBookmarkURL);
- AddAttribute ( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
- AddAttribute ( XML_NAMESPACE_XLINK, XML_SHOW, XML_REPLACE );
- AddAttribute ( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONREQUEST );
- }
- }
-
- // write page
- SvXMLElementExport aDPG(*this, XML_NAMESPACE_DRAW, XML_PAGE, sal_True, sal_True);
-
- // write optional office:forms
- exportFormsElement( xDrawPage );
-
- // prepare animations exporter if impress
- if(IsImpress())
- {
- UniReference< XMLAnimationsExporter > xAnimExport = new XMLAnimationsExporter( GetShapeExport().get() );
- GetShapeExport()->setAnimationsExporter( xAnimExport );
- }
-
- // write graphic objects on this page (if any)
- uno::Reference< drawing::XShapes > xShapes(xDrawPage, uno::UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- GetShapeExport()->exportShapes( xShapes );
-
- // write animations and presentation notes (ONLY if presentation)
- if(IsImpress())
- {
- // animations
- UniReference< XMLAnimationsExporter > xAnimExport( GetShapeExport()->getAnimationsExporter() );
- if( xAnimExport.is() )
- xAnimExport->exportAnimations( *this );
-
- xAnimExport = NULL;
- GetShapeExport()->setAnimationsExporter( xAnimExport );
-
- // presentations
- uno::Reference< presentation::XPresentationPage > xPresPage(xDrawPage, uno::UNO_QUERY);
- if(xPresPage.is())
- {
- uno::Reference< drawing::XDrawPage > xNotesPage(xPresPage->getNotesPage());
- if(xNotesPage.is())
- {
- uno::Reference< drawing::XShapes > xShapes(xNotesPage, uno::UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- {
- // write presentation notes
- SvXMLElementExport aPSY(*this, XML_NAMESPACE_PRESENTATION, XML_NOTES, sal_True, sal_True);
-
- // write optional office:forms
- exportFormsElement( xNotesPage );
-
- // write shapes per se
- GetShapeExport()->exportShapes( xShapes );
- }
- }
- }
- }
- }
- }
-
- if( IsImpress() )
- exportPresentationSettings();
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLExport::exportPresentationSettings()
-{
- try
- {
- Reference< XPresentationSupplier > xPresSupplier( GetModel(), UNO_QUERY );
- if( !xPresSupplier.is() )
- return;
-
- Reference< XPropertySet > xPresProps( xPresSupplier->getPresentation(), UNO_QUERY );
- if( !xPresProps.is() )
- return;
-
- sal_Bool bHasAttr = sal_False;
-
- sal_Bool bTemp;
-
- // export range
- xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsShowAll" ) ) ) >>= bTemp;
- if( !bTemp )
- {
- OUString aFirstPage;
- xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "FirstPage" ) ) ) >>= aFirstPage;
- if( aFirstPage.getLength() )
- {
- AddAttribute(XML_NAMESPACE_PRESENTATION, XML_START_PAGE, aFirstPage );
- bHasAttr = sal_True;
- }
- else
- {
- OUString aCustomShow;
- xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "CustomShow" ) ) ) >>= aCustomShow;
- if( aCustomShow.getLength() )
- {
- AddAttribute(XML_NAMESPACE_PRESENTATION, XML_SHOW, aCustomShow );
- bHasAttr = sal_True;
- }
- }
- }
-
- xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsEndless" ) ) ) >>= bTemp;
- if( bTemp )
- {
- AddAttribute(XML_NAMESPACE_PRESENTATION, XML_ENDLESS, XML_TRUE );
- bHasAttr = sal_True;
-
- sal_Int32 nPause;
- xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Pause" ) ) ) >>= nPause;
-
- util::DateTime aTime( 0, (sal_uInt16)nPause, 0, 0, 0, 0, 0 );
-
- OUStringBuffer aOut;
- SvXMLUnitConverter::convertTime( aOut, aTime );
- AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PAUSE, aOut.makeStringAndClear() );
- }
-
- xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AllowAnimations" ) ) ) >>= bTemp;
- if( !bTemp )
- {
- AddAttribute(XML_NAMESPACE_PRESENTATION, XML_ANIMATIONS, XML_DISABLED );
- bHasAttr = sal_True;
- }
-
- xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAlwaysOnTop" ) ) ) >>= bTemp;
- if( bTemp )
- {
- AddAttribute(XML_NAMESPACE_PRESENTATION, XML_STAY_ON_TOP, XML_TRUE );
- bHasAttr = sal_True;
- }
-
- xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAutomatic" ) ) ) >>= bTemp;
- if( bTemp )
- {
- AddAttribute(XML_NAMESPACE_PRESENTATION, XML_FORCE_MANUAL, XML_TRUE );
- bHasAttr = sal_True;
- }
-
- xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFullScreen" ) ) ) >>= bTemp;
- if( !bTemp )
- {
- AddAttribute(XML_NAMESPACE_PRESENTATION, XML_FULL_SCREEN, XML_FALSE );
- bHasAttr = sal_True;
- }
-
- xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsMouseVisible" ) ) ) >>= bTemp;
- if( !bTemp )
- {
- AddAttribute(XML_NAMESPACE_PRESENTATION, XML_MOUSE_VISIBLE, XML_FALSE );
- bHasAttr = sal_True;
- }
-
- xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "StartWithNavigator" ) ) ) >>= bTemp;
- if( bTemp )
- {
- AddAttribute(XML_NAMESPACE_PRESENTATION, XML_START_WITH_NAVIGATOR, XML_TRUE );
- bHasAttr = sal_True;
- }
-
- xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "UsePen" ) ) ) >>= bTemp;
- if( bTemp )
- {
- AddAttribute(XML_NAMESPACE_PRESENTATION, XML_MOUSE_AS_PEN, XML_TRUE );
- bHasAttr = sal_True;
- }
-
- xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsTransitionOnClick" ) ) ) >>= bTemp;
- if( !bTemp )
- {
- AddAttribute(XML_NAMESPACE_PRESENTATION, XML_TRANSITION_ON_CLICK, XML_DISABLED );
- bHasAttr = sal_True;
- }
-
- xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsShowLogo" ) ) ) >>= bTemp;
- if( bTemp )
- {
- AddAttribute(XML_NAMESPACE_PRESENTATION, XML_SHOW_LOGO, XML_TRUE );
- bHasAttr = sal_True;
- }
-
- Reference< container::XNameContainer > xShows;
- Sequence< OUString > aShowNames;
- const OUString* pShowNames = NULL;
- sal_Int32 nShowCount = 0;
-
- Reference< XCustomPresentationSupplier > xSup( GetModel(), UNO_QUERY );
- if( xSup.is() )
- {
- xShows = xSup->getCustomPresentations();
- if( xShows.is() )
- {
- aShowNames = xShows->getElementNames();
- pShowNames = aShowNames.getArray();
- nShowCount = aShowNames.getLength();
- }
- }
-
- if( bHasAttr || nShowCount != 0 )
- {
- SvXMLElementExport aSettings(*this, XML_NAMESPACE_PRESENTATION, XML_SETTINGS, sal_True, sal_True);
-
- if( nShowCount == 0 )
- return;
-
- Reference< XIndexContainer > xShow;
- Reference< XNamed > xPageName;
-
- OUStringBuffer sTmp;
-
- for( sal_Int32 nIndex = 0; nIndex < nShowCount; nIndex++, pShowNames++ )
- {
- AddAttribute(XML_NAMESPACE_PRESENTATION, XML_NAME, *pShowNames );
-
- xShows->getByName( *pShowNames ) >>= xShow;
- DBG_ASSERT( xShow.is(), "invalid custom show!" );
- if( !xShow.is() )
- continue;
-
- const sal_Int32 nPageCount = xShow->getCount();
- for( sal_Int32 nPage = 0; nPage < nPageCount; nPage++ )
- {
- xShow->getByIndex( nPage ) >>= xPageName;
-
- if( !xPageName.is() )
- continue;
-
- if( sTmp.getLength() != 0 )
- sTmp.append( sal_Unicode( ',' ) );
- sTmp.append( xPageName->getName() );
-
- }
-
- if( sTmp.getLength() )
- AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PAGES, sTmp.makeStringAndClear() );
-
- SvXMLElementExport aShows(*this, XML_NAMESPACE_PRESENTATION, XML_SHOW, sal_True, sal_True);
- }
- }
- }
- catch( uno::Exception )
- {
- DBG_ERROR( "uno::Exception while exporting <presentation:settings>" );
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLExport::_ExportStyles(BOOL bUsed)
-{
- GetPropertySetMapper()->SetAutoStyles( sal_False );
-
- // export fill styles
- SvXMLExport::_ExportStyles( bUsed );
-
- // write draw:style-name for object graphic-styles
- GetShapeExport()->ExportGraphicDefaults();
-
- // write presentation styles
- ImpWritePresentationStyles();
-
- // prepare draw:auto-layout-name for page export
- ImpPrepAutoLayoutInfos();
-
- // write draw:auto-layout-name for page export
- ImpWriteAutoLayoutInfos();
-
- uno::Reference< beans::XPropertySet > xInfoSet( getExportInfo() );
- if( xInfoSet.is() )
- {
- uno::Reference< beans::XPropertySetInfo > xInfoSetInfo( xInfoSet->getPropertySetInfo() );
-
- uno::Any aAny;
-
- if( xInfoSetInfo->hasPropertyByName( msPageLayoutNames ) )
- {
- aAny <<= maDrawPagesAutoLayoutNames;
- xInfoSet->setPropertyValue( msPageLayoutNames, aAny );
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLExport::_ExportAutoStyles()
-{
- uno::Reference< beans::XPropertySet > xInfoSet( getExportInfo() );
- if( xInfoSet.is() )
- {
- uno::Reference< beans::XPropertySetInfo > xInfoSetInfo( xInfoSet->getPropertySetInfo() );
-
- if( xInfoSetInfo->hasPropertyByName( msPageLayoutNames ) )
- {
- xInfoSet->getPropertyValue( msPageLayoutNames ) >>= maDrawPagesAutoLayoutNames;
- }
- }
-
- GetPropertySetMapper()->SetAutoStyles( sal_True );
-
- if( getExportFlags() & EXPORT_STYLES )
- {
- // #80012# PageMaster export moved from _ExportStyles
- // prepare page-master infos
- ImpPrepPageMasterInfos();
-
- // write page-master infos
- ImpWritePageMasterInfos();
-
- // prepare draw:style-name for master page export
- ImpPrepMasterPageInfos();
- }
-
- if( getExportFlags() & EXPORT_CONTENT )
- {
- // prepare draw:style-name for page export
- ImpPrepDrawPageInfos();
- }
-
- // export draw-page styles
- GetAutoStylePool()->exportXML(
- XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID
- , GetDocHandler(),
- GetMM100UnitConverter(),
- GetNamespaceMap()
- );
-
- 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++)
- {
- uno::Any aAny(mxDocMasterPages->getByIndex(nMPageId));
- uno::Reference< drawing::XDrawPage > xMasterPage;
-
- if((aAny >>= xMasterPage) && xMasterPage.is() )
- {
- // collect layer information
- GetFormExport()->examineForms( xMasterPage );
-
- // get MasterPage Name
- OUString aMasterPageNamePrefix;
- uno::Reference < container::XNamed > xNamed(xMasterPage, uno::UNO_QUERY);
- if(xNamed.is())
- {
- aMasterPageNamePrefix = xNamed->getName();
- }
- if(aMasterPageNamePrefix.getLength())
- {
- aMasterPageNamePrefix += OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
- }
- GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix );
-
- uno::Reference< drawing::XShapes > xShapes(xMasterPage, uno::UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- GetShapeExport()->collectShapesAutoStyles( xShapes );
-
- if(IsImpress())
- {
- uno::Reference< presentation::XPresentationPage > xPresPage(xMasterPage, uno::UNO_QUERY);
- if(xPresPage.is())
- {
- uno::Reference< drawing::XDrawPage > xNotesPage(xPresPage->getNotesPage());
- if(xNotesPage.is())
- {
- // collect layer information
- GetFormExport()->examineForms( xNotesPage );
-
- uno::Reference< drawing::XShapes > xShapes(xNotesPage, uno::UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- GetShapeExport()->collectShapesAutoStyles( xShapes );
- }
- }
- }
- }
- }
- }
-
- if( getExportFlags() & EXPORT_CONTENT )
- {
- // prepare animations exporter if impress
- if(IsImpress())
- {
- UniReference< XMLAnimationsExporter > xAnimExport = new XMLAnimationsExporter( GetShapeExport().get() );
- GetShapeExport()->setAnimationsExporter( xAnimExport );
- }
-
- // create auto style infos for objects on pages
- for(sal_Int32 nPageInd(0); nPageInd < mnDocDrawPageCount; nPageInd++)
- {
- uno::Any aAny(mxDocDrawPages->getByIndex(nPageInd));
- uno::Reference<drawing::XDrawPage> xDrawPage;
-
- if((aAny >>= xDrawPage) && xDrawPage.is() )
- {
- // collect layer information
- GetFormExport()->examineForms( xDrawPage );
-
- // get MasterPage Name
- OUString aMasterPageNamePrefix;
- uno::Reference < drawing::XMasterPageTarget > xMasterPageInt(xDrawPage, uno::UNO_QUERY);
- if(xMasterPageInt.is())
- {
- uno::Reference<drawing::XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage());
- if(xUsedMasterPage.is())
- {
- uno::Reference < container::XNamed > xMasterNamed(xUsedMasterPage, uno::UNO_QUERY);
- if(xMasterNamed.is())
- {
- aMasterPageNamePrefix = xMasterNamed->getName();
- }
- }
- }
- if(aMasterPageNamePrefix.getLength())
- {
- aMasterPageNamePrefix += OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
- }
-
- GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix );
-
- // prepare object infos
- uno::Reference< drawing::XShapes > xShapes(xDrawPage, uno::UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- GetShapeExport()->collectShapesAutoStyles( xShapes );
-
- // prepare presentation notes page object infos (ONLY if presentation)
- if(IsImpress())
- {
- uno::Reference< presentation::XPresentationPage > xPresPage(xDrawPage, uno::UNO_QUERY);
- if(xPresPage.is())
- {
- uno::Reference< drawing::XDrawPage > xNotesPage(xPresPage->getNotesPage());
- if(xNotesPage.is())
- {
- // collect layer information
- GetFormExport()->examineForms( xNotesPage );
-
- uno::Reference< drawing::XShapes > xShapes(xNotesPage, uno::UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- GetShapeExport()->collectShapesAutoStyles( xShapes );
- }
- }
- }
- }
- }
- if(IsImpress())
- {
- UniReference< XMLAnimationsExporter > xAnimExport;
- GetShapeExport()->setAnimationsExporter( xAnimExport );
- }
- }
-
- exportAutoDataStyles();
-
- GetShapeExport()->exportAutoStyles();
-
- sal_uInt16 nContentAutostyles = EXPORT_CONTENT | EXPORT_AUTOSTYLES;
- if ( ( getExportFlags() & nContentAutostyles ) == nContentAutostyles )
- GetFormExport()->exportAutoStyles( );
-
- // ...for text
- GetTextParagraphExport()->exportTextAutoStyles();
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-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, XML_PRESENTATION_PAGE_LAYOUT_NAME, maDrawPagesAutoLayoutNames[0]);
- }
-
- ImpXMLEXPPageMasterInfo* pInfo = mpHandoutPageMaster;
- if(pInfo)
- {
- OUString sString = pInfo->GetName();
- AddAttribute(XML_NAMESPACE_STYLE, XML_PAGE_MASTER_NAME, sString);
- }
-
- // write masterpage
- SvXMLElementExport aMPG(*this, XML_NAMESPACE_STYLE, XML_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++)
- {
- uno::Any aAny(mxDocMasterPages->getByIndex(nMPageId));
- uno::Reference< drawing::XDrawPage > xMasterPage;
-
- if((aAny >>= xMasterPage) && xMasterPage.is())
- {
- // prepare masterpage attributes
- OUString sMasterPageName;
- uno::Reference < container::XNamed > xNamed(xMasterPage, uno::UNO_QUERY);
- if(xNamed.is())
- {
- sMasterPageName = xNamed->getName();
- AddAttribute(XML_NAMESPACE_STYLE, XML_NAME, sMasterPageName);
- }
-
- ImpXMLEXPPageMasterInfo* pInfo = mpPageMasterUsageList->GetObject(nMPageId);
- if(pInfo)
- {
- OUString sString = pInfo->GetName();
- AddAttribute(XML_NAMESPACE_STYLE, XML_PAGE_MASTER_NAME, sString);
- }
-
- // draw:style-name (background attributes)
- if( maMasterPagesStyleNames[nMPageId].getLength() )
- AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME, maMasterPagesStyleNames[nMPageId]);
-
- // write masterpage
- SvXMLElementExport aMPG(*this, XML_NAMESPACE_STYLE, XML_MASTER_PAGE, sal_True, sal_True);
-
- // write optional office:forms
- exportFormsElement( xMasterPage );
-
- // write graphic objects on this master page (if any)
- uno::Reference< drawing::XShapes > xShapes(xMasterPage, uno::UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- GetShapeExport()->exportShapes( xShapes );
-
- // write presentation notes (ONLY if presentation)
- if(IsImpress())
- {
- uno::Reference< presentation::XPresentationPage > xPresPage(xMasterPage, uno::UNO_QUERY);
- if(xPresPage.is())
- {
- uno::Reference< drawing::XDrawPage > xNotesPage(xPresPage->getNotesPage());
- if(xNotesPage.is())
- {
- uno::Reference< drawing::XShapes > xShapes(xNotesPage, uno::UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- {
- ImpXMLEXPPageMasterInfo* pInfo = mpNotesPageMasterUsageList->GetObject(nMPageId);
- if(pInfo)
- {
- OUString sString = pInfo->GetName();
- AddAttribute(XML_NAMESPACE_STYLE, XML_PAGE_MASTER_NAME, sString);
- }
-
- // write presentation notes
- SvXMLElementExport aPSY(*this, XML_NAMESPACE_PRESENTATION, XML_NOTES, sal_True, sal_True);
-
- // write optional office:forms
- exportFormsElement( xNotesPage );
-
- // write shapes per se
- GetShapeExport()->exportShapes( xShapes );
- }
- }
- }
- }
- }
- }
-}
-
-void SdXMLExport::exportFormsElement( uno::Reference< drawing::XDrawPage > xDrawPage )
-{
- if( xDrawPage.is() )
- {
- uno::Reference< form::XFormsSupplier > xFormsSupplier( xDrawPage, uno::UNO_QUERY );
- if( xFormsSupplier.is() )
- {
- uno::Reference< container::XNameContainer > xForms( xFormsSupplier->getForms() );
- if( xForms.is() && xForms->hasElements() )
- {
- // write masterpage
- ::binfilter::xmloff::OOfficeFormsExport aForms(*this);
- GetFormExport()->exportForms( xDrawPage );
- }
- }
-
- sal_Bool bRet = GetFormExport()->seekPage( xDrawPage );
- DBG_ASSERT( bRet, "OFormLayerXMLExport::seekPage failed!" );
- }
-}
-
-void SdXMLExport::GetViewSettings(uno::Sequence<beans::PropertyValue>& rProps)
-{
- rProps.realloc(4);
- beans::PropertyValue* pProps = rProps.getArray();
- if(pProps)
- {
-// SvXMLElementExport aViewSettingsElem(*this, XML_NAMESPACE_DRAW, XML_VIEW_SETTINGS, sal_True, sal_True);
-
- uno::Reference< beans::XPropertySet > xPropSet( GetModel(), uno::UNO_QUERY );
- if( !xPropSet.is() )
- return;
-
- awt::Rectangle aVisArea;
- xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ) ) >>= aVisArea;
-/*
- sal_Int16 nMapUnit;
- xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "MapUnit" ) ) ) >>= nMapUnit;
-*/
-
- sal_uInt16 i = 0;
- pProps[i].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaTop"));
- pProps[i++].Value <<= aVisArea.Y;
- pProps[i].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaLeft"));
- pProps[i++].Value <<= aVisArea.X;
- pProps[i].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaWidth"));
- pProps[i++].Value <<= aVisArea.Width;
- pProps[i].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaHeight"));
- pProps[i++].Value <<= aVisArea.Height;
- }
-}
-
-void SdXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>& rProps)
-{
- uno::Reference< lang::XMultiServiceFactory > xFac( GetModel(), uno::UNO_QUERY );
- if( xFac.is() )
- {
- uno::Reference< beans::XPropertySet > xProps( xFac->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.Settings" ) ) ), uno::UNO_QUERY );
- if( xProps.is() )
- SvXMLUnitConverter::convertPropertySet( rProps, xProps );
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLExport::addDataStyle(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat )
-{
- sal_Int32 nFormat = nNumberFormat;
- if( nNumberFormat > 1 )
- nFormat -= 2;
-
- const sal_uInt32 nIndex = 1 << nFormat;
-
- if( bTimeFormat )
- {
- mnUsedTimeStyles |= nIndex;
- }
- else
- {
- mnUsedDateStyles |= nIndex;
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLExport::exportDataStyles()
-{
- // there are no data styles to export in draw/impress yet
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLExport::exportAutoDataStyles()
-{
- for( sal_Int16 nDateFormat = 0; nDateFormat < SdXMLNumberStylesExporter::getDateStyleCount(); nDateFormat++ )
- {
- const sal_uInt32 nIndex = 1 << nDateFormat;
- if( (mnUsedDateStyles & nIndex) != 0 )
- SdXMLNumberStylesExporter::exportDateStyle( *this, nDateFormat );
- }
-
- for( sal_Int16 nTimeFormat = 0; nTimeFormat < SdXMLNumberStylesExporter::getTimeStyleCount(); nTimeFormat++ )
- {
- const sal_uInt32 nIndex = 1 << nTimeFormat;
- if( (mnUsedTimeStyles & nIndex) != 0 )
- SdXMLNumberStylesExporter::exportTimeStyle( *this, nTimeFormat );
- }
-
- if(HasFormExport())
- GetFormExport()->exportAutoControlNumberStyles();
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-OUString SdXMLExport::getDataStyleName(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat ) const
-{
- if( bTimeFormat )
- {
- return SdXMLNumberStylesExporter::getTimeStyleName( nNumberFormat );
- }
- else
- {
- return SdXMLNumberStylesExporter::getDateStyleName( nNumberFormat );
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-uno::Sequence< OUString > SAL_CALL SdImpressXMLExport_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Impress.XMLExporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdImpressXMLExport_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Impress" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLExport( sal_False, EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
- return (cppu::OWeakObject*)new SdXMLExport( rSMgr, sal_False, EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED);
-}
-
-uno::Sequence< OUString > SAL_CALL SdDrawXMLExport_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.XMLExporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdDrawXMLExport_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Draw" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLExport( sal_True, EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
- return (cppu::OWeakObject*)new SdXMLExport( rSMgr, sal_True, EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-uno::Sequence< OUString > SAL_CALL DrawingLayerXMLExport_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.DrawingLayer.XMLExporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL DrawingLayerXMLExport_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "DrawingLayerXMLExport" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL DrawingLayerXMLExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLExport( sal_True, EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
- return (cppu::OWeakObject*)new SdXMLExport( rSMgr, sal_True, EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-uno::Sequence< OUString > SAL_CALL ImpressXMLClipboardExport_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Impress.XMLClipboardExporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL ImpressXMLClipboardExport_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "ImpressXMLClipboardExport" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL ImpressXMLClipboardExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLExport( sal_False, EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
- return (cppu::OWeakObject*)new SdXMLExport( rSMgr, sal_False, EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
-}
-//////////////////////////////////////////////////////////////////////////////
-
-uno::Sequence< OUString > SAL_CALL SdImpressXMLExport_Style_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Impress.XMLStylesExporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdImpressXMLExport_Style_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Impress.Styles" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLExport_Style_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLExport( sal_False, EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES );
- return (cppu::OWeakObject*)new SdXMLExport( rSMgr, sal_False, EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES );
-}
-
-uno::Sequence< OUString > SAL_CALL SdDrawXMLExport_Style_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.XMLStylesExporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdDrawXMLExport_Style_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Draw.Styles" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLExport_Style_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLExport( sal_True, EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES );
- return (cppu::OWeakObject*)new SdXMLExport( rSMgr, sal_True, EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-uno::Sequence< OUString > SAL_CALL SdImpressXMLExport_Meta_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Impress.XMLMetaExporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdImpressXMLExport_Meta_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Impress.Meta" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLExport_Meta_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLExport( sal_False, EXPORT_META );
- return (cppu::OWeakObject*)new SdXMLExport( rSMgr, sal_False, EXPORT_META );
-}
-
-uno::Sequence< OUString > SAL_CALL SdDrawXMLExport_Meta_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.XMLMetaExporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdDrawXMLExport_Meta_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Draw.Meta" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLExport_Meta_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLExport( sal_True, EXPORT_META );
- return (cppu::OWeakObject*)new SdXMLExport( rSMgr, sal_True, EXPORT_META );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-uno::Sequence< OUString > SAL_CALL SdImpressXMLExport_Settings_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Impress.XMLSettingsExporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdImpressXMLExport_Settings_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Impress.Settings" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLExport_Settings_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLExport( sal_False, EXPORT_SETTINGS );
- return (cppu::OWeakObject*)new SdXMLExport( rSMgr, sal_False, EXPORT_SETTINGS );
-}
-
-uno::Sequence< OUString > SAL_CALL SdDrawXMLExport_Settings_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.XMLSettingsExporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdDrawXMLExport_Settings_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Draw.Settings" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLExport_Settings_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLExport( sal_True, EXPORT_SETTINGS );
- return (cppu::OWeakObject*)new SdXMLExport( rSMgr, sal_True, EXPORT_SETTINGS );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-uno::Sequence< OUString > SAL_CALL SdImpressXMLExport_Content_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Impress.XMLContentExporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdImpressXMLExport_Content_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Impress.Content" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLExport_Content_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLExport( sal_False, EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS );
- return (cppu::OWeakObject*)new SdXMLExport( rSMgr, sal_False, EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS );
-}
-
-uno::Sequence< OUString > SAL_CALL SdDrawXMLExport_Content_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.XMLContentExporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdDrawXMLExport_Content_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Draw.Content" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLExport_Content_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLExport( sal_True, EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS );
- return (cppu::OWeakObject*)new SdXMLExport( rSMgr, sal_True, EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS );
-}
-
-// XServiceInfo
-OUString SAL_CALL SdXMLExport::getImplementationName() throw( uno::RuntimeException )
-{
- if( IsDraw())
- {
- // Draw
-
- switch( getExportFlags())
- {
- case EXPORT_ALL:
- return SdDrawXMLExport_getImplementationName();
- case (EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES):
- return SdDrawXMLExport_Style_getImplementationName();
- case (EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS):
- return SdDrawXMLExport_Content_getImplementationName();
- case EXPORT_META:
- return SdDrawXMLExport_Meta_getImplementationName();
- case EXPORT_SETTINGS:
- return SdDrawXMLExport_Settings_getImplementationName();
- default:
- return OUString::createFromAscii( "SdXMLExport.Draw" );
- }
- }
- else
- {
- // Impress
-
- switch( getExportFlags())
- {
- case EXPORT_ALL:
- return SdImpressXMLExport_getImplementationName();
- case (EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES):
- return SdImpressXMLExport_Style_getImplementationName();
- case (EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS):
- return SdImpressXMLExport_Content_getImplementationName();
- case EXPORT_META:
- return SdImpressXMLExport_Meta_getImplementationName();
- case EXPORT_SETTINGS:
- return SdImpressXMLExport_Settings_getImplementationName();
- default:
- return OUString::createFromAscii( "SdXMLExport.Impress" );
- }
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_sdxmlimp.cxx b/binfilter/bf_xmloff/source/draw/xmloff_sdxmlimp.cxx
deleted file mode 100644
index 2e81551e942a..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_sdxmlimp.cxx
+++ /dev/null
@@ -1,1001 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include "xmlscripti.hxx"
-
-
-
-#include "ximpbody.hxx"
-
-#include "xmlmetai.hxx"
-
-#include "ximpstyl.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "xmluconv.hxx"
-
-#include "DocumentSettingsContext.hxx"
-
-#include <com/sun/star/form/XFormsSupplier.hpp>
-
-#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
-
-
-#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-
-#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
-
-#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
-
-
-
-#include "xmlerror.hxx"
-
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-//////////////////////////////////////////////////////////////////////////////
-
-static __FAR_DATA SvXMLTokenMapEntry aDocElemTokenMap[] =
-{
- { XML_NAMESPACE_OFFICE, XML_STYLES, XML_TOK_DOC_STYLES },
- { XML_NAMESPACE_OFFICE, XML_AUTOMATIC_STYLES, XML_TOK_DOC_AUTOSTYLES },
- { XML_NAMESPACE_OFFICE, XML_MASTER_STYLES, XML_TOK_DOC_MASTERSTYLES },
- { XML_NAMESPACE_OFFICE, XML_META, XML_TOK_DOC_META },
- { XML_NAMESPACE_OFFICE, XML_SCRIPT, XML_TOK_DOC_SCRIPT },
- { XML_NAMESPACE_OFFICE, XML_BODY, XML_TOK_DOC_BODY },
- { XML_NAMESPACE_OFFICE, XML_SETTINGS, XML_TOK_DOC_SETTINGS },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aBodyElemTokenMap[] =
-{
- { XML_NAMESPACE_DRAW, XML_PAGE, XML_TOK_BODY_PAGE },
- { XML_NAMESPACE_PRESENTATION, XML_SETTINGS, XML_TOK_BODY_SETTINGS },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aStylesElemTokenMap[] =
-{
- { XML_NAMESPACE_STYLE, XML_PAGE_MASTER, XML_TOK_STYLES_PAGE_MASTER },
- { XML_NAMESPACE_STYLE, XML_PRESENTATION_PAGE_LAYOUT, XML_TOK_STYLES_PRESENTATION_PAGE_LAYOUT },
- { XML_NAMESPACE_STYLE, XML_STYLE, XML_TOK_STYLES_STYLE },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aMasterPageElemTokenMap[] =
-{
- { XML_NAMESPACE_STYLE, XML_STYLE, XML_TOK_MASTERPAGE_STYLE },
- { XML_NAMESPACE_PRESENTATION, XML_NOTES, XML_TOK_MASTERPAGE_NOTES },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aMasterPageAttrTokenMap[] =
-{
- { XML_NAMESPACE_STYLE, XML_NAME, XML_TOK_MASTERPAGE_NAME },
- { XML_NAMESPACE_STYLE, XML_PAGE_MASTER_NAME, XML_TOK_MASTERPAGE_PAGE_MASTER_NAME },
- { XML_NAMESPACE_DRAW, XML_STYLE_NAME, XML_TOK_MASTERPAGE_STYLE_NAME },
- { XML_NAMESPACE_PRESENTATION, XML_PRESENTATION_PAGE_LAYOUT_NAME, XML_TOK_MASTERPAGE_PAGE_LAYOUT_NAME },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aPageMasterAttrTokenMap[] =
-{
- { XML_NAMESPACE_STYLE, XML_NAME, XML_TOK_PAGEMASTER_NAME },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aPageMasterStyleAttrTokenMap[] =
-{
- { XML_NAMESPACE_FO, XML_MARGIN_TOP, XML_TOK_PAGEMASTERSTYLE_MARGIN_TOP },
- { XML_NAMESPACE_FO, XML_MARGIN_BOTTOM, XML_TOK_PAGEMASTERSTYLE_MARGIN_BOTTOM },
- { XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TOK_PAGEMASTERSTYLE_MARGIN_LEFT },
- { XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TOK_PAGEMASTERSTYLE_MARGIN_RIGHT },
- { XML_NAMESPACE_FO, XML_PAGE_WIDTH, XML_TOK_PAGEMASTERSTYLE_PAGE_WIDTH },
- { XML_NAMESPACE_FO, XML_PAGE_HEIGHT, XML_TOK_PAGEMASTERSTYLE_PAGE_HEIGHT },
- { XML_NAMESPACE_STYLE, XML_PRINT_ORIENTATION, XML_TOK_PAGEMASTERSTYLE_PAGE_ORIENTATION },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aDrawPageAttrTokenMap[] =
-{
- { XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_DRAWPAGE_NAME },
- { XML_NAMESPACE_DRAW, XML_STYLE_NAME, XML_TOK_DRAWPAGE_STYLE_NAME },
- { XML_NAMESPACE_DRAW, XML_MASTER_PAGE_NAME, XML_TOK_DRAWPAGE_MASTER_PAGE_NAME },
- { XML_NAMESPACE_PRESENTATION, XML_PRESENTATION_PAGE_LAYOUT_NAME, XML_TOK_DRAWPAGE_PAGE_LAYOUT_NAME },
- { XML_NAMESPACE_DRAW, XML_ID, XML_TOK_DRAWPAGE_ID },
- { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_DRAWPAGE_HREF },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aDrawPageElemTokenMap[] =
-{
- { XML_NAMESPACE_PRESENTATION, XML_NOTES, XML_TOK_DRAWPAGE_NOTES },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aPresentationPlaceholderAttrTokenMap[] =
-{
- { XML_NAMESPACE_PRESENTATION, XML_OBJECT, XML_TOK_PRESENTATIONPLACEHOLDER_OBJECTNAME },
- { XML_NAMESPACE_SVG, XML_X, XML_TOK_PRESENTATIONPLACEHOLDER_X },
- { XML_NAMESPACE_SVG, XML_Y, XML_TOK_PRESENTATIONPLACEHOLDER_Y },
- { XML_NAMESPACE_SVG, XML_WIDTH, XML_TOK_PRESENTATIONPLACEHOLDER_WIDTH },
- { XML_NAMESPACE_SVG, XML_HEIGHT, XML_TOK_PRESENTATIONPLACEHOLDER_HEIGHT },
- XML_TOKEN_MAP_END
-};
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-class SdXMLDocContext_Impl : public SvXMLImportContext
-{
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
-
-public:
- SdXMLDocContext_Impl(
- SdXMLImport& rImport,
- USHORT nPrfx,
- const OUString& rLName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList);
- virtual ~SdXMLDocContext_Impl();
-
- virtual SvXMLImportContext *CreateChildContext(USHORT nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList);
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLDocContext_Impl::SdXMLDocContext_Impl(
- SdXMLImport& rImport,
- USHORT nPrfx,
- const OUString& rLName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-: SvXMLImportContext(rImport, nPrfx, rLName)
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLDocContext_Impl::~SdXMLDocContext_Impl()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext(
- USHORT nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImportContext* pContext = 0L;
-
- const SvXMLTokenMap& rTokenMap = GetSdImport().GetDocElemTokenMap();
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- case XML_TOK_DOC_SETTINGS:
- {
- if( GetImport().getImportFlags() & IMPORT_SETTINGS )
- {
- pContext = new XMLDocumentSettingsContext(GetImport(), nPrefix, rLocalName, xAttrList );
- }
- break;
- }
- case XML_TOK_DOC_STYLES:
- {
- if( GetImport().getImportFlags() & IMPORT_STYLES )
- {
- // office:styles inside office:document
- pContext = GetSdImport().CreateStylesContext(rLocalName, xAttrList);
- }
- break;
- }
- case XML_TOK_DOC_AUTOSTYLES:
- {
- if( GetImport().getImportFlags() & IMPORT_AUTOSTYLES )
- {
- // office:automatic-styles inside office:document
- pContext = GetSdImport().CreateAutoStylesContext(rLocalName, xAttrList);
- }
- break;
- }
- case XML_TOK_DOC_MASTERSTYLES:
- {
- if( GetImport().getImportFlags() & IMPORT_MASTERSTYLES )
- {
- // office:master-styles inside office:document
- pContext = GetSdImport().CreateMasterStylesContext(rLocalName, xAttrList);
- }
- break;
- }
- case XML_TOK_DOC_META:
- {
- if( GetImport().getImportFlags() & IMPORT_META )
- {
- // office:meta inside office:document
- pContext = GetSdImport().CreateMetaContext(rLocalName, xAttrList);
- }
- break;
- }
- case XML_TOK_DOC_SCRIPT:
- {
- if( GetImport().getImportFlags() & IMPORT_SCRIPTS )
- {
- // office:script inside office:document
- pContext = GetSdImport().CreateScriptContext( rLocalName );
- }
- break;
- }
- case XML_TOK_DOC_BODY:
- {
- if( GetImport().getImportFlags() & IMPORT_CONTENT )
- {
- // office:body inside office:document
- pContext = GetSdImport().CreateBodyContext(rLocalName, xAttrList);
- }
- break;
- }
- }
-
- // call parent when no own context was created
- if(!pContext)
- pContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName, xAttrList);
-
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-uno::Sequence< OUString > SAL_CALL SdImpressXMLImport_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Impress.XMLImporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdImpressXMLImport_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLImport.Impress" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLImport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLImport( sal_False );
- return (cppu::OWeakObject*)new SdXMLImport( rSMgr, sal_False );
-}
-
-uno::Sequence< OUString > SAL_CALL SdDrawXMLImport_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.XMLImporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdDrawXMLImport_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLImport.Draw" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLImport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLImport( sal_True );
- return (cppu::OWeakObject*)new SdXMLImport( rSMgr, sal_True );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-uno::Sequence< OUString > SAL_CALL SdImpressXMLImport_Style_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Impress.XMLStylesImporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdImpressXMLImport_Style_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLImport.Impress.Styles" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLImport_Style_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLImport( sal_False, IMPORT_STYLES|IMPORT_AUTOSTYLES|IMPORT_MASTERSTYLES );
- return (cppu::OWeakObject*)new SdXMLImport( rSMgr, sal_False, IMPORT_STYLES|IMPORT_AUTOSTYLES|IMPORT_MASTERSTYLES );
-}
-
-uno::Sequence< OUString > SAL_CALL SdDrawXMLImport_Style_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.XMLStylesImporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdDrawXMLImport_Style_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLImport.Draw.Styles" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLImport_Style_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLImport( sal_True, IMPORT_STYLES|IMPORT_AUTOSTYLES|IMPORT_MASTERSTYLES );
- return (cppu::OWeakObject*)new SdXMLImport( rSMgr, sal_True, IMPORT_STYLES|IMPORT_AUTOSTYLES|IMPORT_MASTERSTYLES );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-uno::Sequence< OUString > SAL_CALL SdImpressXMLImport_Content_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Impress.XMLContentImporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdImpressXMLImport_Content_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLImport.Impress.Content" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLImport_Content_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLImport( sal_False, IMPORT_AUTOSTYLES|IMPORT_CONTENT|IMPORT_SCRIPTS|IMPORT_FONTDECLS );
- return (cppu::OWeakObject*)new SdXMLImport( rSMgr, sal_False, IMPORT_AUTOSTYLES|IMPORT_CONTENT|IMPORT_SCRIPTS|IMPORT_FONTDECLS );
-}
-
-uno::Sequence< OUString > SAL_CALL SdDrawXMLImport_Content_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.XMLContentImporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdDrawXMLImport_Content_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLImport.Draw.Content" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLImport_Content_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLImport( sal_True, IMPORT_AUTOSTYLES|IMPORT_CONTENT|IMPORT_SCRIPTS|IMPORT_FONTDECLS );
- return (cppu::OWeakObject*)new SdXMLImport( rSMgr, sal_True, IMPORT_AUTOSTYLES|IMPORT_CONTENT|IMPORT_SCRIPTS|IMPORT_FONTDECLS );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-uno::Sequence< OUString > SAL_CALL SdImpressXMLImport_Meta_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Impress.XMLMetaImporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdImpressXMLImport_Meta_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLImport.Impress.Meta" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLImport_Meta_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLImport( sal_False, IMPORT_META );
- return (cppu::OWeakObject*)new SdXMLImport( rSMgr, sal_False, IMPORT_META );
-}
-
-uno::Sequence< OUString > SAL_CALL SdDrawXMLImport_Meta_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.XMLMetaImporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdDrawXMLImport_Meta_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLImport.Draw.Meta" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLImport_Meta_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLImport( sal_True, IMPORT_META );
- return (cppu::OWeakObject*)new SdXMLImport( rSMgr, sal_True, IMPORT_META );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-uno::Sequence< OUString > SAL_CALL SdImpressXMLImport_Settings_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Impress.XMLSettingsImporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdImpressXMLImport_Settings_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLImport.Impress.Settings" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLImport_Settings_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLImport( sal_False, IMPORT_SETTINGS );
- return (cppu::OWeakObject*)new SdXMLImport( rSMgr, sal_False, IMPORT_SETTINGS );
-}
-
-uno::Sequence< OUString > SAL_CALL SdDrawXMLImport_Settings_getSupportedServiceNames() throw()
-{
- const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.XMLSettingsImporter" ) );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-OUString SAL_CALL SdDrawXMLImport_Settings_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLImport.Draw.Settings" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLImport_Settings_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SdXMLImport( sal_True, IMPORT_SETTINGS );
- return (cppu::OWeakObject*)new SdXMLImport( rSMgr, sal_True, IMPORT_SETTINGS );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-// #110680#
-SdXMLImport::SdXMLImport(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- sal_Bool bIsDraw, sal_uInt16 nImportFlags )
-: SvXMLImport( xServiceFactory, nImportFlags ),
- mpMasterStylesContext(0L),
- mpDocElemTokenMap(0L),
- mpBodyElemTokenMap(0L),
- mpStylesElemTokenMap(0L),
- mpMasterPageElemTokenMap(0L),
- mpMasterPageAttrTokenMap(0L),
- mpPageMasterAttrTokenMap(0L),
- mpPageMasterStyleAttrTokenMap(0L),
- mpDrawPageAttrTokenMap(0L),
- mpDrawPageElemTokenMap(0L),
- mpPresentationPlaceholderAttrTokenMap(0L),
- mnStyleFamilyMask(0),
- mnNewPageCount(0L),
- mnNewMasterPageCount(0L),
- mbLoadDoc(sal_True),
- mbIsDraw(bIsDraw),
- mbPreview(sal_False),
- msPageLayouts( RTL_CONSTASCII_USTRINGPARAM( "PageLayouts" ) ),
- msPreview( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) )
-{
- // add namespaces
- GetNamespaceMap().Add(
- GetXMLToken(XML_NP_PRESENTATION),
- GetXMLToken(XML_N_PRESENTATION),
- XML_NAMESPACE_PRESENTATION);
-}
-
-// XImporter
-void SAL_CALL SdXMLImport::setTargetDocument( const uno::Reference< lang::XComponent >& xDoc )
- throw(lang::IllegalArgumentException, uno::RuntimeException)
-{
- SvXMLImport::setTargetDocument( xDoc );
-
- uno::Reference< lang::XServiceInfo > xDocServices( GetModel(), uno::UNO_QUERY );
- if( !xDocServices.is() )
- throw lang::IllegalArgumentException();
-
- mbIsDraw = !xDocServices->supportsService( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) );
-
- // prepare access to styles
- uno::Reference< style::XStyleFamiliesSupplier > xFamSup( GetModel(), uno::UNO_QUERY );
- if(xFamSup.is())
- mxDocStyleFamilies = xFamSup->getStyleFamilies();
-
- // prepare access to master pages
- uno::Reference < drawing::XMasterPagesSupplier > xMasterPagesSupplier(GetModel(), uno::UNO_QUERY);
- if(xMasterPagesSupplier.is())
- mxDocMasterPages = mxDocMasterPages.query( xMasterPagesSupplier->getMasterPages() );
-
- // prepare access to draw pages
- uno::Reference <drawing::XDrawPagesSupplier> xDrawPagesSupplier(GetModel(), uno::UNO_QUERY);
- if(!xDrawPagesSupplier.is())
- throw lang::IllegalArgumentException();
-
- mxDocDrawPages = mxDocDrawPages.query( xDrawPagesSupplier->getDrawPages() );
- if(!mxDocDrawPages.is())
- throw lang::IllegalArgumentException();
-
- if( mxDocDrawPages.is() && mxDocDrawPages->getCount() > 0 )
- {
- uno::Reference< form::XFormsSupplier > xFormsSupp;
- mxDocDrawPages->getByIndex(0) >>= xFormsSupp;
- mbIsFormsSupported = xFormsSupp.is();
- }
-
- // #88546# enable progress bar increments, SdXMLImport is only used for
- // draw/impress import
- GetShapeImport()->enableHandleProgressBar();
-}
-
-// XInitialization
-void SAL_CALL SdXMLImport::initialize( const uno::Sequence< uno::Any >& aArguments )
- throw( uno::Exception, uno::RuntimeException)
-{
- SvXMLImport::initialize( aArguments );
-
- uno::Reference< beans::XPropertySet > xInfoSet( getImportInfo() );
- if( xInfoSet.is() )
- {
- uno::Reference< beans::XPropertySetInfo > xInfoSetInfo( xInfoSet->getPropertySetInfo() );
-
- if( xInfoSetInfo->hasPropertyByName( msPageLayouts ) )
- xInfoSet->getPropertyValue( msPageLayouts ) >>= mxPageLayouts;
-
- if( xInfoSetInfo->hasPropertyByName( msPreview ) )
- xInfoSet->getPropertyValue( msPreview ) >>= mbPreview;
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLImport::~SdXMLImport() throw ()
-{
-// #80365# removed ending of progress bar here, this was an old implementation
-// and maybe removed on demand
-// // stop progress view
-// if(mxStatusIndicator.is())
-// {
-// mxStatusIndicator->end();
-// mxStatusIndicator->reset();
-// }
-
- // Styles or AutoStyles context?
- if(mpMasterStylesContext)
- mpMasterStylesContext->ReleaseRef();
-
- // delete all token maps
- if(mpDocElemTokenMap)
- delete mpDocElemTokenMap;
- if(mpBodyElemTokenMap)
- delete mpBodyElemTokenMap;
- if(mpStylesElemTokenMap)
- delete mpStylesElemTokenMap;
- if(mpMasterPageElemTokenMap)
- delete mpMasterPageElemTokenMap;
- if(mpMasterPageAttrTokenMap)
- delete mpMasterPageAttrTokenMap;
- if(mpPageMasterAttrTokenMap)
- delete mpPageMasterAttrTokenMap;
- if(mpPageMasterStyleAttrTokenMap)
- delete mpPageMasterStyleAttrTokenMap;
- if(mpDrawPageAttrTokenMap)
- delete mpDrawPageAttrTokenMap;
- if(mpDrawPageElemTokenMap)
- delete mpDrawPageElemTokenMap;
- if(mpPresentationPlaceholderAttrTokenMap)
- delete mpPresentationPlaceholderAttrTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-const SvXMLTokenMap& SdXMLImport::GetDocElemTokenMap()
-{
- if(!mpDocElemTokenMap)
- mpDocElemTokenMap = new SvXMLTokenMap(aDocElemTokenMap);
- return *mpDocElemTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-const SvXMLTokenMap& SdXMLImport::GetBodyElemTokenMap()
-{
- if(!mpBodyElemTokenMap)
- mpBodyElemTokenMap = new SvXMLTokenMap(aBodyElemTokenMap);
- return *mpBodyElemTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-const SvXMLTokenMap& SdXMLImport::GetStylesElemTokenMap()
-{
- if(!mpStylesElemTokenMap)
- mpStylesElemTokenMap = new SvXMLTokenMap(aStylesElemTokenMap);
- return *mpStylesElemTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-const SvXMLTokenMap& SdXMLImport::GetMasterPageElemTokenMap()
-{
- if(!mpMasterPageElemTokenMap)
- mpMasterPageElemTokenMap = new SvXMLTokenMap(aMasterPageElemTokenMap);
- return *mpMasterPageElemTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-const SvXMLTokenMap& SdXMLImport::GetMasterPageAttrTokenMap()
-{
- if(!mpMasterPageAttrTokenMap)
- mpMasterPageAttrTokenMap = new SvXMLTokenMap(aMasterPageAttrTokenMap);
- return *mpMasterPageAttrTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-const SvXMLTokenMap& SdXMLImport::GetPageMasterAttrTokenMap()
-{
- if(!mpPageMasterAttrTokenMap)
- mpPageMasterAttrTokenMap = new SvXMLTokenMap(aPageMasterAttrTokenMap);
- return *mpPageMasterAttrTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-const SvXMLTokenMap& SdXMLImport::GetPageMasterStyleAttrTokenMap()
-{
- if(!mpPageMasterStyleAttrTokenMap)
- mpPageMasterStyleAttrTokenMap = new SvXMLTokenMap(aPageMasterStyleAttrTokenMap);
- return *mpPageMasterStyleAttrTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-const SvXMLTokenMap& SdXMLImport::GetDrawPageAttrTokenMap()
-{
- if(!mpDrawPageAttrTokenMap)
- mpDrawPageAttrTokenMap = new SvXMLTokenMap(aDrawPageAttrTokenMap);
- return *mpDrawPageAttrTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-const SvXMLTokenMap& SdXMLImport::GetDrawPageElemTokenMap()
-{
- if(!mpDrawPageElemTokenMap)
- mpDrawPageElemTokenMap = new SvXMLTokenMap(aDrawPageElemTokenMap);
- return *mpDrawPageElemTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-const SvXMLTokenMap& SdXMLImport::GetPresentationPlaceholderAttrTokenMap()
-{
- if(!mpPresentationPlaceholderAttrTokenMap)
- mpPresentationPlaceholderAttrTokenMap = new SvXMLTokenMap(aPresentationPlaceholderAttrTokenMap);
- return *mpPresentationPlaceholderAttrTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext *SdXMLImport::CreateContext(USHORT nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImportContext* pContext = 0;
-
- if(XML_NAMESPACE_OFFICE == nPrefix &&
- ( IsXMLToken( rLocalName, XML_DOCUMENT ) ||
- IsXMLToken( rLocalName, XML_DOCUMENT_META ) ||
- IsXMLToken( rLocalName, XML_DOCUMENT_STYLES ) ||
- IsXMLToken( rLocalName, XML_DOCUMENT_CONTENT ) ||
- IsXMLToken( rLocalName, XML_DOCUMENT_SETTINGS ) ))
- {
- pContext = new SdXMLDocContext_Impl(*this, nPrefix, rLocalName, xAttrList);
- }
- else
- {
- pContext = SvXMLImport::CreateContext(nPrefix, rLocalName, xAttrList);
- }
-
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext *SdXMLImport::CreateMetaContext(const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImportContext* pContext = 0L;
-
- if(!IsStylesOnlyMode())
- {
- uno::Reference<document::XDocumentInfoSupplier> xSupp(GetModel(), uno::UNO_QUERY);
-
- if(xSupp.is())
- {
- pContext = new SfxXMLMetaContext(*this,
- XML_NAMESPACE_OFFICE, rLocalName, GetModel());
- }
- }
-
- if(!pContext)
- {
- pContext = new SvXMLImportContext(*this, XML_NAMESPACE_OFFICE, rLocalName);
- }
-
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext *SdXMLImport::CreateBodyContext(const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImportContext *pContext = 0;
- pContext = new SdXMLBodyContext(*this, XML_NAMESPACE_OFFICE, rLocalName);
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLStylesContext *SdXMLImport::CreateStylesContext(const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- if(GetShapeImport()->GetStylesContext())
- return GetShapeImport()->GetStylesContext();
-
- GetShapeImport()->SetStylesContext(new SdXMLStylesContext(
- *this, XML_NAMESPACE_OFFICE, rLocalName, xAttrList, FALSE));
-
- return GetShapeImport()->GetStylesContext();
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLStylesContext *SdXMLImport::CreateAutoStylesContext(const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- if(GetShapeImport()->GetAutoStylesContext())
- return GetShapeImport()->GetAutoStylesContext();
-
- GetShapeImport()->SetAutoStylesContext(new SdXMLStylesContext(
- *this, XML_NAMESPACE_OFFICE, rLocalName, xAttrList, TRUE));
-
- return GetShapeImport()->GetAutoStylesContext();
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext* SdXMLImport::CreateMasterStylesContext(const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- if(mpMasterStylesContext)
- return mpMasterStylesContext;
-
- mpMasterStylesContext = new SdXMLMasterStylesContext(
- *this, XML_NAMESPACE_OFFICE, rLocalName);
- mpMasterStylesContext->AddRef();
-
- return mpMasterStylesContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext *SdXMLImport::CreateScriptContext(
- const OUString& rLocalName )
-{
- SvXMLImportContext *pContext = 0;
-
- pContext = new XMLScriptContext( *this,
- XML_NAMESPACE_OFFICE, rLocalName,
- GetModel() );
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLImport::setDrawPageId( sal_Int32 nId, uno::Reference< drawing::XDrawPage > xPage )
-{
- maDrawPageIds[nId] = xPage;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLImport::SetViewSettings(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aViewProps)
-{
- uno::Reference< beans::XPropertySet > xPropSet( GetModel(), uno::UNO_QUERY );
- if( !xPropSet.is() )
- return;
-
- awt::Rectangle aVisArea( 0,0, 28000, 21000 );
- sal_Int32 nCount = aViewProps.getLength();
-
- const beans::PropertyValue* pValues = aViewProps.getConstArray();
-
- while( nCount-- )
- {
- const OUString& rName = pValues->Name;
- const uno::Any rValue = pValues->Value;
-
- if( rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("VisibleAreaTop") ) )
- {
- rValue >>= aVisArea.Y;
- }
- else if( rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("VisibleAreaLeft") ) )
- {
- rValue >>= aVisArea.X;
- }
- else if( rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("VisibleAreaWidth") ) )
- {
- rValue >>= aVisArea.Width;
- }
- else if( rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("VisibleAreaHeight") ) )
- {
- rValue >>= aVisArea.Height;
- }
-
- pValues++;
- }
-
- try
- {
- xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ), uno::makeAny( aVisArea ) );
- }
- catch( ::com::sun::star::uno::Exception e )
- {
- uno::Sequence<OUString> aSeq(0);
- SetError( XMLERROR_FLAG_WARNING | XMLERROR_API, aSeq, e.Message, NULL );
- }
-}
-
-void SdXMLImport::SetConfigurationSettings(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aConfigProps)
-{
- uno::Reference< lang::XMultiServiceFactory > xFac( GetModel(), uno::UNO_QUERY );
- if( !xFac.is() )
- return;
-
- uno::Reference< beans::XPropertySet > xProps( xFac->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.Settings" ) ) ), uno::UNO_QUERY );
- if( !xProps.is() )
- return;
-
- uno::Reference< beans::XPropertySetInfo > xInfo( xProps->getPropertySetInfo() );
- if( !xInfo.is() )
- return;
-
- sal_Int32 nCount = aConfigProps.getLength();
- const beans::PropertyValue* pValues = aConfigProps.getConstArray();
-
- while( nCount-- )
- {
- try
- {
- if( xInfo->hasPropertyByName( pValues->Name ) )
- {
- xProps->setPropertyValue( pValues->Name, pValues->Value );
- }
- }
- catch( uno::Exception& )
- {
- OSL_TRACE( "#SdXMLImport::SetConfigurationSettings: Exception!" );
- }
-
- pValues++;
- }
-}
-
-// #80365# overload this method to read and use the hint value from the
-// written meta information. If no info is found, guess 10 draw objects
-void SdXMLImport::SetStatisticAttributes(const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImport::SetStatisticAttributes(xAttrList);
-
- sal_uInt32 nCount(10);
- sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
-
- for(sal_Int16 a(0); a < nAttrCount; a++)
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex(a);
- ::rtl::OUString aLocalName;
- sal_uInt16 nPrefix = GetNamespaceMap().GetKeyByAttrName(sAttrName, &aLocalName);
-
- if(nPrefix == XML_NAMESPACE_META)
- {
- ::rtl::OUString sValue = xAttrList->getValueByIndex(a);
- sal_Int32 nValue(0);
-
- if(IsXMLToken(aLocalName, XML_OBJECT_COUNT))
- {
- SvXMLUnitConverter::convertNumber(nValue, sValue);
- nCount = nValue;
- }
- }
- }
-
- if(nCount)
- {
- GetProgressBarHelper()->SetReference(nCount);
- GetProgressBarHelper()->SetValue(0);
- }
-}
-
-
-// XServiceInfo
-OUString SAL_CALL SdXMLImport::getImplementationName() throw( uno::RuntimeException )
-{
- if( IsDraw())
- {
- // Draw
-
- switch( getImportFlags())
- {
- case IMPORT_ALL:
- return SdDrawXMLImport_getImplementationName();
- case (IMPORT_STYLES|IMPORT_AUTOSTYLES|IMPORT_MASTERSTYLES):
- return SdDrawXMLImport_Style_getImplementationName();
- case (IMPORT_AUTOSTYLES|IMPORT_CONTENT|IMPORT_SCRIPTS|IMPORT_FONTDECLS):
- return SdDrawXMLImport_Content_getImplementationName();
- case IMPORT_META:
- return SdDrawXMLImport_Meta_getImplementationName();
- case IMPORT_SETTINGS:
- return SdDrawXMLImport_Settings_getImplementationName();
- default:
- return OUString::createFromAscii( "SdXMLImport.Draw" );
- }
- }
- else
- {
- // Impress
-
- switch( getImportFlags())
- {
- case IMPORT_ALL:
- return SdImpressXMLImport_getImplementationName();
- case (IMPORT_STYLES|IMPORT_AUTOSTYLES|IMPORT_MASTERSTYLES):
- return SdImpressXMLImport_Style_getImplementationName();
- case (IMPORT_AUTOSTYLES|IMPORT_CONTENT|IMPORT_SCRIPTS|IMPORT_FONTDECLS):
- return SdImpressXMLImport_Content_getImplementationName();
- case IMPORT_META:
- return SdImpressXMLImport_Meta_getImplementationName();
- case IMPORT_SETTINGS:
- return SdImpressXMLImport_Settings_getImplementationName();
- default:
- return OUString::createFromAscii( "SdXMLImport.Impress" );
- }
- }
-}
-
-// eof
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_shapeexport.cxx b/binfilter/bf_xmloff/source/draw/xmloff_shapeexport.cxx
deleted file mode 100644
index 6e54d912b2fb..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_shapeexport.cxx
+++ /dev/null
@@ -1,1056 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
-
-#include <com/sun/star/container/XChild.hpp>
-
-#include <com/sun/star/text/XText.hpp>
-
-
-#include <com/sun/star/drawing/XControlShape.hpp>
-
-#include <com/sun/star/style/XStyle.hpp>
-
-#include <com/sun/star/drawing/XGluePointsSupplier.hpp>
-#include <com/sun/star/container/XIdentifierAccess.hpp>
-
-#include <com/sun/star/drawing/GluePoint2.hpp>
-#include "xmluconv.hxx"
-
-
-
-#include "sdpropls.hxx"
-
-#include "sdxmlexp_impl.hxx"
-
-
-#include <tools/debug.hxx>
-
-#include "contextid.hxx"
-
-
-
-#include <sot/clsids.hxx>
-
-#include <tools/globname.hxx>
-
-#include <com/sun/star/beans/XPropertyState.hpp>
-
-#include "xmlnmspe.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-//////////////////////////////////////////////////////////////////////////////
-
-XMLShapeExport::XMLShapeExport(SvXMLExport& rExp,
- SvXMLExportPropertyMapper *pExtMapper )
-: rExport( rExp ),
- // #88546# init to FALSE
- mbHandleProgressBar( sal_False ),
- mnNextUniqueShapeId(1),
- mbExportLayer( sal_False ),
- msZIndex( RTL_CONSTASCII_USTRINGPARAM("ZOrder") ),
- msEmptyPres( RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ),
- msModel( RTL_CONSTASCII_USTRINGPARAM("Model") ),
- msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ),
- msEndShape( RTL_CONSTASCII_USTRINGPARAM("EndShape") ),
- msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") ),
- msEventType( RTL_CONSTASCII_USTRINGPARAM("EventType") ),
- msPresentation( RTL_CONSTASCII_USTRINGPARAM("Presentation") ),
- msMacroName( RTL_CONSTASCII_USTRINGPARAM("MacroName") ),
- msLibrary( RTL_CONSTASCII_USTRINGPARAM("Library") ),
- msClickAction( RTL_CONSTASCII_USTRINGPARAM("ClickAction") ),
- msBookmark( RTL_CONSTASCII_USTRINGPARAM("Bookmark") ),
- msEffect( RTL_CONSTASCII_USTRINGPARAM("Effect") ),
- msPlayFull( RTL_CONSTASCII_USTRINGPARAM("PlayFull") ),
- msVerb( RTL_CONSTASCII_USTRINGPARAM("Verb") ),
- msSoundURL( RTL_CONSTASCII_USTRINGPARAM("SoundURL") ),
- msSpeed( RTL_CONSTASCII_USTRINGPARAM("Speed") ),
- msStarBasic( RTL_CONSTASCII_USTRINGPARAM("StarBasic") )
-{
- // construct PropertyHandlerFactory
- xSdPropHdlFactory = new XMLSdPropHdlFactory( rExport.GetModel() );
-
- // construct PropertySetMapper
- xPropertySetMapper = CreateShapePropMapper( rExport );
- if( pExtMapper )
- {
- UniReference < SvXMLExportPropertyMapper > xExtMapper( pExtMapper );
- xPropertySetMapper->ChainExportMapper( xExtMapper );
- }
-
-/*
- // chain text attributes
- xPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(rExp));
-*/
-
- rExport.GetAutoStylePool()->AddFamily(
- XML_STYLE_FAMILY_SD_GRAPHICS_ID,
- OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)),
- GetPropertySetMapper(),
- OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX)));
- rExport.GetAutoStylePool()->AddFamily(
- XML_STYLE_FAMILY_SD_PRESENTATION_ID,
- OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME)),
- GetPropertySetMapper(),
- OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX)));
-
- maCurrentInfo = maShapeInfos.end();
-}
-
-///////////////////////////////////////////////////////////////////////
-
-XMLShapeExport::~XMLShapeExport()
-{
-}
-
-///////////////////////////////////////////////////////////////////////
-
-// This method collects all automatic styles for the given XShape
-void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShape >& xShape)
-{
- if( maCurrentShapesIter == maShapesInfos.end() )
- {
- DBG_ERROR( "XMLShapeExport::collectShapeAutoStyles(): no call to seekShapes()!" );
- return;
- }
-
- sal_Int32 nZIndex = 0;
- uno::Reference< beans::XPropertySet > xSet( xShape, uno::UNO_QUERY );
- if( xSet.is() )
- xSet->getPropertyValue(msZIndex) >>= nZIndex;
-
- ImplXMLShapeExportInfoVector& aShapeInfoVector = (*maCurrentShapesIter).second;
-
- if( aShapeInfoVector.size() <= nZIndex )
- {
- DBG_ERROR( "XMLShapeExport::collectShapeAutoStyles(): no shape info allocated for a given shape" );
- return;
- }
-
- ImplXMLShapeExportInfo& aShapeInfo = aShapeInfoVector[nZIndex];
-
- // -----------------------------
- // first compute the shapes type
- // -----------------------------
- ImpCalcShapeType(xShape, aShapeInfo.meShapeType);
-
- const bool bObjSupportsText =
-// aShapeInfo.meShapeType != XmlShapeTypeDrawControlShape &&
- aShapeInfo.meShapeType != XmlShapeTypeDrawChartShape &&
- aShapeInfo.meShapeType != XmlShapeTypePresChartShape &&
- aShapeInfo.meShapeType != XmlShapeTypeDrawOLE2Shape &&
- aShapeInfo.meShapeType != XmlShapeTypePresOLE2Shape &&
- aShapeInfo.meShapeType != XmlShapeTypeDraw3DSceneObject &&
- aShapeInfo.meShapeType != XmlShapeTypeDraw3DCubeObject &&
- aShapeInfo.meShapeType != XmlShapeTypeDraw3DSphereObject &&
- aShapeInfo.meShapeType != XmlShapeTypeDraw3DLatheObject &&
- aShapeInfo.meShapeType != XmlShapeTypeDraw3DExtrudeObject &&
- aShapeInfo.meShapeType != XmlShapeTypeDrawPageShape &&
- aShapeInfo.meShapeType != XmlShapeTypePresPageShape &&
- aShapeInfo.meShapeType != XmlShapeTypeDrawGroupShape;
-
- const bool bObjSupportsStyle =
- aShapeInfo.meShapeType != XmlShapeTypeDrawGroupShape;
-
- sal_Bool bIsEmptyPresObj = sal_False;
-
- uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
-
- // ----------------
- // prep text styles
- // ----------------
- if( xPropSet.is() && bObjSupportsText )
- {
- uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY);
- if(xText.is() && xText->getString().getLength())
- {
- uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
-
- if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(msEmptyPres) )
- {
- uno::Any aAny = xPropSet->getPropertyValue(msEmptyPres);
- aAny >>= bIsEmptyPresObj;
- }
-
- if(!bIsEmptyPresObj)
- {
- GetExport().GetTextParagraphExport()->collectTextAutoStyles( xText );
- }
- }
- }
-
- // ------------------------------
- // compute the shape parent style
- // ------------------------------
- if( xPropSet.is() )
- {
- uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
-
- OUString aParentName;
- uno::Reference< style::XStyle > xStyle;
-
- if( bObjSupportsStyle )
- {
- if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName( OUString(RTL_CONSTASCII_USTRINGPARAM("Style"))) )
- xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Style"))) >>= xStyle;
-
- if(xStyle.is())
- {
- // get family ID
- uno::Reference< beans::XPropertySet > xStylePropSet(xStyle, uno::UNO_QUERY);
- DBG_ASSERT( xStylePropSet.is(), "style without a XPropertySet?" );
- if(xStylePropSet.is())
- {
- OUString aFamilyName;
- xStylePropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Family"))) >>= aFamilyName;
- if(aFamilyName.getLength() && aFamilyName.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("presentation"))))
- aShapeInfo.mnFamily = XML_STYLE_FAMILY_SD_PRESENTATION_ID;
- }
-
- // get parent-style name
- if(XML_STYLE_FAMILY_SD_PRESENTATION_ID == aShapeInfo.mnFamily)
- {
- aParentName = msPresentationStylePrefix;
- }
-
- aParentName += xStyle->getName();
- }
- }
-
- // filter propset
- std::vector< XMLPropertyState > xPropStates;
-
- sal_Int32 nCount = 0;
- if( (!bIsEmptyPresObj || (aShapeInfo.meShapeType != XmlShapeTypePresPageShape)) )
- {
- xPropStates = GetPropertySetMapper()->Filter( xPropSet );
-
- if (XmlShapeTypeDrawControlShape == aShapeInfo.meShapeType)
- {
- // for control shapes, we additionally need the number format style (if any)
- uno::Reference< drawing::XControlShape > xControl(xShape, uno::UNO_QUERY);
- DBG_ASSERT(xControl.is(), "XMLShapeExport::collectShapeAutoStyles: ShapeType control, but no XControlShape!");
- if (xControl.is())
- {
- uno::Reference< beans::XPropertySet > xControlModel(xControl->getControl(), uno::UNO_QUERY);
- DBG_ASSERT(xControlModel.is(), "XMLShapeExport::collectShapeAutoStyles: no control model on the control shape!");
-
- ::rtl::OUString sNumberStyle = rExport.GetFormExport()->getControlNumberStyle(xControlModel);
- if (0 != sNumberStyle.getLength())
- {
- sal_Int32 nIndex = GetPropertySetMapper()->getPropertySetMapper()->FindEntryIndex(CTF_SD_CONTROL_SHAPE_DATA_STYLE);
- // TODO : this retrieval of the index should be moved into the ctor, holding the index
- // as member, thus saving time.
- DBG_ASSERT(-1 != nIndex, "XMLShapeExport::collectShapeAutoStyles: could not obtain the index for our context id!");
-
- XMLPropertyState aNewState(nIndex, uno::makeAny(sNumberStyle));
- xPropStates.push_back(aNewState);
- }
- }
- }
-
- std::vector< XMLPropertyState >::iterator aIter = xPropStates.begin();
- std::vector< XMLPropertyState >::iterator aEnd = xPropStates.end();
- while( aIter != aEnd )
- {
- if( aIter->mnIndex != -1 )
- nCount++;
- aIter++;
- }
- }
-
- if(nCount == 0)
- {
- // no hard attributes, use parent style name for export
- aShapeInfo.msStyleName = aParentName;
- }
- else
- {
- // there are filtered properties -> hard attributes
- // try to find this style in AutoStylePool
- aShapeInfo.msStyleName = rExport.GetAutoStylePool()->Find(aShapeInfo.mnFamily, aParentName, xPropStates);
-
- if(!aShapeInfo.msStyleName.getLength())
- {
- // Style did not exist, add it to AutoStalePool
- aShapeInfo.msStyleName = rExport.GetAutoStylePool()->Add(aShapeInfo.mnFamily, aParentName, xPropStates);
- }
- }
-
- // optionaly generate auto style for text attributes
- if( (!bIsEmptyPresObj || (aShapeInfo.meShapeType != XmlShapeTypePresPageShape)) && bObjSupportsText )
- {
- xPropStates = GetExport().GetTextParagraphExport()->GetParagraphPropertyMapper()->Filter( xPropSet );
-
- // ----------------------------------------------------------------------
- // yet more additionally, we need to care for the ParaAdjust property
- if ( XmlShapeTypeDrawControlShape == aShapeInfo.meShapeType )
- {
- // this is because:
- // * if controls shapes have a ParaAdjust property, then this is the Align property of the control model
- // * control models are allowed to have an Align of "void"
- // * the Default for control model's Align is TextAlign_LEFT
- // * defaults for style properties are not written, but we need to write the "left",
- // because we need to distiguish this "left" from the case where not align attribute
- // is present which means "void"
- // 102407 - 2002-11-01 - fs@openoffice.org
- static const ::rtl::OUString s_sParaAdjustPropertyName( RTL_CONSTASCII_USTRINGPARAM( "ParaAdjust" ) );
- uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
- if ( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName( s_sParaAdjustPropertyName ) )
- {
- uno::Reference< beans::XPropertyState > xPropState( xPropSet, uno::UNO_QUERY );
- if ( xPropState.is() && beans::PropertyState_DEFAULT_VALUE == xPropState->getPropertyState( s_sParaAdjustPropertyName ) )
- {
- sal_Int32 nIndex = GetExport().GetTextParagraphExport()->GetParagraphPropertyMapper()->getPropertySetMapper()->FindEntryIndex( CTF_SD_SHAPE_PARA_ADJUST );
- // TODO : this retrieval of the index should be moved into the ctor, holding the index
- // as member, thus saving time.
- DBG_ASSERT(-1 != nIndex, "XMLShapeExport::collectShapeAutoStyles: could not obtain the index for the ParaAdjust context id!");
-
- uno::Any aParaAdjustValue = xPropSet->getPropertyValue( s_sParaAdjustPropertyName );
- XMLPropertyState aAlignDefaultState( nIndex, aParaAdjustValue );
-
- xPropStates.push_back( aAlignDefaultState );
- }
- }
- }
- // ----------------------------------------------------------------------
-
- nCount = 0;
- std::vector< XMLPropertyState >::iterator aIter = xPropStates.begin();
- std::vector< XMLPropertyState >::iterator aEnd = xPropStates.end();
- while( aIter != aEnd )
- {
- if( aIter->mnIndex != -1 )
- nCount++;
- aIter++;
- }
-
- if( nCount )
- {
- const OUString aEmpty;
- aShapeInfo.msTextStyleName = rExport.GetAutoStylePool()->Find( XML_STYLE_FAMILY_TEXT_PARAGRAPH, aEmpty, xPropStates );
- if(!aShapeInfo.msTextStyleName.getLength())
- {
- // Style did not exist, add it to AutoStalePool
- aShapeInfo.msTextStyleName = rExport.GetAutoStylePool()->Add(XML_STYLE_FAMILY_TEXT_PARAGRAPH, aEmpty, xPropStates);
- }
- }
- }
- }
-
- // ----------------------------------------
- // prepare animation informations if needed
- // ----------------------------------------
- if( mxAnimationsExporter.is() )
- mxAnimationsExporter->prepare( xShape );
-
- // -------------------
- // check for connector
- // -------------------
- if( aShapeInfo.meShapeType == XmlShapeTypeDrawConnectorShape )
- {
- uno::Reference< drawing::XShape > xConnection;
-
- // create shape ids for export later
- if( xPropSet->getPropertyValue( msStartShape ) >>= xConnection )
- {
- createShapeId( xConnection );
- }
- if( xPropSet->getPropertyValue( msEndShape ) >>= xConnection )
- {
- createShapeId( xConnection );
- }
- }
-
- maShapeInfos.push_back( aShapeInfo );
- maCurrentInfo = maShapeInfos.begin();
-
- // -----------------------------------------------------
- // check for shape collections (group shape or 3d scene)
- // and collect contained shapes style infos
- // -----------------------------------------------------
- {
- uno::Reference< drawing::XShapes > xShapes( xShape, uno::UNO_QUERY );
- if( xShapes.is() )
- {
- collectShapesAutoStyles( xShapes );
- }
- }
-}
-
-///////////////////////////////////////////////////////////////////////
-
-// This method exports the given XShape
-void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape,
- sal_Int32 nFeatures /* = SEF_DEFAULT */,
- ::com::sun::star::awt::Point* pRefPoint /* = NULL */ )
-{
- if( maCurrentShapesIter == maShapesInfos.end() )
- {
- DBG_ERROR( "XMLShapeExport::exportShape(): no auto styles where collected before export" );
- return;
- }
-
- sal_Int32 nZIndex = 0;
- uno::Reference< beans::XPropertySet > xSet( xShape, uno::UNO_QUERY );
- if( xSet.is() )
- xSet->getPropertyValue(msZIndex) >>= nZIndex;
-
- ImplXMLShapeExportInfoVector& aShapeInfoVector = (*maCurrentShapesIter).second;
-
- if( aShapeInfoVector.size() <= nZIndex )
- {
- DBG_ERROR( "XMLShapeExport::exportShape(): no shape info collected for a given shape" );
- return;
- }
-
- const ImplXMLShapeExportInfo& aShapeInfo = aShapeInfoVector[nZIndex];
-
-#ifdef DBG_UTIL
- // ---------------------------------------
- // check if this is the correct ShapesInfo
- // ---------------------------------------
- uno::Reference< container::XChild > xChild( xShape, uno::UNO_QUERY );
- if( xChild.is() )
- {
- uno::Reference< drawing::XShapes > xParent( xChild->getParent(), uno::UNO_QUERY );
- DBG_ASSERT( xParent.is() && xParent.get() == (*maCurrentShapesIter).first.get(), "XMLShapeExport::exportShape(): Wrong call to XMLShapeExport::seekShapes()" );
- }
-
- // -----------------------------
- // first compute the shapes type
- // -----------------------------
- {
- XmlShapeType eShapeType(XmlShapeTypeNotYetSet);
- ImpCalcShapeType(xShape, eShapeType);
-
- DBG_ASSERT( eShapeType == aShapeInfo.meShapeType, "exportShape callings do not correspond to collectShapeAutoStyles calls!" );
- }
-#endif
-
- // ----------------------------------------
- // collect animation informations if needed
- // ----------------------------------------
- if( mxAnimationsExporter.is() )
- mxAnimationsExporter->collect( xShape );
-
- // -------------------------------
- // export shapes name if he has one
- // -------------------------------
- {
- uno::Reference< container::XNamed > xNamed( xShape, uno::UNO_QUERY );
- if( xNamed.is() )
- {
- const OUString aName( xNamed->getName() );
- if( aName.getLength() )
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_NAME, aName );
- }
- }
-
- // ------------------
- // export style name
- // ------------------
- if( aShapeInfo.msStyleName.getLength() != 0 )
- {
- if(XML_STYLE_FAMILY_SD_GRAPHICS_ID == aShapeInfo.mnFamily)
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME, aShapeInfo.msStyleName);
- else
- rExport.AddAttribute(XML_NAMESPACE_PRESENTATION, XML_STYLE_NAME, aShapeInfo.msStyleName);
- }
-
- // ------------------
- // export text style name
- // ------------------
- if( aShapeInfo.msTextStyleName.getLength() != 0 )
- {
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_TEXT_STYLE_NAME, aShapeInfo.msTextStyleName);
- }
-
- // --------------------------
- // export shapes id if needed
- // --------------------------
- {
- const sal_Int32 nShapeId = getShapeId( xShape );
- if( nShapeId != -1 )
- {
- const OUString sId( OUString::valueOf( nShapeId ) );
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_ID, sId );
- }
- }
-
- // --------------------------
- // export layer information
- // --------------------------
- if( IsLayerExportEnabled() )
- {
- // 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() )
- {
- try
- {
- uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY );
- OUString aLayerName;
- xProps->getPropertyValue( OUString::createFromAscii( "LayerName" ) ) >>= aLayerName;
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_LAYER, aLayerName );
-
- }
- catch( uno::Exception e )
- {
- DBG_ERROR( "could not export layer name for shape!" );
- }
- }
- }
-
- // #82003# test export count
- // #91587# ALWAYS increment since now ALL to be exported shapes are counted.
- if(rExport.GetShapeExport()->IsHandleProgressBarEnabled())
- {
- rExport.GetProgressBarHelper()->Increment();
- }
-
- onExport( xShape );
-
- // --------------------
- // export shape element
- // --------------------
- switch(aShapeInfo.meShapeType)
- {
- case XmlShapeTypeDrawRectangleShape:
- {
- ImpExportRectangleShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
- case XmlShapeTypeDrawEllipseShape:
- {
- ImpExportEllipseShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
- case XmlShapeTypeDrawLineShape:
- {
- ImpExportLineShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
- case XmlShapeTypeDrawPolyPolygonShape: // closed PolyPolygon
- case XmlShapeTypeDrawPolyLineShape: // open PolyPolygon
- case XmlShapeTypeDrawClosedBezierShape: // closed PolyPolygon containing curves
- case XmlShapeTypeDrawOpenBezierShape: // open PolyPolygon containing curves
- {
- ImpExportPolygonShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
-
- case XmlShapeTypeDrawTextShape:
- case XmlShapeTypePresTitleTextShape:
- case XmlShapeTypePresOutlinerShape:
- case XmlShapeTypePresSubtitleShape:
- case XmlShapeTypePresNotesShape:
- {
- ImpExportTextBoxShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
-
- case XmlShapeTypeDrawGraphicObjectShape:
- case XmlShapeTypePresGraphicObjectShape:
- {
- ImpExportGraphicObjectShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
-
- case XmlShapeTypeDrawChartShape:
- case XmlShapeTypePresChartShape:
- {
- ImpExportChartShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
-
- case XmlShapeTypeDrawTableShape:
- case XmlShapeTypePresTableShape:
- {
- ImpExportSpreadsheetShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
-
- case XmlShapeTypeDrawControlShape:
- {
- ImpExportControlShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
-
- case XmlShapeTypeDrawConnectorShape:
- {
- ImpExportConnectorShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
-
- case XmlShapeTypeDrawMeasureShape:
- {
- ImpExportMeasureShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
-
- case XmlShapeTypeDrawOLE2Shape:
- case XmlShapeTypePresOLE2Shape:
- {
- ImpExportOLE2Shape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
-
- case XmlShapeTypeDrawPageShape:
- case XmlShapeTypePresPageShape:
- case XmlShapeTypeHandoutShape:
- {
- ImpExportPageShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
-
- case XmlShapeTypeDrawCaptionShape:
- {
- ImpExportCaptionShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
-
- case XmlShapeTypeDraw3DCubeObject:
- case XmlShapeTypeDraw3DSphereObject:
- case XmlShapeTypeDraw3DLatheObject:
- case XmlShapeTypeDraw3DExtrudeObject:
- {
- ImpExport3DShape(xShape, aShapeInfo.meShapeType);
- break;
- }
-
- case XmlShapeTypeDraw3DSceneObject:
- {
- ImpExport3DSceneShape( xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
-
- case XmlShapeTypeDrawGroupShape:
- {
- // empty group
- ImpExportGroupShape( xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
-
- case XmlShapeTypeDrawFrameShape:
- {
- ImpExportFrameShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
-
- case XmlShapeTypeDrawAppletShape:
- {
- ImpExportAppletShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
-
- case XmlShapeTypeDrawPluginShape:
- {
- ImpExportPluginShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint );
- break;
- }
-
- case XmlShapeTypePresOrgChartShape:
- case XmlShapeTypeUnknown:
- case XmlShapeTypeNotYetSet:
- default:
- {
- // this should never happen and is an error
- DBG_ERROR("XMLEXP: WriteShape: unknown or unexpected type of shape in export!");
- break;
- }
- }
-
- // #97489# #97111#
- // if there was an error and no element for the shape was exported
- // we need to clear the attribute list or the attributes will be
- // set on the next exported element, which can result in corrupt
- // xml files due to duplicate attributes
-
- rExport.CheckAttrList(); // asserts in non pro if we have attributes left
- rExport.ClearAttrList(); // clears the attributes
-}
-
-///////////////////////////////////////////////////////////////////////
-
-// This method collects all automatic styles for the shapes inside the given XShapes collection
-void XMLShapeExport::collectShapesAutoStyles( const uno::Reference < drawing::XShapes >& xShapes )
-{
- ShapesInfos::iterator aOldCurrentShapesIter = maCurrentShapesIter;
- seekShapes( xShapes );
-
- uno::Reference< drawing::XShape > xShape;
- const sal_Int32 nShapeCount(xShapes->getCount());
- for(sal_Int32 nShapeId = 0; nShapeId < nShapeCount; nShapeId++)
- {
- xShapes->getByIndex(nShapeId) >>= xShape;
- DBG_ASSERT( xShape.is(), "Shape without a XShape?" );
- if(!xShape.is())
- continue;
-
- collectShapeAutoStyles( xShape );
- }
-
- maCurrentShapesIter = aOldCurrentShapesIter;
-}
-
-///////////////////////////////////////////////////////////////////////
-
-// This method exports all XShape inside the given XShapes collection
-void XMLShapeExport::exportShapes( const uno::Reference < drawing::XShapes >& xShapes, sal_Int32 nFeatures /* = SEF_DEFAULT */, awt::Point* pRefPoint /* = NULL */ )
-{
- ShapesInfos::iterator aOldCurrentShapesIter = maCurrentShapesIter;
- seekShapes( xShapes );
-
- uno::Reference< drawing::XShape > xShape;
- const sal_Int32 nShapeCount(xShapes->getCount());
- for(sal_Int32 nShapeId = 0; nShapeId < nShapeCount; nShapeId++)
- {
- xShapes->getByIndex(nShapeId) >>= xShape;
- DBG_ASSERT( xShape.is(), "Shape without a XShape?" );
- if(!xShape.is())
- continue;
-
- exportShape( xShape, nFeatures, pRefPoint );
- }
-
- maCurrentShapesIter = aOldCurrentShapesIter;
-}
-
-///////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::seekShapes( const uno::Reference< drawing::XShapes >& xShapes ) throw()
-{
- if( xShapes.is() )
- {
- maCurrentShapesIter = maShapesInfos.find( xShapes );
- if( maCurrentShapesIter == maShapesInfos.end() )
- {
- ImplXMLShapeExportInfoVector aNewInfoVector;
- aNewInfoVector.resize( (ShapesInfos::size_type) xShapes->getCount() );
- maShapesInfos[ xShapes ] = aNewInfoVector;
-
- maCurrentShapesIter = maShapesInfos.find( xShapes );
-
- DBG_ASSERT( maCurrentShapesIter != maShapesInfos.end(), "XMLShapeExport::seekShapes(): insert into stl::map failed" );
- }
-
- DBG_ASSERT( (*maCurrentShapesIter).second.size() == (ShapesInfos::size_type)xShapes->getCount(), "XMLShapeExport::seekShapes(): XShapes size varied between calls" );
-
- }
- else
- {
- maCurrentShapesIter = maShapesInfos.end();
- }
-}
-
-///////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::exportAutoStyles()
-{
- // export all autostyle infos
-
- // ...for graphic
-// if(IsFamilyGraphicUsed())
- {
- GetExport().GetAutoStylePool()->exportXML(
- XML_STYLE_FAMILY_SD_GRAPHICS_ID
- , GetExport().GetDocHandler(),
- GetExport().GetMM100UnitConverter(),
- GetExport().GetNamespaceMap()
- );
- }
-
- // ...for presentation
-// if(IsFamilyPresentationUsed())
- {
- GetExport().GetAutoStylePool()->exportXML(
- XML_STYLE_FAMILY_SD_PRESENTATION_ID
- , GetExport().GetDocHandler(),
- GetExport().GetMM100UnitConverter(),
- GetExport().GetNamespaceMap()
- );
- }
-}
-
-///////////////////////////////////////////////////////////////////////
-
-/** creates a unique id for this shape, this id is saved and exported with this shape later
- with the exportShape method. Its ok to call this twice with the same shape */
-void XMLShapeExport::createShapeId( const uno::Reference < drawing::XShape >& xShape )
-{
- ShapeIdsMap::iterator aId( maShapeIds.find( xShape ) );
-
- if( aId == maShapeIds.end() )
- maShapeIds[xShape] = mnNextUniqueShapeId++;
-}
-
-///////////////////////////////////////////////////////////////////////
-
-/** returns the unique id for this shape. It returns -1 if the was no createShapeId call
- for this shape yet. */
-sal_Int32 XMLShapeExport::getShapeId( const uno::Reference < drawing::XShape >& xShape )
-{
- ShapeIdsMap::iterator aId( maShapeIds.find( xShape ) );
-
- if( aId != maShapeIds.end() )
- return (*aId).second;
-
- return -1;
-}
-
-///////////////////////////////////////////////////////////////////////
-
-/// returns the export property mapper for external chaining
-SvXMLExportPropertyMapper* XMLShapeExport::CreateShapePropMapper(
- SvXMLExport& rExport )
-{
- UniReference< XMLPropertyHandlerFactory > xFactory = new XMLSdPropHdlFactory( rExport.GetModel() );
- UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( xFactory );
- SvXMLExportPropertyMapper* pResult =
- new XMLShapeExportPropertyMapper( xMapper,
- (XMLTextListAutoStylePool*)&rExport.GetTextParagraphExport()->GetListAutoStylePool(),
- rExport );
- // chain text attributes
- return pResult;
-}
-
-///////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType& eShapeType)
-{
- // set in every case, so init here
- eShapeType = XmlShapeTypeUnknown;
-
- uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor(xShape, uno::UNO_QUERY);
- if(xShapeDescriptor.is())
- {
- String aType((OUString)xShapeDescriptor->getShapeType());
-
- if(aType.EqualsAscii((const sal_Char*)"com.sun.star.", 0, 13))
- {
- if(aType.EqualsAscii("drawing.", 13, 8))
- {
- // drawing shapes
- if (aType.EqualsAscii("Rectangle", 21, 9)) { eShapeType = XmlShapeTypeDrawRectangleShape; }
- else if(aType.EqualsAscii("Ellipse", 21, 7)) { eShapeType = XmlShapeTypeDrawEllipseShape; }
- else if(aType.EqualsAscii("Control", 21, 7)) { eShapeType = XmlShapeTypeDrawControlShape; }
- else if(aType.EqualsAscii("Connector", 21, 9)) { eShapeType = XmlShapeTypeDrawConnectorShape; }
- else if(aType.EqualsAscii("Measure", 21, 7)) { eShapeType = XmlShapeTypeDrawMeasureShape; }
- else if(aType.EqualsAscii("Line", 21, 4)) { eShapeType = XmlShapeTypeDrawLineShape; }
- else if(aType.EqualsAscii("PolyPolygon", 21, 11)) { eShapeType = XmlShapeTypeDrawPolyPolygonShape; }
- else if(aType.EqualsAscii("PolyLine", 21, 8)) { eShapeType = XmlShapeTypeDrawPolyLineShape; }
- else if(aType.EqualsAscii("OpenBezier", 21, 10)) { eShapeType = XmlShapeTypeDrawOpenBezierShape; }
- else if(aType.EqualsAscii("ClosedBezier", 21, 12)) { eShapeType = XmlShapeTypeDrawClosedBezierShape; }
- else if(aType.EqualsAscii("GraphicObject", 21, 13)) { eShapeType = XmlShapeTypeDrawGraphicObjectShape; }
- else if(aType.EqualsAscii("Group", 21, 5)) { eShapeType = XmlShapeTypeDrawGroupShape; }
- else if(aType.EqualsAscii("Text", 21, 4)) { eShapeType = XmlShapeTypeDrawTextShape; }
- else if(aType.EqualsAscii("OLE2", 21, 4))
- {
- eShapeType = XmlShapeTypeDrawOLE2Shape;
-
- // get info about presentation shape
- uno::Reference <beans::XPropertySet> xPropSet(xShape, uno::UNO_QUERY);
-
- if(xPropSet.is())
- {
- uno::Any aAny;
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("CLSID")));
- ::rtl::OUString sCLSID;
- if (aAny >>= sCLSID)
- {
- if (sCLSID.equals(rExport.GetChartExport()->getChartCLSID()))
- {
- eShapeType = XmlShapeTypeDrawChartShape;
- }
- else if (
- sCLSID.equals( ::rtl::OUString( SvGlobalName( SO3_SC_CLASSID ).GetHexName()))
- // #110680#
- // same reaction for binfilter
- || sCLSID.equals( ::rtl::OUString( SvGlobalName( BF_SO3_SC_CLASSID ).GetHexName()))
- )
- {
- eShapeType = XmlShapeTypeDrawTableShape;
- }
- else
- {
- // general OLE2 Object
- }
- }
-/* uno::Reference <lang::XServiceInfo> xObjectInfo;
-
- if(aAny >>= xObjectInfo)
- {
- if(xObjectInfo->supportsService(OUString(RTL_CONSTASCII_USTRINGPARAM
- ("com.sun.star.chart.ChartDocument"))))
- {
- eShapeType = XmlShapeTypeDrawChartShape;
- }
- else if(xObjectInfo->supportsService(OUString(RTL_CONSTASCII_USTRINGPARAM
- ("com.sun.star.sheet.SpreadsheetDocument"))))
- {
- eShapeType = XmlShapeTypeDrawTableShape;
- }
- else
- {
- // general OLE2 Object
- }
- }*/
- }
- }
- else if(aType.EqualsAscii("Page", 21, 4)) { eShapeType = XmlShapeTypeDrawPageShape; }
- else if(aType.EqualsAscii("Frame", 21, 5)) { eShapeType = XmlShapeTypeDrawFrameShape; }
- else if(aType.EqualsAscii("Caption", 21, 7)) { eShapeType = XmlShapeTypeDrawCaptionShape; }
- else if(aType.EqualsAscii("Plugin", 21, 6)) { eShapeType = XmlShapeTypeDrawPluginShape; }
- else if(aType.EqualsAscii("Applet", 21, 6)) { eShapeType = XmlShapeTypeDrawAppletShape; }
-
- // 3D shapes
- else if(aType.EqualsAscii("Scene", 21 + 7, 5)) { eShapeType = XmlShapeTypeDraw3DSceneObject; }
- else if(aType.EqualsAscii("Cube", 21 + 7, 4)) { eShapeType = XmlShapeTypeDraw3DCubeObject; }
- else if(aType.EqualsAscii("Sphere", 21 + 7, 6)) { eShapeType = XmlShapeTypeDraw3DSphereObject; }
- else if(aType.EqualsAscii("Lathe", 21 + 7, 5)) { eShapeType = XmlShapeTypeDraw3DLatheObject; }
- else if(aType.EqualsAscii("Extrude", 21 + 7, 7)) { eShapeType = XmlShapeTypeDraw3DExtrudeObject; }
- }
- else if(aType.EqualsAscii("presentation.", 13, 13))
- {
- // presentation shapes
- if (aType.EqualsAscii("TitleText", 26, 9)) { eShapeType = XmlShapeTypePresTitleTextShape; }
- else if(aType.EqualsAscii("Outliner", 26, 8)) { eShapeType = XmlShapeTypePresOutlinerShape; }
- else if(aType.EqualsAscii("Subtitle", 26, 8)) { eShapeType = XmlShapeTypePresSubtitleShape; }
- else if(aType.EqualsAscii("GraphicObject", 26, 13)) { eShapeType = XmlShapeTypePresGraphicObjectShape; }
- else if(aType.EqualsAscii("Page", 26, 4)) { eShapeType = XmlShapeTypePresPageShape; }
- else if(aType.EqualsAscii("OLE2", 26, 4)) { eShapeType = XmlShapeTypePresOLE2Shape; }
- else if(aType.EqualsAscii("Chart", 26, 5)) { eShapeType = XmlShapeTypePresChartShape; }
- 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; }
- }
- }
- }
-}
-
-///////////////////////////////////////////////////////////////////////
-
-extern SvXMLEnumMapEntry aXML_GlueAlignment_EnumMap[];
-extern SvXMLEnumMapEntry aXML_GlueEscapeDirection_EnumMap[];
-
-/** exports all user defined glue points */
-void XMLShapeExport::ImpExportGluePoints( const uno::Reference< drawing::XShape >& xShape )
-{
- uno::Reference< drawing::XGluePointsSupplier > xSupplier( xShape, uno::UNO_QUERY );
- if( !xSupplier.is() )
- return;
-
- uno::Reference< container::XIdentifierAccess > xGluePoints( xSupplier->getGluePoints(), uno::UNO_QUERY );
- if( !xGluePoints.is() )
- return;
-
- drawing::GluePoint2 aGluePoint;
-
- uno::Sequence< sal_Int32 > aIdSequence( xGluePoints->getIdentifiers() );
-
- const sal_Int32 nCount = aIdSequence.getLength();
- for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
- {
- const sal_Int32 nIdentifier = aIdSequence[nIndex];
- if( (xGluePoints->getByIdentifier( nIdentifier ) >>= aGluePoint) && aGluePoint.IsUserDefined )
- {
- // export only user defined glue points
-
- const OUString sId( OUString::valueOf( nIdentifier ) );
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_ID, sId );
-
- rExport.GetMM100UnitConverter().convertMeasure(msBuffer, aGluePoint.Position.X);
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_X, msBuffer.makeStringAndClear());
-
- rExport.GetMM100UnitConverter().convertMeasure(msBuffer, aGluePoint.Position.Y);
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_Y, msBuffer.makeStringAndClear());
-
- if( !aGluePoint.IsRelative )
- {
- SvXMLUnitConverter::convertEnum( msBuffer, aGluePoint.PositionAlignment, aXML_GlueAlignment_EnumMap );
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_ALIGN, msBuffer.makeStringAndClear() );
- }
-
- if( aGluePoint.Escape != drawing::EscapeDirection_SMART )
- {
- SvXMLUnitConverter::convertEnum( msBuffer, aGluePoint.Escape, aXML_GlueEscapeDirection_EnumMap );
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_ESCAPE_DIRECTION, msBuffer.makeStringAndClear() );
- }
-
- SvXMLElementExport aEventsElemt(rExport, XML_NAMESPACE_DRAW, XML_GLUE_POINT, sal_True, sal_True);
- }
- }
-}
-
-void XMLShapeExport::ExportGraphicDefaults()
-{
- XMLStyleExport aStEx(rExport, OUString(), rExport.GetAutoStylePool().get());
-
- // construct PropertySetMapper
- UniReference< SvXMLExportPropertyMapper > xPropertySetMapper( CreateShapePropMapper( rExport ) );
- ((XMLShapeExportPropertyMapper*)xPropertySetMapper.get())->SetAutoStyles( sal_False );
-
- // chain text attributes
- xPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(rExport));
-
- // write graphic family default style
- uno::Reference< lang::XMultiServiceFactory > xFact( rExport.GetModel(), uno::UNO_QUERY );
- if( xFact.is() )
- {
- try
- {
- uno::Reference< beans::XPropertySet > xDefaults( xFact->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Defaults") ) ), uno::UNO_QUERY );
- if( xDefaults.is() )
- {
- aStEx.exportDefaultStyle( xDefaults, OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), xPropertySetMapper );
-
- // write graphic family styles
- aStEx.exportStyleFamily(XML_STYLE_FAMILY_SD_GRAPHICS_NAME, OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), xPropertySetMapper, FALSE, XML_STYLE_FAMILY_SD_GRAPHICS_ID);
- }
- }
- catch( lang::ServiceNotRegisteredException& )
- {
- }
- }
-}
-
-void XMLShapeExport::onExport( const ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShape >& xShape )
-{
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_shapeexport2.cxx b/binfilter/bf_xmloff/source/draw/xmloff_shapeexport2.cxx
deleted file mode 100644
index 8d38b1940bfd..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_shapeexport2.cxx
+++ /dev/null
@@ -1,1584 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/text/XText.hpp>
-
-
-
-#include <com/sun/star/drawing/CircleKind.hpp>
-
-#include <com/sun/star/drawing/ConnectorType.hpp>
-
-#include <com/sun/star/drawing/XControlShape.hpp>
-
-#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
-
-#include <com/sun/star/document/XEventsSupplier.hpp>
-
-#include <com/sun/star/drawing/HomogenMatrix3.hpp>
-
-#include "anim.hxx"
-
-
-#include "sdpropls.hxx"
-
-
-
-#include "xmlexp.hxx"
-
-#include "xmluconv.hxx"
-
-#include "XMLImageMapExport.hxx"
-
-#include "xexptran.hxx"
-
-#include <vcl/salbtype.hxx> // FRound
-
-
-
-#include "xmlnmspe.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportNewTrans(const uno::Reference< beans::XPropertySet >& xPropSet,
- sal_Int32 nFeatures, awt::Point* pRefPoint)
-{
- // get matrix
- Matrix3D aMat;
- ImpExportNewTrans_GetMatrix3D(aMat, xPropSet);
-
- // decompose and correct abour pRefPoint
- Vector2D aTRScale;
- double fTRShear(0.0);
- double fTRRotate(0.0);
- Vector2D aTRTranslate;
- ImpExportNewTrans_DecomposeAndRefPoint(aMat, aTRScale, fTRShear, fTRRotate, aTRTranslate, pRefPoint);
-
- // use features and write
- ImpExportNewTrans_FeaturesAndWrite(aTRScale, fTRShear, fTRRotate, aTRTranslate, nFeatures);
-}
-
-void XMLShapeExport::ImpExportNewTrans_GetMatrix3D(Matrix3D& rMat,
- const uno::Reference< beans::XPropertySet >& xPropSet)
-{
- uno::Any aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Transformation")));
- drawing::HomogenMatrix3 aMatrix;
- aAny >>= aMatrix;
- rMat[0] = Point3D( aMatrix.Line1.Column1, aMatrix.Line1.Column2, aMatrix.Line1.Column3 );
- rMat[1] = Point3D( aMatrix.Line2.Column1, aMatrix.Line2.Column2, aMatrix.Line2.Column3 );
- rMat[2] = Point3D( aMatrix.Line3.Column1, aMatrix.Line3.Column2, aMatrix.Line3.Column3 );
-}
-
-void XMLShapeExport::ImpExportNewTrans_DecomposeAndRefPoint(const Matrix3D& rMat,
- Vector2D& rTRScale, double& fTRShear, double& fTRRotate, Vector2D& rTRTranslate,
- awt::Point* pRefPoint)
-{
- // decompose matrix
- rMat.DecomposeAndCorrect(rTRScale, fTRShear, fTRRotate, rTRTranslate);
-
- // correct translation about pRefPoint
- if(pRefPoint)
- {
- rTRTranslate.X() -= pRefPoint->X;
- rTRTranslate.Y() -= pRefPoint->Y;
- }
-}
-
-void XMLShapeExport::ImpExportNewTrans_FeaturesAndWrite(Vector2D& rTRScale, double fTRShear,
- double fTRRotate, Vector2D& rTRTranslate, const sal_Int32 nFeatures)
-{
- // allways write Size (rTRScale) since this statement carries the union
- // of the object
- OUString aStr;
- OUStringBuffer sStringBuffer;
- Vector2D aTRScale = rTRScale;
-
- // svg: width
- if(!(nFeatures & SEF_EXPORT_WIDTH))
- aTRScale.X() = 1.0;
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, FRound(aTRScale.X()));
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_WIDTH, aStr);
-
- // svg: height
- if(!(nFeatures & SEF_EXPORT_HEIGHT))
- aTRScale.Y() = 1.0;
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, FRound(aTRScale.Y()));
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_HEIGHT, aStr);
-
- // decide if transformation is neccessary
- BOOL bTransformationIsNeccessary(fTRShear != 0.0 || fTRRotate != 0.0);
-
- if(bTransformationIsNeccessary)
- {
- // write transformation, but WITHOUT scale which is exported as size above
- SdXMLImExTransform2D aTransform;
-
- aTransform.AddSkewX(atan(fTRShear));
- aTransform.AddRotate(fTRRotate);
- aTransform.AddTranslate(rTRTranslate);
-
- // does transformation need to be exported?
- if(aTransform.NeedsAction())
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_TRANSFORM, aTransform.GetExportString(rExport.GetMM100UnitConverter()));
- }
- else
- {
- // no shear, no rotate; just add object position to export and we are done
- if(nFeatures & SEF_EXPORT_X)
- {
- // svg: x
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, FRound(rTRTranslate.X()));
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_X, aStr);
- }
-
- if(nFeatures & SEF_EXPORT_Y)
- {
- // svg: y
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, FRound(rTRTranslate.Y()));
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_Y, aStr);
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-sal_Bool XMLShapeExport::ImpExportPresentationAttributes( const uno::Reference< beans::XPropertySet >& xPropSet, const ::rtl::OUString& rClass )
-{
- sal_Bool bIsEmpty = sal_False;
-
- OUStringBuffer sStringBuffer;
-
- // write presentation class entry
- rExport.AddAttribute(XML_NAMESPACE_PRESENTATION, XML_CLASS, rClass);
-
- if( xPropSet.is() )
- {
- uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
-
- sal_Bool bTemp;
-
- // is empty pes shape?
- if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject"))))
- {
- xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject"))) >>= bIsEmpty;
- if( bIsEmpty )
- rExport.AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PLACEHOLDER, XML_TRUE);
- }
-
- // is user-transformed?
- if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsPlaceholderDependent"))))
- {
- xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("IsPlaceholderDependent"))) >>= bTemp;
- if(!bTemp)
- rExport.AddAttribute(XML_NAMESPACE_PRESENTATION, XML_USER_TRANSFORMED, XML_TRUE);
- }
- }
-
- return bIsEmpty;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportText( const uno::Reference< drawing::XShape >& xShape )
-{
- uno::Reference< text::XText > xText( xShape, uno::UNO_QUERY );
- if( xText.is() && xText->getString().getLength() )
- rExport.GetTextParagraphExport()->exportText( xText );
-}
-}//end of namespace binfilter
-//////////////////////////////////////////////////////////////////////////////
-
-#include <com/sun/star/presentation/ClickAction.hpp>
-#include <com/sun/star/presentation/AnimationSpeed.hpp>
-namespace binfilter {//STRIP009
-#define FOUND_CLICKACTION 0x0001
-#define FOUND_BOOKMARK 0x0002
-#define FOUND_EFFECT 0x0004
-#define FOUND_PLAYFULL 0x0008
-#define FOUND_VERB 0x0010
-#define FOUND_SOUNDURL 0x0020
-#define FOUND_SPEED 0x0040
-#define FOUND_EVENTTYPE 0x0080
-#define FOUND_MACRO 0x0100
-#define FOUND_LIBRARY 0x0200
-
-void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& xShape )
-{
- do
- {
- uno::Reference< document::XEventsSupplier > xEventsSupplier( xShape, uno::UNO_QUERY );
- if( !xEventsSupplier.is() )
- break;
-
- uno::Reference< container::XNameReplace > xEvents( xEventsSupplier->getEvents() );
- DBG_ASSERT( xEvents.is(), "XEventsSupplier::getEvents() returned NULL" );
- if( !xEvents.is() )
- break;
-
- uno::Sequence< beans::PropertyValue > aProperties;
- if( !xEvents->hasByName( msOnClick ) )
- break;
-
- if( !(xEvents->getByName( msOnClick ) >>= aProperties) )
- break;
-
- sal_Int32 nFound = 0;
- const beans::PropertyValue* pProperties = aProperties.getConstArray();
-
- OUString aStrEventType;
- presentation::ClickAction eClickAction;
- presentation::AnimationEffect eEffect;
- presentation::AnimationSpeed eSpeed;
- OUString aStrSoundURL;
- sal_Bool bPlayFull;
- sal_Int32 nVerb;
- OUString aStrMacro;
- OUString aStrLibrary;
- OUString aStrBookmark;
-
- const sal_Int32 nCount = aProperties.getLength();
- sal_Int32 nIndex;
- for( nIndex = 0; nIndex < nCount; nIndex++, pProperties++ )
- {
- if( ( ( nFound & FOUND_EVENTTYPE ) == 0 ) && pProperties->Name == msEventType )
- {
- if( pProperties->Value >>= aStrEventType )
- nFound |= FOUND_EVENTTYPE;
- }
- else if( ( ( nFound & FOUND_CLICKACTION ) == 0 ) && pProperties->Name == msClickAction )
- {
- if( pProperties->Value >>= eClickAction )
- nFound |= FOUND_CLICKACTION;
- }
- else if( ( ( nFound & FOUND_MACRO ) == 0 ) && pProperties->Name == msMacroName )
- {
- if( pProperties->Value >>= aStrMacro )
- nFound |= FOUND_MACRO;
- }
- else if( ( ( nFound & FOUND_LIBRARY ) == 0 ) && pProperties->Name == msLibrary )
- {
- if( pProperties->Value >>= aStrLibrary )
- nFound |= FOUND_LIBRARY;
- }
- else if( ( ( nFound & FOUND_EFFECT ) == 0 ) && pProperties->Name == msEffect )
- {
- if( pProperties->Value >>= eEffect )
- nFound |= FOUND_EFFECT;
- }
- else if( ( ( nFound & FOUND_BOOKMARK ) == 0 ) && pProperties->Name == msBookmark )
- {
- if( pProperties->Value >>= aStrBookmark )
- nFound |= FOUND_BOOKMARK;
- }
- else if( ( ( nFound & FOUND_SPEED ) == 0 ) && pProperties->Name == msSpeed )
- {
- if( pProperties->Value >>= eSpeed )
- nFound |= FOUND_SPEED;
- }
- else if( ( ( nFound & FOUND_SOUNDURL ) == 0 ) && pProperties->Name == msSoundURL )
- {
- if( pProperties->Value >>= aStrSoundURL )
- nFound |= FOUND_SOUNDURL;
- }
- else if( ( ( nFound & FOUND_PLAYFULL ) == 0 ) && pProperties->Name == msPlayFull )
- {
- if( pProperties->Value >>= bPlayFull )
- nFound |= FOUND_PLAYFULL;
- }
- else if( ( ( nFound & FOUND_VERB ) == 0 ) && pProperties->Name == msVerb )
- {
- if( pProperties->Value >>= nVerb )
- nFound |= FOUND_VERB;
- }
- }
-
- if( ( nFound & FOUND_EVENTTYPE ) == 0 )
- break;
-
- if( aStrEventType == msPresentation )
- {
- if( ( nFound & FOUND_CLICKACTION ) == 0 )
- break;
-
- if( eClickAction == presentation::ClickAction_NONE )
- break;
-
- SvXMLElementExport aEventsElemt(rExport, XML_NAMESPACE_OFFICE, XML_EVENTS, sal_True, sal_True);
-
- enum XMLTokenEnum eStrAction;
-
- switch( eClickAction )
- {
- case presentation::ClickAction_PREVPAGE: eStrAction = XML_PREVIOUS_PAGE; break;
- case presentation::ClickAction_NEXTPAGE: eStrAction = XML_NEXT_PAGE; break;
- case presentation::ClickAction_FIRSTPAGE: eStrAction = XML_FIRST_PAGE; break;
- case presentation::ClickAction_LASTPAGE: eStrAction = XML_LAST_PAGE; break;
- case presentation::ClickAction_INVISIBLE: eStrAction = XML_HIDE; break;
- case presentation::ClickAction_STOPPRESENTATION:eStrAction = XML_STOP; break;
- case presentation::ClickAction_PROGRAM: eStrAction = XML_EXECUTE; break;
- case presentation::ClickAction_BOOKMARK: eStrAction = XML_SHOW; break;
- case presentation::ClickAction_DOCUMENT: eStrAction = XML_SHOW; break;
- case presentation::ClickAction_MACRO: eStrAction = XML_EXECUTE_MACRO; break;
- case presentation::ClickAction_VERB: eStrAction = XML_VERB; break;
- case presentation::ClickAction_VANISH: eStrAction = XML_FADE_OUT; break;
- case presentation::ClickAction_SOUND: eStrAction = XML_SOUND; break;
- default:
- DBG_ERROR( "unknown presentation::ClickAction found!" );
- eStrAction = XML_UNKNOWN;
- }
-
- rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, OUString( RTL_CONSTASCII_USTRINGPARAM( "on-click" ) ) );
- rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_ACTION, eStrAction );
-
- if( eClickAction == presentation::ClickAction_VANISH )
- {
- if( nFound & FOUND_EFFECT )
- {
- XMLEffect eKind;
- XMLEffectDirection eDirection;
- sal_Int16 nStartScale;
- sal_Bool bIn;
-
- SdXMLImplSetEffect( eEffect, eKind, eDirection, nStartScale, bIn );
-
- if( eEffect != EK_none )
- {
- SvXMLUnitConverter::convertEnum( msBuffer, eKind, aXML_AnimationEffect_EnumMap );
- rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_EFFECT, msBuffer.makeStringAndClear() );
- }
-
- if( eDirection != ED_none )
- {
- SvXMLUnitConverter::convertEnum( msBuffer, eDirection, aXML_AnimationDirection_EnumMap );
- rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_DIRECTION, msBuffer.makeStringAndClear() );
- }
-
- if( nStartScale != -1 )
- {
- SvXMLUnitConverter::convertPercent( msBuffer, nStartScale );
- rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_START_SCALE, msBuffer.makeStringAndClear() );
- }
- }
-
- if( nFound & FOUND_SPEED && eEffect != presentation::AnimationEffect_NONE )
- {
- if( eSpeed != presentation::AnimationSpeed_MEDIUM )
- {
- SvXMLUnitConverter::convertEnum( msBuffer, eSpeed, aXML_AnimationSpeed_EnumMap );
- rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_SPEED, msBuffer.makeStringAndClear() );
- }
- }
- }
-
- if( eClickAction == presentation::ClickAction_PROGRAM ||
- eClickAction == presentation::ClickAction_BOOKMARK ||
- eClickAction == presentation::ClickAction_DOCUMENT )
- {
- if( eClickAction == presentation::ClickAction_BOOKMARK )
- msBuffer.append( sal_Unicode('#') );
-
- msBuffer.append( aStrBookmark );
- rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference(msBuffer.makeStringAndClear()) );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_NEW );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONREQUEST );
- }
-
- if( ( nFound & FOUND_VERB ) && eClickAction == presentation::ClickAction_VERB )
- {
- msBuffer.append( nVerb );
- rExport.AddAttribute(XML_NAMESPACE_PRESENTATION, XML_VERB, msBuffer.makeStringAndClear());
- }
-
- SvXMLElementExport aEventElemt(rExport, XML_NAMESPACE_PRESENTATION, XML_EVENT, sal_True, sal_True);
-
- if( eClickAction == presentation::ClickAction_VANISH || eClickAction == presentation::ClickAction_SOUND )
- {
- if( ( nFound & FOUND_SOUNDURL ) && aStrSoundURL.getLength() != 0 )
- {
- rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference(aStrSoundURL) );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_NEW );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONREQUEST );
- if( nFound & FOUND_PLAYFULL && bPlayFull )
- rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_PLAY_FULL, XML_TRUE );
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_PRESENTATION, XML_SOUND, sal_True, sal_True );
- }
- }
- break;
- }
- else if( aStrEventType == msStarBasic )
- {
- if( nFound & FOUND_MACRO )
- {
- SvXMLElementExport aEventsElemt(rExport, XML_NAMESPACE_OFFICE, XML_EVENTS, sal_True, sal_True);
-
- rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_LANGUAGE, OUString( RTL_CONSTASCII_USTRINGPARAM( "starbasic" ) ) );
- rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, OUString( RTL_CONSTASCII_USTRINGPARAM( "on-click" ) ) );
- rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_MACRO_NAME, aStrMacro );
-
- if( nFound & FOUND_LIBRARY )
- rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_LIBRARY, aStrLibrary );
-
- SvXMLElementExport aEventElemt(rExport, XML_NAMESPACE_SCRIPT, XML_EVENT, sal_True, sal_True);
- }
- }
- }
- while(0);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportGroupShape( const uno::Reference< drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures, awt::Point* pRefPoint)
-{
- uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- {
- // write group shape
- sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
- SvXMLElementExport aPGR(rExport, XML_NAMESPACE_DRAW, XML_G, bCreateNewline, sal_True);
-
- ImpExportEvents( xShape );
- ImpExportGluePoints( xShape );
-
- // #89764# if export of position is supressed for group shape,
- // positions of contained objects should be written relative to
- // the upper left edge of the group.
- awt::Point aUpperLeft;
-
- if(!(nFeatures & SEF_EXPORT_POSITION))
- {
- nFeatures |= SEF_EXPORT_POSITION;
- aUpperLeft = xShape->getPosition();
- pRefPoint = &aUpperLeft;
- }
-
- // write members
- exportShapes( xShapes, nFeatures, pRefPoint );
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportTextBoxShape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures, awt::Point* pRefPoint)
-{
- const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
-
- // presentation attribute (if presentation)
- sal_Bool bIsPresShape(FALSE);
- sal_Bool bIsEmptyPresObj(FALSE);
- OUString aStr;
-
- switch(eShapeType)
- {
- case XmlShapeTypePresSubtitleShape:
- {
- aStr = GetXMLToken(XML_PRESENTATION_SUBTITLE);
- bIsPresShape = TRUE;
- break;
- }
- case XmlShapeTypePresTitleTextShape:
- {
- aStr = GetXMLToken(XML_PRESENTATION_TITLE);
- bIsPresShape = TRUE;
- break;
- }
- case XmlShapeTypePresOutlinerShape:
- {
- aStr = GetXMLToken(XML_PRESENTATION_OUTLINE);
- bIsPresShape = TRUE;
- break;
- }
- case XmlShapeTypePresNotesShape:
- {
- aStr = GetXMLToken(XML_PRESENTATION_NOTES);
- bIsPresShape = TRUE;
- break;
- }
- }
-
- // Transformation
- ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
-
- // evtl. corner radius?
- sal_Int32 nCornerRadius(0L);
- xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("CornerRadius"))) >>= nCornerRadius;
- if(nCornerRadius)
- {
- OUStringBuffer sStringBuffer;
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, nCornerRadius);
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_CORNER_RADIUS, sStringBuffer.makeStringAndClear());
- }
-
- if(bIsPresShape)
- bIsEmptyPresObj = ImpExportPresentationAttributes( xPropSet, aStr );
-
- // write text-box
- sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, XML_TEXT_BOX, bCreateNewline, sal_True);
-
- ImpExportEvents( xShape );
- ImpExportGluePoints( xShape );
- if(!bIsEmptyPresObj)
- ImpExportText( xShape );
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportRectangleShape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures, ::com::sun::star::awt::Point* pRefPoint)
-{
- const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- // Transformation
- ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
-
- // evtl. corner radius?
- sal_Int32 nCornerRadius(0L);
- xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("CornerRadius"))) >>= nCornerRadius;
- if(nCornerRadius)
- {
- OUStringBuffer sStringBuffer;
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, nCornerRadius);
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_CORNER_RADIUS, sStringBuffer.makeStringAndClear());
- }
-
- // write rectangle
- sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, XML_RECT, bCreateNewline, sal_True);
-
- ImpExportEvents( xShape );
- ImpExportGluePoints( xShape );
- ImpExportText( xShape );
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportLineShape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures, awt::Point* pRefPoint)
-{
- const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- OUString aStr;
- OUStringBuffer sStringBuffer;
- awt::Point aStart(0,0);
- awt::Point aEnd(1,1);
-
- // #85920# use 'Geometry' to get the points of the line
- // since this slot take anchor pos into account.
-
- // get matrix
- Matrix3D aMat;
- ImpExportNewTrans_GetMatrix3D(aMat, xPropSet);
-
- // decompose and correct about pRefPoint
- Vector2D aTRScale;
- double fTRShear(0.0);
- double fTRRotate(0.0);
- Vector2D aTRTranslate;
- ImpExportNewTrans_DecomposeAndRefPoint(aMat, aTRScale, fTRShear, fTRRotate, aTRTranslate, pRefPoint);
-
- // create base position
- awt::Point aBasePosition(FRound(aTRTranslate.X()), FRound(aTRTranslate.Y()));
-
- // get the two points
- uno::Any aAny(xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Geometry"))));
- drawing::PointSequenceSequence* pSourcePolyPolygon = (drawing::PointSequenceSequence*)aAny.getValue();
-
- if(pSourcePolyPolygon)
- {
- drawing::PointSequence* pOuterSequence = pSourcePolyPolygon->getArray();
- if(pOuterSequence)
- {
- drawing::PointSequence* pInnerSequence = pOuterSequence++;
- if(pInnerSequence)
- {
- awt::Point* pArray = pInnerSequence->getArray();
- if(pArray)
- {
- if(pInnerSequence->getLength() > 0)
- {
- aStart = awt::Point(
- pArray->X + aBasePosition.X,
- pArray->Y + aBasePosition.Y);
- pArray++;
- }
-
- if(pInnerSequence->getLength() > 1)
- {
- aEnd = awt::Point(
- pArray->X + aBasePosition.X,
- pArray->Y + aBasePosition.Y);
- }
- }
- }
- }
- }
-
- if( nFeatures & SEF_EXPORT_X )
- {
- // svg: x1
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, aStart.X);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_X1, aStr);
- }
- else
- {
- aEnd.X -= aStart.X;
- }
-
- if( nFeatures & SEF_EXPORT_Y )
- {
- // svg: y1
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, aStart.Y);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_Y1, aStr);
- }
- else
- {
- aEnd.Y -= aStart.Y;
- }
-
- // svg: x2
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, aEnd.X);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_X2, aStr);
-
- // svg: y2
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, aEnd.Y);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_Y2, aStr);
-
- // write line
- sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, XML_LINE, bCreateNewline, sal_True);
-
- ImpExportEvents( xShape );
- ImpExportGluePoints( xShape );
- ImpExportText( xShape );
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportEllipseShape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures, awt::Point* pRefPoint)
-{
- const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- // get size to decide between Circle and Ellipse
- awt::Size aSize = xShape->getSize();
- sal_Int32 nRx((aSize.Width + 1) / 2);
- sal_Int32 nRy((aSize.Height + 1) / 2);
- BOOL bCircle(nRx == nRy);
-
- // Transformation
- ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
-
- drawing::CircleKind eKind = drawing::CircleKind_FULL;
- xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CircleKind")) ) >>= eKind;
- if( eKind != drawing::CircleKind_FULL )
- {
- OUStringBuffer sStringBuffer;
- sal_Int32 nStartAngle;
- sal_Int32 nEndAngle;
- xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CircleStartAngle")) ) >>= nStartAngle;
- xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CircleEndAngle")) ) >>= nEndAngle;
-
- const double dStartAngle = nStartAngle / 100.0;
- const double dEndAngle = nEndAngle / 100.0;
-
- // export circle kind
- SvXMLUnitConverter::convertEnum( sStringBuffer, (USHORT)eKind, aXML_CircleKind_EnumMap );
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_KIND, sStringBuffer.makeStringAndClear() );
-
- // export start angle
- SvXMLUnitConverter::convertDouble( sStringBuffer, dStartAngle );
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_START_ANGLE, sStringBuffer.makeStringAndClear() );
-
- // export end angle
- SvXMLUnitConverter::convertDouble( sStringBuffer, dEndAngle );
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_END_ANGLE, sStringBuffer.makeStringAndClear() );
- }
-
- sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
-
- if(bCircle)
- {
- // write circle
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, XML_CIRCLE, bCreateNewline, sal_True);
-
- ImpExportEvents( xShape );
- ImpExportGluePoints( xShape );
- ImpExportText( xShape );
- }
- else
- {
- // write ellipse
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, XML_ELLIPSE, bCreateNewline, sal_True);
-
- ImpExportEvents( xShape );
- ImpExportGluePoints( xShape );
- ImpExportText( xShape );
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportPolygonShape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures, awt::Point* pRefPoint)
-{
- const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- BOOL bClosed(eShapeType == XmlShapeTypeDrawPolyPolygonShape
- || eShapeType == XmlShapeTypeDrawClosedBezierShape);
- BOOL bBezier(eShapeType == XmlShapeTypeDrawClosedBezierShape
- || eShapeType == XmlShapeTypeDrawOpenBezierShape);
-
- // get matrix
- Matrix3D aMat;
- ImpExportNewTrans_GetMatrix3D(aMat, xPropSet);
-
- // decompose and correct abour pRefPoint
- Vector2D aTRScale;
- double fTRShear(0.0);
- double fTRRotate(0.0);
- Vector2D aTRTranslate;
- ImpExportNewTrans_DecomposeAndRefPoint(aMat, aTRScale, fTRShear, fTRRotate, aTRTranslate, pRefPoint);
-
- // use features and write
- ImpExportNewTrans_FeaturesAndWrite(aTRScale, fTRShear, fTRRotate, aTRTranslate, nFeatures);
-
- // create and export ViewBox
- awt::Point aPoint(0, 0);
- awt::Size aSize(FRound(aTRScale.X()), FRound(aTRScale.Y()));
- SdXMLImExViewBox aViewBox(0, 0, aSize.Width, aSize.Height);
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_VIEWBOX, aViewBox.GetExportString(rExport.GetMM100UnitConverter()));
-
- sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
-
- if(bBezier)
- {
- // get PolygonBezier
- uno::Any aAny( xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Geometry"))) );
- drawing::PolyPolygonBezierCoords* pSourcePolyPolygon =
- (drawing::PolyPolygonBezierCoords*)aAny.getValue();
-
- if(pSourcePolyPolygon && pSourcePolyPolygon->Coordinates.getLength())
- {
- sal_Int32 nOuterCnt(pSourcePolyPolygon->Coordinates.getLength());
- drawing::PointSequence* pOuterSequence = pSourcePolyPolygon->Coordinates.getArray();
- drawing::FlagSequence* pOuterFlags = pSourcePolyPolygon->Flags.getArray();
-
- if(pOuterSequence && pOuterFlags)
- {
- // prepare svx:d element export
- SdXMLImExSvgDElement aSvgDElement(aViewBox);
-
- for(sal_Int32 a(0L); a < nOuterCnt; a++)
- {
- drawing::PointSequence* pSequence = pOuterSequence++;
- drawing::FlagSequence* pFlags = pOuterFlags++;
-
- if(pSequence && pFlags)
- {
- aSvgDElement.AddPolygon(pSequence, pFlags,
- aPoint, aSize, rExport.GetMM100UnitConverter(), bClosed);
- }
- }
-
- // write point array
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_D, aSvgDElement.GetExportString());
- }
-
- // write object now
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, XML_PATH, bCreateNewline, sal_True);
-
- ImpExportEvents( xShape );
- ImpExportGluePoints( xShape );
- ImpExportText( xShape );
- }
- }
- else
- {
- // get non-bezier polygon
- uno::Any aAny( xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Geometry"))) );
- drawing::PointSequenceSequence* pSourcePolyPolygon = (drawing::PointSequenceSequence*)aAny.getValue();
-
- if(pSourcePolyPolygon && pSourcePolyPolygon->getLength())
- {
- sal_Int32 nOuterCnt(pSourcePolyPolygon->getLength());
-
- if(1L == nOuterCnt && !bBezier)
- {
- // simple polygon shape, can be written as svg:points sequence
- drawing::PointSequence* pSequence = pSourcePolyPolygon->getArray();
- if(pSequence)
- {
- SdXMLImExPointsElement aPoints(pSequence, aViewBox, aPoint, aSize, rExport.GetMM100UnitConverter(),
- // #96328#
- bClosed);
-
- // write point array
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_POINTS, aPoints.GetExportString());
- }
-
- // write object now
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW,
- bClosed ? XML_POLYGON : XML_POLYLINE , bCreateNewline, sal_True);
-
- ImpExportEvents( xShape );
- ImpExportGluePoints( xShape );
- ImpExportText( xShape );
- }
- else
- {
- // polypolygon or bezier, needs to be written as a svg:path sequence
- drawing::PointSequence* pOuterSequence = pSourcePolyPolygon->getArray();
- if(pOuterSequence)
- {
- // prepare svx:d element export
- SdXMLImExSvgDElement aSvgDElement(aViewBox);
-
- for(sal_Int32 a(0L); a < nOuterCnt; a++)
- {
- drawing::PointSequence* pSequence = pOuterSequence++;
- if(pSequence)
- {
- aSvgDElement.AddPolygon(pSequence, 0L, aPoint,
- aSize, rExport.GetMM100UnitConverter(), bClosed);
- }
- }
-
- // write point array
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_D, aSvgDElement.GetExportString());
- }
-
- // write object now
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, XML_PATH, bCreateNewline, sal_True);
-
- ImpExportEvents( xShape );
- ImpExportGluePoints( xShape );
- ImpExportText( xShape );
- }
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportGraphicObjectShape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures, awt::Point* pRefPoint)
-{
- const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- sal_Bool bIsEmptyPresObj = sal_False;
- uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
-
- // Transformation
- ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
-
- OUString sImageURL;
-
- if(eShapeType == XmlShapeTypePresGraphicObjectShape)
- bIsEmptyPresObj = ImpExportPresentationAttributes( xPropSet, GetXMLToken(XML_PRESENTATION_GRAPHIC) );
-
- if( !bIsEmptyPresObj )
- {
- OUString aStreamURL;
- OUString aStr;
-
- xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicURL"))) >>= sImageURL;
- aStr = rExport.AddEmbeddedGraphicObject( sImageURL );
- rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, aStr );
-
- if( aStr.getLength() )
- {
- if( aStr[ 0 ] == '#' )
- {
- aStreamURL = OUString::createFromAscii( "vnd.sun.star.Package:" );
- aStreamURL = aStreamURL.concat( aStr.copy( 1, aStr.getLength() - 1 ) );
- }
-
- // update stream URL for load on demand
- uno::Any aAny;
- aAny <<= aStreamURL;
- xPropSet->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicStreamURL")), aAny );
-
- rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
-
- rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED );
-
- rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD );
- }
- }
-
- // write graphic object
- sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, XML_IMAGE, bCreateNewline, sal_True);
-
- if( sImageURL.getLength() )
- {
- // optional office:binary-data
- rExport.AddEmbeddedGraphicObjectAsBase64( sImageURL );
- }
-
- ImpExportEvents( xShape );
- ImpExportGluePoints( xShape );
- ImpExportText( xShape );
-
- // image map
- GetExport().GetImageMapExport().Export( xPropSet );
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportChartShape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures, awt::Point* pRefPoint)
-{
- ImpExportOLE2Shape( xShape, eShapeType, nFeatures, pRefPoint );
-/*
- // Transformation
- ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
-
- uno::Reference< chart::XChartDocument > xChartDoc;
- if( !bIsEmptyPresObj )
- xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Model") ) ) >>= xChartDoc;
-
- if( xChartDoc.is() )
- {
- // export chart data if the flag is not set (default)
- sal_Bool bExportOwnData = ( nFeatures & SEF_EXPORT_NO_CHART_DATA ) == 0;
- rExport.GetChartExport()->exportChart( xChartDoc, bExportOwnData );
- }
- else
- {
- // write chart object (fake for now, replace later)
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_CHART, XML_CHART, sal_True, sal_True);
- }
- }
-*/
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportSpreadsheetShape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures /* = SEF_DEFAULT */, awt::Point* pRefPoint /* = NULL */)
-{
- ImpExportOLE2Shape( xShape, eShapeType, nFeatures, pRefPoint );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportControlShape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures, awt::Point* pRefPoint)
-{
- const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- // Transformation
- ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
- }
-
- uno::Reference< drawing::XControlShape > xControl( xShape, uno::UNO_QUERY );
- DBG_ASSERT( xControl.is(), "Control shape is not supporting XControlShape" );
- if( xControl.is() )
- {
- uno::Reference< beans::XPropertySet > xControlModel( xControl->getControl(), uno::UNO_QUERY );
- DBG_ASSERT( xControlModel.is(), "Control shape has not XControlModel" );
- if( xControlModel.is() )
- {
- rExport.AddAttribute( XML_NAMESPACE_FORM, XML_ID, rExport.GetFormExport()->getControlId( xControlModel ) );
- }
- }
-
- sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, XML_CONTROL, bCreateNewline, sal_True);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportConnectorShape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures /* = SEF_DEFAULT */, awt::Point* pRefPoint /* = NULL */)
-{
- uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY );
-
- OUString aStr;
- OUStringBuffer sStringBuffer;
-
- // export connection kind
- drawing::ConnectorType eType = drawing::ConnectorType_STANDARD;
- uno::Any aAny = xProps->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("EdgeKind")));
- aAny >>= eType;
-
- if( eType != drawing::ConnectorType_STANDARD )
- {
- SvXMLUnitConverter::convertEnum( sStringBuffer, (sal_uInt16)eType, aXML_ConnectionKind_EnumMap );
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_TYPE, aStr);
- }
-
- // export line skew
- sal_Int32 nDelta1 = 0, nDelta2 = 0, nDelta3 = 0;
-
- aAny = xProps->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("EdgeLine1Delta")));
- aAny >>= nDelta1;
- aAny = xProps->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("EdgeLine2Delta")));
- aAny >>= nDelta2;
- aAny = xProps->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("EdgeLine3Delta")));
- aAny >>= nDelta3;
-
- if( nDelta1 != 0 || nDelta2 != 0 || nDelta3 != 0 )
- {
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, nDelta1);
- if( nDelta2 != 0 || nDelta3 != 0 )
- {
- const char aSpace = ' ';
- sStringBuffer.appendAscii( &aSpace, 1 );
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, nDelta2);
- if( nDelta3 != 0 )
- {
- sStringBuffer.appendAscii( &aSpace, 1 );
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, nDelta3);
- }
- }
-
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_LINE_SKEW, aStr);
- }
-
- // export start and end point
- awt::Point aStart(0,0);
- awt::Point aEnd(1,1);
-
- xProps->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("StartPosition"))) >>= aStart;
- xProps->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("EndPosition"))) >>= aEnd;
-
- if( pRefPoint )
- {
- aStart.X -= pRefPoint->X;
- aStart.Y -= pRefPoint->Y;
- aEnd.X -= pRefPoint->X;
- aEnd.Y -= pRefPoint->Y;
- }
-
- if( nFeatures & SEF_EXPORT_X )
- {
- // svg: x1
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, aStart.X);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_X1, aStr);
- }
- else
- {
- aEnd.X -= aStart.X;
- }
-
- if( nFeatures & SEF_EXPORT_Y )
- {
- // svg: y1
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, aStart.Y);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_Y1, aStr);
- }
- else
- {
- aEnd.Y -= aStart.Y;
- }
-
- // svg: x2
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, aEnd.X);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_X2, aStr);
-
- // svg: y2
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, aEnd.Y);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_Y2, aStr);
-
- uno::Reference< drawing::XShape > xTempShape;
-
- // export start connection
- aAny = xProps->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("StartShape") ) );
- if( aAny >>= xTempShape )
- {
- sal_Int32 nShapeId = rExport.GetShapeExport()->getShapeId( xTempShape );
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_START_SHAPE, OUString::valueOf( nShapeId ));
-
- aAny = xProps->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("StartGluePointIndex")) );
- sal_Int32 nGluePointId;
- if( aAny >>= nGluePointId )
- {
- if( nGluePointId != -1 )
- {
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_START_GLUE_POINT, OUString::valueOf( nGluePointId ));
- }
- }
- }
-
- // export end connection
- aAny = xProps->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("EndShape")) );
- if( aAny >>= xTempShape )
- {
-
- sal_Int32 nShapeId = rExport.GetShapeExport()->getShapeId( xTempShape );
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_END_SHAPE, OUString::valueOf( nShapeId ));
-
- aAny = xProps->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("EndGluePointIndex")) );
- sal_Int32 nGluePointId;
- if( aAny >>= nGluePointId )
- {
- if( nGluePointId != -1 )
- {
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_END_GLUE_POINT, OUString::valueOf( nGluePointId ));
- }
- }
- }
-
- // write connector shape. Add Export later.
- sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, XML_CONNECTOR, bCreateNewline, sal_True);
-
- ImpExportEvents( xShape );
- ImpExportGluePoints( xShape );
- ImpExportText( xShape );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportMeasureShape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures /* = SEF_DEFAULT */, awt::Point* pRefPoint /* = NULL */)
-{
- uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY );
-
- OUString aStr;
- OUStringBuffer sStringBuffer;
-
- // export start and end point
- awt::Point aStart(0,0);
- awt::Point aEnd(1,1);
-
- uno::Any aAny = xProps->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("StartPosition")));
- aAny >>= aStart;
-
- aAny = xProps->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("EndPosition")));
- aAny >>= aEnd;
-
- if( pRefPoint )
- {
- aStart.X -= pRefPoint->X;
- aStart.Y -= pRefPoint->Y;
- aEnd.X -= pRefPoint->X;
- aEnd.Y -= pRefPoint->Y;
- }
-
- if( nFeatures & SEF_EXPORT_X )
- {
- // svg: x1
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, aStart.X);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_X1, aStr);
- }
- else
- {
- aEnd.X -= aStart.X;
- }
-
- if( nFeatures & SEF_EXPORT_Y )
- {
- // svg: y1
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, aStart.Y);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_Y1, aStr);
- }
- else
- {
- aEnd.Y -= aStart.Y;
- }
-
- // svg: x2
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, aEnd.X);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_X2, aStr);
-
- // svg: y2
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, aEnd.Y);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_Y2, aStr);
-
- // write measure shape
- sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, XML_MEASURE, bCreateNewline, sal_True);
-
- ImpExportEvents( xShape );
- ImpExportGluePoints( xShape );
-
- uno::Reference< text::XText > xText( xShape, uno::UNO_QUERY );
- if( xText.is() )
- rExport.GetTextParagraphExport()->exportText( xText );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportOLE2Shape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures /* = SEF_DEFAULT */, awt::Point* pRefPoint /* = NULL */)
-{
- uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
- uno::Reference< container::XNamed > xNamed(xShape, uno::UNO_QUERY);
-
- DBG_ASSERT( xPropSet.is() && xNamed.is(), "ole shape is not implementing needed interfaces");
- if(xPropSet.is() && xNamed.is())
- {
- // Transformation
- ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
-
- sal_Bool bIsEmptyPresObj = sal_False;
-
- // presentation settings
- if(eShapeType == XmlShapeTypePresOLE2Shape)
- bIsEmptyPresObj = ImpExportPresentationAttributes( xPropSet, GetXMLToken(XML_PRESENTATION_OBJECT) );
- else if(eShapeType == XmlShapeTypePresChartShape)
- bIsEmptyPresObj = ImpExportPresentationAttributes( xPropSet, GetXMLToken(XML_PRESENTATION_CHART) );
- else if(eShapeType == XmlShapeTypePresTableShape)
- bIsEmptyPresObj = ImpExportPresentationAttributes( xPropSet, GetXMLToken(XML_PRESENTATION_TABLE) );
-
- OUString sClassId;
- sal_Bool bInternal;
- xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("IsInternal"))) >>= bInternal;
-
- sal_Bool bExportEmbedded(0 != (rExport.getExportFlags() & EXPORT_EMBEDDED));
-
- OUString sURL;
- OUString sPersistName;
-
- if( !bIsEmptyPresObj )
- {
- xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "PersistName" ) ) ) >>= sPersistName;
- if( sPersistName.getLength() )
- {
- sURL = OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.EmbeddedObject:" ) );
- sURL += sPersistName;
- }
-
- if( !bInternal )
- xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("CLSID"))) >>= sClassId;
-
- if( sClassId.getLength() )
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_CLASS_ID, sClassId );
- }
-
- if( !bIsEmptyPresObj )
- {
- if(!bExportEmbedded)
- {
- // xlink:href
- if( sURL.getLength() )
- {
- // #96717# in theorie, if we don't have a url we shouldn't even
- // export this ole shape. But practical its to risky right now
- // to change this so we better dispose this on load
- sURL = rExport.AddEmbeddedObject( sURL );
-
- rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, sURL );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD );
- }
- }
- }
-
- sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
- enum XMLTokenEnum eElem = sClassId.getLength() ? XML_OBJECT_OLE : XML_OBJECT;
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_DRAW, eElem, bCreateNewline, sal_True );
-
- ImpExportEvents( xShape );
- ImpExportGluePoints( xShape );
-
- if(bExportEmbedded && !bIsEmptyPresObj)
- {
- // #100592#
- if(bInternal)
- {
- // embedded XML
- uno::Reference< lang::XComponent > xComp;
- xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Model") ) ) >>= xComp;
- DBG_ASSERT( xComp.is(), "no xModel for own OLE format" );
- rExport.ExportEmbeddedOwnObject( xComp );
- }
- else
- {
- // embed as Base64
- rExport.AddEmbeddedObjectAsBase64( sURL );
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportPageShape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures /* = SEF_DEFAULT */, awt::Point* pRefPoint /* = NULL */)
-{
- const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- // #86163# Transformation
- ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
-
- // export page number used for this page
- uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
- const OUString aPageNumberStr(RTL_CONSTASCII_USTRINGPARAM("PageNumber"));
- if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(aPageNumberStr))
- {
- sal_Int32 nPageNumber = 0;
- xPropSet->getPropertyValue(aPageNumberStr) >>= nPageNumber;
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_PAGE_NUMBER, OUString::valueOf(nPageNumber));
- }
-
- // a presentation page shape, normally used on notes pages only. If
- // it is used not as presentation shape, it may have been created with
- // copy-paste exchange between draw and impress (this IS possible...)
- if(eShapeType == XmlShapeTypePresPageShape)
- {
- rExport.AddAttribute(XML_NAMESPACE_PRESENTATION, XML_CLASS,
- XML_PRESENTATION_PAGE);
- }
-
- // write Page shape
- sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, XML_PAGE_THUMBNAIL, bCreateNewline, sal_True);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportCaptionShape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures /* = SEF_DEFAULT */, awt::Point* pRefPoint /* = NULL */)
-{
- const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- // Transformation
- ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
-
- // evtl. corner radius?
- sal_Int32 nCornerRadius(0L);
- xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("CornerRadius"))) >>= nCornerRadius;
- if(nCornerRadius)
- {
- OUStringBuffer sStringBuffer;
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, nCornerRadius);
- rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_CORNER_RADIUS, sStringBuffer.makeStringAndClear());
- }
-
- awt::Point aCaptionPoint;
- xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "CaptionPoint" ) ) ) >>= aCaptionPoint;
-
- rExport.GetMM100UnitConverter().convertMeasure(msBuffer, aCaptionPoint.X);
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CAPTION_POINT_X, msBuffer.makeStringAndClear() );
- rExport.GetMM100UnitConverter().convertMeasure(msBuffer, aCaptionPoint.Y);
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CAPTION_POINT_Y, msBuffer.makeStringAndClear() );
-
- // write Caption shape. Add export later.
- sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, XML_CAPTION, bCreateNewline, sal_True);
-
- ImpExportEvents( xShape );
- ImpExportGluePoints( xShape );
- ImpExportText( xShape );
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportFrameShape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures, ::com::sun::star::awt::Point* pRefPoint)
-{
- const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- // Transformation
- ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
-
- // export frame url
- OUString aStr;
- xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "FrameURL" ) ) ) >>= aStr;
- rExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference(aStr) );
- rExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
- rExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED );
- rExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD );
-
- // export name
- xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "FrameName" ) ) ) >>= aStr;
- if( aStr.getLength() )
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_FRAME_NAME, aStr );
-
- // write floating frame
- sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, XML_FLOATING_FRAME, bCreateNewline, sal_True);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportAppletShape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures, ::com::sun::star::awt::Point* pRefPoint)
-{
- const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- // Transformation
- ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
-
- // export frame url
- OUString aStr;
- xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletCodeBase" ) ) ) >>= aStr;
- rExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference(aStr) );
- rExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
- rExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED );
- rExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD );
-
- // export draw:applet-name
- xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletName" ) ) ) >>= aStr;
- if( aStr.getLength() )
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_APPLET_NAME, aStr );
-
- // export draw:code
- xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletCode" ) ) ) >>= aStr;
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CODE, aStr );
-
- // export draw:may-script
- sal_Bool bIsScript;
- xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletIsScript" ) ) ) >>= bIsScript;
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_MAY_SCRIPT, bIsScript ? XML_TRUE : XML_FALSE );
-
- // write applet
- sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, XML_APPLET, bCreateNewline, sal_True);
-
- // export parameters
- uno::Sequence< beans::PropertyValue > aCommands;
- xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletCommands" ) ) ) >>= aCommands;
- const sal_Int32 nCount = aCommands.getLength();
- for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
- {
- aCommands[nIndex].Value >>= aStr;
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, aCommands[nIndex].Name );
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_VALUE, aStr );
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_DRAW, XML_PARAM, sal_False, sal_True );
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExportPluginShape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures, ::com::sun::star::awt::Point* pRefPoint)
-{
- const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- // Transformation
- ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
-
- // export plugin url
- OUString aStr;
- xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "PluginURL" ) ) ) >>= aStr;
- rExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference(aStr) );
- rExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
- rExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED );
- rExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD );
-
-
- // export mime-type
- xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "PluginMimeType" ) ) ) >>= aStr;
- if(aStr.getLength())
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_MIME_TYPE, aStr );
-
- // write plugin
- sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DRAW, XML_PLUGIN, bCreateNewline, sal_True);
-
- // export parameters
- uno::Sequence< beans::PropertyValue > aCommands;
- xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "PluginCommands" ) ) ) >>= aCommands;
- const sal_Int32 nCount = aCommands.getLength();
- for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
- {
- aCommands[nIndex].Value >>= aStr;
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, aCommands[nIndex].Name );
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_VALUE, aStr );
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_DRAW, XML_PARAM, sal_False, sal_True );
- }
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_shapeexport3.cxx b/binfilter/bf_xmloff/source/draw/xmloff_shapeexport3.cxx
deleted file mode 100644
index 4f315b0819ab..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_shapeexport3.cxx
+++ /dev/null
@@ -1,504 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <bf_goodies/hmatrix.hxx>
-
-
-#include <com/sun/star/drawing/PolyPolygonShape3D.hpp>
-
-#include <com/sun/star/drawing/ProjectionMode.hpp>
-
-#include <com/sun/star/drawing/ShadeMode.hpp>
-
-
-
-#include <com/sun/star/drawing/CameraGeometry.hpp>
-
-#include <com/sun/star/drawing/DoubleSequence.hpp>
-
-
-
-#include <tools/debug.hxx>
-
-
-#include "xmlexp.hxx"
-
-#include "xmluconv.hxx"
-
-#include "xexptran.hxx"
-
-
-#include "xmlnmspe.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-//////////////////////////////////////////////////////////////////////////////
-
-inline sal_Int32 FRound( double fVal )
-{
- return( fVal > 0.0 ? (sal_Int32) ( fVal + 0.5 ) : -(sal_Int32) ( -fVal + 0.5 ) );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExport3DSceneShape( const uno::Reference< drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures, awt::Point* pRefPoint)
-{
- uno::Reference< drawing::XShapes > xShapes(xShape, uno::UNO_QUERY);
- if(xShapes.is() && xShapes->getCount())
- {
- uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY );
- DBG_ASSERT( xPropSet.is(), "XMLShapeExport::ImpExport3DSceneShape can't export a scene without a propertyset" );
- if( xPropSet.is() )
- {
- // Transformation
- ImpExportNewTrans(xPropSet, nFeatures, pRefPoint);
-
- // 3d attributes
- export3DSceneAttributes( xPropSet );
-
- // write 3DScene shape
- sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
- SvXMLElementExport aOBJ( rExport, XML_NAMESPACE_DR3D, XML_SCENE, bCreateNewline, sal_True);
-
- ImpExportEvents( xShape );
-
- // write 3DSceneLights
- export3DLamps( xPropSet );
-
- // #89764# if export of position is supressed for group shape,
- // positions of contained objects should be written relative to
- // the upper left edge of the group.
- awt::Point aUpperLeft;
-
- if(!(nFeatures & SEF_EXPORT_POSITION))
- {
- nFeatures |= SEF_EXPORT_POSITION;
- aUpperLeft = xShape->getPosition();
- pRefPoint = &aUpperLeft;
- }
-
- // write members
- exportShapes( xShapes, nFeatures, pRefPoint );
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeExport::ImpExport3DShape(
- const uno::Reference< drawing::XShape >& xShape,
- XmlShapeType eShapeType, sal_Int32 nFeatures /* = SEF_DEFAULT */, awt::Point* pRefPoint /* = NULL */)
-{
- const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- OUString aStr;
- OUStringBuffer sStringBuffer;
-
- // transformation (UNO_NAME_3D_TRANSFORM_MATRIX == "D3DTransformMatrix")
- uno::Any aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DTransformMatrix")));
- drawing::HomogenMatrix xHomMat;
- aAny >>= xHomMat;
- SdXMLImExTransform3D aTransform;
- aTransform.AddHomogenMatrix(xHomMat);
- if(aTransform.NeedsAction())
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_TRANSFORM, aTransform.GetExportString(rExport.GetMM100UnitConverter()));
-
- switch(eShapeType)
- {
- case XmlShapeTypeDraw3DCubeObject:
- {
- // write 3DCube shape
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DR3D, XML_CUBE, sal_True, sal_True);
-
- // minEdge
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DPosition")));
- drawing::Position3D aPosition3D;
- aAny >>= aPosition3D;
- Vector3D aPos3D(aPosition3D.PositionX, aPosition3D.PositionY, aPosition3D.PositionZ);
-
- // maxEdge
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSize")));
- drawing::Direction3D aDirection3D;
- aAny >>= aDirection3D;
- Vector3D aDir3D(aDirection3D.DirectionX, aDirection3D.DirectionY, aDirection3D.DirectionZ);
-
- // transform maxEdge from distance to pos
- aDir3D = aPos3D + aDir3D;
-
- // write minEdge
- if(aPos3D != Vector3D(-2500.0, -2500.0, -2500.0)) // write only when not default
- {
- rExport.GetMM100UnitConverter().convertVector3D(sStringBuffer, aPos3D);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_MIN_EDGE, aStr);
- }
-
- // write maxEdge
- if(aDir3D != Vector3D(2500.0, 2500.0, 2500.0)) // write only when not default
- {
- rExport.GetMM100UnitConverter().convertVector3D(sStringBuffer, aDir3D);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_MAX_EDGE, aStr);
- }
-
- break;
- }
- case XmlShapeTypeDraw3DSphereObject:
- {
- // write 3DSphere shape
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DR3D, XML_SPHERE, sal_True, sal_True);
-
- // Center
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DPosition")));
- drawing::Position3D aPosition3D;
- aAny >>= aPosition3D;
- Vector3D aPos3D(aPosition3D.PositionX, aPosition3D.PositionY, aPosition3D.PositionZ);
-
- // Size
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSize")));
- drawing::Direction3D aDirection3D;
- aAny >>= aDirection3D;
- Vector3D aDir3D(aDirection3D.DirectionX, aDirection3D.DirectionY, aDirection3D.DirectionZ);
-
- // write Center
- if(aPos3D != Vector3D(0.0, 0.0, 0.0)) // write only when not default
- {
- rExport.GetMM100UnitConverter().convertVector3D(sStringBuffer, aPos3D);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_CENTER, aStr);
- }
-
- // write Size
- if(aDir3D != Vector3D(5000.0, 5000.0, 5000.0)) // write only when not default
- {
- rExport.GetMM100UnitConverter().convertVector3D(sStringBuffer, aDir3D);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_SIZE, aStr);
- }
-
- break;
- }
- case XmlShapeTypeDraw3DLatheObject:
- case XmlShapeTypeDraw3DExtrudeObject:
- {
- // write special 3DLathe/3DExtrude attributes
- uno::Any aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DPolyPolygon3D")));
- drawing::PolyPolygonShape3D xPolyPolygon3D;
- aAny >>= xPolyPolygon3D;
-
- // look for maximal values
- double fXMin, fXMax, fYMin, fYMax;
- BOOL bInit(FALSE);
- sal_Int32 nOuterSequenceCount(xPolyPolygon3D.SequenceX.getLength());
- drawing::DoubleSequence* pInnerSequenceX = xPolyPolygon3D.SequenceX.getArray();
- drawing::DoubleSequence* pInnerSequenceY = xPolyPolygon3D.SequenceY.getArray();
- sal_Int32 a;
-
- for(a = 0L; a < nOuterSequenceCount; a++)
- {
- sal_Int32 nInnerSequenceCount(pInnerSequenceX->getLength());
- double* pArrayX = pInnerSequenceX->getArray();
- double* pArrayY = pInnerSequenceY->getArray();
-
- for(sal_Int32 b(0L); b < nInnerSequenceCount; b++)
- {
- double fX = *pArrayX++;
- double fY = *pArrayY++;
-
- if(bInit)
- {
- if(fX > fXMax)
- fXMax = fX;
-
- if(fX < fXMin)
- fXMin = fX;
-
- if(fY > fYMax)
- fYMax = fY;
-
- if(fY < fYMin)
- fYMin = fY;
- }
- else
- {
- fXMin = fXMax = fX;
- fYMin = fYMax = fY;
- bInit = TRUE;
- }
- }
-
- pInnerSequenceX++;
- pInnerSequenceY++;
- }
-
- // export ViewBox
- awt::Point aMinPoint(FRound(fXMin), FRound(fYMin));
- awt::Size aMaxSize(FRound(fXMax) - aMinPoint.X, FRound(fYMax) - aMinPoint.Y);
- SdXMLImExViewBox aViewBox(
- aMinPoint.X, aMinPoint.Y, aMaxSize.Width, aMaxSize.Height);
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_VIEWBOX,
- aViewBox.GetExportString(rExport.GetMM100UnitConverter()));
-
- // prepare svx:d element export
- SdXMLImExSvgDElement aSvgDElement(aViewBox);
- pInnerSequenceX = xPolyPolygon3D.SequenceX.getArray();
- pInnerSequenceY = xPolyPolygon3D.SequenceY.getArray();
-
- for(a = 0L; a < nOuterSequenceCount; a++)
- {
- sal_Int32 nInnerSequenceCount(pInnerSequenceX->getLength());
- double* pArrayX = pInnerSequenceX->getArray();
- double* pArrayY = pInnerSequenceY->getArray();
- drawing::PointSequence aPoly(nInnerSequenceCount);
- awt::Point* pInnerSequence = aPoly.getArray();
-
- for(sal_Int32 b(0L); b < nInnerSequenceCount; b++)
- {
- double fX = *pArrayX++;
- double fY = *pArrayY++;
-
- *pInnerSequence = awt::Point(FRound(fX), FRound(fY));
- pInnerSequence++;
- }
-
- // calculate closed flag
- awt::Point* pFirst = aPoly.getArray();
- awt::Point* pLast = pFirst + (nInnerSequenceCount - 1);
- BOOL bClosed = (pFirst->X == pLast->X && pFirst->Y == pLast->Y);
-
- aSvgDElement.AddPolygon(&aPoly, 0L, aMinPoint,
- aMaxSize, rExport.GetMM100UnitConverter(), bClosed);
-
- // #80594# corrected error in PolyPolygon3D export for 3D XML
- pInnerSequenceX++;
- pInnerSequenceY++;
- }
-
- // write point array
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_D, aSvgDElement.GetExportString());
-
- if(eShapeType == XmlShapeTypeDraw3DLatheObject)
- {
- // write 3DLathe shape
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DR3D, XML_ROTATE, sal_True, sal_True);
- }
- else
- {
- // write 3DExtrude shape
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DR3D, XML_EXTRUDE, sal_True, sal_True);
- }
- break;
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-/** helper for chart that adds all attributes of a 3d scene element to the export */
-void XMLShapeExport::export3DSceneAttributes( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xPropSet )
-{
- OUString aStr;
- OUStringBuffer sStringBuffer;
-
- // world transformation (UNO_NAME_3D_TRANSFORM_MATRIX == "D3DTransformMatrix")
- uno::Any aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DTransformMatrix")));
- drawing::HomogenMatrix xHomMat;
- aAny >>= xHomMat;
- SdXMLImExTransform3D aTransform;
- aTransform.AddHomogenMatrix(xHomMat);
- if(aTransform.NeedsAction())
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_TRANSFORM, aTransform.GetExportString(rExport.GetMM100UnitConverter()));
-
- // VRP, VPN, VUP
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DCameraGeometry")));
- drawing::CameraGeometry aCamGeo;
- aAny >>= aCamGeo;
-
- Vector3D aVRP(aCamGeo.vrp.PositionX, aCamGeo.vrp.PositionY, aCamGeo.vrp.PositionZ);
- if(aVRP != Vector3D(0.0, 0.0, 1.0)) // write only when not default
- {
- rExport.GetMM100UnitConverter().convertVector3D(sStringBuffer, aVRP);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_VRP, aStr);
- }
-
- Vector3D aVPN(aCamGeo.vpn.DirectionX, aCamGeo.vpn.DirectionY, aCamGeo.vpn.DirectionZ);
- if(aVPN != Vector3D(0.0, 0.0, 1.0)) // write only when not default
- {
- rExport.GetMM100UnitConverter().convertVector3D(sStringBuffer, aVPN);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_VPN, aStr);
- }
-
- Vector3D aVUP(aCamGeo.vup.DirectionX, aCamGeo.vup.DirectionY, aCamGeo.vup.DirectionZ);
- if(aVUP != Vector3D(0.0, 1.0, 0.0)) // write only when not default
- {
- rExport.GetMM100UnitConverter().convertVector3D(sStringBuffer, aVUP);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_VUP, aStr);
- }
-
- // projection "D3DScenePerspective" drawing::ProjectionMode
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DScenePerspective")));
- drawing::ProjectionMode xPrjMode;
- aAny >>= xPrjMode;
- if(xPrjMode == drawing::ProjectionMode_PARALLEL)
- aStr = GetXMLToken(XML_PARALLEL);
- else
- aStr = GetXMLToken(XML_PERSPECTIVE);
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_PROJECTION, aStr);
-
- // distance
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneDistance")));
- sal_Int32 nDistance;
- aAny >>= nDistance;
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, nDistance);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_DISTANCE, aStr);
-
- // focalLength
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneFocalLength")));
- sal_Int32 nFocalLength;
- aAny >>= nFocalLength;
- rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, nFocalLength);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_FOCAL_LENGTH, aStr);
-
- // shadowSlant
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneShadowSlant")));
- sal_Int16 nShadowSlant;
- aAny >>= nShadowSlant;
- rExport.GetMM100UnitConverter().convertNumber(sStringBuffer, (sal_Int32)nShadowSlant);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_SHADOW_SLANT, aStr);
-
- // shadeMode
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneShadeMode")));
- drawing::ShadeMode xShadeMode;
- if(aAny >>= xShadeMode)
- {
- if(xShadeMode == drawing::ShadeMode_FLAT)
- aStr = GetXMLToken(XML_FLAT);
- else if(xShadeMode == drawing::ShadeMode_PHONG)
- aStr = GetXMLToken(XML_PHONG);
- else if(xShadeMode == drawing::ShadeMode_SMOOTH)
- aStr = GetXMLToken(XML_GOURAUD);
- else
- aStr = GetXMLToken(XML_DRAFT);
- }
- else
- {
- // ShadeMode enum not there, write default
- aStr = GetXMLToken(XML_GOURAUD);
- }
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_SHADE_MODE, aStr);
-
- // ambientColor
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneAmbientColor")));
- sal_Int32 aColTemp;
- Color aAmbientColor;
- aAny >>= aColTemp; aAmbientColor.SetColor(aColTemp);
- rExport.GetMM100UnitConverter().convertColor(sStringBuffer, aAmbientColor);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_AMBIENT_COLOR, aStr);
-
- // lightingMode
- aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneTwoSidedLighting")));
- sal_Bool bTwoSidedLighting;
- aAny >>= bTwoSidedLighting;
- rExport.GetMM100UnitConverter().convertBool(sStringBuffer, bTwoSidedLighting);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_LIGHTING_MODE, aStr);
-}
-
-/** helper for chart that exports all lamps from the propertyset */
-void XMLShapeExport::export3DLamps( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xPropSet )
-{
- // write lamps 1..8 as content
- OUString aStr;
- OUStringBuffer sStringBuffer;
-
- const OUString aColorPropName(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightColor") );
- const OUString aDirectionPropName(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightDirection") );
- const OUString aLightOnPropName(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightOn") );
-
- OUString aPropName;
- OUString aIndexStr;
- sal_Int32 aColTemp;
- Color aLightColor;
- Vector3D aLightDirection;
- drawing::Direction3D xLightDir;
- sal_Bool bLightOnOff;
- for(sal_Int32 nLamp = 1; nLamp <= 8; nLamp++)
- {
- aIndexStr = OUString::valueOf( nLamp );
-
- // lightcolor
- aPropName = aColorPropName;
- aPropName += aIndexStr;
- xPropSet->getPropertyValue( aPropName ) >>= aColTemp;
- aLightColor.SetColor(aColTemp);
- rExport.GetMM100UnitConverter().convertColor(sStringBuffer, aLightColor);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_DIFFUSE_COLOR, aStr);
-
- // lightdirection
- aPropName = aDirectionPropName;
- aPropName += aIndexStr;
- xPropSet->getPropertyValue(aPropName) >>= xLightDir;
- aLightDirection = Vector3D(xLightDir.DirectionX, xLightDir.DirectionY, xLightDir.DirectionZ);
- rExport.GetMM100UnitConverter().convertVector3D(sStringBuffer, aLightDirection);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_DIRECTION, aStr);
-
- // lighton
- aPropName = aLightOnPropName;
- aPropName += aIndexStr;
- xPropSet->getPropertyValue(aPropName) >>= bLightOnOff;
- rExport.GetMM100UnitConverter().convertBool(sStringBuffer, bLightOnOff);
- aStr = sStringBuffer.makeStringAndClear();
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_ENABLED, aStr);
-
- // specular
- rExport.AddAttribute(XML_NAMESPACE_DR3D, XML_SPECULAR,
- nLamp == 1 ? XML_TRUE : XML_FALSE);
-
- // write light entry
- SvXMLElementExport aOBJ(rExport, XML_NAMESPACE_DR3D, XML_LIGHT, sal_True, sal_True);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_shapeimport.cxx b/binfilter/bf_xmloff/source/draw/xmloff_shapeimport.cxx
deleted file mode 100644
index 545f7de010a8..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_shapeimport.cxx
+++ /dev/null
@@ -1,1092 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-
-#include <list>
-
-
-
-#include "xmlnmspe.hxx"
-
-
-#include "ximpstyl.hxx"
-
-
-#include "sdpropls.hxx"
-
-
-#include "ximp3dscene.hxx"
-
-#include "ximp3dobject.hxx"
-
-#include "ximpgrp.hxx"
-
-#include <map>
-#include <vector>
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::std;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-//////////////////////////////////////////////////////////////////////////////
-
-struct ltint32
-{
- bool operator()(const sal_Int32 p, sal_Int32 q) const
- {
- return p < q;
- }
-};
-
-typedef ::std::map<sal_Int32,com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >,ltint32> IdShapeMap;
-
-struct ConnectionHint
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxConnector;
- sal_Bool bStart;
- sal_Int32 nDestShapeId;
- sal_Int32 nDestGlueId;
-};
-
-struct XShapeCompareHelper
-{
- bool operator()( ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShape > x1,
- ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShape > x2 ) const
- {
- return x1.get() < x2.get();
- }
-};
-
-/** this map store all glue point id mappings for shapes that had user defined glue points. This
- is needed because on insertion the glue points will get a new and unique id */
-typedef ::std::map<sal_Int32,sal_Int32,ltint32> GluePointIdMap;
-typedef ::std::map< ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShape >, GluePointIdMap, XShapeCompareHelper > ShapeGluePointsMap;
-
-/** this struct is created for each startPage() call and stores information that is needed during
- import of shapes for one page. Since pages could be nested ( notes pages inside impress ) there
- is a pointer so one can build up a stack of this structs */
-struct XMLShapeImportPageContextImpl
-{
- ShapeGluePointsMap maShapeGluePointsMap;
-
- uno::Reference < drawing::XShapes > mxShapes;
-
- struct XMLShapeImportPageContextImpl* mpNext;
-};
-
-/** this class is to enable adding members to the XMLShapeImportHelper without getting incompatible */
-struct XMLShapeImportHelperImpl
-{
- // context for sorting shapes
- ShapeSortContext* mpSortContext;
-
- IdShapeMap maShapeIds;
-
- std::vector<ConnectionHint> maConnections;
-
- // #88546# possibility to swich progress bar handling on/off
- sal_Bool mbHandleProgressBar;
-
- // stores the capability of the current model to create presentation shapes
- sal_Bool mbIsPresentationShapesSupported;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-XMLShapeImportHelper::XMLShapeImportHelper(
- SvXMLImport& rImporter,
- const uno::Reference< frame::XModel>& rModel,
- SvXMLImportPropertyMapper *pExtMapper )
-: mxModel(rModel),
- mrImporter( rImporter ),
- mpPageContext(NULL),
-
- mpPropertySetMapper(0L),
- mpPresPagePropsMapper(0L),
- mpStylesContext(0L),
- mpAutoStylesContext(0L),
- mpGroupShapeElemTokenMap(0L),
- mp3DSceneShapeElemTokenMap(0L),
- mp3DObjectAttrTokenMap(0L),
- mp3DPolygonBasedAttrTokenMap(0L),
- mp3DCubeObjectAttrTokenMap(0L),
- mp3DSphereObjectAttrTokenMap(0L),
- mp3DSceneShapeAttrTokenMap(0L),
- mp3DLightAttrTokenMap(0L),
- mpPathShapeAttrTokenMap(0L),
- mpPolygonShapeAttrTokenMap(0L),
-/*
- mpShapeAttrTokenMap(0L),
- mpRectShapeAttrTokenMap(0L),
- mpLineShapeAttrTokenMap(0L),
- mpEllipseShapeAttrTokenMap(0L),
- mpTextBoxShapeAttrTokenMap(0L),
- mpControlShapeAttrTokenMap(0L),
- mpPageShapeAttrTokenMap(0L),
- mpGraphicObjectShapeAttrTokenMap(0L),
-*/
- msStartShape(RTL_CONSTASCII_USTRINGPARAM("StartShape")),
- msEndShape(RTL_CONSTASCII_USTRINGPARAM("EndShape")),
- msStartGluePointIndex(RTL_CONSTASCII_USTRINGPARAM("StartGluePointIndex")),
- msEndGluePointIndex(RTL_CONSTASCII_USTRINGPARAM("EndGluePointIndex"))
-{
- mpImpl = new XMLShapeImportHelperImpl();
- mpImpl->mpSortContext = 0;
-
- // #88546# init to FALSE
- mpImpl->mbHandleProgressBar = sal_False;
-
- mpSdPropHdlFactory = new XMLSdPropHdlFactory( rModel );
-
- // set lock to avoid deletion
- mpSdPropHdlFactory->acquire();
-
- // construct PropertySetMapper
- UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper(mpSdPropHdlFactory);
- mpPropertySetMapper = new SvXMLImportPropertyMapper( xMapper, rImporter );
- // set lock to avoid deletion
- mpPropertySetMapper->acquire();
-
- if( pExtMapper )
- {
- UniReference < SvXMLImportPropertyMapper > xExtMapper( pExtMapper );
- mpPropertySetMapper->ChainImportMapper( xExtMapper );
- }
-
- // chain text attributes
- mpPropertySetMapper->ChainImportMapper(XMLTextImportHelper::CreateParaExtPropMapper(rImporter));
-
-/*
- // chain form attributes
- const UniReference< SvXMLImportPropertyMapper> xFormMapper( rImporter.GetFormImport()->getStylePropertyMapper().get() );
- mpPropertySetMapper->ChainImportMapper(xFormMapper);
-*/
-
- // construct PresPagePropsMapper
- xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, mpSdPropHdlFactory);
- mpPresPagePropsMapper = new SvXMLImportPropertyMapper( xMapper, rImporter );
- if(mpPresPagePropsMapper)
- {
- // set lock to avoid deletion
- mpPresPagePropsMapper->acquire();
- }
-
- uno::Reference< lang::XServiceInfo > xInfo( rImporter.GetModel(), uno::UNO_QUERY );
- const OUString aSName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.PresentationDocument") );
- mpImpl->mbIsPresentationShapesSupported = xInfo.is() && xInfo->supportsService( aSName );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-XMLShapeImportHelper::~XMLShapeImportHelper()
-{
- DBG_ASSERT( mpImpl->maConnections.empty(), "XMLShapeImportHelper::restoreConnections() was not called!" );
-
- // cleanup factory, decrease refcount. Should lead to destruction.
- if(mpSdPropHdlFactory)
- {
- mpSdPropHdlFactory->release();
- mpSdPropHdlFactory = 0L;
- }
-
- // cleanup mapper, decrease refcount. Should lead to destruction.
- if(mpPropertySetMapper)
- {
- mpPropertySetMapper->release();
- mpPropertySetMapper = 0L;
- }
-
- // cleanup presPage mapper, decrease refcount. Should lead to destruction.
- if(mpPresPagePropsMapper)
- {
- mpPresPagePropsMapper->release();
- mpPresPagePropsMapper = 0L;
- }
-
- if(mpGroupShapeElemTokenMap) delete mpGroupShapeElemTokenMap;
-/*
- if(mpShapeAttrTokenMap) delete mpShapeAttrTokenMap;
- if(mpRectShapeAttrTokenMap) delete mpRectShapeAttrTokenMap;
- if(mpLineShapeAttrTokenMap) delete mpLineShapeAttrTokenMap;
- if(mpEllipseShapeAttrTokenMap) delete mpEllipseShapeAttrTokenMap;
- if(mpTextBoxShapeAttrTokenMap) delete mpTextBoxShapeAttrTokenMap;
- if(mpControlShapeAttrTokenMap) delete mpControlShapeAttrTokenMap;
- if(mpPageShapeAttrTokenMap) delete mpPageShapeAttrTokenMap;
- if(mpGraphicObjectShapeAttrTokenMap) delete mpGraphicObjectShapeAttrTokenMap;
-*/
- if(mpPolygonShapeAttrTokenMap) delete mpPolygonShapeAttrTokenMap;
- if(mpPathShapeAttrTokenMap) delete mpPathShapeAttrTokenMap;
- if(mp3DSceneShapeElemTokenMap) delete mp3DSceneShapeElemTokenMap;
- if(mp3DObjectAttrTokenMap) delete mp3DObjectAttrTokenMap;
- if(mp3DPolygonBasedAttrTokenMap) delete mp3DPolygonBasedAttrTokenMap;
- if(mp3DCubeObjectAttrTokenMap) delete mp3DCubeObjectAttrTokenMap;
- if(mp3DSphereObjectAttrTokenMap) delete mp3DSphereObjectAttrTokenMap;
- if(mp3DSceneShapeAttrTokenMap) delete mp3DSceneShapeAttrTokenMap;
- if(mp3DLightAttrTokenMap) delete mp3DLightAttrTokenMap;
-
- // Styles or AutoStyles context?
- if(mpStylesContext)
- {
- mpStylesContext->Clear();
- mpStylesContext->ReleaseRef();
- }
-
- if(mpAutoStylesContext)
- {
- mpAutoStylesContext->Clear();
- mpAutoStylesContext->ReleaseRef();
- }
-
- delete mpImpl;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-static __FAR_DATA SvXMLTokenMapEntry aGroupShapeElemTokenMap[] =
-{
- { XML_NAMESPACE_DRAW, XML_G, XML_TOK_GROUP_GROUP },
- { XML_NAMESPACE_DRAW, XML_RECT, XML_TOK_GROUP_RECT },
- { XML_NAMESPACE_DRAW, XML_LINE, XML_TOK_GROUP_LINE },
- { XML_NAMESPACE_DRAW, XML_CIRCLE, XML_TOK_GROUP_CIRCLE },
- { XML_NAMESPACE_DRAW, XML_ELLIPSE, XML_TOK_GROUP_ELLIPSE },
- { XML_NAMESPACE_DRAW, XML_POLYGON, XML_TOK_GROUP_POLYGON },
- { XML_NAMESPACE_DRAW, XML_POLYLINE, XML_TOK_GROUP_POLYLINE },
- { XML_NAMESPACE_DRAW, XML_PATH, XML_TOK_GROUP_PATH },
- { XML_NAMESPACE_DRAW, XML_TEXT_BOX, XML_TOK_GROUP_TEXT_BOX },
-
- { XML_NAMESPACE_DRAW, XML_CONTROL, XML_TOK_GROUP_CONTROL },
- { XML_NAMESPACE_DRAW, XML_CONNECTOR, XML_TOK_GROUP_CONNECTOR },
- { XML_NAMESPACE_DRAW, XML_MEASURE, XML_TOK_GROUP_MEASURE },
- { XML_NAMESPACE_DRAW, XML_PAGE_THUMBNAIL, XML_TOK_GROUP_PAGE },
- { XML_NAMESPACE_DRAW, XML_CAPTION, XML_TOK_GROUP_CAPTION },
-
- { XML_NAMESPACE_CHART, XML_CHART, XML_TOK_GROUP_CHART },
- { XML_NAMESPACE_DRAW, XML_IMAGE, XML_TOK_GROUP_IMAGE },
- { XML_NAMESPACE_DR3D, XML_SCENE, XML_TOK_GROUP_3DSCENE },
- { XML_NAMESPACE_DRAW, XML_OBJECT, XML_TOK_GROUP_OBJECT },
- { XML_NAMESPACE_DRAW, XML_OBJECT_OLE, XML_TOK_GROUP_OBJECT_OLE },
-
- { XML_NAMESPACE_DRAW, XML_PLUGIN, XML_TOK_GROUP_PLUGIN },
- { XML_NAMESPACE_DRAW, XML_FLOATING_FRAME, XML_TOK_GROUP_FRAME },
- { XML_NAMESPACE_DRAW, XML_APPLET, XML_TOK_GROUP_APPLET },
-
- XML_TOKEN_MAP_END
-};
-
-const SvXMLTokenMap& XMLShapeImportHelper::GetGroupShapeElemTokenMap()
-{
- if(!mpGroupShapeElemTokenMap)
- mpGroupShapeElemTokenMap = new SvXMLTokenMap(aGroupShapeElemTokenMap);
- return *mpGroupShapeElemTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-static __FAR_DATA SvXMLTokenMapEntry a3DSceneShapeElemTokenMap[] =
-{
- { XML_NAMESPACE_DR3D, XML_SCENE, XML_TOK_3DSCENE_3DSCENE },
- { XML_NAMESPACE_DR3D, XML_CUBE, XML_TOK_3DSCENE_3DCUBE },
- { XML_NAMESPACE_DR3D, XML_SPHERE, XML_TOK_3DSCENE_3DSPHERE },
- { XML_NAMESPACE_DR3D, XML_ROTATE, XML_TOK_3DSCENE_3DLATHE },
- { XML_NAMESPACE_DR3D, XML_EXTRUDE, XML_TOK_3DSCENE_3DEXTRUDE },
- XML_TOKEN_MAP_END
-};
-
-const SvXMLTokenMap& XMLShapeImportHelper::Get3DSceneShapeElemTokenMap()
-{
- if(!mp3DSceneShapeElemTokenMap)
- mp3DSceneShapeElemTokenMap = new SvXMLTokenMap(a3DSceneShapeElemTokenMap);
- return *mp3DSceneShapeElemTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-/*
-static __FAR_DATA SvXMLTokenMapEntry aShapeAttrTokenMap[] =
-{
- { XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_SHAPE_NAME },
- { XML_NAMESPACE_DRAW, XML_STYLE_NAME, XML_TOK_SHAPE_DRAWSTYLE_NAME_GRAPHICS },
- { XML_NAMESPACE_PRESENTATION, XML_CLASS, XML_TOK_SHAPE_PRESENTATION_CLASS },
- { XML_NAMESPACE_PRESENTATION, XML_STYLE_NAME, XML_TOK_SHAPE_DRAWSTYLE_NAME_PRESENTATION },
- { XML_NAMESPACE_SVG, XML_TRANSFORM, XML_TOK_SHAPE_TRANSFORM },
- { XML_NAMESPACE_PRESENTATION, XML_PLACEHOLDER, XML_TOK_SHAPE_IS_PLACEHOLDER },
- { XML_NAMESPACE_PRESENTATION, XML_USER_TRANSFORMED, XML_TOK_SHAPE_IS_USER_TRANSFORMED },
- XML_TOKEN_MAP_END
-};
-
-const SvXMLTokenMap& XMLShapeImportHelper::GetShapeAttrTokenMap()
-{
- if(!mpShapeAttrTokenMap)
- mpShapeAttrTokenMap = new SvXMLTokenMap(aShapeAttrTokenMap);
- return *mpShapeAttrTokenMap;
-}
-*/
-//////////////////////////////////////////////////////////////////////////////
-
-static __FAR_DATA SvXMLTokenMapEntry a3DObjectAttrTokenMap[] =
-{
- { XML_NAMESPACE_DRAW, XML_STYLE_NAME, XML_TOK_3DOBJECT_DRAWSTYLE_NAME },
- { XML_NAMESPACE_DR3D, XML_TRANSFORM, XML_TOK_3DOBJECT_TRANSFORM },
- XML_TOKEN_MAP_END
-};
-
-const SvXMLTokenMap& XMLShapeImportHelper::Get3DObjectAttrTokenMap()
-{
- if(!mp3DObjectAttrTokenMap)
- mp3DObjectAttrTokenMap = new SvXMLTokenMap(a3DObjectAttrTokenMap);
- return *mp3DObjectAttrTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-static __FAR_DATA SvXMLTokenMapEntry a3DPolygonBasedAttrTokenMap[] =
-{
- { XML_NAMESPACE_SVG, XML_VIEWBOX, XML_TOK_3DPOLYGONBASED_VIEWBOX },
- { XML_NAMESPACE_SVG, XML_D, XML_TOK_3DPOLYGONBASED_D },
- XML_TOKEN_MAP_END
-};
-
-const SvXMLTokenMap& XMLShapeImportHelper::Get3DPolygonBasedAttrTokenMap()
-{
- if(!mp3DPolygonBasedAttrTokenMap)
- mp3DPolygonBasedAttrTokenMap = new SvXMLTokenMap(a3DPolygonBasedAttrTokenMap);
- return *mp3DPolygonBasedAttrTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-static __FAR_DATA SvXMLTokenMapEntry a3DCubeObjectAttrTokenMap[] =
-{
- { XML_NAMESPACE_DR3D, XML_MIN_EDGE, XML_TOK_3DCUBEOBJ_MINEDGE },
- { XML_NAMESPACE_DR3D, XML_MAX_EDGE, XML_TOK_3DCUBEOBJ_MAXEDGE },
- XML_TOKEN_MAP_END
-};
-
-const SvXMLTokenMap& XMLShapeImportHelper::Get3DCubeObjectAttrTokenMap()
-{
- if(!mp3DCubeObjectAttrTokenMap)
- mp3DCubeObjectAttrTokenMap = new SvXMLTokenMap(a3DCubeObjectAttrTokenMap);
- return *mp3DCubeObjectAttrTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-static __FAR_DATA SvXMLTokenMapEntry a3DSphereObjectAttrTokenMap[] =
-{
- { XML_NAMESPACE_DR3D, XML_CENTER, XML_TOK_3DSPHEREOBJ_CENTER },
- { XML_NAMESPACE_DR3D, XML_SIZE, XML_TOK_3DSPHEREOBJ_SIZE },
- XML_TOKEN_MAP_END
-};
-
-const SvXMLTokenMap& XMLShapeImportHelper::Get3DSphereObjectAttrTokenMap()
-{
- if(!mp3DSphereObjectAttrTokenMap)
- mp3DSphereObjectAttrTokenMap = new SvXMLTokenMap(a3DSphereObjectAttrTokenMap);
- return *mp3DSphereObjectAttrTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-static __FAR_DATA SvXMLTokenMapEntry a3DLightAttrTokenMap[] =
-{
- { XML_NAMESPACE_DR3D, XML_DIFFUSE_COLOR, XML_TOK_3DLIGHT_DIFFUSE_COLOR },
- { XML_NAMESPACE_DR3D, XML_DIRECTION, XML_TOK_3DLIGHT_DIRECTION },
- { XML_NAMESPACE_DR3D, XML_ENABLED, XML_TOK_3DLIGHT_ENABLED },
- { XML_NAMESPACE_DR3D, XML_SPECULAR, XML_TOK_3DLIGHT_SPECULAR },
- XML_TOKEN_MAP_END
-};
-
-const SvXMLTokenMap& XMLShapeImportHelper::Get3DLightAttrTokenMap()
-{
- if(!mp3DLightAttrTokenMap)
- mp3DLightAttrTokenMap = new SvXMLTokenMap(a3DLightAttrTokenMap);
- return *mp3DLightAttrTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-/*
-static __FAR_DATA SvXMLTokenMapEntry aPageShapeAttrTokenMap[] =
-{
- { XML_NAMESPACE_SVG, XML_X, XML_TOK_PAGESHAPE_X },
- { XML_NAMESPACE_SVG, XML_Y, XML_TOK_PAGESHAPE_Y },
- { XML_NAMESPACE_SVG, XML_WIDTH, XML_TOK_PAGESHAPE_WIDTH },
- { XML_NAMESPACE_SVG, XML_HEIGHT, XML_TOK_PAGESHAPE_HEIGHT },
- XML_TOKEN_MAP_END
-};
-
-const SvXMLTokenMap& XMLShapeImportHelper::GetPageShapeAttrTokenMap()
-{
- if(!mpPageShapeAttrTokenMap)
- mpPageShapeAttrTokenMap = new SvXMLTokenMap(aPageShapeAttrTokenMap);
- return *mpPageShapeAttrTokenMap;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-static __FAR_DATA SvXMLTokenMapEntry aGraphicObjectShapeAttrTokenMap[] =
-{
- { XML_NAMESPACE_SVG, XML_X, XML_TOK_GOSHAPE_X },
- { XML_NAMESPACE_SVG, XML_Y, XML_TOK_GOSHAPE_Y },
- { XML_NAMESPACE_SVG, XML_WIDTH, XML_TOK_GOSHAPE_WIDTH },
- { XML_NAMESPACE_SVG, XML_HEIGHT, XML_TOK_GOSHAPE_HEIGHT },
- { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_GOSHAPE_URL },
- XML_TOKEN_MAP_END
-};
-
-const SvXMLTokenMap& XMLShapeImportHelper::GetGraphicObjectShapeAttrTokenMap()
-{
- if(!mpGraphicObjectShapeAttrTokenMap)
- mpGraphicObjectShapeAttrTokenMap = new SvXMLTokenMap(aGraphicObjectShapeAttrTokenMap);
- return *mpGraphicObjectShapeAttrTokenMap;
-}
-*/
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext* XMLShapeImportHelper::Create3DSceneChildContext(
- SvXMLImport& rImport,
- USHORT nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-{
- SdXMLShapeContext *pContext = 0L;
-
- if(rShapes.is())
- {
- const SvXMLTokenMap& rTokenMap = Get3DSceneShapeElemTokenMap();
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
-
- for(sal_Int16 a(0); a < nAttrCount; a++)
- {
- const OUString& rAttrName = xAttrList->getNameByIndex(a);
- OUString aLocalName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName(rAttrName, &aLocalName);
- }
-
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- case XML_TOK_3DSCENE_3DSCENE:
- {
- // dr3d:3dscene inside dr3d:3dscene context
- pContext = new SdXML3DSceneShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes);
- break;
- }
- case XML_TOK_3DSCENE_3DCUBE:
- {
- // dr3d:3dcube inside dr3d:3dscene context
- pContext = new SdXML3DCubeObjectShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes);
- break;
- }
- case XML_TOK_3DSCENE_3DSPHERE:
- {
- // dr3d:3dsphere inside dr3d:3dscene context
- pContext = new SdXML3DSphereObjectShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes);
- break;
- }
- case XML_TOK_3DSCENE_3DLATHE:
- {
- // dr3d:3dlathe inside dr3d:3dscene context
- pContext = new SdXML3DLatheObjectShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes);
- break;
- }
- case XML_TOK_3DSCENE_3DEXTRUDE:
- {
- // dr3d:3dextrude inside dr3d:3dscene context
- pContext = new SdXML3DExtrudeObjectShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes);
- break;
- }
- }
- }
-
- // now parse the attribute list and call the child context for each unknown attribute
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 a(0); a < nAttrCount; a++)
- {
- const OUString& rAttrName = xAttrList->getNameByIndex(a);
- OUString aLocalName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName(rAttrName, &aLocalName);
- const OUString aValue( xAttrList->getValueByIndex(a) );
-
- pContext->processAttribute( nPrefix, aLocalName, aValue );
- }
-
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeImportHelper::SetStylesContext(SvXMLStylesContext* pNew)
-{
- mpStylesContext = pNew;
- mpStylesContext->AddRef();
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void XMLShapeImportHelper::SetAutoStylesContext(SvXMLStylesContext* pNew)
-{
- mpAutoStylesContext = pNew;
- mpAutoStylesContext->AddRef();
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext* XMLShapeImportHelper::CreateGroupChildContext(
- SvXMLImport& rImport,
- USHORT nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-{
- SdXMLShapeContext *pContext = 0L;
-
- const SvXMLTokenMap& rTokenMap = GetGroupShapeElemTokenMap();
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
-
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- case XML_TOK_GROUP_GROUP:
- {
- // draw:g inside group context (RECURSIVE)
- pContext = new SdXMLGroupShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes);
- break;
- }
- case XML_TOK_GROUP_3DSCENE:
- {
- // dr3d:3dscene inside group context
- pContext = new SdXML3DSceneShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes);
- break;
- }
- case XML_TOK_GROUP_RECT:
- {
- // draw:rect inside group context
- pContext = new SdXMLRectShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
- break;
- }
- case XML_TOK_GROUP_LINE:
- {
- // draw:line inside group context
- pContext = new SdXMLLineShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
- break;
- }
- case XML_TOK_GROUP_CIRCLE:
- case XML_TOK_GROUP_ELLIPSE:
- {
- // draw:circle or draw:ellipse inside group context
- pContext = new SdXMLEllipseShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
- break;
- }
- case XML_TOK_GROUP_POLYGON:
- case XML_TOK_GROUP_POLYLINE:
- {
- // draw:polygon or draw:polyline inside group context
- pContext = new SdXMLPolygonShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes,
- rTokenMap.Get(nPrefix, rLocalName) == XML_TOK_GROUP_POLYGON ? TRUE : FALSE );
- break;
- }
- case XML_TOK_GROUP_PATH:
- {
- // draw:path inside group context
- pContext = new SdXMLPathShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes);
- break;
- }
- case XML_TOK_GROUP_TEXT_BOX:
- {
- // text:text-box inside group context
- pContext = new SdXMLTextBoxShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
- break;
- }
- case XML_TOK_GROUP_CONTROL:
- {
- // draw:control inside group context
- pContext = new SdXMLControlShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
- break;
- }
- case XML_TOK_GROUP_CONNECTOR:
- {
- // draw:connector inside group context
- pContext = new SdXMLConnectorShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
- break;
- }
- case XML_TOK_GROUP_MEASURE:
- {
- // draw:measure inside group context
- pContext = new SdXMLMeasureShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
- break;
- }
- case XML_TOK_GROUP_PAGE:
- {
- // draw:page inside group context
- pContext = new SdXMLPageShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
- break;
- }
- case XML_TOK_GROUP_CAPTION:
- {
- // draw:caption inside group context
- pContext = new SdXMLCaptionShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
- break;
- }
- case XML_TOK_GROUP_CHART:
- {
- // chart:chart inside group context
- pContext = new SdXMLChartShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
- break;
- }
- case XML_TOK_GROUP_IMAGE:
- {
- // office:image inside group context
- pContext = new SdXMLGraphicObjectShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
- break;
- }
- case XML_TOK_GROUP_OBJECT:
- case XML_TOK_GROUP_OBJECT_OLE:
- {
- // draw:object or draw:object_ole
- pContext = new SdXMLObjectShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
- break;
- }
- case XML_TOK_GROUP_PLUGIN:
- {
- // draw:plugin
- pContext = new SdXMLPluginShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
- break;
- }
- case XML_TOK_GROUP_FRAME:
- {
- // draw:frame
- pContext = new SdXMLFrameShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
- break;
- }
- case XML_TOK_GROUP_APPLET:
- {
- // draw:applet
- pContext = new SdXMLAppletShapeContext( rImport, nPrefix, rLocalName, xAttrList, rShapes );
- break;
- }
- // add other shapes here...
- default:
- return new SvXMLImportContext( rImport, nPrefix, rLocalName );
- }
-
- // now parse the attribute list and call the child context for each unknown attribute
- for(sal_Int16 a(0); a < nAttrCount; a++)
- {
- const OUString& rAttrName = xAttrList->getNameByIndex(a);
- OUString aLocalName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName(rAttrName, &aLocalName);
- const OUString aValue( xAttrList->getValueByIndex(a) );
-
- pContext->processAttribute( nPrefix, aLocalName, aValue );
- }
-
- return pContext;
-}
-
-
-/** this function is called whenever the implementation classes like to add this new
- shape to the given XShapes.
-*/
-void XMLShapeImportHelper::addShape( uno::Reference< drawing::XShape >& rShape,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-{
- if( rShape.is() && rShapes.is() )
- {
- // add new shape to parent
- rShapes->add( rShape );
- }
-}
-
-/** this function is called whenever the implementation classes have finished importing
- a shape to the given XShapes. The shape is already inserted into its XShapes and
- all properties and styles are set.
-*/
-void XMLShapeImportHelper::finishShape(
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes)
-{
-}
-
-// helper functions for z-order sorting
-struct ZOrderHint
-{
- sal_Int32 nIs;
- sal_Int32 nShould;
-
- int operator<(const ZOrderHint& rComp) const { return nShould < rComp.nShould; }
-};
-
-class ShapeSortContext
-{
-public:
- uno::Reference< drawing::XShapes > mxShapes;
- list<ZOrderHint> maZOrderList;
- list<ZOrderHint> maUnsortedList;
-
- sal_Int32 mnCurrentZ;
- ShapeSortContext* mpParentContext;
- const OUString msZOrder;
-
- ShapeSortContext( uno::Reference< drawing::XShapes >& rShapes, ShapeSortContext* pParentContext = NULL );
-
- void moveShape( sal_Int32 nSourcePos, sal_Int32 nDestPos );
-};
-
-ShapeSortContext::ShapeSortContext( uno::Reference< drawing::XShapes >& rShapes, ShapeSortContext* pParentContext )
-: mxShapes( rShapes ), mnCurrentZ( 0 ), mpParentContext( pParentContext ),
- msZOrder(RTL_CONSTASCII_USTRINGPARAM("ZOrder"))
-{
-}
-
-void ShapeSortContext::moveShape( sal_Int32 nSourcePos, sal_Int32 nDestPos )
-{
- uno::Any aAny( mxShapes->getByIndex( nSourcePos ) );
- uno::Reference< beans::XPropertySet > xPropSet;
- aAny >>= xPropSet;
-
- if( xPropSet.is() && xPropSet->getPropertySetInfo()->hasPropertyByName( msZOrder ) )
- {
- aAny <<= nDestPos;
- xPropSet->setPropertyValue( msZOrder, aAny );
-
- list<ZOrderHint>::iterator aIter = maZOrderList.begin();
- list<ZOrderHint>::iterator aEnd = maZOrderList.end();
-
- while( aIter != aEnd )
- {
- if( (*aIter).nIs < nSourcePos )
- {
- DBG_ASSERT( (*aIter).nIs >= nDestPos, "Shape sorting failed" );
- (*aIter).nIs++;
- }
- aIter++;
- }
-
- aIter = maUnsortedList.begin();
- aEnd = maUnsortedList.end();
-
- while( aIter != aEnd )
- {
- if( (*aIter).nIs < nSourcePos )
- {
- DBG_ASSERT( (*aIter).nIs >= nDestPos, "shape sorting failed" );
- (*aIter).nIs++;
- }
- aIter++;
- }
- }
-}
-
-void XMLShapeImportHelper::pushGroupForSorting( uno::Reference< drawing::XShapes >& rShapes )
-{
- mpImpl->mpSortContext = new ShapeSortContext( rShapes, mpImpl->mpSortContext );
-}
-
-void XMLShapeImportHelper::popGroupAndSort()
-{
- DBG_ASSERT( mpImpl->mpSortContext, "No context to sort!" );
- if( mpImpl->mpSortContext == NULL )
- return;
-
- try
- {
- list<ZOrderHint>& rZList = mpImpl->mpSortContext->maZOrderList;
- list<ZOrderHint>& rUnsortedList = mpImpl->mpSortContext->maUnsortedList;
-
- // sort shapes
- if( !rZList.empty() )
- {
- // only do something if we have shapes to sort
-
- // check if there are more shapes than inserted with ::shapeWithZIndexAdded()
- // This can happen if there where already shapes on the page before import
- // Since the writer may delete some of this shapes during import, we need
- // to do this here and not in our c'tor anymore
-
- // check if we have more shapes than we know of
- sal_Int32 nCount = mpImpl->mpSortContext->mxShapes->getCount();
-
- nCount -= rZList.size();
- nCount -= rUnsortedList.size();
-
-
- if( nCount > 0 )
- {
- // first update offsets of added shapes
- list<ZOrderHint>::iterator aIter( rZList.begin() );
- while( aIter != rZList.end() )
- (*aIter++).nIs += nCount;
-
- aIter = rUnsortedList.begin();
- while( aIter != rUnsortedList.end() )
- (*aIter++).nIs += nCount;
-
- // second add the already existing shapes in the unsorted list
- ZOrderHint aNewHint;
-
- do
- {
- nCount--;
-
- aNewHint.nIs = nCount;
- aNewHint.nShould = -1;
-
- rUnsortedList.insert(rUnsortedList.begin(), aNewHint);
- }
- while( nCount );
- }
-
- // sort z ordered shapes
- rZList.sort();
-
- // this is the current index, all shapes before that
- // index are finished
- sal_Int32 nIndex = 0;
- while( !rZList.empty() )
- {
- list<ZOrderHint>::iterator aIter( rZList.begin() );
-
- while( nIndex < (*aIter).nShould && !rUnsortedList.empty() )
- {
- ZOrderHint aGapHint( *rUnsortedList.begin() );
- rUnsortedList.pop_front();
-
- mpImpl->mpSortContext->moveShape( aGapHint.nIs, nIndex++ );
- }
-
- if( (*aIter).nIs != nIndex )
- mpImpl->mpSortContext->moveShape( (*aIter).nIs, nIndex );
-
- rZList.pop_front();
- nIndex++;
- }
- }
- }
- catch( uno::Exception& )
- {
- DBG_ERROR("exception while sorting shapes, sorting failed!");
- }
-
- // put parent on top and delete current context, were done
- ShapeSortContext* pContext = mpImpl->mpSortContext;
- mpImpl->mpSortContext = pContext->mpParentContext;
- delete pContext;
-}
-
-void XMLShapeImportHelper::shapeWithZIndexAdded( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape, sal_Int32 nZIndex )
-{
- if( mpImpl->mpSortContext )
- {
- ZOrderHint aNewHint;
- aNewHint.nIs = mpImpl->mpSortContext->mnCurrentZ++;
- aNewHint.nShould = nZIndex;
-
- sal_Int32 nInsertIndex = 0;
-
- if( nZIndex == -1 )
- {
- // don't care, so add to unsorted list
- mpImpl->mpSortContext->maUnsortedList.push_back(aNewHint);
- }
- else
- {
- // insert into sort list
- mpImpl->mpSortContext->maZOrderList.push_back(aNewHint);
- }
- }
-}
-
-void XMLShapeImportHelper::createShapeId( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape, sal_Int32 nId )
-{
- DBG_ASSERT( mpImpl->maShapeIds.find(nId) == mpImpl->maShapeIds.end(), "draw:id imported twice!" );
- mpImpl->maShapeIds[nId] = xShape;
-}
-
-uno::Reference< drawing::XShape > XMLShapeImportHelper::getShapeFromId( sal_Int32 nId )
-{
- IdShapeMap::iterator aShapeIter( mpImpl->maShapeIds.find( nId ) );
- if( aShapeIter != mpImpl->maShapeIds.end() )
- {
- return (*aShapeIter).second;
- }
- else
- {
- DBG_ERROR( "unknown draw:id found!" );
- uno::Reference< drawing::XShape > xShape;
- return xShape;
- }
-}
-
-void XMLShapeImportHelper::addShapeConnection( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rConnectorShape,
- sal_Bool bStart,
- sal_Int32 nDestShapeId,
- sal_Int32 nDestGlueId )
-{
- ConnectionHint aHint;
- aHint.mxConnector = rConnectorShape;
- aHint.bStart = bStart;
- aHint.nDestShapeId = nDestShapeId;
- aHint.nDestGlueId = nDestGlueId;
-
- mpImpl->maConnections.push_back( aHint );
-}
-
-void XMLShapeImportHelper::restoreConnections()
-{
- if( !mpImpl->maConnections.empty() )
- {
- uno::Any aAny;
-
- const vector<ConnectionHint>::size_type nCount = mpImpl->maConnections.size();
- for( vector<ConnectionHint>::size_type i = 0; i < nCount; i++ )
- {
- ConnectionHint& rHint = mpImpl->maConnections[i];
- uno::Reference< beans::XPropertySet > xConnector( rHint.mxConnector, uno::UNO_QUERY );
- if( xConnector.is() )
- {
- // #86637# remember line deltas
- uno::Any aLine1Delta;
- uno::Any aLine2Delta;
- uno::Any aLine3Delta;
- OUString aStr1(RTL_CONSTASCII_USTRINGPARAM("EdgeLine1Delta"));
- OUString aStr2(RTL_CONSTASCII_USTRINGPARAM("EdgeLine2Delta"));
- OUString aStr3(RTL_CONSTASCII_USTRINGPARAM("EdgeLine3Delta"));
- aLine1Delta = xConnector->getPropertyValue(aStr1);
- aLine2Delta = xConnector->getPropertyValue(aStr2);
- aLine3Delta = xConnector->getPropertyValue(aStr3);
-
- // #86637# simply setting these values WILL force the connector to do
- // an new layout promptly. So the line delta values have to be rescued
- // and restored around connector changes.
- uno::Reference< drawing::XShape > xShape( getShapeFromId( rHint.nDestShapeId ) );
- if( xShape.is() )
- {
- aAny <<= xShape;
- xConnector->setPropertyValue( rHint.bStart ? msStartShape : msEndShape, aAny );
-
- sal_Int32 nGlueId = rHint.nDestGlueId < 4 ? rHint.nDestGlueId : getGluePointId( xShape, rHint.nDestGlueId );
- aAny <<= nGlueId;
- xConnector->setPropertyValue( rHint.bStart ? msStartGluePointIndex : msEndGluePointIndex, aAny );
- }
-
- // #86637# restore line deltas
- xConnector->setPropertyValue(aStr1, aLine1Delta );
- xConnector->setPropertyValue(aStr2, aLine2Delta );
- xConnector->setPropertyValue(aStr3, aLine3Delta );
- }
- }
- mpImpl->maConnections.clear();
- }
-}
-
-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, rImport );
-
- // chain text attributes
- pResult->ChainImportMapper( XMLTextImportHelper::CreateParaExtPropMapper( rImport ) );
- return pResult;
-}
-
-/** adds a mapping for a glue point identifier from an xml file to the identifier created after inserting
- the new glue point into the core. The saved mappings can be retrieved by getGluePointId() */
-void XMLShapeImportHelper::addGluePointMapping( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape,
- sal_Int32 nSourceId, sal_Int32 nDestinnationId )
-{
- if( mpPageContext )
- mpPageContext->maShapeGluePointsMap[xShape][nSourceId] = nDestinnationId;
-}
-
-/** retrieves a mapping for a glue point identifier from the current xml file to the identifier created after
- inserting the new glue point into the core. The mapping must be initialized first with addGluePointMapping() */
-sal_Int32 XMLShapeImportHelper::getGluePointId( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape, sal_Int32 nSourceId )
-{
- if( mpPageContext )
- {
- ShapeGluePointsMap::iterator aShapeIter( mpPageContext->maShapeGluePointsMap.find( xShape ) );
- if( aShapeIter != mpPageContext->maShapeGluePointsMap.end() )
- {
- GluePointIdMap::iterator aIdIter = (*aShapeIter).second.find(nSourceId);
- if( aIdIter != (*aShapeIter).second.end() )
- return (*aIdIter).second;
- }
- }
-
- return -1;
-}
-
-/** this method must be calling before the first shape is imported for the given page */
-void XMLShapeImportHelper::startPage( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes )
-{
- XMLShapeImportPageContextImpl* pOldContext = mpPageContext;
- mpPageContext = new XMLShapeImportPageContextImpl();
- mpPageContext->mpNext = pOldContext;
- mpPageContext->mxShapes = rShapes;
-}
-
-/** this method must be calling after the last shape is imported for the given page */
-void XMLShapeImportHelper::endPage( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes )
-{
- DBG_ASSERT( mpPageContext && (mpPageContext->mxShapes == rShapes), "wrong call to endPage(), no startPage called or wrong page" );
- if( NULL == mpPageContext )
- return;
-
- restoreConnections();
-
- XMLShapeImportPageContextImpl* pNextContext = mpPageContext->mpNext;
- delete mpPageContext;
- mpPageContext = pNextContext;
-}
-
-// #88546#
-/** defines if the import should increment the progress bar or not */
-void XMLShapeImportHelper::enableHandleProgressBar( sal_Bool bEnable )
-{
- mpImpl->mbHandleProgressBar = bEnable;
-}
-
-sal_Bool XMLShapeImportHelper::IsHandleProgressBarEnabled() const
-{
- return mpImpl->mbHandleProgressBar;
-}
-
-/** queries the capability of the current model to create presentation shapes */
-sal_Bool XMLShapeImportHelper::IsPresentationShapesSupported()
-{
- return mpImpl->mbIsPresentationShapesSupported;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_viewcontext.cxx b/binfilter/bf_xmloff/source/draw/xmloff_viewcontext.cxx
deleted file mode 100644
index 5c5c50e7ce7c..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_viewcontext.cxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "viewcontext.hxx"
-#include "sdxmlimp_impl.hxx"
-
-#include "xmlnmspe.hxx"
-#include "VisAreaContext.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace rtl;
-using ::binfilter::xmloff::token::IsXMLToken;
-
-using ::binfilter::xmloff::token::XML_EMBEDDED_VISIBLE_AREA;
-
-//------------------------------------------------------------------
-
-SdXMLViewSettingsContext::~SdXMLViewSettingsContext()
-{
-}
-
-SvXMLImportContext *SdXMLViewSettingsContext::CreateChildContext( USHORT nPrefix,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext *pContext = 0;
-
- if (nPrefix == XML_NAMESPACE_OFFICE)
- {
- if ( IsXMLToken( rLocalName, XML_EMBEDDED_VISIBLE_AREA ) )
- {
- sal_Int16 nMeasureUnit = 0;
-
- uno::Reference< beans::XPropertySet > xProps( GetImport().GetModel(), uno::UNO_QUERY );
- if( xProps.is() )
- xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "MapUnit" ) ) ) >>= nMeasureUnit;
-
- pContext = new XMLVisAreaContext(GetImport(), nPrefix, rLocalName, xAttrList, maVisArea, nMeasureUnit);
- }
- }
-
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
- return pContext;
-}
-
-void SdXMLViewSettingsContext::EndElement()
-{
- uno::Reference< beans::XPropertySet > xProps( GetImport().GetModel(), uno::UNO_QUERY );
- if( xProps.is() )
- {
- uno::Any aAny;
- aAny <<= maVisArea;
-
- xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ), aAny );
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_xexptran.cxx b/binfilter/bf_xmloff/source/draw/xmloff_xexptran.cxx
deleted file mode 100644
index dda132ba5bb8..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_xexptran.cxx
+++ /dev/null
@@ -1,2943 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include "xexptran.hxx"
-
-
-#include <rtl/ustrbuf.hxx>
-
-#include "xmluconv.hxx"
-
-#include <bf_goodies/hmatrix.hxx>
-
-// #100617# FRound
-#include <vcl/salbtype.hxx>
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-
-//////////////////////////////////////////////////////////////////////////////
-// Defines
-
-#define BORDER_INTEGERS_ARE_EQUAL (4)
-
-//////////////////////////////////////////////////////////////////////////////
-// Predeclarations
-
-void Imp_SkipDouble(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen);
-void Imp_CalcVectorValues(Vector2D& aVec1, Vector2D& aVec2, sal_Bool& bSameLength, sal_Bool& bSameDirection);
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-// parsing help functions for simple chars
-void Imp_SkipSpaces(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen)
-{
- while(rPos < nLen
- && sal_Unicode(' ') == rStr[rPos])
- rPos++;
-}
-
-void Imp_SkipSpacesAndOpeningBraces(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen)
-{
- while(rPos < nLen
- && (sal_Unicode(' ') == rStr[rPos] || sal_Unicode('(') == rStr[rPos]))
- rPos++;
-}
-
-void Imp_SkipSpacesAndCommas(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen)
-{
- while(rPos < nLen
- && (sal_Unicode(' ') == rStr[rPos] || sal_Unicode(',') == rStr[rPos]))
- rPos++;
-}
-
-void Imp_SkipSpacesAndClosingBraces(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen)
-{
- while(rPos < nLen
- && (sal_Unicode(' ') == rStr[rPos] || sal_Unicode(')') == rStr[rPos]))
- rPos++;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-// parsing help functions for integer numbers
-
-sal_Bool Imp_IsOnNumberChar(const OUString& rStr, const sal_Int32 nPos, BOOL bSignAllowed = TRUE)
-{
- sal_Unicode aChar(rStr[nPos]);
-
- if((sal_Unicode('0') <= aChar && sal_Unicode('9') >= aChar)
- || (bSignAllowed && sal_Unicode('+') == aChar)
- || (bSignAllowed && sal_Unicode('-') == aChar)
- )
- return TRUE;
- return FALSE;
-}
-
-sal_Bool Imp_IsOnUnitChar(const OUString& rStr, const sal_Int32 nPos)
-{
- sal_Unicode aChar(rStr[nPos]);
-
- if((sal_Unicode('a') <= aChar && sal_Unicode('z') >= aChar)
- || (sal_Unicode('A') <= aChar && sal_Unicode('Z') >= aChar)
- || sal_Unicode('%') == aChar
- )
- return TRUE;
- return FALSE;
-}
-
-void Imp_SkipNumber(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen)
-{
- BOOL bSignAllowed(TRUE);
-
- while(rPos < nLen && Imp_IsOnNumberChar(rStr, rPos, bSignAllowed))
- {
- bSignAllowed = FALSE;
- rPos++;
- }
-}
-
-void Imp_SkipNumberAndSpacesAndCommas(const OUString& rStr, sal_Int32& rPos,
- const sal_Int32 nLen)
-{
- Imp_SkipNumber(rStr, rPos, nLen);
- Imp_SkipSpacesAndCommas(rStr, rPos, nLen);
-}
-
-// #100617# Allow to skip doubles, too.
-void Imp_SkipDoubleAndSpacesAndCommas(const OUString& rStr, sal_Int32& rPos,
- const sal_Int32 nLen)
-{
- Imp_SkipDouble(rStr, rPos, nLen);
- Imp_SkipSpacesAndCommas(rStr, rPos, nLen);
-}
-
-void Imp_PutNumberChar(OUString& rStr, const SvXMLUnitConverter& rConv, sal_Int32 nValue)
-{
- OUStringBuffer sStringBuffer;
- rConv.convertNumber(sStringBuffer, nValue);
- rStr += OUString(sStringBuffer.makeStringAndClear());
-}
-
-void Imp_PutNumberCharWithSpace(OUString& rStr, const SvXMLUnitConverter& rConv, sal_Int32 nValue)
-{
- const sal_Int32 aLen(rStr.getLength());
- if(aLen)
- if(Imp_IsOnNumberChar(rStr, aLen - 1, FALSE) && nValue >= 0)
- rStr += OUString(sal_Unicode(' '));
- Imp_PutNumberChar(rStr, rConv, nValue);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-// parsing help functions for double numbers
-
-void Imp_SkipDouble(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen)
-{
- sal_Unicode aChar(rStr[rPos]);
-
- if(sal_Unicode('+') == aChar || sal_Unicode('-') == aChar)
- aChar = rStr[++rPos];
-
- while((sal_Unicode('0') <= aChar && sal_Unicode('9') >= aChar)
- || sal_Unicode('.') == aChar)
- {
- aChar = rStr[++rPos];
- }
-
- if(sal_Unicode('e') == aChar || sal_Unicode('E') == aChar)
- {
- aChar = rStr[++rPos];
-
- if(sal_Unicode('+') == aChar || sal_Unicode('-') == aChar)
- aChar = rStr[++rPos];
-
- while(sal_Unicode('0') <= aChar && sal_Unicode('9') >= aChar)
- {
- aChar = rStr[++rPos];
- }
- }
-}
-
-double Imp_GetDoubleChar(const OUString& rStr, sal_Int32& rPos, const sal_Int32 nLen,
- const SvXMLUnitConverter& rConv, double fRetval, BOOL bLookForUnits = FALSE)
-{
- sal_Unicode aChar(rStr[rPos]);
- OUStringBuffer sNumberString;
-
- if(sal_Unicode('+') == aChar || sal_Unicode('-') == aChar)
- {
- sNumberString.append(rStr[rPos]);
- aChar = rStr[++rPos];
- }
-
- while((sal_Unicode('0') <= aChar && sal_Unicode('9') >= aChar)
- || sal_Unicode('.') == aChar)
- {
- sNumberString.append(rStr[rPos]);
- aChar = rStr[++rPos];
- }
-
- if(sal_Unicode('e') == aChar || sal_Unicode('E') == aChar)
- {
- sNumberString.append(rStr[rPos]);
- aChar = rStr[++rPos];
-
- if(sal_Unicode('+') == aChar || sal_Unicode('-') == aChar)
- {
- sNumberString.append(rStr[rPos]);
- aChar = rStr[++rPos];
- }
-
- while(sal_Unicode('0') <= aChar && sal_Unicode('9') >= aChar)
- {
- sNumberString.append(rStr[rPos]);
- aChar = rStr[++rPos];
- }
- }
-
- if(bLookForUnits)
- {
- Imp_SkipSpaces(rStr, rPos, nLen);
- while(rPos < nLen && Imp_IsOnUnitChar(rStr, rPos))
- sNumberString.append(rStr[rPos++]);
- }
-
- if(sNumberString.getLength())
- {
- if(bLookForUnits)
- rConv.convertDouble(fRetval, sNumberString.makeStringAndClear(), TRUE);
- else
- rConv.convertDouble(fRetval, sNumberString.makeStringAndClear());
- }
-
- return fRetval;
-}
-
-void Imp_PutDoubleChar(OUString& rStr, const SvXMLUnitConverter& rConv, double fValue,
- BOOL bConvertUnits = FALSE)
-{
- OUStringBuffer sStringBuffer;
-
- if(bConvertUnits)
- rConv.convertDouble(sStringBuffer, fValue, TRUE);
- else
- rConv.convertDouble(sStringBuffer, fValue);
-
- rStr += OUString(sStringBuffer.makeStringAndClear());
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-// base class of all 2D transform objects
-
-struct ImpSdXMLExpTransObj2DBase
-{
- sal_uInt16 mnType;
- ImpSdXMLExpTransObj2DBase(sal_uInt16 nType)
- : mnType(nType) {}
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// possible object types for 2D
-
-#define IMP_SDXMLEXP_TRANSOBJ2D_ROTATE 0x0000
-#define IMP_SDXMLEXP_TRANSOBJ2D_SCALE 0x0001
-#define IMP_SDXMLEXP_TRANSOBJ2D_TRANSLATE 0x0002
-#define IMP_SDXMLEXP_TRANSOBJ2D_SKEWX 0x0003
-#define IMP_SDXMLEXP_TRANSOBJ2D_SKEWY 0x0004
-#define IMP_SDXMLEXP_TRANSOBJ2D_MATRIX 0x0005
-
-//////////////////////////////////////////////////////////////////////////////
-// classes of objects, different sizes
-
-struct ImpSdXMLExpTransObj2DRotate : public ImpSdXMLExpTransObj2DBase
-{
- double mfRotate;
- ImpSdXMLExpTransObj2DRotate(double fVal)
- : ImpSdXMLExpTransObj2DBase(IMP_SDXMLEXP_TRANSOBJ2D_ROTATE), mfRotate(fVal) {}
-};
-struct ImpSdXMLExpTransObj2DScale : public ImpSdXMLExpTransObj2DBase
-{
- Vector2D maScale;
- ImpSdXMLExpTransObj2DScale(const Vector2D& rNew)
- : ImpSdXMLExpTransObj2DBase(IMP_SDXMLEXP_TRANSOBJ2D_SCALE), maScale(rNew) {}
-};
-struct ImpSdXMLExpTransObj2DTranslate : public ImpSdXMLExpTransObj2DBase
-{
- Vector2D maTranslate;
- ImpSdXMLExpTransObj2DTranslate(const Vector2D& rNew)
- : ImpSdXMLExpTransObj2DBase(IMP_SDXMLEXP_TRANSOBJ2D_TRANSLATE), maTranslate(rNew) {}
-};
-struct ImpSdXMLExpTransObj2DSkewX : public ImpSdXMLExpTransObj2DBase
-{
- double mfSkewX;
- ImpSdXMLExpTransObj2DSkewX(double fVal)
- : ImpSdXMLExpTransObj2DBase(IMP_SDXMLEXP_TRANSOBJ2D_SKEWX), mfSkewX(fVal) {}
-};
-struct ImpSdXMLExpTransObj2DSkewY : public ImpSdXMLExpTransObj2DBase
-{
- double mfSkewY;
- ImpSdXMLExpTransObj2DSkewY(double fVal)
- : ImpSdXMLExpTransObj2DBase(IMP_SDXMLEXP_TRANSOBJ2D_SKEWY), mfSkewY(fVal) {}
-};
-struct ImpSdXMLExpTransObj2DMatrix : public ImpSdXMLExpTransObj2DBase
-{
- Matrix3D maMatrix;
- ImpSdXMLExpTransObj2DMatrix(const Matrix3D& rNew)
- : ImpSdXMLExpTransObj2DBase(IMP_SDXMLEXP_TRANSOBJ2D_MATRIX), maMatrix(rNew) {}
-};
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-// delete all entries in list
-
-void SdXMLImExTransform2D::EmptyList()
-{
- while(maList.Count())
- {
- ImpSdXMLExpTransObj2DBase* pObj = maList.Remove(maList.Count() - 1);
- switch(pObj->mnType)
- {
- case IMP_SDXMLEXP_TRANSOBJ2D_ROTATE : delete (ImpSdXMLExpTransObj2DRotate*)pObj; break;
- case IMP_SDXMLEXP_TRANSOBJ2D_SCALE : delete (ImpSdXMLExpTransObj2DScale*)pObj; break;
- case IMP_SDXMLEXP_TRANSOBJ2D_TRANSLATE : delete (ImpSdXMLExpTransObj2DTranslate*)pObj; break;
- case IMP_SDXMLEXP_TRANSOBJ2D_SKEWX : delete (ImpSdXMLExpTransObj2DSkewX*)pObj; break;
- case IMP_SDXMLEXP_TRANSOBJ2D_SKEWY : delete (ImpSdXMLExpTransObj2DSkewY*)pObj; break;
- case IMP_SDXMLEXP_TRANSOBJ2D_MATRIX : delete (ImpSdXMLExpTransObj2DMatrix*)pObj; break;
- default : DBG_ERROR("SdXMLImExTransform2D: impossible entry!"); break;
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// add members
-
-void SdXMLImExTransform2D::AddRotate(double fNew)
-{
- if(fNew != 0.0)
- maList.Insert(new ImpSdXMLExpTransObj2DRotate(fNew), LIST_APPEND);
-}
-
-void SdXMLImExTransform2D::AddTranslate(const Vector2D& rNew)
-{
- if(rNew.X() != 0.0 || rNew.Y() != 0.0)
- maList.Insert(new ImpSdXMLExpTransObj2DTranslate(rNew), LIST_APPEND);
-}
-
-void SdXMLImExTransform2D::AddSkewX(double fNew)
-{
- if(fNew != 0.0)
- maList.Insert(new ImpSdXMLExpTransObj2DSkewX(fNew), LIST_APPEND);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// gen string for export
-const OUString& SdXMLImExTransform2D::GetExportString(const SvXMLUnitConverter& rConv)
-{
- OUString aNewString;
- OUString aClosingBrace(sal_Unicode(')'));
- OUString aEmptySpace(sal_Unicode(' '));
-
- for(sal_uInt32 a(0L); a < maList.Count(); a++)
- {
- ImpSdXMLExpTransObj2DBase* pObj = maList.GetObject(a);
- switch(pObj->mnType)
- {
- case IMP_SDXMLEXP_TRANSOBJ2D_ROTATE :
- {
- aNewString += OUString::createFromAscii("rotate (");
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DRotate*)pObj)->mfRotate);
- aNewString += aClosingBrace;
- break;
- }
- case IMP_SDXMLEXP_TRANSOBJ2D_SCALE :
- {
- aNewString += OUString::createFromAscii("scale (");
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DScale*)pObj)->maScale.X());
- aNewString += aEmptySpace;
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DScale*)pObj)->maScale.Y());
- aNewString += aClosingBrace;
- break;
- }
- case IMP_SDXMLEXP_TRANSOBJ2D_TRANSLATE :
- {
- aNewString += OUString::createFromAscii("translate (");
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DTranslate*)pObj)->maTranslate.X(), TRUE);
- aNewString += aEmptySpace;
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DTranslate*)pObj)->maTranslate.Y(), TRUE);
- aNewString += aClosingBrace;
- break;
- }
- case IMP_SDXMLEXP_TRANSOBJ2D_SKEWX :
- {
- aNewString += OUString::createFromAscii("skewX (");
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DSkewX*)pObj)->mfSkewX);
- aNewString += aClosingBrace;
- break;
- }
- case IMP_SDXMLEXP_TRANSOBJ2D_SKEWY :
- {
- aNewString += OUString::createFromAscii("skewY (");
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DSkewY*)pObj)->mfSkewY);
- aNewString += aClosingBrace;
- break;
- }
- case IMP_SDXMLEXP_TRANSOBJ2D_MATRIX :
- {
- aNewString += OUString::createFromAscii("matrix (");
-
- // a
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DMatrix*)pObj)->maMatrix[0][0]);
- aNewString += aEmptySpace;
-
- // b
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DMatrix*)pObj)->maMatrix[1][0]);
- aNewString += aEmptySpace;
-
- // c
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DMatrix*)pObj)->maMatrix[0][1]);
- aNewString += aEmptySpace;
-
- // d
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DMatrix*)pObj)->maMatrix[1][1]);
- aNewString += aEmptySpace;
-
- // e
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DMatrix*)pObj)->maMatrix[0][2], TRUE);
- aNewString += aEmptySpace;
-
- // f
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DMatrix*)pObj)->maMatrix[1][2], TRUE);
-
- aNewString += aClosingBrace;
- break;
- }
- default : DBG_ERROR("SdXMLImExTransform2D: impossible entry!"); break;
- }
-
- // if not the last entry, add one space to next tag
- if(a+1 != maList.Count())
- aNewString += aEmptySpace;
- }
-
- // fill string form OUString
- msString = aNewString;
-
- return msString;
-}
-
-
-//////////////////////////////////////////////////////////////////////////////
-// sets new string, parses it and generates entries
-void SdXMLImExTransform2D::SetString(const OUString& rNew, const SvXMLUnitConverter& rConv)
-{
- msString = rNew;
- EmptyList();
-
- if(msString.getLength())
- {
- const OUString aStr(msString.getStr(), (sal_uInt16)msString.getLength());
- const sal_Int32 nLen(aStr.getLength());
-
- const OUString aString_rotate(OUString::createFromAscii("rotate"));
- const OUString aString_scale(OUString::createFromAscii("scale"));
- const OUString aString_translate(OUString::createFromAscii("translate"));
- const OUString aString_skewX(OUString::createFromAscii("skewX"));
- const OUString aString_skewY(OUString::createFromAscii("skewY"));
- const OUString aString_matrix(OUString::createFromAscii("matrix"));
-
- sal_Int32 nPos(0);
-
- while(nPos < nLen)
- {
- // skip spaces
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- // look for tag
- if(nPos < nLen)
- {
- if(nPos == aStr.indexOf(aString_rotate, nPos))
- {
- double fValue(0.0);
- nPos += 6;
- Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
- fValue = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, fValue);
- if(fValue != 0.0)
- maList.Insert(new ImpSdXMLExpTransObj2DRotate(fValue), LIST_APPEND);
-
- Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
- }
- else if(nPos == aStr.indexOf(aString_scale, nPos))
- {
- Vector2D aValue(1.0, 1.0);
- nPos += 5;
- Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
- aValue.X() = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue.X());
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
- aValue.Y() = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue.Y());
-
- if(aValue.X() != 1.0 || aValue.Y() != 1.0)
- maList.Insert(new ImpSdXMLExpTransObj2DScale(aValue), LIST_APPEND);
-
- Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
- }
- else if(nPos == aStr.indexOf(aString_translate, nPos))
- {
- Vector2D aValue;
- nPos += 9;
- Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
- aValue.X() = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue.X(), TRUE);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
- aValue.Y() = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue.Y(), TRUE);
-
- if(aValue.X() != 0.0 || aValue.Y() != 0.0)
- maList.Insert(new ImpSdXMLExpTransObj2DTranslate(aValue), LIST_APPEND);
-
- Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
- }
- else if(nPos == aStr.indexOf(aString_skewX, nPos))
- {
- double fValue(0.0);
- nPos += 5;
- Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
- fValue = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, fValue);
- if(fValue != 0.0)
- maList.Insert(new ImpSdXMLExpTransObj2DSkewX(fValue), LIST_APPEND);
-
- Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
- }
- else if(nPos == aStr.indexOf(aString_skewY, nPos))
- {
- double fValue(0.0);
- nPos += 5;
- Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
- fValue = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, fValue);
- if(fValue != 0.0)
- maList.Insert(new ImpSdXMLExpTransObj2DSkewY(fValue), LIST_APPEND);
-
- Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
- }
- else if(nPos == aStr.indexOf(aString_matrix, nPos))
- {
- Matrix3D aValue;
-
- nPos += 6;
- Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
-
- // a
- aValue[0][0] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[0][0]);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // b
- aValue[1][0] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[1][0]);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // c
- aValue[0][1] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[0][1]);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // d
- aValue[1][1] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[1][1]);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // e
- aValue[0][2] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[0][2], TRUE);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // f
- aValue[1][2] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[1][2], TRUE);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- maList.Insert(new ImpSdXMLExpTransObj2DMatrix(aValue), LIST_APPEND);
- Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
- }
- else
- nPos++;
- }
- }
- }
-}
-
-void SdXMLImExTransform2D::GetFullTransform(Matrix3D& rFullTrans)
-{
- rFullTrans.Identity();
-
- for(sal_uInt32 a(0L); a < maList.Count(); a++)
- {
- ImpSdXMLExpTransObj2DBase* pObj = maList.GetObject(a);
- switch(pObj->mnType)
- {
- case IMP_SDXMLEXP_TRANSOBJ2D_ROTATE :
- rFullTrans.Rotate(((ImpSdXMLExpTransObj2DRotate*)pObj)->mfRotate);
- break;
- case IMP_SDXMLEXP_TRANSOBJ2D_SCALE :
- rFullTrans.Scale(((ImpSdXMLExpTransObj2DScale*)pObj)->maScale);
- break;
- case IMP_SDXMLEXP_TRANSOBJ2D_TRANSLATE :
- rFullTrans.Translate(((ImpSdXMLExpTransObj2DTranslate*)pObj)->maTranslate);
- break;
- case IMP_SDXMLEXP_TRANSOBJ2D_SKEWX :
- rFullTrans.ShearX(tan(((ImpSdXMLExpTransObj2DSkewX*)pObj)->mfSkewX));
- break;
- case IMP_SDXMLEXP_TRANSOBJ2D_SKEWY :
- rFullTrans.ShearY(tan(((ImpSdXMLExpTransObj2DSkewY*)pObj)->mfSkewY));
- break;
- case IMP_SDXMLEXP_TRANSOBJ2D_MATRIX :
- rFullTrans *= ((ImpSdXMLExpTransObj2DMatrix*)pObj)->maMatrix;
- break;
- default :
- DBG_ERROR("SdXMLImExTransform2D: impossible entry!");
- break;
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-// base class of all 3D transform objects
-
-struct ImpSdXMLExpTransObj3DBase
-{
- sal_uInt16 mnType;
- ImpSdXMLExpTransObj3DBase(sal_uInt16 nType)
- : mnType(nType) {}
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// possible object types for 3D
-
-#define IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_X 0x0000
-#define IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_Y 0x0001
-#define IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_Z 0x0002
-#define IMP_SDXMLEXP_TRANSOBJ3D_SCALE 0x0003
-#define IMP_SDXMLEXP_TRANSOBJ3D_TRANSLATE 0x0004
-#define IMP_SDXMLEXP_TRANSOBJ3D_MATRIX 0x0005
-
-//////////////////////////////////////////////////////////////////////////////
-// classes of objects, different sizes
-
-struct ImpSdXMLExpTransObj3DRotateX : public ImpSdXMLExpTransObj3DBase
-{
- double mfRotateX;
- ImpSdXMLExpTransObj3DRotateX(double fVal)
- : ImpSdXMLExpTransObj3DBase(IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_X), mfRotateX(fVal) {}
-};
-struct ImpSdXMLExpTransObj3DRotateY : public ImpSdXMLExpTransObj3DBase
-{
- double mfRotateY;
- ImpSdXMLExpTransObj3DRotateY(double fVal)
- : ImpSdXMLExpTransObj3DBase(IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_Y), mfRotateY(fVal) {}
-};
-struct ImpSdXMLExpTransObj3DRotateZ : public ImpSdXMLExpTransObj3DBase
-{
- double mfRotateZ;
- ImpSdXMLExpTransObj3DRotateZ(double fVal)
- : ImpSdXMLExpTransObj3DBase(IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_Z), mfRotateZ(fVal) {}
-};
-struct ImpSdXMLExpTransObj3DScale : public ImpSdXMLExpTransObj3DBase
-{
- Vector3D maScale;
- ImpSdXMLExpTransObj3DScale(const Vector3D& rNew)
- : ImpSdXMLExpTransObj3DBase(IMP_SDXMLEXP_TRANSOBJ3D_SCALE), maScale(rNew) {}
-};
-struct ImpSdXMLExpTransObj3DTranslate : public ImpSdXMLExpTransObj3DBase
-{
- Vector3D maTranslate;
- ImpSdXMLExpTransObj3DTranslate(const Vector3D& rNew)
- : ImpSdXMLExpTransObj3DBase(IMP_SDXMLEXP_TRANSOBJ3D_TRANSLATE), maTranslate(rNew) {}
-};
-struct ImpSdXMLExpTransObj3DMatrix : public ImpSdXMLExpTransObj3DBase
-{
- Matrix4D maMatrix;
- ImpSdXMLExpTransObj3DMatrix(const Matrix4D& rNew)
- : ImpSdXMLExpTransObj3DBase(IMP_SDXMLEXP_TRANSOBJ3D_MATRIX), maMatrix(rNew) {}
-};
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-// delete all entries in list
-
-void SdXMLImExTransform3D::EmptyList()
-{
- while(maList.Count())
- {
- ImpSdXMLExpTransObj3DBase* pObj = maList.Remove(maList.Count() - 1);
- switch(pObj->mnType)
- {
- case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_X : delete (ImpSdXMLExpTransObj3DRotateX*)pObj; break;
- case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_Y : delete (ImpSdXMLExpTransObj3DRotateY*)pObj; break;
- case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_Z : delete (ImpSdXMLExpTransObj3DRotateZ*)pObj; break;
- case IMP_SDXMLEXP_TRANSOBJ3D_SCALE : delete (ImpSdXMLExpTransObj3DScale*)pObj; break;
- case IMP_SDXMLEXP_TRANSOBJ3D_TRANSLATE : delete (ImpSdXMLExpTransObj3DTranslate*)pObj; break;
- case IMP_SDXMLEXP_TRANSOBJ3D_MATRIX : delete (ImpSdXMLExpTransObj3DMatrix*)pObj; break;
- default : DBG_ERROR("SdXMLImExTransform3D: impossible entry!"); break;
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// add members
-
-void SdXMLImExTransform3D::AddMatrix(const Matrix4D& rNew)
-{
- if(rNew[0][0] != 1.0 || rNew[1][1] != 1.0 || rNew[2][2] != 1.0
- || rNew[0][1] != 0.0 || rNew[0][2] != 0.0 || rNew[0][3] != 0.0
- || rNew[1][0] != 0.0 || rNew[1][2] != 0.0 || rNew[1][3] != 0.0
- || rNew[2][0] != 0.0 || rNew[2][1] != 0.0 || rNew[2][3] != 0.0)
- maList.Insert(new ImpSdXMLExpTransObj3DMatrix(rNew), LIST_APPEND);
-}
-
-void SdXMLImExTransform3D::AddHomogenMatrix(const drawing::HomogenMatrix& xHomMat)
-{
- Matrix4D aExportMatrix;
-
- aExportMatrix[0][0] = xHomMat.Line1.Column1;
- aExportMatrix[0][1] = xHomMat.Line1.Column2;
- aExportMatrix[0][2] = xHomMat.Line1.Column3;
- aExportMatrix[0][3] = xHomMat.Line1.Column4;
- aExportMatrix[1][0] = xHomMat.Line2.Column1;
- aExportMatrix[1][1] = xHomMat.Line2.Column2;
- aExportMatrix[1][2] = xHomMat.Line2.Column3;
- aExportMatrix[1][3] = xHomMat.Line2.Column4;
- aExportMatrix[2][0] = xHomMat.Line3.Column1;
- aExportMatrix[2][1] = xHomMat.Line3.Column2;
- aExportMatrix[2][2] = xHomMat.Line3.Column3;
- aExportMatrix[2][3] = xHomMat.Line3.Column4;
-
- AddMatrix(aExportMatrix);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// gen string for export
-const OUString& SdXMLImExTransform3D::GetExportString(const SvXMLUnitConverter& rConv)
-{
- OUString aNewString;
- OUString aClosingBrace(sal_Unicode(')'));
- OUString aEmptySpace(sal_Unicode(' '));
-
- for(sal_uInt32 a(0L); a < maList.Count(); a++)
- {
- ImpSdXMLExpTransObj3DBase* pObj = maList.GetObject(a);
- switch(pObj->mnType)
- {
- case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_X :
- {
- aNewString += OUString::createFromAscii("rotatex (");
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DRotateX*)pObj)->mfRotateX);
- aNewString += aClosingBrace;
- break;
- }
- case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_Y :
- {
- aNewString += OUString::createFromAscii("rotatey (");
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DRotateY*)pObj)->mfRotateY);
- aNewString += aClosingBrace;
- break;
- }
- case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_Z :
- {
- aNewString += OUString::createFromAscii("rotatez (");
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DRotateZ*)pObj)->mfRotateZ);
- aNewString += aClosingBrace;
- break;
- }
- case IMP_SDXMLEXP_TRANSOBJ3D_SCALE :
- {
- aNewString += OUString::createFromAscii("scale (");
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DScale*)pObj)->maScale.X());
- aNewString += aEmptySpace;
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DScale*)pObj)->maScale.Y());
- aNewString += aEmptySpace;
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DScale*)pObj)->maScale.Z());
- aNewString += aClosingBrace;
- break;
- }
- case IMP_SDXMLEXP_TRANSOBJ3D_TRANSLATE :
- {
- aNewString += OUString::createFromAscii("translate (");
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DTranslate*)pObj)->maTranslate.X(), TRUE);
- aNewString += aEmptySpace;
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DTranslate*)pObj)->maTranslate.Y(), TRUE);
- aNewString += aEmptySpace;
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DTranslate*)pObj)->maTranslate.Z(), TRUE);
- aNewString += aClosingBrace;
- break;
- }
- case IMP_SDXMLEXP_TRANSOBJ3D_MATRIX :
- {
- aNewString += OUString::createFromAscii("matrix (");
-
- // a
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix[0][0]);
- aNewString += aEmptySpace;
-
- // b
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix[1][0]);
- aNewString += aEmptySpace;
-
- // c
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix[2][0]);
- aNewString += aEmptySpace;
-
- // d
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix[0][1]);
- aNewString += aEmptySpace;
-
- // e
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix[1][1]);
- aNewString += aEmptySpace;
-
- // f
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix[2][1]);
- aNewString += aEmptySpace;
-
- // g
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix[0][2]);
- aNewString += aEmptySpace;
-
- // h
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix[1][2]);
- aNewString += aEmptySpace;
-
- // i
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix[2][2]);
- aNewString += aEmptySpace;
-
- // j
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix[0][3], TRUE);
- aNewString += aEmptySpace;
-
- // k
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix[1][3], TRUE);
- aNewString += aEmptySpace;
-
- // l
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix[2][3], TRUE);
-
- aNewString += aClosingBrace;
- break;
- }
- default : DBG_ERROR("SdXMLImExTransform3D: impossible entry!"); break;
- }
-
- // if not the last entry, add one space to next tag
- if(a+1 != maList.Count())
- aNewString += aEmptySpace;
- }
-
- // fill string form OUString
- msString = aNewString;
-
- return msString;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// for Import: constructor with string, parses it and generates entries
-SdXMLImExTransform3D::SdXMLImExTransform3D(const OUString& rNew, const SvXMLUnitConverter& rConv)
-{
- SetString(rNew, rConv);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// sets new string, parses it and generates entries
-void SdXMLImExTransform3D::SetString(const OUString& rNew, const SvXMLUnitConverter& rConv)
-{
- msString = rNew;
- EmptyList();
-
- if(msString.getLength())
- {
- const OUString aStr(msString.getStr(), (sal_uInt16)msString.getLength());
- const sal_Int32 nLen(aStr.getLength());
-
- const OUString aString_rotatex(OUString::createFromAscii("rotatex"));
- const OUString aString_rotatey(OUString::createFromAscii("rotatey"));
- const OUString aString_rotatez(OUString::createFromAscii("rotatez"));
- const OUString aString_scale(OUString::createFromAscii("scale"));
- const OUString aString_translate(OUString::createFromAscii("translate"));
- const OUString aString_matrix(OUString::createFromAscii("matrix"));
-
- sal_Int32 nPos(0);
-
- while(nPos < nLen)
- {
- // skip spaces
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- // look for tag
- if(nPos < nLen)
- {
- if(nPos == aStr.indexOf(aString_rotatex, nPos))
- {
- double fValue(0.0);
-
- nPos += 7;
- Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
- fValue = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, fValue);
- if(fValue != 0.0)
- maList.Insert(new ImpSdXMLExpTransObj3DRotateX(fValue), LIST_APPEND);
-
- Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
- }
- else if(nPos == aStr.indexOf(aString_rotatey, nPos))
- {
- double fValue(0.0);
-
- nPos += 7;
- Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
- fValue = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, fValue);
- if(fValue != 0.0)
- maList.Insert(new ImpSdXMLExpTransObj3DRotateY(fValue), LIST_APPEND);
-
- Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
- }
- else if(nPos == aStr.indexOf(aString_rotatez, nPos))
- {
- double fValue(0.0);
-
- nPos += 7;
- Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
- fValue = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, fValue);
- if(fValue != 0.0)
- maList.Insert(new ImpSdXMLExpTransObj3DRotateZ(fValue), LIST_APPEND);
-
- Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
- }
- else if(nPos == aStr.indexOf(aString_scale, nPos))
- {
- Vector3D aValue(1.0, 1.0, 1.0);
-
- nPos += 5;
- Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
- aValue.X() = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue.X());
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
- aValue.Y() = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue.Y());
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
- aValue.Z() = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue.Z());
-
- if(aValue.X() != 1.0 || aValue.Y() != 1.0 || aValue.Z() != 1.0)
- maList.Insert(new ImpSdXMLExpTransObj3DScale(aValue), LIST_APPEND);
-
- Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
- }
- else if(nPos == aStr.indexOf(aString_translate, nPos))
- {
- Vector3D aValue;
-
- nPos += 9;
- Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
- aValue.X() = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue.X(), TRUE);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
- aValue.Y() = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue.Y(), TRUE);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
- aValue.Z() = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue.Z(), TRUE);
-
- if(aValue.X() != 0.0 || aValue.Y() != 0.0 || aValue.Z() != 0.0)
- maList.Insert(new ImpSdXMLExpTransObj3DTranslate(aValue), LIST_APPEND);
-
- Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
- }
- else if(nPos == aStr.indexOf(aString_matrix, nPos))
- {
- Matrix4D aValue;
-
- nPos += 6;
- Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
-
- // a
- aValue[0][0] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[0][0]);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // b
- aValue[1][0] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[1][0]);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // c
- aValue[2][0] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[2][0]);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // d
- aValue[0][1] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[0][1]);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // e
- aValue[1][1] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[1][1]);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // f
- aValue[2][1] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[2][1]);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // g
- aValue[0][2] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[0][2]);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // h
- aValue[1][2] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[1][2]);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // i
- aValue[2][2] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[2][2]);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // j
- aValue[0][3] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[0][3], TRUE);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // k
- aValue[1][3] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[1][3], TRUE);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // l
- aValue[2][3] = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue[2][3], TRUE);
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- maList.Insert(new ImpSdXMLExpTransObj3DMatrix(aValue), LIST_APPEND);
- Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
- }
- else
- nPos++;
- }
- }
- }
-}
-
-BOOL SdXMLImExTransform3D::GetFullHomogenTransform( ::com::sun::star::drawing::HomogenMatrix& xHomMat)
-{
- Matrix4D aFullTransform;
- GetFullTransform(aFullTransform);
-
- if(aFullTransform[0][0] != 1.0 || aFullTransform[1][1] != 1.0 || aFullTransform[2][2] != 1.0
- || aFullTransform[0][1] != 0.0 || aFullTransform[0][2] != 0.0 || aFullTransform[0][3] != 0.0
- || aFullTransform[1][0] != 0.0 || aFullTransform[1][2] != 0.0 || aFullTransform[1][3] != 0.0
- || aFullTransform[2][0] != 0.0 || aFullTransform[2][1] != 0.0 || aFullTransform[2][3] != 0.0)
- {
- xHomMat.Line1.Column1 = aFullTransform[0][0];
- xHomMat.Line1.Column2 = aFullTransform[0][1];
- xHomMat.Line1.Column3 = aFullTransform[0][2];
- xHomMat.Line1.Column4 = aFullTransform[0][3];
-
- xHomMat.Line2.Column1 = aFullTransform[1][0];
- xHomMat.Line2.Column2 = aFullTransform[1][1];
- xHomMat.Line2.Column3 = aFullTransform[1][2];
- xHomMat.Line2.Column4 = aFullTransform[1][3];
-
- xHomMat.Line3.Column1 = aFullTransform[2][0];
- xHomMat.Line3.Column2 = aFullTransform[2][1];
- xHomMat.Line3.Column3 = aFullTransform[2][2];
- xHomMat.Line3.Column4 = aFullTransform[2][3];
-
- xHomMat.Line4.Column1 = aFullTransform[3][0];
- xHomMat.Line4.Column2 = aFullTransform[3][1];
- xHomMat.Line4.Column3 = aFullTransform[3][2];
- xHomMat.Line4.Column4 = aFullTransform[3][3];
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-void SdXMLImExTransform3D::GetFullTransform(Matrix4D& rFullTrans)
-{
- rFullTrans.Identity();
-
- for(sal_uInt32 a(0L); a < maList.Count(); a++)
- {
- ImpSdXMLExpTransObj3DBase* pObj = maList.GetObject(a);
- switch(pObj->mnType)
- {
- case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_X :
- rFullTrans.RotateX(((ImpSdXMLExpTransObj3DRotateX*)pObj)->mfRotateX); break;
- case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_Y :
- rFullTrans.RotateY(((ImpSdXMLExpTransObj3DRotateY*)pObj)->mfRotateY); break;
- case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_Z :
- rFullTrans.RotateZ(((ImpSdXMLExpTransObj3DRotateZ*)pObj)->mfRotateZ); break;
- case IMP_SDXMLEXP_TRANSOBJ3D_SCALE :
- rFullTrans.Scale(((ImpSdXMLExpTransObj3DScale*)pObj)->maScale); break;
- case IMP_SDXMLEXP_TRANSOBJ3D_TRANSLATE :
- rFullTrans.Translate(((ImpSdXMLExpTransObj3DTranslate*)pObj)->maTranslate); break;
- case IMP_SDXMLEXP_TRANSOBJ3D_MATRIX :
- rFullTrans *= ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix; break;
- default : DBG_ERROR("SdXMLImExTransform3D: impossible entry!"); break;
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLImExViewBox::SdXMLImExViewBox(sal_Int32 nX, sal_Int32 nY, sal_Int32 nW, sal_Int32 nH)
-: mnX( nX ),
- mnY( nY ),
- mnW( nW ),
- mnH( nH )
-{
-}
-
-// #100617# Asked vincent hardy: svg:viewBox values may be double precision.
-SdXMLImExViewBox::SdXMLImExViewBox(const OUString& rNew, const SvXMLUnitConverter& rConv)
-: mnX( 0L ),
- mnY( 0L ),
- mnW( 1000L ),
- mnH( 1000L ),
- msString(rNew)
-{
- if(msString.getLength())
- {
- const OUString aStr(msString.getStr(), (sal_uInt16)msString.getLength());
- const sal_Int32 nLen(aStr.getLength());
- sal_Int32 nPos(0);
-
- // skip starting spaces
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- // get mX, #100617# be prepared for doubles
- mnX = FRound(Imp_GetDoubleChar(aStr, nPos, nLen, rConv, (double)mnX));
-
- // skip spaces and commas
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // get mY, #100617# be prepared for doubles
- mnY = FRound(Imp_GetDoubleChar(aStr, nPos, nLen, rConv, (double)mnY));
-
- // skip spaces and commas
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // get mW, #100617# be prepared for doubles
- mnW = FRound(Imp_GetDoubleChar(aStr, nPos, nLen, rConv, (double)mnW));
-
- // skip spaces and commas
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // get mH, #100617# be prepared for doubles
- mnH = FRound(Imp_GetDoubleChar(aStr, nPos, nLen, rConv, (double)mnH));
- }
-}
-
-const OUString& SdXMLImExViewBox::GetExportString(const SvXMLUnitConverter& rConv)
-{
- OUString aNewString;
- OUString aEmptySpace(sal_Unicode(' '));
-
- Imp_PutNumberChar(aNewString, rConv, mnX);
- aNewString += aEmptySpace;
-
- Imp_PutNumberChar(aNewString, rConv, mnY);
- aNewString += aEmptySpace;
-
- Imp_PutNumberChar(aNewString, rConv, mnW);
- aNewString += aEmptySpace;
-
- Imp_PutNumberChar(aNewString, rConv, mnH);
-
- // set new string
- msString = aNewString;
-
- return msString;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLImExPointsElement::SdXMLImExPointsElement(drawing::PointSequence* pPoints,
- const SdXMLImExViewBox& rViewBox,
- const awt::Point& rObjectPos,
- const awt::Size& rObjectSize,
- const SvXMLUnitConverter& rConv,
- // #96328#
- const sal_Bool bClosed)
-: maPoly( 0L )
-{
- DBG_ASSERT(pPoints, "Empty PointSequence handed over to SdXMLImExPointsElement(!)");
-
- // add polygon to string
- sal_Int32 nCnt(pPoints->getLength());
-
- // #104076# Convert to string only when at last one point included
- if(nCnt > 0)
- {
- OUString aNewString;
- awt::Point* pArray = pPoints->getArray();
-
- // last point same? Ignore it.
- // #96328# ...but only when polygon is CLOSED
- if(bClosed && (pArray->X == (pArray + (nCnt - 1))->X) && (pArray->Y == (pArray + (nCnt - 1))->Y))
- nCnt--;
-
- // object size and ViewBox size different?
- sal_Bool bScale(rObjectSize.Width != rViewBox.GetWidth()
- || rObjectSize.Height != rViewBox.GetHeight());
- sal_Bool bTranslate(rViewBox.GetX() != 0L || rViewBox.GetY() != 0L);
-
- for(sal_Int32 a(0L); a < nCnt; a++)
- {
- // prepare coordinates
- sal_Int32 nX( pArray->X - rObjectPos.X );
- sal_Int32 nY( pArray->Y - rObjectPos.Y );
-
- if(bScale)
- {
- nX = (nX * rViewBox.GetWidth()) / rObjectSize.Width;
- nY = (nY * rViewBox.GetHeight()) / rObjectSize.Height;
- }
-
- if(bTranslate)
- {
- nX += rViewBox.GetX();
- nY += rViewBox.GetY();
- }
-
- // X and comma
- Imp_PutNumberChar(aNewString, rConv, nX);
- aNewString += OUString(sal_Unicode(','));
-
- // Y and space (not for last)
- Imp_PutNumberChar(aNewString, rConv, nY);
- if(a + 1 != nCnt)
- aNewString += OUString(sal_Unicode(' '));
-
- // next point
- pArray++;
- }
-
- // set new string
- msString = aNewString;
- }
-}
-
-// #100617# svg:polyline or svg:polygon values may be double precision.
-SdXMLImExPointsElement::SdXMLImExPointsElement(const OUString& rNew,
- const SdXMLImExViewBox& rViewBox,
- const awt::Point& rObjectPos,
- const awt::Size& rObjectSize,
- const SvXMLUnitConverter& rConv)
-: msString( rNew ),
- maPoly( 0L )
-{
- // convert string to polygon
- const OUString aStr(msString.getStr(), (sal_uInt16)msString.getLength());
- const sal_Int32 nLen(aStr.getLength());
- sal_Int32 nPos(0);
- sal_Int32 nNumPoints(0L);
-
- // skip starting spaces
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- // count points in first loop
- while(nPos < nLen)
- {
- // skip number, #100617# be prepared for doubles
- Imp_SkipDouble(aStr, nPos, nLen);
-
- // skip spaces and commas
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // skip number, #100617# be prepared for doubles
- Imp_SkipDouble(aStr, nPos, nLen);
-
- // skip spaces and commas
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // one more point
- nNumPoints++;
- }
-
- // second loop
- if(nNumPoints)
- {
- nPos = 0L;
- maPoly.realloc(1L);
- drawing::PointSequence* pOuterSequence = maPoly.getArray();
- pOuterSequence->realloc(nNumPoints);
- awt::Point* pInnerSequence = pOuterSequence->getArray();
-
- // object size and ViewBox size different?
- sal_Bool bScale(rObjectSize.Width != rViewBox.GetWidth()
- || rObjectSize.Height != rViewBox.GetHeight());
- sal_Bool bTranslate(rViewBox.GetX() != 0L || rViewBox.GetY() != 0L);
-
- // skip starting spaces
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen)
- {
- // prepare new parameter pair
- sal_Int32 nX(0L);
- sal_Int32 nY(0L);
-
- // get mX, #100617# be prepared for doubles
- nX = FRound(Imp_GetDoubleChar(aStr, nPos, nLen, rConv, (double)nX));
-
- // skip spaces and commas
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // get mY, #100617# be prepared for doubles
- nY = FRound(Imp_GetDoubleChar(aStr, nPos, nLen, rConv, (double)nY));
-
- // skip spaces and commas
- Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
-
- // prepare parameters
- if(bTranslate)
- {
- nX -= rViewBox.GetX();
- nY -= rViewBox.GetY();
- }
-
- if(bScale)
- {
- nX = (nX * rObjectSize.Width) / rViewBox.GetWidth();
- nY = (nY * rObjectSize.Height) / rViewBox.GetHeight();
- }
-
- nX += rObjectPos.X;
- nY += rObjectPos.Y;
-
- // add new point
- *pInnerSequence = awt::Point( nX, nY );
- pInnerSequence++;
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLImExSvgDElement::SdXMLImExSvgDElement(const SdXMLImExViewBox& rViewBox)
-: mrViewBox( rViewBox ),
- mbIsClosed( FALSE ),
- mbIsCurve( FALSE ),
- mnLastX( 0L ),
- mnLastY( 0L ),
- maPoly( 0L ),
- maFlag( 0L )
-{
-}
-
-void Imp_GetPrevPos(awt::Point*& pPrevPos1,
- drawing::PolygonFlags& aPrevFlag1,
- const BOOL bClosed, awt::Point* pPoints,
- drawing::PolygonFlags* pFlags, const sal_Int32 nPos,
- const sal_Int32 nCnt, const sal_Int32 nAdd)
-{
- if(bClosed)
- {
- pPrevPos1 = pPoints + ((nPos + nCnt - nAdd) % nCnt);
- aPrevFlag1 = *(pFlags + ((nPos + nCnt - nAdd) % nCnt));
- }
- else if(nPos > (nAdd - 1))
- {
- pPrevPos1 = pPoints + (nPos - nAdd);
- aPrevFlag1 = *(pFlags + (nPos - nAdd));
- }
- else
- pPrevPos1 = 0L;
-}
-
-void Imp_PrepareCoorExport(sal_Int32& nX, sal_Int32& nY,
- const awt::Point* pPointArray, const awt::Point& rObjectPos,
- const awt::Size& rObjectSize, const SdXMLImExViewBox& mrViewBox,
- const BOOL bScale, const BOOL bTranslate)
-{
- nX = pPointArray->X - rObjectPos.X;
- nY = pPointArray->Y - rObjectPos.Y;
-
- if(bScale)
- {
- nX = (nX * mrViewBox.GetWidth()) / rObjectSize.Width;
- nY = (nY * mrViewBox.GetHeight()) / rObjectSize.Height;
- }
-
- if(bTranslate)
- {
- nX += mrViewBox.GetX();
- nY += mrViewBox.GetY();
- }
-}
-
-//#define TEST_QUADRATIC_CURVES
-#ifdef TEST_QUADRATIC_CURVES
-// To be able to test quadratic curve code: The code concerning to
-// bDoTestHere can be used (see below). Construct shapes which have their control
-// points on equal coordinates. When these are written, they can be
-// forced to create correct 'Q' and 'T' statements using this flag.
-// These may then be tested for import/exporting.
-static BOOL bDoTestHere(TRUE);
-#endif // TEST_QUADRATIC_CURVES
-
-void SdXMLImExSvgDElement::AddPolygon(
- drawing::PointSequence* pPoints,
- drawing::FlagSequence* pFlags,
- const awt::Point& rObjectPos,
- const awt::Size& rObjectSize,
- const SvXMLUnitConverter& rConv,
- sal_Bool bClosed, sal_Bool bRelative)
-{
- DBG_ASSERT(pPoints, "Empty PointSequence handed over to SdXMLImExSvgDElement(!)");
-
- sal_Int32 nCnt(pPoints->getLength());
-
- // #104076# Convert to string only when at last one point included
- if(nCnt > 0)
- {
- // append polygon to string
- OUString aNewString;
- sal_Unicode aLastCommand;
- awt::Point* pPointArray = pPoints->getArray();
-
- // are the flags used at all? If not forget about them
- if(pFlags)
- {
- sal_Int32 nFlagCnt(pFlags->getLength());
-
- if(nFlagCnt)
- {
- sal_Bool bFlagsUsed(sal_False);
- drawing::PolygonFlags* pFlagArray = pFlags->getArray();
-
- for(sal_Int32 a(0); !bFlagsUsed && a < nFlagCnt; a++)
- if(drawing::PolygonFlags_NORMAL != *pFlagArray++)
- bFlagsUsed = sal_True;
-
- if(!bFlagsUsed)
- pFlags = 0L;
- }
- else
- {
- pFlags = 0L;
- }
- }
-
- // object size and ViewBox size different?
- sal_Bool bScale(rObjectSize.Width != mrViewBox.GetWidth()
- || rObjectSize.Height != mrViewBox.GetHeight());
- sal_Bool bTranslate(mrViewBox.GetX() != 0L || mrViewBox.GetY() != 0L);
-
- // #87202# rework of point reduction:
- // Test for Last point same -> closed, ignore last point. Take
- // some more circumstances in account when looking at curve segments.
- drawing::PolygonFlags* pFlagArray = (pFlags) ? pFlags->getArray() : 0L;
- if((pPointArray->X == (pPointArray + (nCnt - 1))->X) && (pPointArray->Y == (pPointArray + (nCnt - 1))->Y))
- {
- if(pFlags)
- {
- // point needs to be ignored if point before it is
- // NO control point. Else the last point is needed
- // for exporting the last segment of the curve. That means
- // that the last and the first point will be saved double,
- // but SVG does not support a better solution here.
- if(nCnt >= 2 && drawing::PolygonFlags_CONTROL != *(pFlagArray + (nCnt - 2)))
- {
- nCnt--;
- }
- }
- else
- {
- // no curve, ignore last point
- nCnt--;
- }
- }
-
- // bezier poly, handle curves
- BOOL bDidWriteStart(FALSE);
-
- for(sal_Int32 a(0L); a < nCnt; a++)
- {
- if(!pFlags || drawing::PolygonFlags_CONTROL != *pFlagArray)
- {
- BOOL bDidWriteAsCurve(FALSE);
-
- if(bDidWriteStart)
- {
- if(pFlags)
- {
- // real curve point, get previous to see if it's a control point
- awt::Point* pPrevPos1;
- drawing::PolygonFlags aPrevFlag1;
-
- Imp_GetPrevPos(pPrevPos1, aPrevFlag1, bClosed, pPoints->getArray(),
- pFlags->getArray(), a, nCnt, 1);
-
- if(pPrevPos1 && drawing::PolygonFlags_CONTROL == aPrevFlag1)
- {
- // get previous2 to see if it's a control point, too
- awt::Point* pPrevPos2;
- drawing::PolygonFlags aPrevFlag2;
-
- Imp_GetPrevPos(pPrevPos2, aPrevFlag2, bClosed, pPoints->getArray(),
- pFlags->getArray(), a, nCnt, 2);
-
- if(pPrevPos2 && drawing::PolygonFlags_CONTROL == aPrevFlag2)
- {
- // get previous3 to see if it's a curve point and if,
- // if it is fully symmetric or not
- awt::Point* pPrevPos3;
- drawing::PolygonFlags aPrevFlag3;
-
- Imp_GetPrevPos(pPrevPos3, aPrevFlag3, bClosed, pPoints->getArray(),
- pFlags->getArray(), a, nCnt, 3);
-
- if(pPrevPos3)
- {
- // prepare coordinates
- sal_Int32 nX, nY;
-
- Imp_PrepareCoorExport(nX, nY, pPointArray, rObjectPos, rObjectSize,
- mrViewBox, bScale, bTranslate);
-
- // #100617# test if this curve segment may be written as
- // a quadratic bezier
- // That's the case if both control points are in the same place
- // when they are prolonged to the common quadratic control point
- // Left: P = (3P1 - P0) / 2
- // Right: P = (3P2 - P3) / 2
- sal_Bool bIsQuadratic(sal_False);
- const sal_Bool bEnableSaveQuadratic(sal_False);
-
- sal_Int32 nPX_L(FRound((double)((3 * pPrevPos2->X) - pPrevPos3->X) / 2.0));
- sal_Int32 nPY_L(FRound((double)((3 * pPrevPos2->Y) - pPrevPos3->Y) / 2.0));
- sal_Int32 nPX_R(FRound((double)((3 * pPrevPos1->X) - pPointArray->X) / 2.0));
- sal_Int32 nPY_R(FRound((double)((3 * pPrevPos1->Y) - pPointArray->Y) / 2.0));
- sal_Int32 nDist(0);
-
- if(nPX_L != nPX_R)
- {
- nDist += abs(nPX_L - nPX_R);
- }
-
- if(nPY_L != nPY_R)
- {
- nDist += abs(nPY_L - nPY_R);
- }
-
- if(nDist <= BORDER_INTEGERS_ARE_EQUAL)
- {
- if(bEnableSaveQuadratic)
- {
- bIsQuadratic = sal_True;
- }
- }
-
-#ifdef TEST_QUADRATIC_CURVES
- if(bDoTestHere)
- {
- bIsQuadratic = sal_False;
-
- if(pPrevPos1->X == pPrevPos2->X && pPrevPos1->Y == pPrevPos2->Y)
- bIsQuadratic = sal_True;
- }
-#endif // TEST_QUADRATIC_CURVES
-
- if(bIsQuadratic)
- {
-#ifdef TEST_QUADRATIC_CURVES
- if(bDoTestHere)
- {
- sal_Bool bPrevPointIsSymmetric(sal_False);
-
- if(drawing::PolygonFlags_SYMMETRIC == aPrevFlag3)
- {
- // get previous4 to see if it's a control point
- awt::Point* pPrevPos4;
- drawing::PolygonFlags aPrevFlag4;
-
- Imp_GetPrevPos(pPrevPos4, aPrevFlag4, bClosed, pPoints->getArray(),
- pFlags->getArray(), a, nCnt, 4);
-
- if(drawing::PolygonFlags_CONTROL == aPrevFlag4)
- {
- // okay, prevPos3 is symmetric (c2) and prevPos4
- // is existing control point, the 's' statement can be used
- bPrevPointIsSymmetric = sal_True;
- }
- }
-
- if(bPrevPointIsSymmetric)
- {
- // write a shorthand/smooth quadratic curveto entry (T)
- if(bRelative)
- {
- if(aLastCommand != sal_Unicode('t'))
- aNewString += OUString(sal_Unicode('t'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX - mnLastX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY - mnLastY);
-
- aLastCommand = sal_Unicode('t');
- }
- else
- {
- if(aLastCommand != sal_Unicode('T'))
- aNewString += OUString(sal_Unicode('T'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY);
-
- aLastCommand = sal_Unicode('T');
- }
- }
- else
- {
- // prepare coordinates
- sal_Int32 nX1, nY1;
-
- Imp_PrepareCoorExport(nX1, nY1, pPrevPos1, rObjectPos, rObjectSize,
- mrViewBox, bScale, bTranslate);
-
- // write a quadratic curveto entry (Q)
- if(bRelative)
- {
- if(aLastCommand != sal_Unicode('q'))
- aNewString += OUString(sal_Unicode('q'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX1 - mnLastX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY1 - mnLastY);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX - mnLastX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY - mnLastY);
-
- aLastCommand = sal_Unicode('q');
- }
- else
- {
- if(aLastCommand != sal_Unicode('Q'))
- aNewString += OUString(sal_Unicode('Q'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX1);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY1);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY);
-
- aLastCommand = sal_Unicode('Q');
- }
- }
- }
- else
- {
-#endif // TEST_QUADRATIC_CURVES
- awt::Point aNewPoint(nPX_L, nPY_L);
- sal_Bool bPrevPointIsSmooth(sal_False);
-
- if(drawing::PolygonFlags_SMOOTH == aPrevFlag3)
- {
- // get previous4 to see if it's a control point
- awt::Point* pPrevPos4;
- drawing::PolygonFlags aPrevFlag4;
-
- Imp_GetPrevPos(pPrevPos4, aPrevFlag4, bClosed, pPoints->getArray(),
- pFlags->getArray(), a, nCnt, 4);
-
- if(drawing::PolygonFlags_CONTROL == aPrevFlag4)
- {
- // okay, prevPos3 is smooth (c1) and prevPos4
- // is existing control point. Test if it's even symmetric
- // and thus the 'T' statement may be used.
- Vector2D aVec1(pPrevPos4->X - pPrevPos3->X, pPrevPos4->Y - pPrevPos3->Y);
- Vector2D aVec2(aNewPoint.X - pPrevPos3->X, aNewPoint.Y - pPrevPos3->Y);
- sal_Bool bSameLength(FALSE);
- sal_Bool bSameDirection(FALSE);
-
- // get vector values
- Imp_CalcVectorValues(aVec1, aVec2, bSameLength, bSameDirection);
-
- if(bSameLength && bSameDirection)
- bPrevPointIsSmooth = sal_True;
- }
- }
-
- if(bPrevPointIsSmooth)
- {
- // write a shorthand/smooth quadratic curveto entry (T)
- if(bRelative)
- {
- if(aLastCommand != sal_Unicode('t'))
- aNewString += OUString(sal_Unicode('t'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX - mnLastX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY - mnLastY);
-
- aLastCommand = sal_Unicode('t');
- }
- else
- {
- if(aLastCommand != sal_Unicode('T'))
- aNewString += OUString(sal_Unicode('T'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY);
-
- aLastCommand = sal_Unicode('T');
- }
- }
- else
- {
- // prepare coordinates
- sal_Int32 nX1, nY1;
-
- Imp_PrepareCoorExport(nX1, nY1, &aNewPoint, rObjectPos, rObjectSize,
- mrViewBox, bScale, bTranslate);
-
- // write a quadratic curveto entry (Q)
- if(bRelative)
- {
- if(aLastCommand != sal_Unicode('q'))
- aNewString += OUString(sal_Unicode('q'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX1 - mnLastX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY1 - mnLastY);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX - mnLastX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY - mnLastY);
-
- aLastCommand = sal_Unicode('q');
- }
- else
- {
- if(aLastCommand != sal_Unicode('Q'))
- aNewString += OUString(sal_Unicode('Q'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX1);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY1);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY);
-
- aLastCommand = sal_Unicode('Q');
- }
- }
-#ifdef TEST_QUADRATIC_CURVES
- }
-#endif // TEST_QUADRATIC_CURVES
- }
- else
- {
- sal_Bool bPrevPointIsSymmetric(sal_False);
-
- if(drawing::PolygonFlags_SYMMETRIC == aPrevFlag3)
- {
- // get previous4 to see if it's a control point
- awt::Point* pPrevPos4;
- drawing::PolygonFlags aPrevFlag4;
-
- Imp_GetPrevPos(pPrevPos4, aPrevFlag4, bClosed, pPoints->getArray(),
- pFlags->getArray(), a, nCnt, 4);
-
- if(drawing::PolygonFlags_CONTROL == aPrevFlag4)
- {
- // okay, prevPos3 is symmetric (c2) and prevPos4
- // is existing control point, the 's' statement can be used
- bPrevPointIsSymmetric = sal_True;
- }
- }
-
- // prepare coordinates
- sal_Int32 nX2, nY2;
-
- Imp_PrepareCoorExport(nX2, nY2, pPrevPos1, rObjectPos, rObjectSize,
- mrViewBox, bScale, bTranslate);
-
- if(bPrevPointIsSymmetric)
- {
- // write a shorthand/smooth curveto entry (S)
- if(bRelative)
- {
- if(aLastCommand != sal_Unicode('s'))
- aNewString += OUString(sal_Unicode('s'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX2 - mnLastX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY2 - mnLastY);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX - mnLastX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY - mnLastY);
-
- aLastCommand = sal_Unicode('s');
- }
- else
- {
- if(aLastCommand != sal_Unicode('S'))
- aNewString += OUString(sal_Unicode('S'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX2);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY2);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY);
-
- aLastCommand = sal_Unicode('S');
- }
- }
- else
- {
- // prepare coordinates
- sal_Int32 nX1, nY1;
-
- Imp_PrepareCoorExport(nX1, nY1, pPrevPos2, rObjectPos, rObjectSize,
- mrViewBox, bScale, bTranslate);
-
- // write a curveto entry (C)
- if(bRelative)
- {
- if(aLastCommand != sal_Unicode('c'))
- aNewString += OUString(sal_Unicode('c'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX1 - mnLastX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY1 - mnLastY);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX2 - mnLastX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY2 - mnLastY);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX - mnLastX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY - mnLastY);
-
- aLastCommand = sal_Unicode('c');
- }
- else
- {
- if(aLastCommand != sal_Unicode('C'))
- aNewString += OUString(sal_Unicode('C'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX1);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY1);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX2);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY2);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY);
-
- aLastCommand = sal_Unicode('C');
- }
- }
- }
-
- // remember that current point IS written
- bDidWriteAsCurve = TRUE;
-
- // remember new last position
- mnLastX = nX;
- mnLastY = nY;
- }
- }
- }
- }
- }
-
- if(!bDidWriteAsCurve)
- {
- // current point not yet written, prepare coordinates
- sal_Int32 nX, nY;
-
- Imp_PrepareCoorExport(nX, nY, pPointArray, rObjectPos, rObjectSize,
- mrViewBox, bScale, bTranslate);
-
- if(bDidWriteStart)
- {
- // write as normal point
- if(mnLastX == nX)
- {
- if(bRelative)
- {
- if(aLastCommand != sal_Unicode('v'))
- aNewString += OUString(sal_Unicode('v'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY - mnLastY);
-
- aLastCommand = sal_Unicode('v');
- }
- else
- {
- if(aLastCommand != sal_Unicode('V'))
- aNewString += OUString(sal_Unicode('V'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY);
-
- aLastCommand = sal_Unicode('V');
- }
- }
- else if(mnLastY == nY)
- {
- if(bRelative)
- {
- if(aLastCommand != sal_Unicode('h'))
- aNewString += OUString(sal_Unicode('h'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX - mnLastX);
-
- aLastCommand = sal_Unicode('h');
- }
- else
- {
- if(aLastCommand != sal_Unicode('H'))
- aNewString += OUString(sal_Unicode('H'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX);
-
- aLastCommand = sal_Unicode('H');
- }
- }
- else
- {
- if(bRelative)
- {
- if(aLastCommand != sal_Unicode('l'))
- aNewString += OUString(sal_Unicode('l'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX - mnLastX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY - mnLastY);
-
- aLastCommand = sal_Unicode('l');
- }
- else
- {
- if(aLastCommand != sal_Unicode('L'))
- aNewString += OUString(sal_Unicode('L'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY);
-
- aLastCommand = sal_Unicode('L');
- }
- }
- }
- else
- {
- // write as start point
- if(bRelative)
- {
- aNewString += OUString(sal_Unicode('m'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX - mnLastX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY - mnLastY);
-
- aLastCommand = sal_Unicode('l');
- }
- else
- {
- aNewString += OUString(sal_Unicode('M'));
-
- Imp_PutNumberCharWithSpace(aNewString, rConv, nX);
- Imp_PutNumberCharWithSpace(aNewString, rConv, nY);
-
- aLastCommand = sal_Unicode('L');
- }
-
- // remember start written
- bDidWriteStart = TRUE;
- }
-
- // remember new last position
- mnLastX = nX;
- mnLastY = nY;
- }
- }
-
- // next point
- pPointArray++;
- pFlagArray++;
- }
-
- // close path if closed poly
- if(bClosed)
- {
- if(bRelative)
- aNewString += OUString(sal_Unicode('z'));
- else
- aNewString += OUString(sal_Unicode('Z'));
- }
-
- // append new string
- msString += aNewString;
- }
-}
-
-// #100617# Linear double reader
-double Imp_ImportDoubleAndSpaces(
- double fRetval, const OUString& rStr, sal_Int32& rPos,
- const sal_Int32 nLen, const SvXMLUnitConverter& rConv)
-{
- fRetval = Imp_GetDoubleChar(rStr, rPos, nLen, rConv, fRetval);
- Imp_SkipSpacesAndCommas(rStr, rPos, nLen);
- return fRetval;
-}
-
-// #100617# Allow to read doubles, too. This will need to be changed to
-// the usage of Imp_ImportDoubleAndSpaces(...). For now, this is sufficient
-// since the interface cannot transport doubles.
-sal_Int32 Imp_ImportNumberAndSpaces(
- sal_Int32 nRetval, const OUString& rStr, sal_Int32& rPos,
- const sal_Int32 nLen, const SvXMLUnitConverter& rConv)
-{
- nRetval = FRound(Imp_ImportDoubleAndSpaces(double(nRetval), rStr, rPos, nLen, rConv));
- Imp_SkipSpacesAndCommas(rStr, rPos, nLen);
- return nRetval;
-}
-
-void Imp_PrepareCoorImport(sal_Int32& nX, sal_Int32& nY,
- const awt::Point& rObjectPos, const awt::Size& rObjectSize,
- const SdXMLImExViewBox& rViewBox, const BOOL bScale, const BOOL bTranslate)
-{
- if(bTranslate)
- {
- nX -= rViewBox.GetX();
- nY -= rViewBox.GetY();
- }
-
- if(bScale)
- {
- nX = (nX * rObjectSize.Width) / rViewBox.GetWidth();
- nY = (nY * rObjectSize.Height) / rViewBox.GetHeight();
- }
-
- nX += rObjectPos.X;
- nY += rObjectPos.Y;
-}
-
-void Imp_AddExportPoints(sal_Int32 nX, sal_Int32 nY,
- awt::Point* pPoints, drawing::PolygonFlags* pFlags,
- const sal_Int32 nInnerIndex,
- drawing::PolygonFlags eFlag)
-{
- if(pPoints)
- pPoints[nInnerIndex] = awt::Point( nX, nY );
-
- if(pFlags)
- pFlags[nInnerIndex] = eFlag;
-}
-
-void Imp_CalcVectorValues(Vector2D& aVec1, Vector2D& aVec2, sal_Bool& bSameLength, sal_Bool& bSameDirection)
-{
- sal_Int32 nLen1 = (sal_Int32)(aVec1.GetLength() + 0.5);
- sal_Int32 nLen2 = (sal_Int32)(aVec2.GetLength() + 0.5);
- aVec1.Normalize();
- aVec2.Normalize();
- aVec1 += aVec2;
- sal_Int32 nLen3 = (sal_Int32)((aVec1.GetLength() * ((nLen1 + nLen2) / 2.0))+ 0.5);
-
- bSameLength = (abs(nLen1 - nLen2) <= BORDER_INTEGERS_ARE_EQUAL);
- bSameDirection = (nLen3 <= BORDER_INTEGERS_ARE_EQUAL);
-}
-
-void Imp_CorrectPolygonFlag(const sal_uInt32 nInnerIndex, const awt::Point* const pInnerSequence,
- drawing::PolygonFlags* const pInnerFlags, const sal_Int32 nX1, const sal_Int32 nY1)
-{
- if(nInnerIndex)
- {
- const awt::Point aPPrev1 = pInnerSequence[nInnerIndex - 1];
-
- if(nInnerIndex > 1)
- {
- const awt::Point aPPrev2 = pInnerSequence[nInnerIndex - 2];
- const drawing::PolygonFlags aFPrev2 = pInnerFlags[nInnerIndex - 2];
- Vector2D aVec1(aPPrev2.X - aPPrev1.X, aPPrev2.Y - aPPrev1.Y);
- Vector2D aVec2(nX1 - aPPrev1.X, nY1 - aPPrev1.Y);
- sal_Bool bSameLength(FALSE);
- sal_Bool bSameDirection(FALSE);
-
- // get vector values
- Imp_CalcVectorValues(aVec1, aVec2, bSameLength, bSameDirection);
-
- if(drawing::PolygonFlags_CONTROL == aFPrev2)
- {
- // point before is a control point
- if(bSameDirection)
- {
- if(bSameLength)
- {
- // set to PolygonFlags_SYMMETRIC
- pInnerFlags[nInnerIndex - 1] = drawing::PolygonFlags_SYMMETRIC;
- }
- else
- {
- // set to PolygonFlags_SMOOTH
- pInnerFlags[nInnerIndex - 1] = drawing::PolygonFlags_SMOOTH;
- }
- }
- else
- {
- // set to PolygonFlags_NORMAL
- pInnerFlags[nInnerIndex - 1] = drawing::PolygonFlags_NORMAL;
- }
- }
- else
- {
- // point before is a simple curve point
- if(bSameDirection)
- {
- // set to PolygonFlags_SMOOTH
- pInnerFlags[nInnerIndex - 1] = drawing::PolygonFlags_SMOOTH;
- }
- else
- {
- // set to PolygonFlags_NORMAL
- pInnerFlags[nInnerIndex - 1] = drawing::PolygonFlags_NORMAL;
- }
- }
- }
- else
- {
- // no point before starpoint, set type to PolygonFlags_NORMAL
- pInnerFlags[nInnerIndex - 1] = drawing::PolygonFlags_NORMAL;
- }
- }
-}
-
-SdXMLImExSvgDElement::SdXMLImExSvgDElement(const OUString& rNew,
- const SdXMLImExViewBox& rViewBox,
- const awt::Point& rObjectPos,
- const awt::Size& rObjectSize,
- const SvXMLUnitConverter& rConv)
-: msString( rNew ),
- mrViewBox( rViewBox ),
- mbIsClosed( FALSE ),
- mbIsCurve( FALSE ),
- mnLastX( 0L ),
- mnLastY( 0L ),
- maPoly( 0L ),
- maFlag( 0L )
-{
- // convert string to polygon
- const OUString aStr(msString.getStr(), msString.getLength());
- const sal_Int32 nLen(aStr.getLength());
- sal_Int32 nPos(0);
- sal_Int32 nNumPolys(0L);
- sal_Bool bEllipticalArc(FALSE);
-
- // object size and ViewBox size different?
- sal_Bool bScale(rObjectSize.Width != mrViewBox.GetWidth()
- || rObjectSize.Height != mrViewBox.GetHeight());
- sal_Bool bTranslate(mrViewBox.GetX() != 0L || mrViewBox.GetY() != 0L);
-
- // first loop: count polys and get flags
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen)
- {
- switch(aStr[nPos++])
- {
- case 'Z' :
- case 'z' :
- {
- break;
- }
- case 'M' :
- case 'm' :
- {
- nNumPolys++;
- break;
- }
- case 'S' :
- case 's' :
- case 'C' :
- case 'c' :
- case 'Q' :
- case 'q' :
- case 'T' :
- case 't' :
- {
- mbIsCurve = TRUE;
- break;
- }
- case 'L' :
- case 'l' :
- case 'H' :
- case 'h' :
- case 'V' :
- case 'v' :
- {
- // normal, interpreted values. All okay.
- break;
- }
- case 'A' :
- case 'a' :
- {
- // Not yet interpreted value.
- bEllipticalArc = TRUE;
- break;
- }
- }
- }
-
- DBG_ASSERT(!bEllipticalArc, "XMLIMP: non-interpreted tags in svg:d element!");
-
- if(nNumPolys)
- {
- // alloc arrays
- maPoly.realloc(nNumPolys);
- if(IsCurve())
- maFlag.realloc(nNumPolys);
-
- // get outer sequences
- drawing::PointSequence* pOuterSequence = maPoly.getArray();
- drawing::FlagSequence* pOuterFlags = (IsCurve()) ? maFlag.getArray() : 0L;
-
- // prepare new loop, count
- sal_uInt32 nPointCount(0L);
- nPos = 0;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- // #104076# reset closed flag for next to be started polygon
- mbIsClosed = FALSE;
-
- while(nPos < nLen)
- {
- switch(aStr[nPos])
- {
- case 'z' :
- case 'Z' :
- {
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- // #104076# remember closed state of current polygon
- mbIsClosed = TRUE;
-
- break;
- }
- case 'm' :
- case 'M' :
- {
- // new poly starts, end-process current poly
- if(nPointCount)
- {
- // #104076# If this partial polygon is closed, use one more point
- // to represent that
- if(mbIsClosed)
- {
- nPointCount++;
- }
-
- pOuterSequence->realloc(nPointCount);
- pOuterSequence++;
-
- if(pOuterFlags)
- {
- pOuterFlags->realloc(nPointCount);
- pOuterFlags++;
- }
-
- // reset point count for next polygon
- nPointCount = 0L;
- }
-
- // #104076# reset closed flag for next to be started polygon
- mbIsClosed = FALSE;
-
- // NO break, continue in next case
- }
- case 'L' :
- case 'l' :
- {
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen && Imp_IsOnNumberChar(aStr, nPos))
- {
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- nPointCount++;
- }
- break;
- }
- case 'H' :
- case 'h' :
- case 'V' :
- case 'v' :
- {
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen && Imp_IsOnNumberChar(aStr, nPos))
- {
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- nPointCount++;
- }
- break;
- }
- case 'S' :
- case 's' :
- {
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen && Imp_IsOnNumberChar(aStr, nPos))
- {
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- nPointCount += 3;
- }
- break;
- }
- case 'C' :
- case 'c' :
- {
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen && Imp_IsOnNumberChar(aStr, nPos))
- {
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- nPointCount += 3;
- }
- break;
- }
-
- // #100617# quadratic beziers, supported as cubic ones
- case 'Q' :
- case 'q' :
- {
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen && Imp_IsOnNumberChar(aStr, nPos))
- {
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
-
- // use three points since quadratic is imported as cubic
- nPointCount += 3;
- }
- break;
- }
-
- // #100617# relative quadratic beziers, supported as cubic ones
- case 'T' :
- case 't' :
- {
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen && Imp_IsOnNumberChar(aStr, nPos))
- {
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
-
- // use three points since quadratic is imported as cubic
- nPointCount += 3;
- }
- break;
- }
-
- // #100617# not yet supported: elliptical arc
- case 'A' :
- case 'a' :
- {
- DBG_ERROR("XMLIMP: non-interpreted tags in svg:d element (elliptical arc)!");
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen && Imp_IsOnNumberChar(aStr, nPos))
- {
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipNumberAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipNumberAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- }
- break;
- }
-
- default:
- {
- nPos++;
- DBG_ERROR("XMLIMP: non-interpreted tags in svg:d element (unknown)!");
- break;
- }
- }
- }
-
- // alloc last poly (when points used)
- if(nPointCount)
- {
- // #104076# If this partial polygon is closed, use one more point
- // to represent that
- if(mbIsClosed)
- {
- nPointCount++;
- }
-
- pOuterSequence->realloc(nPointCount);
- pOuterSequence++;
-
- if(pOuterFlags)
- {
- pOuterFlags->realloc(nPointCount);
- pOuterFlags++;
- }
- }
-
- // set pointers back
- pOuterSequence = maPoly.getArray();
- pOuterFlags = (IsCurve()) ? maFlag.getArray() : 0L;
- awt::Point* pInnerSequence = 0L;
- drawing::PolygonFlags* pInnerFlags = 0L;
- sal_uInt32 nInnerIndex(0L);
-
- // prepare new loop, read points
- nPos = 0;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- // #104076# reset closed flag for next to be started polygon
- mbIsClosed = FALSE;
-
- while(nPos < nLen)
- {
- BOOL bRelative(FALSE);
-
- switch(aStr[nPos])
- {
- case 'z' :
- case 'Z' :
- {
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- // #104076# remember closed state of current polygon
- mbIsClosed = TRUE;
-
- // closed: add first point again
- // sal_Int32 nX(pInnerSequence[0].X);
- // sal_Int32 nY(pInnerSequence[0].Y);
- // Imp_AddExportPoints(nX, nY, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_NORMAL);
-
- break;
- }
-
- case 'm' :
- {
- bRelative = TRUE;
- }
- case 'M' :
- {
- // #104076# end-process current poly
- if(mbIsClosed)
- {
- if(pInnerSequence)
- {
- // closed: add first point again
- sal_Int32 nX(pInnerSequence[0].X);
- sal_Int32 nY(pInnerSequence[0].Y);
- Imp_AddExportPoints(nX, nY, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_NORMAL);
- }
-
- // reset closed flag for next to be started polygon
- mbIsClosed = FALSE;
- }
-
- // next poly
- pInnerSequence = pOuterSequence->getArray();
- pOuterSequence++;
-
- if(pOuterFlags)
- {
- pInnerFlags = pOuterFlags->getArray();
- pOuterFlags++;
- }
-
- nInnerIndex = 0L;
-
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen && Imp_IsOnNumberChar(aStr, nPos))
- {
- sal_Int32 nX(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
- sal_Int32 nY(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
-
- if(bRelative)
- {
- nX += mnLastX;
- nY += mnLastY;
- }
-
- // set last position
- mnLastX = nX;
- mnLastY = nY;
-
- // calc transform and add point and flag
- Imp_PrepareCoorImport(nX, nY, rObjectPos, rObjectSize, mrViewBox, bScale, bTranslate);
- Imp_AddExportPoints(nX, nY, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_NORMAL);
- }
- break;
- }
-
- case 'l' :
- {
- bRelative = TRUE;
- }
- case 'L' :
- {
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen && Imp_IsOnNumberChar(aStr, nPos))
- {
- sal_Int32 nX(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
- sal_Int32 nY(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
-
- if(bRelative)
- {
- nX += mnLastX;
- nY += mnLastY;
- }
-
- // set last position
- mnLastX = nX;
- mnLastY = nY;
-
- // calc transform and add point and flag
- Imp_PrepareCoorImport(nX, nY, rObjectPos, rObjectSize, mrViewBox, bScale, bTranslate);
- Imp_AddExportPoints(nX, nY, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_NORMAL);
- }
- break;
- }
-
- case 'h' :
- {
- bRelative = TRUE;
- }
- case 'H' :
- {
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen && Imp_IsOnNumberChar(aStr, nPos))
- {
- sal_Int32 nX(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
- sal_Int32 nY(mnLastY);
-
- if(bRelative)
- nX += mnLastX;
-
- // set last position
- mnLastX = nX;
-
- // calc transform and add point and flag
- Imp_PrepareCoorImport(nX, nY, rObjectPos, rObjectSize, mrViewBox, bScale, bTranslate);
- Imp_AddExportPoints(nX, nY, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_NORMAL);
- }
- break;
- }
-
- case 'v' :
- {
- bRelative = TRUE;
- }
- case 'V' :
- {
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen && Imp_IsOnNumberChar(aStr, nPos))
- {
- sal_Int32 nX(mnLastX);
- sal_Int32 nY(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
-
- if(bRelative)
- nY += mnLastY;
-
- // set last position
- mnLastY = nY;
-
- // calc transform and add point and flag
- Imp_PrepareCoorImport(nX, nY, rObjectPos, rObjectSize, mrViewBox, bScale, bTranslate);
- Imp_AddExportPoints(nX, nY, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_NORMAL);
- }
- break;
- }
-
- case 's' :
- {
- bRelative = TRUE;
- }
- case 'S' :
- {
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen && Imp_IsOnNumberChar(aStr, nPos))
- {
- sal_Int32 nX1;
- sal_Int32 nY1;
- sal_Int32 nX2(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
- sal_Int32 nY2(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
- sal_Int32 nX(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
- sal_Int32 nY(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
-
- if(bRelative)
- {
- nX2 += mnLastX;
- nY2 += mnLastY;
- nX += mnLastX;
- nY += mnLastY;
- }
-
- // set last position
- mnLastX = nX;
- mnLastY = nY;
-
- // calc transform for new points
- Imp_PrepareCoorImport(nX2, nY2, rObjectPos, rObjectSize, mrViewBox, bScale, bTranslate);
- Imp_PrepareCoorImport(nX, nY, rObjectPos, rObjectSize, mrViewBox, bScale, bTranslate);
-
- // one more thing is known: the previous real point is PolygonFlags_SYMMETRIC
- // and the Point X1,Y1 can be constructed by mirroring the point before it.
- nX1 = nX2;
- nY1 = nY2;
- if(nInnerIndex)
- {
- awt::Point aPPrev1 = pInnerSequence[nInnerIndex - 1];
-
- if(nInnerIndex > 1)
- {
- awt::Point aPPrev2 = pInnerSequence[nInnerIndex - 2];
- nX1 = aPPrev1.X -(aPPrev2.X - aPPrev1.X);
- nY1 = aPPrev1.Y -(aPPrev2.Y - aPPrev1.Y);
- }
-
- // set curve point to symmetric
- pInnerFlags[nInnerIndex - 1] = drawing::PolygonFlags_SYMMETRIC;
- }
-
- // add calculated control point
- Imp_AddExportPoints(nX1, nY1, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_CONTROL);
-
- // add new points and set flags
- Imp_AddExportPoints(nX2, nY2, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_CONTROL);
- Imp_AddExportPoints(nX, nY, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_SMOOTH);
- }
- break;
- }
-
- case 'c' :
- {
- bRelative = TRUE;
- }
- case 'C' :
- {
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen && Imp_IsOnNumberChar(aStr, nPos))
- {
- sal_Int32 nX1(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
- sal_Int32 nY1(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
- sal_Int32 nX2(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
- sal_Int32 nY2(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
- sal_Int32 nX(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
- sal_Int32 nY(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
-
- if(bRelative)
- {
- nX1 += mnLastX;
- nY1 += mnLastY;
- nX2 += mnLastX;
- nY2 += mnLastY;
- nX += mnLastX;
- nY += mnLastY;
- }
-
- // set last position
- mnLastX = nX;
- mnLastY = nY;
-
- // calc transform for new points
- Imp_PrepareCoorImport(nX1, nY1, rObjectPos, rObjectSize, mrViewBox, bScale, bTranslate);
- Imp_PrepareCoorImport(nX2, nY2, rObjectPos, rObjectSize, mrViewBox, bScale, bTranslate);
- Imp_PrepareCoorImport(nX, nY, rObjectPos, rObjectSize, mrViewBox, bScale, bTranslate);
-
- // correct polygon flag for previous point
- Imp_CorrectPolygonFlag(nInnerIndex, pInnerSequence, pInnerFlags, nX1, nY1);
-
- // add new points and set flags
- Imp_AddExportPoints(nX1, nY1, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_CONTROL);
- Imp_AddExportPoints(nX2, nY2, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_CONTROL);
- Imp_AddExportPoints(nX, nY, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_SMOOTH);
- }
- break;
- }
-
- // #100617# quadratic beziers are imported as cubic
- case 'q' :
- {
- bRelative = TRUE;
- }
- case 'Q' :
- {
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen && Imp_IsOnNumberChar(aStr, nPos))
- {
- sal_Int32 nXX(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
- sal_Int32 nYY(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
- sal_Int32 nX(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
- sal_Int32 nY(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
-
- if(bRelative)
- {
- nXX += mnLastX;
- nYY += mnLastY;
- nX += mnLastX;
- nY += mnLastY;
- }
-
- // set last position
- mnLastX = nX;
- mnLastY = nY;
-
- // calc transform for new points
- Imp_PrepareCoorImport(nXX, nYY, rObjectPos, rObjectSize, mrViewBox, bScale, bTranslate);
- Imp_PrepareCoorImport(nX, nY, rObjectPos, rObjectSize, mrViewBox, bScale, bTranslate);
-
- // calculate X1,X2
- awt::Point aPPrev1 = (nInnerIndex) ? pInnerSequence[nInnerIndex-1] : pInnerSequence[0];
- sal_Int32 nX1 = FRound((double)((nXX * 2) + aPPrev1.X) / 3.0);
- sal_Int32 nY1 = FRound((double)((nYY * 2) + aPPrev1.Y) / 3.0);
- sal_Int32 nX2 = FRound((double)((nXX * 2) + nX) / 3.0);
- sal_Int32 nY2 = FRound((double)((nYY * 2) + nY) / 3.0);
-
- // correct polygon flag for previous point
- Imp_CorrectPolygonFlag(nInnerIndex, pInnerSequence, pInnerFlags, nX1, nY1);
-
- // add new points and set flags
- Imp_AddExportPoints(nX1, nY1, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_CONTROL);
- Imp_AddExportPoints(nX2, nY2, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_CONTROL);
- Imp_AddExportPoints(nX, nY, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_SMOOTH);
- }
- break;
- }
-
- // #100617# relative quadratic beziers are imported as cubic
- case 't' :
- {
- bRelative = TRUE;
- }
- case 'T' :
- {
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen && Imp_IsOnNumberChar(aStr, nPos))
- {
- sal_Int32 nXX;
- sal_Int32 nYY;
- sal_Int32 nX(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
- sal_Int32 nY(Imp_ImportNumberAndSpaces(0L, aStr, nPos, nLen, rConv));
-
- if(bRelative)
- {
- nX += mnLastX;
- nY += mnLastY;
- }
-
- // set last position
- mnLastX = nX;
- mnLastY = nY;
-
- // calc transform for new points
- Imp_PrepareCoorImport(nX, nY, rObjectPos, rObjectSize, mrViewBox, bScale, bTranslate);
-
- // one more thing is known: the previous real point is PolygonFlags_SYMMETRIC
- // and the Point X1,Y1 can be constructed by mirroring the point before it.
- nXX = nX;
- nYY = nY;
- awt::Point aPPrev1 = pInnerSequence[0];
-
- if(nInnerIndex)
- {
- aPPrev1 = pInnerSequence[nInnerIndex - 1];
-
- if(nInnerIndex > 1)
- {
- awt::Point aPPrev2 = pInnerSequence[nInnerIndex - 2];
- nXX = aPPrev1.X -(aPPrev2.X - aPPrev1.X);
- nYY = aPPrev1.Y -(aPPrev2.Y - aPPrev1.Y);
- }
-
- // set curve point to smooth here, since length
- // is changed and thus only c1 can be used.
- pInnerFlags[nInnerIndex - 1] = drawing::PolygonFlags_SMOOTH;
- }
-
- // calculate X1,X2
- sal_Int32 nX1 = FRound((double)((nXX * 2) + aPPrev1.X) / 3.0);
- sal_Int32 nY1 = FRound((double)((nYY * 2) + aPPrev1.Y) / 3.0);
- sal_Int32 nX2 = FRound((double)((nXX * 2) + nX) / 3.0);
- sal_Int32 nY2 = FRound((double)((nYY * 2) + nY) / 3.0);
-
- // correct polygon flag for previous point
- Imp_CorrectPolygonFlag(nInnerIndex, pInnerSequence, pInnerFlags, nX1, nY1);
-
- // add new points and set flags
- Imp_AddExportPoints(nX1, nY1, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_CONTROL);
- Imp_AddExportPoints(nX2, nY2, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_CONTROL);
- Imp_AddExportPoints(nX, nY, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_SMOOTH);
- }
- break;
- }
-
- // #100617# not yet supported: elliptical arc
- case 'A' :
- case 'a' :
- {
- DBG_ERROR("XMLIMP: non-interpreted tags in svg:d element (elliptical arc)!");
- nPos++;
- Imp_SkipSpaces(aStr, nPos, nLen);
-
- while(nPos < nLen && Imp_IsOnNumberChar(aStr, nPos))
- {
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipNumberAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipNumberAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- Imp_SkipDoubleAndSpacesAndCommas(aStr, nPos, nLen);
- }
- break;
- }
-
- default:
- {
- nPos++;
- DBG_ERROR("XMLIMP: non-interpreted tags in svg:d element (unknown)!");
- break;
- }
- }
- }
-
- // #104076# end-process closed state of last poly
- if(mbIsClosed)
- {
- if(pInnerSequence)
- {
- // closed: add first point again
- sal_Int32 nX(pInnerSequence[0].X);
- sal_Int32 nY(pInnerSequence[0].Y);
- Imp_AddExportPoints(nX, nY, pInnerSequence, pInnerFlags, nInnerIndex++, drawing::PolygonFlags_NORMAL);
- }
- }
-
- // #87202# If it's a curve and it's closed the last point maybe too much
- // and just exported since SVG does not allow special handling of same
- // start and end point, remove this last point.
- // Evtl. correct the last curve flags, too.
- if(IsCurve() && IsClosed())
- {
- // make one more loop over the PolyPolygon
- pOuterSequence = maPoly.getArray();
- pOuterFlags = maFlag.getArray();
- sal_Int32 nOuterCnt(maPoly.getLength());
-
- for(sal_Int32 a(0); a < nOuterCnt; a++)
- {
- // get Polygon pointers
- awt::Point* pInnerSequence = pOuterSequence->getArray();
- drawing::PolygonFlags* pInnerFlags = pOuterFlags->getArray();
- sal_Int32 nInnerCnt(pOuterSequence->getLength());
-
- while( nInnerCnt >= 2
- && ((pInnerSequence + (nInnerCnt - 2))->X == (pInnerSequence + (nInnerCnt - 1))->X)
- && ((pInnerSequence + (nInnerCnt - 2))->Y == (pInnerSequence + (nInnerCnt - 1))->Y)
- && drawing::PolygonFlags_CONTROL != *(pInnerFlags + (nInnerCnt - 2)))
- {
- // remove last point from array
- pOuterSequence->realloc(nInnerCnt - 1);
- pOuterFlags->realloc(nInnerCnt - 1);
-
- // get new pointers
- pInnerSequence = pOuterSequence->getArray();
- pInnerFlags = pOuterFlags->getArray();
- nInnerCnt = pOuterSequence->getLength();
- }
-
- // now evtl. correct the last curve flags
- if(nInnerCnt >= 4)
- {
- if( pInnerSequence->X == (pInnerSequence + (nInnerCnt - 1))->X
- && pInnerSequence->Y == (pInnerSequence + (nInnerCnt - 1))->Y
- && drawing::PolygonFlags_CONTROL == *(pInnerFlags + 1)
- && drawing::PolygonFlags_CONTROL == *(pInnerFlags + (nInnerCnt - 2)))
- {
- awt::Point aPrev = *(pInnerSequence + (nInnerCnt - 2));
- awt::Point aCurr = *pInnerSequence;
- awt::Point aNext = *(pInnerSequence + 1);
- Vector2D aVec1(aPrev.X - aCurr.X, aPrev.Y - aCurr.Y);
- Vector2D aVec2(aNext.X - aCurr.X, aNext.Y - aCurr.Y);
- sal_Bool bSameLength(FALSE);
- sal_Bool bSameDirection(FALSE);
-
- // get vector values
- Imp_CalcVectorValues(aVec1, aVec2, bSameLength, bSameDirection);
-
- // set correct flag value
- if(bSameDirection)
- {
- if(bSameLength)
- {
- // set to PolygonFlags_SYMMETRIC
- *pInnerFlags = drawing::PolygonFlags_SYMMETRIC;
- *(pInnerFlags + (nInnerCnt - 1)) = drawing::PolygonFlags_SYMMETRIC;
- }
- else
- {
- // set to PolygonFlags_SMOOTH
- *pInnerFlags = drawing::PolygonFlags_SMOOTH;
- *(pInnerFlags + (nInnerCnt - 1)) = drawing::PolygonFlags_SMOOTH;
- }
- }
- else
- {
- // set to PolygonFlags_NORMAL
- *pInnerFlags = drawing::PolygonFlags_NORMAL;
- *(pInnerFlags + (nInnerCnt - 1)) = drawing::PolygonFlags_NORMAL;
- }
- }
- }
-
- // switch to next Polygon
- pOuterSequence++;
- pOuterFlags++;
- }
- }
- }
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_ximp3dobject.cxx b/binfilter/bf_xmloff/source/draw/xmloff_ximp3dobject.cxx
deleted file mode 100644
index b472420cfd89..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_ximp3dobject.cxx
+++ /dev/null
@@ -1,615 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-
-#include "ximp3dobject.hxx"
-
-
-#include "xmluconv.hxx"
-
-
-
-
-
-
-
-
-
-#include <com/sun/star/drawing/PolyPolygonShape3D.hpp>
-
-#include <com/sun/star/drawing/DoubleSequence.hpp>
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXML3DObjectContext, SdXMLShapeContext );
-
-SdXML3DObjectContext::SdXML3DObjectContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ),
- mbSetTransform( FALSE )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- OUString sValue = xAttrList->getValueByIndex( i );
- const SvXMLTokenMap& rAttrTokenMap = GetImport().GetShapeImport()->Get3DObjectAttrTokenMap();
-
- switch(rAttrTokenMap.Get(nPrefix, aLocalName))
- {
- case XML_TOK_3DOBJECT_DRAWSTYLE_NAME:
- {
- maDrawStyleName = sValue;
- break;
- }
- case XML_TOK_3DOBJECT_TRANSFORM:
- {
- SdXMLImExTransform3D aTransform(sValue, GetImport().GetMM100UnitConverter());
- if(aTransform.NeedsAction())
- mbSetTransform = aTransform.GetFullHomogenTransform(mxHomMat);
- break;
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXML3DObjectContext::~SdXML3DObjectContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXML3DObjectContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- // set parameters
- if(mbSetTransform)
- {
- uno::Any aAny;
- aAny <<= mxHomMat;
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DTransformMatrix")), aAny);
- }
-
- // call parent
- SdXMLShapeContext::StartElement(xAttrList);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXML3DObjectContext::EndElement()
-{
- // call parent
- SdXMLShapeContext::EndElement();
-}
-
-//////////////////////////////////////////////////////////////////////////////
-/*
-void SdXML3DObjectContext::AddShape(uno::Reference< drawing::XShape >& xShape)
-{
- if(xShape.is() && mxShapes.is())
- {
- // set shape local
- mxShape = xShape;
-
- // add new shape to parent
- mxShapes->add( xShape );
- }
-}
-*/
-//////////////////////////////////////////////////////////////////////////////
-/*
-void SdXML3DObjectContext::SetStyle()
-{
- // set style on shape
- if(maDrawStyleName.getLength() && mxShape.is())
- {
- const SvXMLStyleContext* pStyle = 0L;
- sal_Bool bAutoStyle(FALSE);
-
- if(GetImport().GetShapeImport()->GetAutoStylesContext())
- pStyle = GetImport().GetShapeImport()->GetAutoStylesContext()->FindStyleChildContext(
- XML_STYLE_FAMILY_SD_GRAPHICS_ID, maDrawStyleName);
-
- if(pStyle)
- bAutoStyle = TRUE;
-
- if(!pStyle && GetImport().GetShapeImport()->GetStylesContext())
- pStyle = GetImport().GetShapeImport()->GetStylesContext()->
- FindStyleChildContext(XML_STYLE_FAMILY_SD_GRAPHICS_ID, maDrawStyleName);
-
- if(pStyle && pStyle->ISA(XMLShapeStyleContext))
- {
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- XMLShapeStyleContext* pDocStyle = (XMLShapeStyleContext*)pStyle;
-
- if(pDocStyle->GetStyle().is())
- {
- // set style on object
- uno::Any aAny;
- aAny <<= pDocStyle->GetStyle();
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Style")), aAny);
- }
-
- if(bAutoStyle)
- {
- // set PropertySet on object
- pDocStyle->FillPropertySet(xPropSet);
- }
- }
- }
- }
-}
-*/
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXML3DCubeObjectShapeContext, SdXML3DObjectContext);
-
-SdXML3DCubeObjectShapeContext::SdXML3DCubeObjectShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ),
- maMinEdge(-2500.0, -2500.0, -2500.0),
- maMaxEdge(2500.0, 2500.0, 2500.0),
- mbMinEdgeUsed(FALSE),
- mbMaxEdgeUsed(FALSE)
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- OUString sValue = xAttrList->getValueByIndex( i );
- const SvXMLTokenMap& rAttrTokenMap = GetImport().GetShapeImport()->Get3DCubeObjectAttrTokenMap();
-
- switch(rAttrTokenMap.Get(nPrefix, aLocalName))
- {
- case XML_TOK_3DCUBEOBJ_MINEDGE:
- {
- Vector3D aNewVec;
- GetImport().GetMM100UnitConverter().convertVector3D(aNewVec, sValue);
-
- if(aNewVec != maMinEdge)
- {
- maMinEdge = aNewVec;
- mbMinEdgeUsed = TRUE;
- }
- break;
- }
- case XML_TOK_3DCUBEOBJ_MAXEDGE:
- {
- Vector3D aNewVec;
- GetImport().GetMM100UnitConverter().convertVector3D(aNewVec, sValue);
-
- if(aNewVec != maMaxEdge)
- {
- maMaxEdge = aNewVec;
- mbMaxEdgeUsed = TRUE;
- }
- break;
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXML3DCubeObjectShapeContext::~SdXML3DCubeObjectShapeContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXML3DCubeObjectShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- // create shape
- AddShape( "com.sun.star.drawing.Shape3DCubeObject" );
- if(mxShape.is())
- {
- // add, set style and properties from base shape
- SetStyle();
- SdXML3DObjectContext::StartElement(xAttrList);
-
- // set local parameters on shape
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- // set parameters
- drawing::Position3D aPosition3D;
- drawing::Direction3D aDirection3D;
-
- // convert from min, max to size to be set
- maMaxEdge = maMaxEdge - maMinEdge;
-
- aPosition3D.PositionX = maMinEdge.X();
- aPosition3D.PositionY = maMinEdge.Y();
- aPosition3D.PositionZ = maMinEdge.Z();
-
- aDirection3D.DirectionX = maMaxEdge.X();
- aDirection3D.DirectionY = maMaxEdge.Y();
- aDirection3D.DirectionZ = maMaxEdge.Z();
-
- uno::Any aAny;
- aAny <<= aPosition3D;
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DPosition")), aAny);
- aAny <<= aDirection3D;
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSize")), aAny);
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXML3DCubeObjectShapeContext::EndElement()
-{
- // call parent
- SdXML3DObjectContext::EndElement();
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXML3DSphereObjectShapeContext, SdXML3DObjectContext);
-
-SdXML3DSphereObjectShapeContext::SdXML3DSphereObjectShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ),
- maCenter(0.0, 0.0, 0.0),
- maSize(5000.0, 5000.0, 5000.0),
- mbCenterUsed(FALSE),
- mbSizeUsed(FALSE)
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- OUString sValue = xAttrList->getValueByIndex( i );
- const SvXMLTokenMap& rAttrTokenMap = GetImport().GetShapeImport()->Get3DSphereObjectAttrTokenMap();
-
- switch(rAttrTokenMap.Get(nPrefix, aLocalName))
- {
- case XML_TOK_3DSPHEREOBJ_CENTER:
- {
- Vector3D aNewVec;
- GetImport().GetMM100UnitConverter().convertVector3D(aNewVec, sValue);
-
- if(aNewVec != maCenter)
- {
- maCenter = aNewVec;
- mbCenterUsed = TRUE;
- }
- break;
- }
- case XML_TOK_3DSPHEREOBJ_SIZE:
- {
- Vector3D aNewVec;
- GetImport().GetMM100UnitConverter().convertVector3D(aNewVec, sValue);
-
- if(aNewVec != maSize)
- {
- maSize = aNewVec;
- mbSizeUsed = TRUE;
- }
- break;
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXML3DSphereObjectShapeContext::~SdXML3DSphereObjectShapeContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXML3DSphereObjectShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- // create shape
- AddShape( "com.sun.star.drawing.Shape3DSphereObject" );
- if(mxShape.is())
- {
- // add, set style and properties from base shape
- SetStyle();
- SdXML3DObjectContext::StartElement(xAttrList);
-
- // set local parameters on shape
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- // set parameters
- drawing::Position3D aPosition3D;
- drawing::Direction3D aDirection3D;
-
- aPosition3D.PositionX = maCenter.X();
- aPosition3D.PositionY = maCenter.Y();
- aPosition3D.PositionZ = maCenter.Z();
-
- aDirection3D.DirectionX = maSize.X();
- aDirection3D.DirectionY = maSize.Y();
- aDirection3D.DirectionZ = maSize.Z();
-
- uno::Any aAny;
- aAny <<= aPosition3D;
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DPosition")), aAny);
- aAny <<= aDirection3D;
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSize")), aAny);
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXML3DSphereObjectShapeContext::EndElement()
-{
- // call parent
- SdXML3DObjectContext::EndElement();
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXML3DPolygonBasedShapeContext, SdXML3DObjectContext );
-
-SdXML3DPolygonBasedShapeContext::SdXML3DPolygonBasedShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- OUString sValue = xAttrList->getValueByIndex( i );
- const SvXMLTokenMap& rAttrTokenMap = GetImport().GetShapeImport()->Get3DPolygonBasedAttrTokenMap();
-
- switch(rAttrTokenMap.Get(nPrefix, aLocalName))
- {
- case XML_TOK_3DPOLYGONBASED_VIEWBOX:
- {
- maViewBox = sValue;
- break;
- }
- case XML_TOK_3DPOLYGONBASED_D:
- {
- maPoints = sValue;
- break;
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXML3DPolygonBasedShapeContext::~SdXML3DPolygonBasedShapeContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXML3DPolygonBasedShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- // set parameters
- if(maPoints.getLength() && maViewBox.getLength())
- {
- SdXMLImExViewBox aViewBox(maViewBox, GetImport().GetMM100UnitConverter());
- awt::Point aMinPoint(aViewBox.GetX(), aViewBox.GetY());
- awt::Size aMaxSize(aViewBox.GetWidth(), aViewBox.GetHeight());
- SdXMLImExSvgDElement aPoints(maPoints, aViewBox,
- aMinPoint, aMaxSize, GetImport().GetMM100UnitConverter());
-
- // convert to double sequences
- drawing::PointSequenceSequence& xPoSeSe =
- (drawing::PointSequenceSequence&)aPoints.GetPointSequenceSequence();
- sal_Int32 nOuterSequenceCount = xPoSeSe.getLength();
- drawing::PointSequence* pInnerSequence = xPoSeSe.getArray();
-
- drawing::PolyPolygonShape3D xPolyPolygon3D;
- xPolyPolygon3D.SequenceX.realloc(nOuterSequenceCount);
- xPolyPolygon3D.SequenceY.realloc(nOuterSequenceCount);
- xPolyPolygon3D.SequenceZ.realloc(nOuterSequenceCount);
- drawing::DoubleSequence* pOuterSequenceX = xPolyPolygon3D.SequenceX.getArray();
- drawing::DoubleSequence* pOuterSequenceY = xPolyPolygon3D.SequenceY.getArray();
- drawing::DoubleSequence* pOuterSequenceZ = xPolyPolygon3D.SequenceZ.getArray();
-
- for(sal_Int32 a(0L); a < nOuterSequenceCount; a++)
- {
- sal_Int32 nInnerSequenceCount(pInnerSequence->getLength());
- awt::Point* pArray = pInnerSequence->getArray();
-
- pOuterSequenceX->realloc(nInnerSequenceCount);
- pOuterSequenceY->realloc(nInnerSequenceCount);
- pOuterSequenceZ->realloc(nInnerSequenceCount);
- double* pInnerSequenceX = pOuterSequenceX->getArray();
- double* pInnerSequenceY = pOuterSequenceY->getArray();
- double* pInnerSequenceZ = pOuterSequenceZ->getArray();
-
- for(sal_Int32 b(0L); b < nInnerSequenceCount; b++)
- {
- *pInnerSequenceX++ = pArray->X;
- *pInnerSequenceY++ = pArray->Y;
- *pInnerSequenceZ++ = 0.0;
- pArray++;
- }
- pInnerSequence++;
-
- pOuterSequenceX++;
- pOuterSequenceY++;
- pOuterSequenceZ++;
- }
-
- // set poly
- uno::Any aAny;
- aAny <<= xPolyPolygon3D;
- xPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("D3DPolyPolygon3D")), aAny);
- }
-
- // call parent
- SdXML3DObjectContext::StartElement(xAttrList);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXML3DPolygonBasedShapeContext::EndElement()
-{
- // call parent
- SdXML3DObjectContext::EndElement();
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXML3DLatheObjectShapeContext, SdXML3DPolygonBasedShapeContext);
-
-SdXML3DLatheObjectShapeContext::SdXML3DLatheObjectShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXML3DPolygonBasedShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes )
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXML3DLatheObjectShapeContext::~SdXML3DLatheObjectShapeContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXML3DLatheObjectShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- // create shape
- AddShape( "com.sun.star.drawing.Shape3DLatheObject" );
- if(mxShape.is())
- {
- // add, set style and properties from base shape
- SetStyle();
- SdXML3DPolygonBasedShapeContext::StartElement(xAttrList);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXML3DLatheObjectShapeContext::EndElement()
-{
- // call parent
- SdXML3DPolygonBasedShapeContext::EndElement();
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXML3DExtrudeObjectShapeContext, SdXML3DPolygonBasedShapeContext);
-
-SdXML3DExtrudeObjectShapeContext::SdXML3DExtrudeObjectShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXML3DPolygonBasedShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes )
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXML3DExtrudeObjectShapeContext::~SdXML3DExtrudeObjectShapeContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXML3DExtrudeObjectShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- AddShape( "com.sun.star.drawing.Shape3DExtrudeObject" );
- if(mxShape.is())
- {
- // add, set style and properties from base shape
- SetStyle();
- SdXML3DPolygonBasedShapeContext::StartElement(xAttrList);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXML3DExtrudeObjectShapeContext::EndElement()
-{
- // call parent
- SdXML3DPolygonBasedShapeContext::EndElement();
-}
-
-// EOF
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_ximp3dscene.cxx b/binfilter/bf_xmloff/source/draw/xmloff_ximp3dscene.cxx
deleted file mode 100644
index f426ffdf853b..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_ximp3dscene.cxx
+++ /dev/null
@@ -1,498 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include "ximp3dscene.hxx"
-
-#include "xmluconv.hxx"
-
-
-
-#include "xmlnmspe.hxx"
-
-
-#include <com/sun/star/drawing/CameraGeometry.hpp>
-
-#include "eventimp.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-//////////////////////////////////////////////////////////////////////////////
-// dr3d:3dlight context
-
-SdXML3DLightContext::SdXML3DLightContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList)
-: SvXMLImportContext( rImport, nPrfx, rLName),
- maDiffuseColor(0x00000000),
- maDirection(0.0, 0.0, 1.0),
- mbEnabled(FALSE),
- mbSpecular(FALSE)
-{
- // read attributes for the 3DScene
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- OUString sValue = xAttrList->getValueByIndex( i );
- const SvXMLTokenMap& rAttrTokenMap = GetImport().GetShapeImport()->Get3DLightAttrTokenMap();
-
- switch(rAttrTokenMap.Get(nPrefix, aLocalName))
- {
- case XML_TOK_3DLIGHT_DIFFUSE_COLOR:
- {
- GetImport().GetMM100UnitConverter().convertColor(maDiffuseColor, sValue);
- break;
- }
- case XML_TOK_3DLIGHT_DIRECTION:
- {
- GetImport().GetMM100UnitConverter().convertVector3D(maDirection, sValue);
- break;
- }
- case XML_TOK_3DLIGHT_ENABLED:
- {
- GetImport().GetMM100UnitConverter().convertBool(mbEnabled, sValue);
- break;
- }
- case XML_TOK_3DLIGHT_SPECULAR:
- {
- GetImport().GetMM100UnitConverter().convertBool(mbSpecular, sValue);
- break;
- }
- }
- }
-}
-
-SdXML3DLightContext::~SdXML3DLightContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXML3DSceneShapeContext, SdXMLShapeContext );
-
-SdXML3DSceneShapeContext::SdXML3DSceneShapeContext(
- SvXMLImport& rImport,
- USHORT nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ), SdXML3DSceneAttributesHelper( rImport )
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXML3DSceneShapeContext::~SdXML3DSceneShapeContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXML3DSceneShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- // create new 3DScene shape and add it to rShapes, use it
- // as base for the new 3DScene import
- AddShape( "com.sun.star.drawing.Shape3DSceneObject" );
- if( mxShape.is() )
- {
- SetStyle();
-
- mxChilds = uno::Reference< drawing::XShapes >::query( mxShape );
- if( mxChilds.is() )
- GetImport().GetShapeImport()->pushGroupForSorting( mxChilds );
-
- SetLayer();
-
- // set pos, size, shear and rotate
- SetTransformation();
- }
-
- // read attributes for the 3DScene
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- OUString sValue = xAttrList->getValueByIndex( i );
- processSceneAttribute( nPrefix, aLocalName, sValue );
- }
-
- // #91047# call parent function is missing here, added it
- if(mxShape.is())
- {
- // call parent
- SdXMLShapeContext::StartElement(xAttrList);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXML3DSceneShapeContext::EndElement()
-{
- if(mxShape.is())
- {
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- setSceneAttributes( xPropSet );
- }
-
- if( mxChilds.is() )
- GetImport().GetShapeImport()->popGroupAndSort();
-
- // call parent
- SdXMLShapeContext::EndElement();
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext* SdXML3DSceneShapeContext::CreateChildContext( USHORT nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext* pContext = 0L;
-
- if( nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken( rLocalName, XML_EVENTS ) )
- {
- pContext = new SdXMLEventsContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShape );
- }
- // look for local light context first
- else if(nPrefix == XML_NAMESPACE_DR3D && IsXMLToken( rLocalName, XML_LIGHT ) )
- {
- // dr3d:light inside dr3d:scene context
- pContext = create3DLightContext( nPrefix, rLocalName, xAttrList );
- }
-
- // call GroupChildContext function at common ShapeImport
- if(!pContext)
- {
- pContext = GetImport().GetShapeImport()->Create3DSceneChildContext(
- GetImport(), nPrefix, rLocalName, xAttrList, mxChilds);
- }
-
- // call parent when no own context was created
- if(!pContext)
- {
- pContext = SvXMLImportContext::CreateChildContext(
- nPrefix, rLocalName, xAttrList);
- }
-
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXML3DSceneAttributesHelper::SdXML3DSceneAttributesHelper( SvXMLImport& rImporter )
-: mrImport( rImporter ),
- mbSetTransform( FALSE ),
- mxPrjMode(drawing::ProjectionMode_PERSPECTIVE),
- mnDistance(1000),
- mnFocalLength(1000),
- mnShadowSlant(0),
- mxShadeMode(drawing::ShadeMode_SMOOTH),
- maAmbientColor(0x00666666),
- mbLightingMode(FALSE),
- maVRP(0.0, 0.0, 1.0),
- maVPN(0.0, 0.0, 1.0),
- maVUP(0.0, 1.0, 0.0),
- mbVRPUsed(FALSE),
- mbVPNUsed(FALSE),
- mbVUPUsed(FALSE)
-{
-}
-
-SdXML3DSceneAttributesHelper::~SdXML3DSceneAttributesHelper()
-{
- // release remembered light contexts, they are no longer needed
- while(maList.Count())
- maList.Remove(maList.Count() - 1)->ReleaseRef();
-}
-
-/** creates a 3d ligth context and adds it to the internal list for later processing */
-SvXMLImportContext * SdXML3DSceneAttributesHelper::create3DLightContext( sal_uInt16 nPrfx, const ::rtl::OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList)
-{
- SvXMLImportContext* pContext = new SdXML3DLightContext(mrImport, nPrfx, rLName, xAttrList);
-
- // remember SdXML3DLightContext for later evaluation
- if(pContext)
- {
- pContext->AddRef();
- maList.Insert((SdXML3DLightContext*)pContext, LIST_APPEND);
- }
-
- return pContext;
-}
-
-/** this should be called for each scene attribute */
-void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- if( XML_NAMESPACE_DR3D == nPrefix )
- {
- if( IsXMLToken( rLocalName, XML_TRANSFORM ) )
- {
- SdXMLImExTransform3D aTransform(rValue, mrImport.GetMM100UnitConverter());
- if(aTransform.NeedsAction())
- mbSetTransform = aTransform.GetFullHomogenTransform(mxHomMat);
- return;
- }
- else if( IsXMLToken( rLocalName, XML_VRP ) )
- {
- Vector3D aNewVec;
- mrImport.GetMM100UnitConverter().convertVector3D(aNewVec, rValue);
-
- if(aNewVec != maVRP)
- {
- maVRP = aNewVec;
- mbVRPUsed = TRUE;
- }
- return;
- }
- else if( IsXMLToken( rLocalName, XML_VPN ) )
- {
- Vector3D aNewVec;
- mrImport.GetMM100UnitConverter().convertVector3D(aNewVec, rValue);
-
- if(aNewVec != maVPN)
- {
- maVPN = aNewVec;
- mbVPNUsed = TRUE;
- }
- return;
- }
- else if( IsXMLToken( rLocalName, XML_VUP ) )
- {
- Vector3D aNewVec;
- mrImport.GetMM100UnitConverter().convertVector3D(aNewVec, rValue);
-
- if(aNewVec != maVUP)
- {
- maVUP = aNewVec;
- mbVUPUsed = TRUE;
- }
- return;
- }
- else if( IsXMLToken( rLocalName, XML_PROJECTION ) )
- {
- if( IsXMLToken( rValue, XML_PARALLEL ) )
- mxPrjMode = drawing::ProjectionMode_PARALLEL;
- else
- mxPrjMode = drawing::ProjectionMode_PERSPECTIVE;
- return;
- }
- else if( IsXMLToken( rLocalName, XML_DISTANCE ) )
- {
- mrImport.GetMM100UnitConverter().convertMeasure(mnDistance, rValue);
- return;
- }
- else if( IsXMLToken( rLocalName, XML_FOCAL_LENGTH ) )
- {
- mrImport.GetMM100UnitConverter().convertMeasure(mnFocalLength, rValue);
- return;
- }
- else if( IsXMLToken( rLocalName, XML_SHADOW_SLANT ) )
- {
- mrImport.GetMM100UnitConverter().convertNumber(mnShadowSlant, rValue);
- return;
- }
- else if( IsXMLToken( rLocalName, XML_SHADE_MODE ) )
- {
- if( IsXMLToken( rValue, XML_FLAT ) )
- mxShadeMode = drawing::ShadeMode_FLAT;
- else if( IsXMLToken( rValue, XML_PHONG ) )
- mxShadeMode = drawing::ShadeMode_PHONG;
- else if( IsXMLToken( rValue, XML_GOURAUD ) )
- mxShadeMode = drawing::ShadeMode_SMOOTH;
- else
- mxShadeMode = drawing::ShadeMode_DRAFT;
- return;
- }
- else if( IsXMLToken( rLocalName, XML_AMBIENT_COLOR ) )
- {
- mrImport.GetMM100UnitConverter().convertColor(maAmbientColor, rValue);
- return;
- }
- else if( IsXMLToken( rLocalName, XML_LIGHTING_MODE ) )
- {
- mrImport.GetMM100UnitConverter().convertBool(mbLightingMode, rValue);
- return;
- }
- }
-}
-
-/** this sets the scene attributes at this propertyset */
-void SdXML3DSceneAttributesHelper::setSceneAttributes( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xPropSet )
-{
- uno::Any aAny;
-
- // world transformation
- if(mbSetTransform)
- {
- aAny <<= mxHomMat;
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DTransformMatrix")), aAny);
- }
-
- // distance
- aAny <<= mnDistance;
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneDistance")), aAny);
-
- // focalLength
- aAny <<= mnFocalLength;
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneFocalLength")), aAny);
-
- // shadowSlant
- aAny <<= (sal_Int16)mnShadowSlant;
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneShadowSlant")), aAny);
-
- // shadeMode
- aAny <<= mxShadeMode;
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneShadeMode")), aAny);
-
- // ambientColor
- aAny <<= maAmbientColor.GetColor();
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneAmbientColor")), aAny);
-
- // lightingMode
- aAny <<= mbLightingMode;
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneTwoSidedLighting")), aAny);
-
- if(maList.Count())
- {
- uno::Any aAny2;
- uno::Any aAny3;
-
- // set lights
- for(sal_uInt32 a(0L); a < maList.Count(); a++)
- {
- SdXML3DLightContext* pCtx = (SdXML3DLightContext*)maList.GetObject(a);
-
- // set anys
- aAny <<= pCtx->GetDiffuseColor().GetColor();
- drawing::Direction3D xLightDir;
- xLightDir.DirectionX = pCtx->GetDirection().X();
- xLightDir.DirectionY = pCtx->GetDirection().Y();
- xLightDir.DirectionZ = pCtx->GetDirection().Z();
- aAny2 <<= xLightDir;
- aAny3 <<= pCtx->GetEnabled();
-
- switch(a)
- {
- case 0:
- {
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightColor1")), aAny);
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightDirection1")), aAny2);
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightOn1")), aAny3);
- break;
- }
- case 1:
- {
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightColor2")), aAny);
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightDirection2")), aAny2);
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightOn2")), aAny3);
- break;
- }
- case 2:
- {
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightColor3")), aAny);
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightDirection3")), aAny2);
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightOn3")), aAny3);
- break;
- }
- case 3:
- {
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightColor4")), aAny);
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightDirection4")), aAny2);
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightOn4")), aAny3);
- break;
- }
- case 4:
- {
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightColor5")), aAny);
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightDirection5")), aAny2);
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightOn5")), aAny3);
- break;
- }
- case 5:
- {
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightColor6")), aAny);
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightDirection6")), aAny2);
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightOn6")), aAny3);
- break;
- }
- case 6:
- {
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightColor7")), aAny);
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightDirection7")), aAny2);
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightOn7")), aAny3);
- break;
- }
- case 7:
- {
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightColor8")), aAny);
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightDirection8")), aAny2);
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneLightOn8")), aAny3);
- break;
- }
- }
- }
- }
-
- // CameraGeometry and camera settings
- drawing::CameraGeometry aCamGeo;
- aCamGeo.vrp.PositionX = maVRP.X();
- aCamGeo.vrp.PositionY = maVRP.Y();
- aCamGeo.vrp.PositionZ = maVRP.Z();
- aCamGeo.vpn.DirectionX = maVPN.X();
- aCamGeo.vpn.DirectionY = maVPN.Y();
- aCamGeo.vpn.DirectionZ = maVPN.Z();
- aCamGeo.vup.DirectionX = maVUP.X();
- aCamGeo.vup.DirectionY = maVUP.Y();
- aCamGeo.vup.DirectionZ = maVUP.Z();
- aAny <<= aCamGeo;
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DCameraGeometry")), aAny);
-
- // #91047# set drawing::ProjectionMode AFTER camera geometry is set
- // projection "D3DScenePerspective" drawing::ProjectionMode
- aAny <<= mxPrjMode;
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DScenePerspective")), aAny);
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_ximpbody.cxx b/binfilter/bf_xmloff/source/draw/xmloff_ximpbody.cxx
deleted file mode 100644
index 30d37c18d12e..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_ximpbody.cxx
+++ /dev/null
@@ -1,399 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include "ximpbody.hxx"
-
-#include "prstylei.hxx"
-
-#include "ximpnote.hxx"
-
-
-#include <com/sun/star/drawing/XDrawPages.hpp>
-
-
-#include <com/sun/star/presentation/XPresentationPage.hpp>
-
-#include "ximpstyl.hxx"
-
-#include <com/sun/star/drawing/XMasterPageTarget.hpp>
-
-
-#include "xmluconv.hxx"
-
-
-
-#include "ximpshow.hxx"
-
-#include "PropertySetMerger.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLDrawPageContext::SdXMLDrawPageContext( SdXMLImport& rImport,
- USHORT nPrfx, const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLGenericPageContext( rImport, nPrfx, rLocalName, xAttrList, rShapes )
-{
- sal_Int32 nPageId = -1;
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
-
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- USHORT nPrefix = GetSdImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- OUString sValue = xAttrList->getValueByIndex( i );
- const SvXMLTokenMap& rAttrTokenMap = GetSdImport().GetDrawPageAttrTokenMap();
-
- switch(rAttrTokenMap.Get(nPrefix, aLocalName))
- {
- case XML_TOK_DRAWPAGE_NAME:
- {
- maName = sValue;
- break;
- }
- case XML_TOK_DRAWPAGE_STYLE_NAME:
- {
- maStyleName = sValue;
- break;
- }
- case XML_TOK_DRAWPAGE_MASTER_PAGE_NAME:
- {
- maMasterPageName = sValue;
- break;
- }
- case XML_TOK_DRAWPAGE_PAGE_LAYOUT_NAME:
- {
- maPageLayoutName = sValue;
- break;
- }
- case XML_TOK_DRAWPAGE_ID:
- {
- sal_Int32 nId;
- if( SvXMLUnitConverter::convertNumber( nId, sValue ) )
- nPageId = nId;
- break;
- }
- case XML_TOK_DRAWPAGE_HREF:
- {
- maHREF = sValue;
- break;
- }
- }
- }
-
- GetImport().GetShapeImport()->startPage( rShapes );
-
- uno::Reference< drawing::XDrawPage > xDrawPage(rShapes, uno::UNO_QUERY);
-
- // set an id?
- if( nPageId != -1 && xDrawPage.is() )
- rImport.setDrawPageId( nPageId, xDrawPage );
-
- // set PageName?
- if(maName.getLength())
- {
- if(xDrawPage.is())
- {
- uno::Reference < container::XNamed > xNamed(xDrawPage, uno::UNO_QUERY);
- if(xNamed.is())
- xNamed->setName(maName);
- }
- }
-
- // set MasterPage?
- if(maMasterPageName.getLength())
- {
- // #85906# Code for setting masterpage needs complete rework
- // since GetSdImport().GetMasterStylesContext() gives always ZERO
- // because of content/style file split. Now the nechanism is to
- // compare the wanted masterpage-name with the existing masterpages
- // which were loaded and created in the styles section loading.
- uno::Reference< drawing::XDrawPages > xMasterPages(GetSdImport().GetLocalMasterPages(), uno::UNO_QUERY);
- uno::Reference < drawing::XMasterPageTarget > xDrawPage(rShapes, uno::UNO_QUERY);
- uno::Reference< drawing::XDrawPage > xMasterPage;
-
- if(xDrawPage.is() && xMasterPages.is())
- {
- sal_Bool bDone(FALSE);
-
- for(sal_Int32 a = 0; !bDone && a < xMasterPages->getCount(); a++)
- {
- uno::Any aAny(xMasterPages->getByIndex(a));
- aAny >>= xMasterPage;
-
- if(xMasterPage.is())
- {
- uno::Reference < container::XNamed > xMasterNamed(xMasterPage, uno::UNO_QUERY);
- if(xMasterNamed.is())
- {
- OUString sMasterPageName = xMasterNamed->getName();
-
- if(sMasterPageName.getLength() && sMasterPageName.equals(maMasterPageName))
- {
- xDrawPage->setMasterPage(xMasterPage);
- bDone = TRUE;
- }
- }
- }
- }
- }
- }
-
- // set PageProperties?
- if(maStyleName.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, maStyleName);
-
- if(pStyle && pStyle->ISA(XMLPropStyleContext))
- {
- XMLPropStyleContext* pPropStyle = (XMLPropStyleContext*)pStyle;
-
-
- uno::Reference <beans::XPropertySet> xPropSet1(rShapes, uno::UNO_QUERY);
- if(xPropSet1.is())
- {
- // since the background items are in a different propertyset
- // which itself is a property of the pages property set
- // we now merge these two propertysets if possible to simulate
- // a single propertyset with all draw page properties
- 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())
- {
- pPropStyle->FillPropertySet(xPropSet);
- }
-
- if( xPropSet2.is() )
- {
- uno::Any aAny;
- aAny <<= xPropSet2;
- xPropSet1->setPropertyValue( aBackground, aAny );
- }
- }
- }
- }
- }
- }
-
- if( maHREF.getLength() )
- {
- uno::Reference< beans::XPropertySet > xProps( xDrawPage, uno::UNO_QUERY );
- if( xProps.is() )
- {
- sal_Int32 nIndex = maHREF.lastIndexOf( (sal_Unicode)'#' );
- if( nIndex != -1 )
- {
- OUString aFileName( maHREF.copy( 0, nIndex ) );
- OUString aBookmarkName( maHREF.copy( nIndex+1 ) );
-
- maHREF = GetImport().GetAbsoluteReference( aFileName );
- maHREF += OUString( (sal_Unicode)'#' );
- maHREF += aBookmarkName;
- }
-
- xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "BookmarkURL" ) ), uno::makeAny( maHREF ) );
- }
- }
-
- SetLayout();
-
- DeleteAllShapes();
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLDrawPageContext::~SdXMLDrawPageContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext *SdXMLDrawPageContext::CreateChildContext( USHORT nPrefix,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext *pContext = 0L;
- const SvXMLTokenMap& rTokenMap = GetSdImport().GetDrawPageElemTokenMap();
-
- // some special objects inside draw:page context
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- case XML_TOK_DRAWPAGE_NOTES:
- {
- if( GetSdImport().IsImpress() )
- {
- // get notes page
- uno::Reference< presentation::XPresentationPage > xPresPage(GetLocalShapesContext(), uno::UNO_QUERY);
- if(xPresPage.is())
- {
- uno::Reference< drawing::XDrawPage > xNotesDrawPage(xPresPage->getNotesPage(), uno::UNO_QUERY);
- if(xNotesDrawPage.is())
- {
- uno::Reference< drawing::XShapes > xNewShapes(xNotesDrawPage, uno::UNO_QUERY);
- if(xNewShapes.is())
- {
- // presentation:notes inside draw:page context
- pContext = new SdXMLNotesContext( GetSdImport(), nPrefix, rLocalName, xAttrList, xNewShapes);
- }
- }
- }
- }
- }
- }
-
- // call parent when no own context was created
- if(!pContext)
- pContext = SdXMLGenericPageContext::CreateChildContext(nPrefix, rLocalName, xAttrList);
-
- return pContext;
-}
-
-void SdXMLDrawPageContext::EndElement()
-{
- SdXMLGenericPageContext::EndElement();
- GetImport().GetShapeImport()->endPage(GetLocalShapesContext());
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLBodyContext::SdXMLBodyContext( SdXMLImport& rImport,
- USHORT nPrfx, const OUString& rLocalName )
-: SvXMLImportContext( rImport, nPrfx, rLocalName )
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLBodyContext::~SdXMLBodyContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext *SdXMLBodyContext::CreateChildContext(
- USHORT nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext *pContext = 0L;
- const SvXMLTokenMap& rTokenMap = GetSdImport().GetBodyElemTokenMap();
-
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- case XML_TOK_BODY_PAGE:
- {
- // only read the first page in preview mode
- if( (GetSdImport().GetNewPageCount() == 0) || !GetSdImport().IsPreview() )
- {
- // import this page
- uno::Reference< drawing::XDrawPage > xNewDrawPage;
- uno::Reference< drawing::XDrawPages > xDrawPages(GetSdImport().GetLocalDrawPages(), uno::UNO_QUERY);
-
- if(GetSdImport().GetNewPageCount() + 1 > xDrawPages->getCount())
- {
- // new page, create and insert
- xNewDrawPage = xDrawPages->insertNewByIndex(xDrawPages->getCount());
- }
- else
- {
- // existing page, use it
- uno::Any aAny(xDrawPages->getByIndex(GetSdImport().GetNewPageCount()));
- aAny >>= xNewDrawPage;
- }
-
- // increment global import page counter
- GetSdImport().IncrementNewPageCount();
-
- if(xNewDrawPage.is())
- {
- uno::Reference< drawing::XShapes > xNewShapes(xNewDrawPage, uno::UNO_QUERY);
- if(xNewShapes.is())
- {
- // draw:page inside office:body context
- pContext = new SdXMLDrawPageContext(GetSdImport(), nPrefix, rLocalName, xAttrList,
- xNewShapes);
- }
- }
- }
- break;
- }
- case XML_TOK_BODY_SETTINGS:
- {
- pContext = new SdXMLShowsContext( GetSdImport(), nPrefix, rLocalName, xAttrList );
- }
- }
-
- // call parent when no own context was created
- if(!pContext)
- pContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName, xAttrList);
-
- return pContext;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_ximpgrp.cxx b/binfilter/bf_xmloff/source/draw/xmloff_ximpgrp.cxx
deleted file mode 100644
index 8e38331e3d98..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_ximpgrp.cxx
+++ /dev/null
@@ -1,129 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include"xmlnmspe.hxx"
-
-#include "ximpgrp.hxx"
-
-
-
-#include "eventimp.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_EVENTS;
-using ::binfilter::xmloff::token::XML_GLUE_POINT;
-
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLGroupShapeContext, SvXMLImportContext );
-
-SdXMLGroupShapeContext::SdXMLGroupShapeContext(
- SvXMLImport& rImport,
- USHORT nPrfx, const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes )
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLGroupShapeContext::~SdXMLGroupShapeContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext* SdXMLGroupShapeContext::CreateChildContext( USHORT nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext* pContext = 0L;
-
- if( nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken( rLocalName, XML_EVENTS ) )
- {
- pContext = new SdXMLEventsContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShape );
- }
- else if( nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( rLocalName, XML_GLUE_POINT ) )
- {
- addGluePoint( xAttrList );
- }
- else
- {
- // call GroupChildContext function at common ShapeImport
- pContext = GetImport().GetShapeImport()->CreateGroupChildContext(
- GetImport(), nPrefix, rLocalName, xAttrList, mxChilds);
- }
-
- // call parent when no own context was created
- if(!pContext)
- pContext = SvXMLImportContext::CreateChildContext(
- nPrefix, rLocalName, xAttrList);
-
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLGroupShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- // create new group shape and add it to rShapes, use it
- // as base for the new group import
- AddShape( "com.sun.star.drawing.GroupShape" );
-
- if(mxShape.is())
- {
- SetStyle( false );
-
- mxChilds = uno::Reference< drawing::XShapes >::query( mxShape );
- if( mxChilds.is() )
- GetImport().GetShapeImport()->pushGroupForSorting( mxChilds );
- }
-
- GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLGroupShapeContext::EndElement()
-{
- if( mxChilds.is() )
- GetImport().GetShapeImport()->popGroupAndSort();
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_ximpnote.cxx b/binfilter/bf_xmloff/source/draw/xmloff_ximpnote.cxx
deleted file mode 100644
index a27f197d2829..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_ximpnote.cxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include "ximpnote.hxx"
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLNotesContext::SdXMLNotesContext( SdXMLImport& rImport,
- USHORT nPrfx, const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLGenericPageContext( rImport, nPrfx, rLocalName, xAttrList, rShapes )
-{
- const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetSdImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- OUString sValue = xAttrList->getValueByIndex( i );
- const SvXMLTokenMap& rAttrTokenMap = GetSdImport().GetMasterPageAttrTokenMap();
-
- switch(rAttrTokenMap.Get(nPrefix, aLocalName))
- {
- case XML_TOK_MASTERPAGE_PAGE_MASTER_NAME:
- {
- msPageMasterName = sValue;
- break;
- }
- }
- }
-
- // now delete all up-to-now contained shapes from this notes page
- uno::Reference< drawing::XShape > xShape;
- while(rShapes->getCount())
- {
- rShapes->getByIndex(0L) >>= xShape;
- if(xShape.is())
- rShapes->remove(xShape);
- }
-
- // set page-master?
- if(msPageMasterName.getLength())
- {
- SetPageMaster( msPageMasterName );
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLNotesContext::~SdXMLNotesContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext *SdXMLNotesContext::CreateChildContext( USHORT nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList>& xAttrList )
-{
- // OK, notes page is set on base class, objects can be imported on notes page
- SvXMLImportContext *pContext = 0L;
-
- // some special objects inside presentation:notes context
- // ...
-
-
-
-
-
-
-
- // call parent when no own context was created
- if(!pContext)
- pContext = SdXMLGenericPageContext::CreateChildContext(nPrefix, rLocalName, xAttrList);
-
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLNotesContext::EndElement()
-{
- SdXMLGenericPageContext::EndElement();
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_ximppage.cxx b/binfilter/bf_xmloff/source/draw/xmloff_ximppage.cxx
deleted file mode 100644
index 78f99a1d447b..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_ximppage.cxx
+++ /dev/null
@@ -1,257 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-
-
-#include "xmlnmspe.hxx"
-
-
-
-#include "animimp.hxx"
-
-
-
-#include "ximpstyl.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLGenericPageContext, SvXMLImportContext );
-
-SdXMLGenericPageContext::SdXMLGenericPageContext(
- SvXMLImport& rImport,
- USHORT nPrfx, const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SvXMLImportContext( rImport, nPrfx, rLocalName ),
- mxShapes( rShapes )
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLGenericPageContext::~SdXMLGenericPageContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLGenericPageContext::StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList )
-{
- GetImport().GetShapeImport()->pushGroupForSorting( mxShapes );
-
-#ifndef SVX_LIGHT
- if( GetImport().IsFormsSupported() )
- GetImport().GetFormImport()->startPage( uno::Reference< drawing::XDrawPage >::query( mxShapes ) );
-#endif
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext* SdXMLGenericPageContext::CreateChildContext( USHORT nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext* pContext = 0L;
-
- if( nPrefix == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_ANIMATIONS ) )
- {
- pContext = new XMLAnimationsContext( GetImport(), nPrefix, rLocalName, xAttrList );
- }
- else if( nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken( rLocalName, XML_FORMS ) )
- {
-#ifndef SVX_LIGHT
- if( GetImport().IsFormsSupported() )
- pContext = GetImport().GetFormImport()->createOfficeFormsContext( GetImport(), nPrefix, rLocalName );
-#endif
- }
- else
- {
- // call GroupChildContext function at common ShapeImport
- pContext = GetImport().GetShapeImport()->CreateGroupChildContext(
- GetImport(), nPrefix, rLocalName, xAttrList, mxShapes);
- }
-
- // call parent when no own context was created
- if(!pContext)
- pContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName, xAttrList);
-
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLGenericPageContext::EndElement()
-{
- GetImport().GetShapeImport()->popGroupAndSort();
-
-#ifndef SVX_LIGHT
- if( GetImport().IsFormsSupported() )
- GetImport().GetFormImport()->endPage();
-#endif
-}
-
-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);
- }
- }
-}
-
-void SdXMLGenericPageContext::SetPageMaster( OUString& rsPageMasterName )
-{
- if( GetSdImport().GetShapeImport()->GetStylesContext() )
- {
- // look for PageMaster with this name
-
- // #80012# GetStylesContext() replaced with GetAutoStylesContext()
- const SvXMLStylesContext* pAutoStyles = GetSdImport().GetShapeImport()->GetAutoStylesContext();
-
- const SvXMLStyleContext* pStyle = pAutoStyles ? pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_SD_PAGEMASTERCONEXT_ID, rsPageMasterName) : NULL;
-
- if(pStyle && pStyle->ISA(SdXMLPageMasterContext))
- {
- const SdXMLPageMasterContext* pPageMaster = (SdXMLPageMasterContext*)pStyle;
- const SdXMLPageMasterStyleContext* pPageMasterContext = pPageMaster->GetPageMasterStyle();
-
- if(pPageMasterContext)
- {
- uno::Reference< drawing::XDrawPage > xMasterPage(GetLocalShapesContext(), uno::UNO_QUERY);
- if(xMasterPage.is())
- {
- // set sizes for this masterpage
- uno::Reference <beans::XPropertySet> xPropSet(xMasterPage, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- uno::Any aAny;
-
- aAny <<= pPageMasterContext->GetBorderBottom();
- xPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("BorderBottom")), aAny);
-
- aAny <<= pPageMasterContext->GetBorderLeft();
- xPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("BorderLeft")), aAny);
-
- aAny <<= pPageMasterContext->GetBorderRight();
- xPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("BorderRight")), aAny);
-
- aAny <<= pPageMasterContext->GetBorderTop();
- xPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("BorderTop")), aAny);
-
- aAny <<= pPageMasterContext->GetWidth();
- xPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Width")), aAny);
-
- aAny <<= pPageMasterContext->GetHeight();
- xPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Height")), aAny);
-
- aAny <<= pPageMasterContext->GetOrientation();
- xPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Orientation")), aAny);
- }
- }
- }
- }
-
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_ximpshap.cxx b/binfilter/bf_xmloff/source/draw/xmloff_ximpshap.cxx
deleted file mode 100644
index e6b686980716..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_ximpshap.cxx
+++ /dev/null
@@ -1,2813 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include <tools/debug.hxx>
-
-#include <com/sun/star/drawing/XGluePointsSupplier.hpp>
-
-
-#include <com/sun/star/drawing/GluePoint2.hpp>
-
-
-
-#include <comphelper/extract.hxx>
-
-
-#include "XMLBase64ImportContext.hxx"
-
-#include "XMLShapeStyleContext.hxx"
-
-#include "xmluconv.hxx"
-
-
-#include <com/sun/star/drawing/CircleKind.hpp>
-
-
-
-#include <com/sun/star/drawing/XControlShape.hpp>
-
-
-
-#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-
-
-
-#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
-
-#include <com/sun/star/drawing/ConnectorType.hpp>
-
-#include <com/sun/star/drawing/HomogenMatrix3.hpp>
-
-
-
-#include "ximpstyl.hxx"
-
-#include"xmlnmspe.hxx"
-
-
-#include "XMLImageMapContext.hxx"
-
-#include "sdpropls.hxx"
-
-#include "eventimp.hxx"
-
-#include "XMLEmbeddedObjectImportContext.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-SvXMLEnumMapEntry aXML_GlueAlignment_EnumMap[] =
-{
- { XML_TOP_LEFT, drawing::Alignment_TOP_LEFT },
- { XML_TOP, drawing::Alignment_TOP },
- { XML_TOP_RIGHT, drawing::Alignment_TOP_RIGHT },
- { XML_LEFT, drawing::Alignment_LEFT },
- { XML_CENTER, drawing::Alignment_CENTER },
- { XML_RIGHT, drawing::Alignment_RIGHT },
- { XML_BOTTOM_LEFT, drawing::Alignment_BOTTOM_LEFT },
- { XML_BOTTOM, drawing::Alignment_BOTTOM },
- { XML_BOTTOM_RIGHT, drawing::Alignment_BOTTOM_RIGHT },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry aXML_GlueEscapeDirection_EnumMap[] =
-{
- { XML_AUTO, drawing::EscapeDirection_SMART },
- { XML_LEFT, drawing::EscapeDirection_LEFT },
- { XML_RIGHT, drawing::EscapeDirection_RIGHT },
- { XML_UP, drawing::EscapeDirection_UP },
- { XML_DOWN, drawing::EscapeDirection_DOWN },
- { XML_HORIZONTAL, drawing::EscapeDirection_HORIZONTAL },
- { XML_VERTICAL, drawing::EscapeDirection_VERTICAL },
- { XML_TOKEN_INVALID, 0 }
-};
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-static bool ImpIsEmptyURL( const ::rtl::OUString& rURL )
-{
- if( rURL.getLength() == 0 )
- return true;
-
- // #i13140# Also compare against 'toplevel' URLs. which also
- // result in empty filename strings.
- if( 0 == rURL.compareToAscii( "#./" ) )
- return true;
-
- return false;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLShapeContext, SvXMLImportContext );
-
-SdXMLShapeContext::SdXMLShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SvXMLImportContext( rImport, nPrfx, rLocalName ),
- mxShapes( rShapes ),
- mnStyleFamily(XML_STYLE_FAMILY_SD_GRAPHICS_ID),
- mbIsPlaceholder(FALSE),
- mbIsUserTransformed(FALSE),
- mxAttrList(xAttrList),
- mnZOrder(-1),
- mnShapeId(-1),
- maPosition(0, 0),
- maSize(1, 1)
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLShapeContext::~SdXMLShapeContext()
-{
- if(mxCursor.is())
- {
- // delete addition newline
- const OUString aEmpty;
- mxCursor->gotoEnd( sal_False );
- mxCursor->goLeft( 1, sal_True );
- mxCursor->setString( aEmpty );
-
- // reset cursor
- GetImport().GetTextImport()->ResetCursor();
- }
-
- if(mxOldCursor.is())
- GetImport().GetTextImport()->SetCursor( mxOldCursor );
-
- // reinstall old list item (if necessary) #91964#
- if ( mxOldListBlock.Is() )
- {
- GetImport().GetTextImport()->_SetListBlock( mxOldListBlock );
- GetImport().GetTextImport()->_SetListItem( mxOldListItem );
- }
-
- if( mxLockable.is() )
- mxLockable->removeActionLock();
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext *SdXMLShapeContext::CreateChildContext( USHORT nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext * pContext = NULL;
-
- if( nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken( rLocalName, XML_EVENTS ) )
- {
- pContext = new SdXMLEventsContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShape );
- }
- else if( nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( rLocalName, XML_GLUE_POINT ) )
- {
- addGluePoint( xAttrList );
- }
- else if( nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( rLocalName, XML_THUMBNAIL ) )
- {
- // search attributes for xlink:href
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- if( nPrefix == XML_NAMESPACE_XLINK )
- {
- if( IsXMLToken( aLocalName, XML_HREF ) )
- {
- maThumbnailURL = xAttrList->getValueByIndex( i );
- break;
- }
- }
- }
- }
- else
- {
- // create text cursor on demand
- if( !mxCursor.is() )
- {
- uno::Reference< text::XText > xText( mxShape, uno::UNO_QUERY );
- if( xText.is() )
- {
- UniReference < XMLTextImportHelper > xTxtImport =
- GetImport().GetTextImport();
- mxOldCursor = xTxtImport->GetCursor();
- mxCursor = xText->createTextCursor();
- if( mxCursor.is() )
- {
- xTxtImport->SetCursor( mxCursor );
- }
-
- // remember old list item and block (#91964#) and reset them
- // for the text frame
- mxOldListBlock = xTxtImport->_GetListBlock();
- mxOldListItem = xTxtImport->_GetListItem();
- xTxtImport->_SetListBlock( NULL );
- xTxtImport->_SetListItem( NULL );
- }
- }
-
- // if we have a text cursor, lets try to import some text
- if( mxCursor.is() )
- {
- pContext = GetImport().GetTextImport()->CreateTextChildContext(
- GetImport(), nPrefix, rLocalName, xAttrList );
- }
- }
-
- // call parent for content
- if(!pContext)
- pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList );
-
- return pContext;
-}
-
-void SdXMLShapeContext::addGluePoint( const uno::Reference< xml::sax::XAttributeList>& xAttrList )
-{
- // get the glue points container for this shape if its not already there
- if( !mxGluePoints.is() )
- {
- uno::Reference< drawing::XGluePointsSupplier > xSupplier( mxShape, uno::UNO_QUERY );
- if( !xSupplier.is() )
- return;
-
- mxGluePoints = uno::Reference< container::XIdentifierContainer >::query( xSupplier->getGluePoints() );
-
- if( !mxGluePoints.is() )
- return;
- }
-
- drawing::GluePoint2 aGluePoint;
- aGluePoint.IsUserDefined = sal_True;
- aGluePoint.Position.X = 0;
- aGluePoint.Position.Y = 0;
- aGluePoint.Escape = drawing::EscapeDirection_SMART;
- aGluePoint.PositionAlignment = drawing::Alignment_CENTER;
- aGluePoint.IsRelative = sal_True;
-
- sal_Int32 nId = -1;
-
- // read attributes for the 3DScene
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- const OUString sValue( xAttrList->getValueByIndex( i ) );
-
- if( nPrefix == XML_NAMESPACE_SVG )
- {
- if( IsXMLToken( aLocalName, XML_X ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(aGluePoint.Position.X, sValue);
- }
- else if( IsXMLToken( aLocalName, XML_Y ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(aGluePoint.Position.Y, sValue);
- }
- }
- else if( nPrefix == XML_NAMESPACE_DRAW )
- {
- if( IsXMLToken( aLocalName, XML_ID ) )
- {
- nId = sValue.toInt32();
- }
- else if( IsXMLToken( aLocalName, XML_ALIGN ) )
- {
- USHORT eKind;
- if( SvXMLUnitConverter::convertEnum( eKind, sValue, aXML_GlueAlignment_EnumMap ) )
- {
- aGluePoint.PositionAlignment = (drawing::Alignment)eKind;
- aGluePoint.IsRelative = sal_False;
- }
- }
- else if( IsXMLToken( aLocalName, XML_ESCAPE_DIRECTION ) )
- {
- USHORT eKind;
- if( SvXMLUnitConverter::convertEnum( eKind, sValue, aXML_GlueEscapeDirection_EnumMap ) )
- {
- aGluePoint.Escape = (drawing::EscapeDirection)eKind;
- }
- }
- }
- }
-
- if( nId != -1 )
- {
- try
- {
- sal_Int32 nInternalId = mxGluePoints->insert( uno::makeAny( aGluePoint ) );
- GetImport().GetShapeImport()->addGluePointMapping( mxShape, nId, nInternalId );
- }
- catch( uno::Exception& )
- {
- DBG_ERROR( "exception during setting of glue points!");
- }
- }
-}
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLShapeContext::AddShape(uno::Reference< drawing::XShape >& xShape)
-{
- if(xShape.is())
- {
- // set shape local
- mxShape = xShape;
-
- if(maShapeName.getLength())
- {
- uno::Reference< container::XNamed > xNamed( mxShape, uno::UNO_QUERY );
- if( xNamed.is() )
- xNamed->setName( maShapeName );
- }
-
- UniReference< XMLShapeImportHelper > xImp( GetImport().GetShapeImport() );
- xImp->addShape( xShape, mxAttrList, mxShapes );
-
- // #107848#
- if(!GetImport().HasTextImport()
- || !GetImport().GetTextImport()->IsInsideDeleteContext())
- {
- xImp->shapeWithZIndexAdded( xShape, mnZOrder );
- }
-
- if( mnShapeId != -1 )
- xImp->createShapeId( xShape, mnShapeId );
-
- // #91065# count only if counting for shape import is enabled
- if(GetImport().GetShapeImport()->IsHandleProgressBarEnabled())
- {
- // #80365# increment progress bar at load once for each draw object
- GetImport().GetProgressBarHelper()->Increment();
- }
- }
-
- mxLockable = uno::Reference< document::XActionLockable >::query( xShape );
-
- if( mxLockable.is() )
- mxLockable->addActionLock();
-
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLShapeContext::AddShape(const char* pServiceName )
-{
- uno::Reference< lang::XMultiServiceFactory > xServiceFact(GetImport().GetModel(), uno::UNO_QUERY);
- if(xServiceFact.is())
- {
- uno::Reference< drawing::XShape > xShape(xServiceFact->createInstance(OUString::createFromAscii(pServiceName)), uno::UNO_QUERY);
- if( xShape.is() )
- AddShape( xShape );
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLShapeContext::SetTransformation()
-{
- if(mxShape.is())
- {
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- Matrix3D aTransformation;
-
- if(maSize.Width != 1 || maSize.Height != 1)
- {
- // take care there are no zeros used by error
- if(0 == maSize.Width)
- maSize.Width = 1;
- if(0 == maSize.Height)
- maSize.Height = 1;
-
- // set global size. This should always be used.
- aTransformation.Scale(maSize.Width, maSize.Height);
- }
-
- if(maPosition.X != 0 || maPosition.Y != 0)
- {
- // if global position is used, add it to transformation
- aTransformation.Translate(maPosition.X, maPosition.Y);
- }
-
- if(mnTransform.NeedsAction())
- {
- // transformation is used, apply to object.
- // NOTICE: The transformation is applied AFTER evtl. used
- // global positioning and scaling is used, so any shear or
- // rotate used herein is applied around the (0,0) position
- // of the PAGE object !!!
- Matrix3D aMat;
- mnTransform.GetFullTransform(aMat);
-
- // now add to transformation
- aTransformation *= aMat;
- }
-
- // now set transformation for this object
- uno::Any aAny;
- drawing::HomogenMatrix3 aMatrix;
-
- aMatrix.Line1.Column1 = aTransformation[0].X();
- aMatrix.Line1.Column2 = aTransformation[0].Y();
- aMatrix.Line1.Column3 = aTransformation[0].W();
-
- aMatrix.Line2.Column1 = aTransformation[1].X();
- aMatrix.Line2.Column2 = aTransformation[1].Y();
- aMatrix.Line2.Column3 = aTransformation[1].W();
-
- aMatrix.Line3.Column1 = aTransformation[2].X();
- aMatrix.Line3.Column2 = aTransformation[2].Y();
- aMatrix.Line3.Column3 = aTransformation[2].W();
-
- aAny <<= aMatrix;
-
- xPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Transformation")), aAny);
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */)
-{
- try
- {
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if( !xPropSet.is() )
- return;
-
- do
- {
- XMLPropStyleContext* pDocStyle = NULL;
-
- // set style on shape
- if(maDrawStyleName.getLength() == 0)
- break;
-
- const SvXMLStyleContext* pStyle = 0L;
- sal_Bool bAutoStyle(FALSE);
-
- if(GetImport().GetShapeImport()->GetAutoStylesContext())
- pStyle = GetImport().GetShapeImport()->GetAutoStylesContext()->FindStyleChildContext(mnStyleFamily, maDrawStyleName);
-
- if(pStyle)
- bAutoStyle = TRUE;
-
- if(!pStyle && GetImport().GetShapeImport()->GetStylesContext())
- pStyle = GetImport().GetShapeImport()->GetStylesContext()->FindStyleChildContext(mnStyleFamily, maDrawStyleName);
-
- OUString aStyleName = maDrawStyleName;
- uno::Reference< style::XStyle > xStyle;
-
- if( pStyle && pStyle->ISA(XMLShapeStyleContext) )
- {
- pDocStyle = PTR_CAST( XMLShapeStyleContext, pStyle );
-
- if( pDocStyle->GetStyle().is() )
- {
- xStyle = pDocStyle->GetStyle();
- }
- else
- {
- aStyleName = pDocStyle->GetParent();
- }
- }
-
- if( !xStyle.is() && aStyleName.getLength() )
- {
- try
- {
-
- uno::Reference< style::XStyleFamiliesSupplier > xFamiliesSupplier( GetImport().GetModel(), uno::UNO_QUERY );
-
- if( xFamiliesSupplier.is() )
- {
- uno::Reference< container::XNameAccess > xFamilies( xFamiliesSupplier->getStyleFamilies() );
- if( xFamilies.is() )
- {
-
- uno::Reference< container::XNameAccess > xFamily;
-
- if( XML_STYLE_FAMILY_SD_PRESENTATION_ID == mnStyleFamily )
- {
- sal_Int32 nPos = aStyleName.lastIndexOf( sal_Unicode('-') );
- if( -1 != nPos )
- {
- OUString aFamily( aStyleName.copy( 0, nPos ) );
-
- xFamilies->getByName( aFamily ) >>= xFamily;
- aStyleName = aStyleName.copy( nPos + 1 );
- }
- }
- else
- {
- // get graphics familie
- xFamilies->getByName( OUString( RTL_CONSTASCII_USTRINGPARAM( "graphics" ) ) ) >>= xFamily;
- }
-
- if( xFamily.is() )
- xFamily->getByName( aStyleName ) >>= xStyle;
- }
- }
- }
- catch( uno::Exception& )
- {
- DBG_ERROR( "could not find style for shape!" );
- }
- }
-
- if( bSupportsStyle && xStyle.is() )
- {
- try
- {
- // set style on object
- uno::Any aAny;
- aAny <<= xStyle;
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Style")), aAny);
- }
- catch( uno::Exception& )
- {
- DBG_ERROR( "could not find style for shape!" );
- }
- }
-
- // if this is an auto style, set its properties
- if(bAutoStyle && pDocStyle)
- {
- // set PropertySet on object
- pDocStyle->FillPropertySet(xPropSet);
- }
-
- } while(0);
-
- // try to set text auto style
- do
- {
- // set style on shape
- if( 0 == maTextStyleName.getLength() )
- break;
-
- if( NULL == GetImport().GetShapeImport()->GetAutoStylesContext())
- break;
-
- XMLPropStyleContext* pStyle = PTR_CAST( XMLPropStyleContext, GetImport().GetShapeImport()->GetAutoStylesContext()->FindStyleChildContext(XML_STYLE_FAMILY_TEXT_PARAGRAPH, maTextStyleName) );
- if( pStyle == NULL )
- break;
-
- // set PropertySet on object
- pStyle->FillPropertySet(xPropSet);
-
- } while(0);
- }
- catch( uno::Exception& )
- {
- }
-}
-
-void SdXMLShapeContext::SetLayer()
-{
- if( maLayerName.getLength() )
- {
- try
- {
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if(xPropSet.is() )
- {
- uno::Any aAny;
- aAny <<= maLayerName;
-
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("LayerName")), aAny);
- return;
- }
- }
- catch( uno::Exception e )
- {
- }
- }
-}
-
-void SdXMLShapeContext::SetThumbnail()
-{
- if( 0 == maThumbnailURL.getLength() )
- return;
-
- try
- {
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if( !xPropSet.is() )
- return;
-
- const OUString sProperty(RTL_CONSTASCII_USTRINGPARAM("ThumbnailGraphicURL"));
-
- uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
- if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName( sProperty ) )
- {
- // load the thumbnail graphic and export it to a wmf stream so we can set
- // it at the api
-
- const OUString aInternalURL( GetImport().ResolveGraphicObjectURL( maThumbnailURL, sal_False ) );
- xPropSet->setPropertyValue( sProperty, uno::makeAny( aInternalURL ) );
- }
- }
- catch( uno::Exception e )
- {
- }
-}
-
-// this is called from the parent group for each unparsed attribute in the attribute list
-void SdXMLShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- if( XML_NAMESPACE_DRAW == nPrefix )
- {
- if( IsXMLToken( rLocalName, XML_ZINDEX ) )
- {
- mnZOrder = rValue.toInt32();
- }
- else if( IsXMLToken( rLocalName, XML_ID ) )
- {
- mnShapeId = rValue.toInt32();
- }
- else if( IsXMLToken( rLocalName, XML_NAME ) )
- {
- maShapeName = rValue;
- }
- else if( IsXMLToken( rLocalName, XML_STYLE_NAME ) )
- {
- maDrawStyleName = rValue;
- }
- else if( IsXMLToken( rLocalName, XML_TEXT_STYLE_NAME ) )
- {
- maTextStyleName = rValue;
- }
- else if( IsXMLToken( rLocalName, XML_LAYER ) )
- {
- maLayerName = rValue;
- }
- else if( IsXMLToken( rLocalName, XML_TRANSFORM ) )
- {
- mnTransform.SetString(rValue, GetImport().GetMM100UnitConverter());
- }
- }
- else if( XML_NAMESPACE_PRESENTATION == nPrefix )
- {
- if( IsXMLToken( rLocalName, XML_USER_TRANSFORMED ) )
- {
- mbIsUserTransformed = IsXMLToken( rValue, XML_TRUE );
- }
- else if( IsXMLToken( rLocalName, XML_PLACEHOLDER ) )
- {
- mbIsPlaceholder = IsXMLToken( rValue, XML_TRUE );
- }
- else if( IsXMLToken( rLocalName, XML_CLASS ) )
- {
- maPresentationClass = rValue;
- }
- else if( IsXMLToken( rLocalName, XML_STYLE_NAME ) )
- {
- maDrawStyleName = rValue;
- mnStyleFamily = XML_STYLE_FAMILY_SD_PRESENTATION_ID;
- }
- }
- else if( XML_NAMESPACE_SVG == nPrefix )
- {
- if( IsXMLToken( rLocalName, XML_X ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(maPosition.X, rValue);
- }
- else if( IsXMLToken( rLocalName, XML_Y ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(maPosition.Y, rValue);
- }
- else if( IsXMLToken( rLocalName, XML_WIDTH ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(maSize.Width, rValue);
- }
- else if( IsXMLToken( rLocalName, XML_HEIGHT ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(maSize.Height, rValue);
- }
- else if( IsXMLToken( rLocalName, XML_TRANSFORM ) )
- {
- // because of #85127# take svg:transform into account and hanle like
- // draw:transform for compatibility
- mnTransform.SetString(rValue, GetImport().GetMM100UnitConverter());
- }
- }
-}
-
-sal_Bool SdXMLShapeContext::isPresentationShape() const
-{
- return (XML_STYLE_FAMILY_SD_PRESENTATION_ID == mnStyleFamily) &&
- maPresentationClass.getLength() &&
- (const_cast<SdXMLShapeContext*>(this))->GetImport().GetShapeImport()->IsPresentationShapesSupported();
-}
-
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLRectShapeContext, SdXMLShapeContext );
-
-SdXMLRectShapeContext::SdXMLRectShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ),
- mnRadius( 0L )
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLRectShapeContext::~SdXMLRectShapeContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-// this is called from the parent group for each unparsed attribute in the attribute list
-void SdXMLRectShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- if( XML_NAMESPACE_DRAW == nPrefix )
- {
- if( IsXMLToken( rLocalName, XML_CORNER_RADIUS ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(mnRadius, rValue);
- return;
- }
- }
-
- SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLRectShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- // create rectangle shape
- AddShape("com.sun.star.drawing.RectangleShape");
- if(mxShape.is())
- {
- // Add, set Style and properties from base shape
- SetStyle();
- SetLayer();
-
- // set pos, size, shear and rotate
- SetTransformation();
-
- if(mnRadius)
- {
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- try
- {
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("CornerRadius")), uno::makeAny( mnRadius ) );
- }
- catch( uno::Exception& )
- {
- DBG_ERROR( "exception during setting of corner radius!");
- }
- }
- }
- SdXMLShapeContext::StartElement(xAttrList);
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLLineShapeContext, SdXMLShapeContext );
-
-SdXMLLineShapeContext::SdXMLLineShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ),
- mnX1( 0L ),
- mnY1( 0L ),
- mnX2( 1L ),
- mnY2( 1L )
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLLineShapeContext::~SdXMLLineShapeContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-// this is called from the parent group for each unparsed attribute in the attribute list
-void SdXMLLineShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- if( XML_NAMESPACE_SVG == nPrefix )
- {
- if( IsXMLToken( rLocalName, XML_X1 ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(mnX1, rValue);
- return;
- }
- if( IsXMLToken( rLocalName, XML_Y1 ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(mnY1, rValue);
- return;
- }
- if( IsXMLToken( rLocalName, XML_X2 ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(mnX2, rValue);
- return;
- }
- if( IsXMLToken( rLocalName, XML_Y2 ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(mnY2, rValue);
- return;
- }
- }
-
- SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLLineShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- // #85920# use SetTransformation() to handle import of simple lines.
- // This is necessary to kake into account all anchor positions and
- // other things. All shape imports use the same import schemata now.
- // create necessary shape (Line Shape)
- AddShape("com.sun.star.drawing.PolyLineShape");
-
- if(mxShape.is())
- {
- // Add, set Style and properties from base shape
- SetStyle();
- SetLayer();
-
- // get sizes and offsets
- awt::Point aTopLeft(mnX1, mnY1);
- awt::Point aBottomRight(mnX2, mnY2);
-
- if(mnX1 > mnX2)
- {
- aTopLeft.X = mnX2;
- aBottomRight.X = mnX1;
- }
-
- if(mnY1 > mnY2)
- {
- aTopLeft.Y = mnY2;
- aBottomRight.Y = mnY1;
- }
-
- // set local parameters on shape
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- drawing::PointSequenceSequence aPolyPoly(1L);
- drawing::PointSequence* pOuterSequence = aPolyPoly.getArray();
- pOuterSequence->realloc(2L);
- awt::Point* pInnerSequence = pOuterSequence->getArray();
- uno::Any aAny;
-
- *pInnerSequence = awt::Point( mnX1 - aTopLeft.X, mnY1 - aTopLeft.Y);
- pInnerSequence++;
- *pInnerSequence = awt::Point( mnX2 - aTopLeft.X, mnY2 - aTopLeft.Y);
-
- aAny <<= aPolyPoly;
- xPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Geometry")), aAny);
- }
-
- // set sizes for transformation
- maSize.Width = aBottomRight.X - aTopLeft.X;
- maSize.Height = aBottomRight.Y - aTopLeft.Y;
- maPosition.X = aTopLeft.X;
- maPosition.Y = aTopLeft.Y;
-
- // set pos, size, shear and rotate and get copy of matrix
- SetTransformation();
-
- SdXMLShapeContext::StartElement(xAttrList);
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLEllipseShapeContext, SdXMLShapeContext );
-
-SdXMLEllipseShapeContext::SdXMLEllipseShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ),
- mnCX( 0L ),
- mnCY( 0L ),
- mnRX( 1L ),
- mnRY( 1L ),
- meKind( drawing::CircleKind_FULL ),
- mnStartAngle( 0 ),
- mnEndAngle( 0 )
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLEllipseShapeContext::~SdXMLEllipseShapeContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-// this is called from the parent group for each unparsed attribute in the attribute list
-void SdXMLEllipseShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- if( XML_NAMESPACE_SVG == nPrefix )
- {
- if( IsXMLToken( rLocalName, XML_RX ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(mnRX, rValue);
- return;
- }
- if( IsXMLToken( rLocalName, XML_RY ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(mnRY, rValue);
- return;
- }
- if( IsXMLToken( rLocalName, XML_CX ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(mnCX, rValue);
- return;
- }
- if( IsXMLToken( rLocalName, XML_CY ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(mnCY, rValue);
- return;
- }
- if( IsXMLToken( rLocalName, XML_R ) )
- {
- // single radius, it's a circle and both radii are the same
- GetImport().GetMM100UnitConverter().convertMeasure(mnRX, rValue);
- mnRY = mnRX;
- return;
- }
- }
- else if( XML_NAMESPACE_DRAW == nPrefix )
- {
- if( IsXMLToken( rLocalName, XML_KIND ) )
- {
- USHORT eKind;
- if( SvXMLUnitConverter::convertEnum( eKind, rValue, aXML_CircleKind_EnumMap ) )
- {
- meKind = eKind;
- }
- return;
- }
- if( IsXMLToken( rLocalName, XML_START_ANGLE ) )
- {
- double dStartAngle;
- if( SvXMLUnitConverter::convertDouble( dStartAngle, rValue ) )
- mnStartAngle = (sal_Int32)(dStartAngle * 100.0);
- return;
- }
- if( IsXMLToken( rLocalName, XML_END_ANGLE ) )
- {
- double dEndAngle;
- if( SvXMLUnitConverter::convertDouble( dEndAngle, rValue ) )
- mnEndAngle = (sal_Int32)(dEndAngle * 100.0);
- return;
- }
- }
-
- SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLEllipseShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- // create rectangle shape
- AddShape("com.sun.star.drawing.EllipseShape");
- if(mxShape.is())
- {
- // Add, set Style and properties from base shape
- SetStyle();
- SetLayer();
-
- // set pos, size, shear and rotate
- SetTransformation();
-
- if( meKind != drawing::CircleKind_FULL )
- {
- uno::Reference< beans::XPropertySet > xPropSet( mxShape, uno::UNO_QUERY );
- if( xPropSet.is() )
- {
- uno::Any aAny;
- aAny <<= (drawing::CircleKind)meKind;
- xPropSet->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CircleKind")), aAny );
-
- aAny <<= mnStartAngle;
- xPropSet->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CircleStartAngle")), aAny );
-
- aAny <<= mnEndAngle;
- xPropSet->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CircleEndAngle")), aAny );
- }
- }
-
- SdXMLShapeContext::StartElement(xAttrList);
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLPolygonShapeContext, SdXMLShapeContext );
-
-SdXMLPolygonShapeContext::SdXMLPolygonShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes, sal_Bool bClosed)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ),
- mbClosed( bClosed )
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-// this is called from the parent group for each unparsed attribute in the attribute list
-void SdXMLPolygonShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- if( XML_NAMESPACE_SVG == nPrefix )
- {
- if( IsXMLToken( rLocalName, XML_VIEWBOX ) )
- {
- maViewBox = rValue;
- return;
- }
- }
- else if( XML_NAMESPACE_DRAW == nPrefix )
- {
- if( IsXMLToken( rLocalName, XML_POINTS ) )
- {
- maPoints = rValue;
- return;
- }
- }
-
- SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLPolygonShapeContext::~SdXMLPolygonShapeContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLPolygonShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- // Add, set Style and properties from base shape
- if(mbClosed)
- AddShape("com.sun.star.drawing.PolyPolygonShape");
- else
- AddShape("com.sun.star.drawing.PolyLineShape");
-
- if( mxShape.is() )
- {
- SetStyle();
- SetLayer();
-
- // set local parameters on shape
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- // set polygon
- if(maPoints.getLength() && maViewBox.getLength())
- {
- SdXMLImExViewBox aViewBox(maViewBox, GetImport().GetMM100UnitConverter());
- awt::Size aSize(aViewBox.GetWidth(), aViewBox.GetHeight());
- awt::Point aPosition(aViewBox.GetX(), aViewBox.GetY());
- SdXMLImExPointsElement aPoints(maPoints, aViewBox,
- aPosition, aSize, GetImport().GetMM100UnitConverter());
-
- uno::Any aAny;
- aAny <<= aPoints.GetPointSequenceSequence();
- xPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Geometry")), aAny);
- }
- }
-
- // set pos, size, shear and rotate and get copy of matrix
- SetTransformation();
-
- SdXMLShapeContext::StartElement(xAttrList);
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLPathShapeContext, SdXMLShapeContext );
-
-SdXMLPathShapeContext::SdXMLPathShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ),
- mbClosed( TRUE )
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLPathShapeContext::~SdXMLPathShapeContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-// this is called from the parent group for each unparsed attribute in the attribute list
-void SdXMLPathShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- if( XML_NAMESPACE_SVG == nPrefix )
- {
- if( IsXMLToken( rLocalName, XML_VIEWBOX ) )
- {
- maViewBox = rValue;
- return;
- }
- else if( IsXMLToken( rLocalName, XML_D ) )
- {
- maD = rValue;
- return;
- }
- }
-
- SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLPathShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- // create polygon shape
- if(maD.getLength())
- {
- // prepare some of the parameters
- SdXMLImExViewBox aViewBox(maViewBox, GetImport().GetMM100UnitConverter());
- awt::Size aSize(aViewBox.GetWidth(), aViewBox.GetHeight());
- awt::Point aPosition(aViewBox.GetX(), aViewBox.GetY());
- SdXMLImExSvgDElement aPoints(maD, aViewBox,
- aPosition, aSize, GetImport().GetMM100UnitConverter());
-
- char* pService;
- // now create shape
- if(aPoints.IsCurve())
- {
- if(aPoints.IsClosed())
- {
- pService = "com.sun.star.drawing.ClosedBezierShape";
- }
- else
- {
- pService = "com.sun.star.drawing.OpenBezierShape";
- }
- }
- else
- {
- if(aPoints.IsClosed())
- {
- pService = "com.sun.star.drawing.PolyPolygonShape";
- }
- else
- {
- pService = "com.sun.star.drawing.PolyLineShape";
- }
- }
-
- // Add, set Style and properties from base shape
- AddShape(pService);
-
- // #89344# test for mxShape.is() and not for mxShapes.is() to support
- // shape import helper classes WITHOUT XShapes (member mxShapes). This
- // is used by the writer.
- if( mxShape.is() )
- {
- SetStyle();
- SetLayer();
-
- // set local parameters on shape
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- uno::Any aAny;
-
- // set svg:d
- if(maD.getLength())
- {
- if(aPoints.IsCurve())
- {
- drawing::PolyPolygonBezierCoords aSourcePolyPolygon(
- aPoints.GetPointSequenceSequence(),
- aPoints.GetFlagSequenceSequence());
-
- aAny <<= aSourcePolyPolygon;
- xPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Geometry")), aAny);
- }
- else
- {
- aAny <<= aPoints.GetPointSequenceSequence();
- xPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Geometry")), aAny);
- }
- }
- }
-
- // set pos, size, shear and rotate
- SetTransformation();
-
- SdXMLShapeContext::StartElement(xAttrList);
- }
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLTextBoxShapeContext, SdXMLShapeContext );
-
-SdXMLTextBoxShapeContext::SdXMLTextBoxShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ),
- mnRadius(0)
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLTextBoxShapeContext::~SdXMLTextBoxShapeContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-// this is called from the parent group for each unparsed attribute in the attribute list
-void SdXMLTextBoxShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- if( XML_NAMESPACE_DRAW == nPrefix )
- {
- if( IsXMLToken( rLocalName, XML_CORNER_RADIUS ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(mnRadius, rValue);
- return;
- }
- }
-
- SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLTextBoxShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- // create textbox shape
- sal_Bool bIsPresShape(FALSE);
-
- char *pService = NULL;
-
- if( isPresentationShape() )
- {
- // check if the current document supports presentation shapes
- if( GetImport().GetShapeImport()->IsPresentationShapesSupported() )
- {
- if( IsXMLToken( maPresentationClass, XML_PRESENTATION_SUBTITLE ))
- {
- // XmlShapeTypePresSubtitleShape
- pService = "com.sun.star.presentation.SubtitleShape";
- }
- else if( IsXMLToken( maPresentationClass, XML_PRESENTATION_OUTLINE ) )
- {
- // XmlShapeTypePresOutlinerShape
- pService = "com.sun.star.presentation.OutlinerShape";
- }
- else if( IsXMLToken( maPresentationClass, XML_PRESENTATION_NOTES ) )
- {
- // XmlShapeTypePresNotesShape
- pService = "com.sun.star.presentation.NotesShape";
- }
- else // IsXMLToken( maPresentationClass, XML_PRESENTATION_TITLE ) )
- {
- // XmlShapeTypePresTitleTextShape
- pService = "com.sun.star.presentation.TitleTextShape";
- }
- bIsPresShape = TRUE;
- }
- }
-
- if( NULL == pService )
- {
- // normal text shape
- pService = "com.sun.star.drawing.TextShape";
- }
-
- // Add, set Style and properties from base shape
- AddShape(pService);
-
- if( mxShape.is() )
- {
- SetStyle();
- SetLayer();
-
- if(bIsPresShape)
- {
- uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
- if(xProps.is())
- {
- uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
- if( xPropsInfo.is() )
- {
- if( !mbIsPlaceholder && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") )))
- xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ), ::cppu::bool2any( sal_False ) );
-
- if( mbIsUserTransformed && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsPlaceholderDependent") )))
- xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsPlaceholderDependent") ), ::cppu::bool2any( sal_False ) );
- }
- }
- }
-
- // set parameters on shape
-//A AW->CL: Eventually You need to strip scale and translate from the transformation
-//A to reach the same goal again.
-//A if(!bIsPresShape || mbIsUserTransformed)
-//A {
-//A // set pos and size on shape, this should remove binding
-//A // to pres object on masterpage
-//A SetSizeAndPosition();
-//A }
-
- // set pos, size, shear and rotate
- SetTransformation();
-
- if(mnRadius)
- {
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- try
- {
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("CornerRadius")), uno::makeAny( mnRadius ) );
- }
- catch( uno::Exception& )
- {
- DBG_ERROR( "exception during setting of corner radius!");
- }
- }
- }
-
- SdXMLShapeContext::StartElement(xAttrList);
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLControlShapeContext, SdXMLShapeContext );
-
-SdXMLControlShapeContext::SdXMLControlShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes )
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLControlShapeContext::~SdXMLControlShapeContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-// this is called from the parent group for each unparsed attribute in the attribute list
-void SdXMLControlShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- if( XML_NAMESPACE_FORM == nPrefix )
- {
- if( IsXMLToken( rLocalName, XML_ID ) )
- {
- maFormId = rValue;
- return;
- }
- }
-
- SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
-}
-
-void SdXMLControlShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- // create Control shape
- // add, set style and properties from base shape
- AddShape("com.sun.star.drawing.ControlShape");
- if( mxShape.is() )
- {
- DBG_ASSERT( maFormId.getLength(), "draw:control without a form:id attribute!" );
- if( maFormId.getLength() )
- {
-#ifndef SVX_LIGHT
- if( GetImport().IsFormsSupported() )
- {
- uno::Reference< awt::XControlModel > xControlModel( GetImport().GetFormImport()->lookupControl( maFormId ), uno::UNO_QUERY );
- if( xControlModel.is() )
- {
- uno::Reference< drawing::XControlShape > xControl( mxShape, uno::UNO_QUERY );
- if( xControl.is() )
- xControl->setControl( xControlModel );
-
- }
- }
-#endif // #ifndef SVX_LIGHT
- }
-
- SetStyle();
- SetLayer();
-
- // set pos, size, shear and rotate
- SetTransformation();
-
- SdXMLShapeContext::StartElement(xAttrList);
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLConnectorShapeContext, SdXMLShapeContext );
-
-SdXMLConnectorShapeContext::SdXMLConnectorShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ),
- maStart(0,0),
- maEnd(1,1),
- mnType( (USHORT)drawing::ConnectorType_STANDARD ),
- mnStartShapeId(-1),
- mnStartGlueId(-1),
- mnEndShapeId(-1),
- mnEndGlueId(-1),
- mnDelta1(0),
- mnDelta2(0),
- mnDelta3(0)
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLConnectorShapeContext::~SdXMLConnectorShapeContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-// this is called from the parent group for each unparsed attribute in the attribute list
-void SdXMLConnectorShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- switch( nPrefix )
- {
- case XML_NAMESPACE_DRAW:
- {
- if( IsXMLToken( rLocalName, XML_START_SHAPE ) )
- {
- mnStartShapeId = rValue.toInt32();
- return;
- }
- if( IsXMLToken( rLocalName, XML_START_GLUE_POINT ) )
- {
- mnStartGlueId = rValue.toInt32();
- return;
- }
- if( IsXMLToken( rLocalName, XML_END_SHAPE ) )
- {
- mnEndShapeId = rValue.toInt32();
- return;
- }
- if( IsXMLToken( rLocalName, XML_END_GLUE_POINT ) )
- {
- mnEndGlueId = rValue.toInt32();
- return;
- }
- if( IsXMLToken( rLocalName, XML_LINE_SKEW ) )
- {
- SvXMLTokenEnumerator aTokenEnum( rValue );
- OUString aToken;
- if( aTokenEnum.getNextToken( aToken ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(mnDelta1, aToken);
- if( aTokenEnum.getNextToken( aToken ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(mnDelta2, aToken);
- if( aTokenEnum.getNextToken( aToken ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(mnDelta3, aToken);
- }
- }
- }
- return;
- }
- if( IsXMLToken( rLocalName, XML_TYPE ) )
- {
- SvXMLUnitConverter::convertEnum( mnType, rValue, aXML_ConnectionKind_EnumMap );
- return;
- }
- }
- case XML_NAMESPACE_SVG:
- {
- if( IsXMLToken( rLocalName, XML_X1 ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(maStart.X, rValue);
- return;
- }
- if( IsXMLToken( rLocalName, XML_Y1 ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(maStart.Y, rValue);
- return;
- }
- if( IsXMLToken( rLocalName, XML_X2 ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(maEnd.X, rValue);
- return;
- }
- if( IsXMLToken( rLocalName, XML_Y2 ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(maEnd.Y, rValue);
- return;
- }
- }
- }
-
- SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLConnectorShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- // #107928#
- // For security reasons, do not add empty connectors. There may have been an error in EA2
- // that created empty, far set off connectors (e.g. 63 meters below top of document). This
- // is not guaranteed, but it's definitely safe to not add empty connectors.
- sal_Bool bDoAdd(sal_True);
-
- if( -1 == mnStartShapeId
- && -1 == mnEndShapeId
- && maStart.X == maEnd.X
- && maStart.Y == maEnd.Y
- && 0 == mnDelta1
- && 0 == mnDelta2
- && 0 == mnDelta3
- )
- {
- bDoAdd = sal_False;
- }
-
- if(bDoAdd)
- {
- // create Connector shape
- // add, set style and properties from base shape
- AddShape("com.sun.star.drawing.ConnectorShape");
- if(mxShape.is())
- {
- // add connection ids
- if( mnStartShapeId != -1 )
- GetImport().GetShapeImport()->addShapeConnection( mxShape, sal_True, mnStartShapeId, mnStartGlueId );
- if( mnEndShapeId != -1 )
- GetImport().GetShapeImport()->addShapeConnection( mxShape, sal_False, mnEndShapeId, mnEndGlueId );
-
- uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
- if( xProps.is() )
- {
- uno::Any aAny;
- aAny <<= maStart;
- xProps->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("StartPosition")), aAny);
-
- aAny <<= maEnd;
- xProps->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("EndPosition")), aAny );
-
- aAny <<= (drawing::ConnectorType)mnType;
- xProps->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("EdgeKind")), aAny );
-
- aAny <<= mnDelta1;
- xProps->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("EdgeLine1Delta")), aAny );
-
- aAny <<= mnDelta2;
- xProps->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("EdgeLine2Delta")), aAny );
-
- aAny <<= mnDelta3;
- xProps->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("EdgeLine3Delta")), aAny );
- }
- SetStyle();
- SetLayer();
-
- SdXMLShapeContext::StartElement(xAttrList);
- }
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLMeasureShapeContext, SdXMLShapeContext );
-
-SdXMLMeasureShapeContext::SdXMLMeasureShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ),
- maStart(0,0),
- maEnd(1,1)
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLMeasureShapeContext::~SdXMLMeasureShapeContext()
-{
-}
-
-// this is called from the parent group for each unparsed attribute in the attribute list
-void SdXMLMeasureShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- switch( nPrefix )
- {
- case XML_NAMESPACE_SVG:
- {
- if( IsXMLToken( rLocalName, XML_X1 ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(maStart.X, rValue);
- return;
- }
- if( IsXMLToken( rLocalName, XML_Y1 ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(maStart.Y, rValue);
- return;
- }
- if( IsXMLToken( rLocalName, XML_X2 ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(maEnd.X, rValue);
- return;
- }
- if( IsXMLToken( rLocalName, XML_Y2 ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(maEnd.Y, rValue);
- return;
- }
- }
- }
-
- SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLMeasureShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- // create Measure shape
- // add, set style and properties from base shape
- AddShape("com.sun.star.drawing.MeasureShape");
- if(mxShape.is())
- {
- SetStyle();
- SetLayer();
- uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
- if( xProps.is() )
- {
- uno::Any aAny;
- aAny <<= maStart;
- xProps->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("StartPosition")), aAny);
-
- aAny <<= maEnd;
- xProps->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("EndPosition")), aAny );
- }
-
- // delete pre created fields
- uno::Reference< text::XText > xText( mxShape, uno::UNO_QUERY );
- if( xText.is() )
- {
- const OUString aEmpty( RTL_CONSTASCII_USTRINGPARAM( " " ) );
- xText->setString( aEmpty );
- }
-
- SdXMLShapeContext::StartElement(xAttrList);
- }
-}
-
-void SdXMLMeasureShapeContext::EndElement()
-{
- SdXMLShapeContext::EndElement();
-
- do
- {
- // delete pre created fields
- uno::Reference< text::XText > xText( mxShape, uno::UNO_QUERY );
- if( !xText.is() )
- break;
-
- uno::Reference< text::XTextCursor > xCursor( xText->createTextCursor() );
- if( !xCursor.is() )
- break;
-
- const OUString aEmpty;
- xCursor->collapseToStart();
- xCursor->goRight( 1, sal_True );
- xCursor->setString( aEmpty );
- }
- while(0);
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLPageShapeContext, SdXMLShapeContext );
-
-SdXMLPageShapeContext::SdXMLPageShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ), mnPageNumber(0)
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLPageShapeContext::~SdXMLPageShapeContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-// this is called from the parent group for each unparsed attribute in the attribute list
-void SdXMLPageShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- if( XML_NAMESPACE_DRAW == nPrefix )
- {
- if( IsXMLToken( rLocalName, XML_PAGE_NUMBER ) )
- {
- mnPageNumber = rValue.toInt32();
- return;
- }
- }
-
- SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLPageShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- // create Page shape
- // add, set style and properties from base shape
-
- // #86163# take into account which type of PageShape needs to
- // be constructed. It's an pres shape if presentation:XML_CLASS == XML_PRESENTATION_PAGE.
- sal_Bool bIsPresentation = maPresentationClass.getLength() &&
- GetImport().GetShapeImport()->IsPresentationShapesSupported();
-
- 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( bIsOnHandoutPage )
- {
- AddShape("com.sun.star.presentation.HandoutShape");
- }
- else
- {
- if(bIsPresentation && !IsXMLToken( maPresentationClass, XML_PRESENTATION_PAGE ) )
- {
- bIsPresentation = FALSE;
- }
-
- if(bIsPresentation)
- {
- AddShape("com.sun.star.presentation.PageShape");
- }
- else
- {
- AddShape("com.sun.star.drawing.PageShape");
- }
- }
-
- if(mxShape.is())
- {
- SetStyle();
- SetLayer();
-
- // set pos, size, shear and rotate
- SetTransformation();
-
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
- const OUString aPageNumberStr(RTL_CONSTASCII_USTRINGPARAM("PageNumber"));
- if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(aPageNumberStr))
- xPropSet->setPropertyValue(aPageNumberStr, uno::makeAny( mnPageNumber ));
- }
-
- SdXMLShapeContext::StartElement(xAttrList);
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLCaptionShapeContext, SdXMLShapeContext );
-
-SdXMLCaptionShapeContext::SdXMLCaptionShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ),
- // #86616# for correct edge rounding import mnRadius needs to be initialized
- mnRadius( 0L )
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLCaptionShapeContext::~SdXMLCaptionShapeContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLCaptionShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- // create Caption shape
- // add, set style and properties from base shape
- AddShape("com.sun.star.drawing.CaptionShape");
- if( mxShape.is() )
- {
- SetStyle();
- SetLayer();
-
- // set pos, size, shear and rotate
- SetTransformation();
-
- uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
- if( xProps.is() )
- xProps->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("CaptionPoint")), uno::makeAny( maCaptionPoint ) );
-
- if(mnRadius)
- {
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- try
- {
- xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("CornerRadius")), uno::makeAny( mnRadius ) );
- }
- catch( uno::Exception& )
- {
- DBG_ERROR( "exception during setting of corner radius!");
- }
- }
- }
-
- SdXMLShapeContext::StartElement(xAttrList);
- }
-}
-
-// this is called from the parent group for each unparsed attribute in the attribute list
-void SdXMLCaptionShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- if( XML_NAMESPACE_DRAW == nPrefix )
- {
- if( IsXMLToken( rLocalName, XML_CAPTION_POINT_X ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(maCaptionPoint.X, rValue);
- return;
- }
- if( IsXMLToken( rLocalName, XML_CAPTION_POINT_Y ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(maCaptionPoint.Y, rValue);
- return;
- }
- if( IsXMLToken( rLocalName, XML_CORNER_RADIUS ) )
- {
- GetImport().GetMM100UnitConverter().convertMeasure(mnRadius, rValue);
- return;
- }
- }
- SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLGraphicObjectShapeContext, SdXMLShapeContext );
-
-SdXMLGraphicObjectShapeContext::SdXMLGraphicObjectShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ),
- maURL()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-// this is called from the parent group for each unparsed attribute in the attribute list
-void SdXMLGraphicObjectShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- if( XML_NAMESPACE_XLINK == nPrefix )
- {
- if( IsXMLToken( rLocalName, XML_HREF ) )
- {
- maURL = rValue;
- return;
- }
- }
-
- SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLGraphicObjectShapeContext::StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList )
-{
- // create graphic object shape
- char *pService;
-
- if( IsXMLToken( maPresentationClass, XML_GRAPHIC ) && GetImport().GetShapeImport()->IsPresentationShapesSupported() )
- {
- pService = "com.sun.star.presentation.GraphicObjectShape";
- }
- else
- {
- pService = "com.sun.star.drawing.GraphicObjectShape";
- }
-
- AddShape( pService );
-
- if(mxShape.is())
- {
- SetStyle();
- SetLayer();
- uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
- if(xProps.is())
- {
- uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
- if( xPropsInfo.is() && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") )))
- xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ), ::cppu::bool2any( mbIsPlaceholder ) );
-
- if( !mbIsPlaceholder )
- {
- if( maURL.getLength() )
- {
- uno::Any aAny;
- aAny <<= GetImport().ResolveGraphicObjectURL( maURL, sal_True );
- try
- {
- xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicURL") ), aAny );
- xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicStreamURL") ), aAny );
- }
- catch (lang::IllegalArgumentException const &)
- {
- }
- }
- }
- }
-
- if(mbIsUserTransformed)
- {
- uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
- if(xProps.is())
- {
- uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
- if( xPropsInfo.is() )
- {
- if( xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsPlaceholderDependent") )))
- xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsPlaceholderDependent") ), ::cppu::bool2any( sal_False ) );
- }
- }
- }
-
- // set pos, size, shear and rotate
- SetTransformation();
-
- SdXMLShapeContext::StartElement(xAttrList);
- }
-}
-
-void SdXMLGraphicObjectShapeContext::EndElement()
-{
- if( mxBase64Stream.is() )
- {
- OUString sURL( GetImport().ResolveGraphicObjectURLFromBase64( mxBase64Stream ) );
- if( sURL.getLength() )
- {
- try
- {
- uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
- if(xProps.is())
- {
- const uno::Any aAny( uno::makeAny( sURL ) );
- xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicURL") ), aAny );
- xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicStreamURL") ), aAny );
- }
- }
- catch (lang::IllegalArgumentException const &)
- {
- }
- }
- }
-
-}
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext* SdXMLGraphicObjectShapeContext::CreateChildContext(
- USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
-
- if ( (XML_NAMESPACE_DRAW == nPrefix) &&
- IsXMLToken( rLocalName, XML_IMAGE_MAP ) )
- {
- uno::Reference< beans::XPropertySet > xPropSet(mxShape,uno::UNO_QUERY);
- if (xPropSet.is())
- {
- pContext = new XMLImageMapContext(GetImport(), nPrefix,
- rLocalName, xPropSet);
- }
- }
- else if( (XML_NAMESPACE_OFFICE == nPrefix) &&
- xmloff::token::IsXMLToken( rLocalName, xmloff::token::XML_BINARY_DATA ) )
- {
- if( !maURL.getLength() && !mxBase64Stream.is() )
- {
- mxBase64Stream = GetImport().GetStreamForGraphicObjectURLFromBase64();
- if( mxBase64Stream.is() )
- pContext = new XMLBase64ImportContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- mxBase64Stream );
- }
- }
-
- // delegate to parent class if no context could be created
- if ( NULL == pContext )
- pContext = SdXMLShapeContext::CreateChildContext(nPrefix, rLocalName,
- xAttrList);
-
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLGraphicObjectShapeContext::~SdXMLGraphicObjectShapeContext()
-{
-
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLChartShapeContext, SdXMLShapeContext );
-
-SdXMLChartShapeContext::SdXMLChartShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ),
- mpChartContext( NULL )
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLChartShapeContext::~SdXMLChartShapeContext()
-{
- if( mpChartContext )
- delete mpChartContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLChartShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-{
- const sal_Bool bIsPresentation = isPresentationShape();
-
- AddShape( bIsPresentation ? "com.sun.star.presentation.ChartShape" : "com.sun.star.drawing.OLE2Shape" );
-
- if(mxShape.is())
- {
- SetStyle();
- SetLayer();
-
- if( !mbIsPlaceholder )
- {
- uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
- if(xProps.is())
- {
- uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
- if( xPropsInfo.is() && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") )))
- xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ), ::cppu::bool2any( sal_False ) );
-
- uno::Any aAny;
-
- const OUString aCLSID( RTL_CONSTASCII_USTRINGPARAM("12DCAE26-281F-416F-a234-c3086127382e"));
-
- aAny <<= aCLSID;
- xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CLSID") ), aAny );
-
-#ifndef SVX_LIGHT
- aAny = xProps->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Model") ) );
- uno::Reference< frame::XModel > xChartModel;
- if( aAny >>= xChartModel )
- {
- mpChartContext = GetImport().GetChartImport()->CreateChartContext( GetImport(), XML_NAMESPACE_SVG, GetXMLToken(XML_CHART), xChartModel, xAttrList );
- }
-#endif
- }
- }
-
- if(mbIsUserTransformed)
- {
- uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
- if(xProps.is())
- {
- uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
- if( xPropsInfo.is() )
- {
- if( xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsPlaceholderDependent") )))
- xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsPlaceholderDependent") ), ::cppu::bool2any( sal_False ) );
- }
- }
- }
-
-
- // set pos, size, shear and rotate
- SetTransformation();
-
- SdXMLShapeContext::StartElement(xAttrList);
-
- if( mpChartContext )
- mpChartContext->StartElement( xAttrList );
- }
-}
-
-void SdXMLChartShapeContext::EndElement()
-{
- if( mpChartContext )
- mpChartContext->EndElement();
-}
-
-void SdXMLChartShapeContext::Characters( const ::rtl::OUString& rChars )
-{
- if( mpChartContext )
- mpChartContext->Characters( rChars );
-}
-
-SvXMLImportContext * SdXMLChartShapeContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
-{
- if( mpChartContext )
- return mpChartContext->CreateChildContext( nPrefix, rLocalName, xAttrList );
-
- return NULL;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLObjectShapeContext, SdXMLShapeContext );
-
-SdXMLObjectShapeContext::SdXMLObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes )
-{
-}
-
-SdXMLObjectShapeContext::~SdXMLObjectShapeContext()
-{
-}
-
-void SdXMLObjectShapeContext::StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList )
-{
- // #96717# in theorie, if we don't have a url we shouldn't even
- // export this ole shape. But practical its to risky right now
- // to change this so we better dispose this on load
- //if( !mbIsPlaceholder && ImpIsEmptyURL(maHref) )
- // return;
-
- // #100592# this BugFix prevents that a shape is created. CL
- // is thinking about an alternative.
- // #i13140# Check for more than empty string in maHref, there are
- // other possibilities that maHref results in empty container
- // storage names
- if( !(GetImport().getImportFlags() & IMPORT_EMBEDDED) && !mbIsPlaceholder && ImpIsEmptyURL(maHref) )
- return;
-
- char* pService = "com.sun.star.drawing.OLE2Shape";
-
- sal_Bool bIsPresShape = maPresentationClass.getLength() && GetImport().GetShapeImport()->IsPresentationShapesSupported();
-;
-
- if( bIsPresShape )
- {
- if( IsXMLToken( maPresentationClass, XML_PRESENTATION_CHART ) )
- {
- pService = "com.sun.star.presentation.ChartShape";
- }
- else if( IsXMLToken( maPresentationClass, XML_PRESENTATION_TABLE ) )
- {
- pService = "com.sun.star.presentation.TableShape";
- }
- else if( IsXMLToken( maPresentationClass, XML_PRESENTATION_OBJECT ) )
- {
- pService = "com.sun.star.presentation.OLE2Shape";
- }
- }
-
- AddShape( pService );
-
- if( mxShape.is() )
- {
- SetLayer();
-
- if(bIsPresShape)
- {
- uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
- if(xProps.is())
- {
- uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() );
- if( xPropsInfo.is() )
- {
- if( !mbIsPlaceholder && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") )))
- xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ), ::cppu::bool2any( sal_False ) );
-
- if( mbIsUserTransformed && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsPlaceholderDependent") )))
- xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsPlaceholderDependent") ), ::cppu::bool2any( sal_False ) );
- }
- }
- }
-
- if( !mbIsPlaceholder && maHref.getLength() )
- {
- uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
-
- if( xProps.is() )
- {
- uno::Any aAny;
- OUString aPersistName( GetImport().ResolveEmbeddedObjectURL( maHref, maCLSID ) );
- const OUString sURL(RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.EmbeddedObject:" ));
-
- aAny <<= ( aPersistName = aPersistName.copy( sURL.getLength() ) );
- xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "PersistName" ) ), aAny );
- }
- }
-
- // set pos, size, shear and rotate
- SetTransformation();
-
- SetStyle();
-
- GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
- }
-}
-
-void SdXMLObjectShapeContext::EndElement()
-{
- // #100592#
- if( mxBase64Stream.is() )
- {
- OUString aPersistName( GetImport().ResolveEmbeddedObjectURL( maHref, OUString() ) );
- const OUString sURL(RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.EmbeddedObject:" ));
-
- aPersistName = aPersistName.copy( sURL.getLength() );
-
- uno::Reference< beans::XPropertySet > xProps(mxShape, uno::UNO_QUERY);
- if( xProps.is() )
- xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "PersistName" ) ), uno::makeAny( aPersistName ) );
- }
-}
-
-// this is called from the parent group for each unparsed attribute in the attribute list
-void SdXMLObjectShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- switch( nPrefix )
- {
- case XML_NAMESPACE_DRAW:
- if( IsXMLToken( rLocalName, XML_CLASS_ID ) )
- {
- maCLSID = rValue;
- return;
- }
- break;
- case XML_NAMESPACE_XLINK:
- if( IsXMLToken( rLocalName, XML_HREF ) )
- {
- maHref = rValue;
- return;
- }
- break;
- }
-
- SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
-}
-
-SvXMLImportContext* SdXMLObjectShapeContext::CreateChildContext(
- USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList )
-{
- // #100592#
- SvXMLImportContext* pContext = NULL;
-
- if((XML_NAMESPACE_OFFICE == nPrefix) && IsXMLToken(rLocalName, XML_BINARY_DATA))
- {
- maHref = OUString( RTL_CONSTASCII_USTRINGPARAM( "#Obj12345678" ) );
- mxBase64Stream = GetImport().ResolveEmbeddedObjectURLFromBase64( maHref );
- if( mxBase64Stream.is() )
- pContext = new XMLBase64ImportContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- mxBase64Stream );
- }
- else if( ((XML_NAMESPACE_OFFICE == nPrefix) && IsXMLToken(rLocalName, XML_DOCUMENT)) ||
- ((XML_NAMESPACE_MATH == nPrefix) && IsXMLToken(rLocalName, XML_MATH)) )
- {
- XMLEmbeddedObjectImportContext *pEContext =
- new XMLEmbeddedObjectImportContext( GetImport(), nPrefix,
- rLocalName, xAttrList );
- maCLSID = pEContext->GetFilterCLSID();
- if( maCLSID.getLength() != 0 )
- {
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if( xPropSet.is() )
- {
- xPropSet->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("CLSID") ), uno::makeAny( maCLSID ) );
-
- uno::Reference< lang::XComponent > xComp;
- xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Model") ) ) >>= xComp;
- DBG_ASSERT( xComp.is(), "no xModel for own OLE format" );
- pEContext->SetComponent( xComp );
- }
- }
- pContext = pEContext;
- }
-
- // delegate to parent class if no context could be created
- if(!pContext)
- pContext = SdXMLShapeContext::CreateChildContext(nPrefix, rLocalName, xAttrList);
-
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLAppletShapeContext, SdXMLShapeContext );
-
-SdXMLAppletShapeContext::SdXMLAppletShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ),
- mbIsScript( sal_False )
-{
-}
-
-SdXMLAppletShapeContext::~SdXMLAppletShapeContext()
-{
-}
-
-void SdXMLAppletShapeContext::StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList )
-{
- char* pService = "com.sun.star.drawing.AppletShape";
- AddShape( pService );
-
- if( mxShape.is() )
- {
- SetLayer();
-
- // set pos, size, shear and rotate
- SetTransformation();
- GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
- }
-}
-
-// this is called from the parent group for each unparsed attribute in the attribute list
-void SdXMLAppletShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- switch( nPrefix )
- {
- case XML_NAMESPACE_DRAW:
- if( IsXMLToken( rLocalName, XML_APPLET_NAME ) )
- {
- maAppletName = rValue;
- return;
- }
- if( IsXMLToken( rLocalName, XML_CODE ) )
- {
- maAppletCode = rValue;
- return;
- }
- if( IsXMLToken( rLocalName, XML_MAY_SCRIPT ) )
- {
- mbIsScript = IsXMLToken( rValue, XML_TRUE );
- return;
- }
- break;
- case XML_NAMESPACE_XLINK:
- if( IsXMLToken( rLocalName, XML_HREF ) )
- {
- maHref = GetImport().GetAbsoluteReference(rValue);
- return;
- }
- break;
- }
-
- SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
-}
-
-void SdXMLAppletShapeContext::EndElement()
-{
- uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
- if( xProps.is() )
- {
- uno::Any aAny;
-
- if( maParams.getLength() )
- {
- aAny <<= maParams;
- xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletCommands" ) ), aAny );
- }
-
- if( maHref.getLength() )
- {
- aAny <<= maHref;
- xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletCodeBase" ) ), aAny );
- }
-
- if( maAppletName.getLength() )
- {
- aAny <<= maAppletName;
- xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletName" ) ), aAny );
- }
-
- if( mbIsScript )
- {
- aAny <<= mbIsScript;
- xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletIsScript" ) ), aAny );
-
- }
-
- if( maAppletCode.getLength() )
- {
- aAny <<= maAppletCode;
- xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AppletCode" ) ), aAny );
- }
-
- SetThumbnail();
- }
-}
-
-SvXMLImportContext * SdXMLAppletShapeContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext * pContext = NULL;
-
- if( nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( rLocalName, XML_PARAM ) )
- {
- OUString aParamName, aParamValue;
- const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- // now parse the attribute list and look for draw:name and draw:value
- for(sal_Int16 a(0); a < nAttrCount; a++)
- {
- const OUString& rAttrName = xAttrList->getNameByIndex(a);
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName(rAttrName, &aLocalName);
- const OUString aValue( xAttrList->getValueByIndex(a) );
-
- if( nPrefix == XML_NAMESPACE_DRAW )
- {
- if( IsXMLToken( aLocalName, XML_NAME ) )
- {
- aParamName = aValue;
- }
- else if( IsXMLToken( aLocalName, XML_VALUE ) )
- {
- aParamValue = aValue;
- }
- }
- }
-
- if( aParamName.getLength() )
- {
- sal_Int32 nIndex = maParams.getLength();
- maParams.realloc( nIndex + 1 );
- maParams[nIndex].Name = aParamName;
- maParams[nIndex].Handle = -1;
- maParams[nIndex].Value <<= aParamValue;
- maParams[nIndex].State = beans::PropertyState_DIRECT_VALUE;
- }
-
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
-
- return SdXMLShapeContext::CreateChildContext( nPrefix, rLocalName, xAttrList );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLPluginShapeContext, SdXMLShapeContext );
-
-SdXMLPluginShapeContext::SdXMLPluginShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes )
-{
-}
-
-SdXMLPluginShapeContext::~SdXMLPluginShapeContext()
-{
-}
-
-void SdXMLPluginShapeContext::StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList )
-{
- char* pService = "com.sun.star.drawing.PluginShape";
- AddShape( pService );
-
- if( mxShape.is() )
- {
- SetLayer();
-
- // set pos, size, shear and rotate
- SetTransformation();
- GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
- }
-}
-
-// this is called from the parent group for each unparsed attribute in the attribute list
-void SdXMLPluginShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- switch( nPrefix )
- {
- case XML_NAMESPACE_DRAW:
- if( IsXMLToken( rLocalName, XML_MIME_TYPE ) )
- {
- maMimeType = rValue;
- return;
- }
- break;
- case XML_NAMESPACE_XLINK:
- if( IsXMLToken( rLocalName, XML_HREF ) )
- {
- maHref = GetImport().GetAbsoluteReference(rValue);
- return;
- }
- break;
- }
-
- SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
-}
-
-void SdXMLPluginShapeContext::EndElement()
-{
- uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
- if( xProps.is() )
- {
- uno::Any aAny;
-
- if( maParams.getLength() )
- {
- aAny <<= maParams;
- xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "PluginCommands" ) ), aAny );
- }
-
- if( maMimeType.getLength() )
- {
- aAny <<= maMimeType;
- xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "PluginMimeType" ) ), aAny );
- }
-
- if( maHref.getLength() )
- {
- aAny <<= maHref;
- xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "PluginURL" ) ), aAny );
- }
-
- SetThumbnail();
- }
-}
-
-SvXMLImportContext * SdXMLPluginShapeContext::CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext * pContext = NULL;
-
- if( nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( rLocalName, XML_PARAM ) )
- {
- OUString aParamName, aParamValue;
- const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- // now parse the attribute list and look for draw:name and draw:value
- for(sal_Int16 a(0); a < nAttrCount; a++)
- {
- const OUString& rAttrName = xAttrList->getNameByIndex(a);
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName(rAttrName, &aLocalName);
- const OUString aValue( xAttrList->getValueByIndex(a) );
-
- if( nPrefix == XML_NAMESPACE_DRAW )
- {
- if( IsXMLToken( aLocalName, XML_NAME ) )
- {
- aParamName = aValue;
- }
- else if( IsXMLToken( aLocalName, XML_VALUE ) )
- {
- aParamValue = aValue;
- }
- }
-
- if( aParamName.getLength() )
- {
- sal_Int32 nIndex = maParams.getLength();
- maParams.realloc( nIndex + 1 );
- maParams[nIndex].Name = aParamName;
- maParams[nIndex].Handle = -1;
- maParams[nIndex].Value <<= aParamValue;
- maParams[nIndex].State = beans::PropertyState_DIRECT_VALUE;
- }
- }
-
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
-
- return SdXMLShapeContext::CreateChildContext( nPrefix, rLocalName, xAttrList );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLFrameShapeContext, SdXMLShapeContext );
-
-SdXMLFrameShapeContext::SdXMLFrameShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes )
-{
-}
-
-SdXMLFrameShapeContext::~SdXMLFrameShapeContext()
-{
-}
-
-void SdXMLFrameShapeContext::StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList )
-{
- char* pService = "com.sun.star.drawing.FrameShape";
- AddShape( pService );
-
- if( mxShape.is() )
- {
- SetLayer();
-
- // set pos, size, shear and rotate
- SetTransformation();
-
- uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
- if( xProps.is() )
- {
- uno::Any aAny;
-
- if( maFrameName.getLength() )
- {
- aAny <<= maFrameName;
- xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "FrameName" ) ), aAny );
- }
-
- if( maHref.getLength() )
- {
- aAny <<= maHref;
- xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "FrameURL" ) ), aAny );
- }
- }
-
- SetStyle();
-
- GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
- }
-}
-
-// this is called from the parent group for each unparsed attribute in the attribute list
-void SdXMLFrameShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
-{
- switch( nPrefix )
- {
- case XML_NAMESPACE_DRAW:
- if( IsXMLToken( rLocalName, XML_FRAME_NAME ) )
- {
- maFrameName = rValue;
- return;
- }
- break;
- case XML_NAMESPACE_XLINK:
- if( IsXMLToken( rLocalName, XML_HREF ) )
- {
- maHref = GetImport().GetAbsoluteReference(rValue);
- return;
- }
- break;
- }
-
- SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
-}
-
-void SdXMLFrameShapeContext::EndElement()
-{
- SetThumbnail();
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_ximpshow.cxx b/binfilter/bf_xmloff/source/draw/xmloff_ximpshow.cxx
deleted file mode 100644
index 3f646fa6bf4a..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_ximpshow.cxx
+++ /dev/null
@@ -1,285 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <com/sun/star/util/DateTime.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
-#include <com/sun/star/presentation/XPresentationSupplier.hpp>
-#include <com/sun/star/container/XIndexContainer.hpp>
-#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
-
-
-#include <comphelper/extract.hxx>
-
-#include "xmlnmspe.hxx"
-#include "nmspmap.hxx"
-
-#include "xmluconv.hxx"
-
-#include "ximpshow.hxx"
-namespace binfilter {
-
-using namespace ::std;
-using namespace ::cppu;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::xml;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::drawing;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::presentation;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-///////////////////////////////////////////////////////////////////////
-
-class ShowsImpImpl
-{
-public:
- Reference< XSingleServiceFactory > mxShowFactory;
- Reference< XNameContainer > mxShows;
- Reference< XPropertySet > mxPresProps;
- Reference< XNameAccess > mxPages;
- OUString maCustomShowName;
- SdXMLImport& mrImport;
-
- ShowsImpImpl( SdXMLImport& rImport )
- : mrImport( rImport )
- {}
-};
-
-///////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLShowsContext, SvXMLImportContext );
-
-SdXMLShowsContext::SdXMLShowsContext( SdXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList )
-: SvXMLImportContext(rImport, nPrfx, rLocalName)
-{
- mpImpl = new ShowsImpImpl( rImport );
-
- Reference< XCustomPresentationSupplier > xShowsSupplier( rImport.GetModel(), UNO_QUERY );
- if( xShowsSupplier.is() )
- {
- mpImpl->mxShows = xShowsSupplier->getCustomPresentations();
- mpImpl->mxShowFactory = Reference< XSingleServiceFactory >::query( mpImpl->mxShows );
- }
-
- Reference< XDrawPagesSupplier > xDrawPagesSupplier( rImport.GetModel(), UNO_QUERY );
- if( xDrawPagesSupplier.is() )
- mpImpl->mxPages = Reference< XNameAccess >::query( xDrawPagesSupplier->getDrawPages() );
-
- Reference< XPresentationSupplier > xPresentationSupplier( rImport.GetModel(), UNO_QUERY );
- if( xPresentationSupplier.is() )
- mpImpl->mxPresProps = Reference< XPropertySet >::query( xPresentationSupplier->getPresentation() );
-
-
- if( mpImpl->mxPresProps.is() )
- {
- sal_Bool bAll = sal_True;
- uno::Any aAny;
-
- // read attributes
- const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- OUString sValue = xAttrList->getValueByIndex( i );
-
- switch( nPrefix )
- {
- case XML_NAMESPACE_PRESENTATION:
- if( IsXMLToken( aLocalName, XML_START_PAGE ) )
- {
- aAny <<= sValue;
- mpImpl->mxPresProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "FirstPage" ) ), aAny );
- bAll = sal_False;
- }
- else if( IsXMLToken( aLocalName, XML_SHOW ) )
- {
- mpImpl->maCustomShowName = sValue;
- bAll = sal_False;
- }
- else if( IsXMLToken( aLocalName, XML_PAUSE ) )
- {
- DateTime aTime;
- if( !SvXMLUnitConverter::convertTime( aTime, sValue ) )
- continue;
-
- const sal_Int32 nMS = ( aTime.Hours * 60 + aTime.Minutes ) * 60 + aTime.Seconds;
- aAny <<= nMS;
- mpImpl->mxPresProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Pause" ) ), aAny );
- }
- else if( IsXMLToken( aLocalName, XML_ANIMATIONS ) )
- {
- aAny = bool2any( IsXMLToken( sValue, XML_ENABLED ) );
- mpImpl->mxPresProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AllowAnimations" ) ), aAny );
- }
- else if( IsXMLToken( aLocalName, XML_STAY_ON_TOP ) )
- {
- aAny = bool2any( IsXMLToken( sValue, XML_TRUE ) );
- mpImpl->mxPresProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAlwaysOnTop" ) ), aAny );
- }
- else if( IsXMLToken( aLocalName, XML_FORCE_MANUAL ) )
- {
- aAny = bool2any( IsXMLToken( sValue, XML_TRUE ) );
- mpImpl->mxPresProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAutomatic" ) ), aAny );
- }
- else if( IsXMLToken( aLocalName, XML_ENDLESS ) )
- {
- aAny = bool2any( IsXMLToken( sValue, XML_TRUE ) );
- mpImpl->mxPresProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsEndless" ) ), aAny );
- }
- else if( IsXMLToken( aLocalName, XML_FULL_SCREEN ) )
- {
- aAny = bool2any( IsXMLToken( sValue, XML_TRUE ) );
- mpImpl->mxPresProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFullScreen" ) ), aAny );
- }
- else if( IsXMLToken( aLocalName, XML_MOUSE_VISIBLE ) )
- {
- aAny = bool2any( IsXMLToken( sValue, XML_TRUE ) );
- mpImpl->mxPresProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsMouseVisible" ) ), aAny );
- }
- else if( IsXMLToken( aLocalName, XML_START_WITH_NAVIGATOR ) )
- {
- aAny = bool2any( IsXMLToken( sValue, XML_TRUE ) );
- mpImpl->mxPresProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "StartWithNavigator" ) ), aAny );
- }
- else if( IsXMLToken( aLocalName, XML_MOUSE_AS_PEN ) )
- {
- aAny = bool2any( IsXMLToken( sValue, XML_TRUE ) );
- mpImpl->mxPresProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "UsePen" ) ), aAny );
- }
- else if( IsXMLToken( aLocalName, XML_TRANSITION_ON_CLICK ) )
- {
- aAny = bool2any( IsXMLToken( sValue, XML_ENABLED ) );
- mpImpl->mxPresProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsTransitionOnClick" ) ), aAny );
- }
- else if( IsXMLToken( aLocalName, XML_SHOW_LOGO ) )
- {
- aAny = bool2any( IsXMLToken( sValue, XML_TRUE ) );
- mpImpl->mxPresProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsShowLogo" ) ), aAny );
- }
- }
- }
- aAny = bool2any( bAll );
- mpImpl->mxPresProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsShowAll" ) ), aAny );
- }
-}
-
-SdXMLShowsContext::~SdXMLShowsContext()
-{
- if( mpImpl && mpImpl->maCustomShowName.getLength() )
- {
- uno::Any aAny;
- aAny <<= mpImpl->maCustomShowName;
- mpImpl->mxPresProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "CustomShow" ) ), aAny );
- }
-
- delete mpImpl;
-}
-
-SvXMLImportContext * SdXMLShowsContext::CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList )
-{
- if( mpImpl && nPrefix == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_SHOW ) )
- {
- OUString aName;
- OUString aPages;
-
- // read attributes
- const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- OUString sValue = xAttrList->getValueByIndex( i );
-
- switch( nPrefix )
- {
- case XML_NAMESPACE_PRESENTATION:
- if( IsXMLToken( aLocalName, XML_NAME ) )
- {
- aName = sValue;
- }
- else if( IsXMLToken( aLocalName, XML_PAGES ) )
- {
- aPages = sValue;
- }
- }
- }
-
- if( aName.getLength() != 0 && aPages.getLength() != 0 )
- {
- Reference< XIndexContainer > xShow( mpImpl->mxShowFactory->createInstance(), UNO_QUERY );
- if( xShow.is() )
- {
- SvXMLTokenEnumerator aPageNames( aPages, sal_Unicode(',') );
- OUString sPageName;
- Any aAny;
-
- while( aPageNames.getNextToken( sPageName ) )
- {
- if( !mpImpl->mxPages->hasByName( sPageName ) )
- continue;
-
- Reference< XDrawPage > xPage;
- mpImpl->mxPages->getByName( sPageName ) >>= xPage;
- if( xPage.is() )
- {
- aAny <<= xPage;
- xShow->insertByIndex( xShow->getCount(), aAny );
- }
- }
-
- aAny <<= xShow;
-
- if( mpImpl->mxShows->hasByName( aName ) )
- {
- mpImpl->mxShows->replaceByName( aName, aAny );
- }
- else
- {
- mpImpl->mxShows->insertByName( aName, aAny );
- }
- }
- }
- }
-
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/draw/xmloff_ximpstyl.cxx b/binfilter/bf_xmloff/source/draw/xmloff_ximpstyl.cxx
deleted file mode 100644
index 0f67f8ac2fc8..000000000000
--- a/binfilter/bf_xmloff/source/draw/xmloff_ximpstyl.cxx
+++ /dev/null
@@ -1,1490 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include "ximpstyl.hxx"
-
-#include "XMLShapeStyleContext.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "xmluconv.hxx"
-
-#include "ximpnote.hxx"
-
-#include <tools/debug.hxx>
-
-
-#include <com/sun/star/presentation/XPresentationPage.hpp>
-
-#include <com/sun/star/drawing/XDrawPages.hpp>
-
-
-
-#include <com/sun/star/beans/XPropertyState.hpp>
-
-#include <comphelper/namecontainer.hxx>
-
-#include <com/sun/star/presentation/XHandoutMasterSupplier.hpp>
-
-#include "xmlprcon.hxx"
-
-
-
-#include <bf_svtools/zforlist.hxx>
-
-#include "PropertySetMerger.hxx"
-
-#include "sdpropls.hxx"
-
-#include "layerimp.hxx"
-
-#include "XMLGraphicsDefaultStyle.hxx"
-
-#include "XMLNumberStylesImport.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-//////////////////////////////////////////////////////////////////////////////
-
-class SdXMLDrawingPagePropertySetContext : public SvXMLPropertySetContext
-{
-public:
-
- TYPEINFO();
-
- SdXMLDrawingPagePropertySetContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
- ::std::vector< XMLPropertyState > &rProps,
- const UniReference < SvXMLImportPropertyMapper > &rMap );
-
- virtual ~SdXMLDrawingPagePropertySetContext();
-
- virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
- ::std::vector< XMLPropertyState > &rProperties,
- const XMLPropertyState& rProp);
-};
-
-TYPEINIT1( SdXMLDrawingPagePropertySetContext, SvXMLPropertySetContext );
-
-SdXMLDrawingPagePropertySetContext::SdXMLDrawingPagePropertySetContext(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList,
- ::std::vector< XMLPropertyState > &rProps,
- const UniReference < SvXMLImportPropertyMapper > &rMap ) :
- SvXMLPropertySetContext( rImport, nPrfx, rLName, xAttrList, rProps, rMap )
-{
-}
-
-SdXMLDrawingPagePropertySetContext::~SdXMLDrawingPagePropertySetContext()
-{
-}
-
-SvXMLImportContext *SdXMLDrawingPagePropertySetContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList,
- ::std::vector< XMLPropertyState > &rProperties,
- const XMLPropertyState& rProp )
-{
- SvXMLImportContext *pContext = 0;
-
- switch( xMapper->getPropertySetMapper()->GetEntryContextId( rProp.mnIndex ) )
- {
- case CTF_PAGE_SOUND_URL:
- {
- const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName(xAttrList->getNameByIndex(i), &aLocalName);
-
- if( (nPrefix == XML_NAMESPACE_XLINK) && IsXMLToken( aLocalName, XML_HREF ) )
- {
- uno::Any aAny;
- aAny <<= GetImport().GetAbsoluteReference( xAttrList->getValueByIndex(i) );
- XMLPropertyState aPropState( rProp.mnIndex, aAny );
- rProperties.push_back( aPropState );
- }
- }
- break;
- }
- }
-
- if( !pContext )
- pContext = SvXMLPropertySetContext::CreateChildContext( nPrefix, rLocalName,
- xAttrList,
- rProperties, rProp );
-
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-class SdXMLDrawingPageStyleContext : public XMLPropStyleContext
-{
-public:
- TYPEINFO();
-
- SdXMLDrawingPageStyleContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
- SvXMLStylesContext& rStyles,
- sal_uInt16 nFamily = XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID);
- virtual ~SdXMLDrawingPageStyleContext();
-
- SvXMLImportContext * CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
-};
-
-TYPEINIT1( SdXMLDrawingPageStyleContext, XMLPropStyleContext );
-
-SdXMLDrawingPageStyleContext::SdXMLDrawingPageStyleContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList,
- SvXMLStylesContext& rStyles,
- sal_uInt16 nFamily)
-: XMLPropStyleContext(rImport, nPrfx, rLName, xAttrList, rStyles, nFamily )
-{
-}
-
-SdXMLDrawingPageStyleContext::~SdXMLDrawingPageStyleContext()
-{
-}
-
-SvXMLImportContext *SdXMLDrawingPageStyleContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
-
- if( XML_NAMESPACE_STYLE == nPrefix &&
- IsXMLToken( rLocalName, XML_PROPERTIES ) )
- {
- UniReference < SvXMLImportPropertyMapper > xImpPrMap =
- GetStyles()->GetImportPropertyMapper( GetFamily() );
- if( xImpPrMap.is() )
- pContext = new SdXMLDrawingPagePropertySetContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- GetProperties(),
- xImpPrMap );
- }
-
- if( !pContext )
- pContext = XMLPropStyleContext::CreateChildContext( nPrefix, rLocalName,
- xAttrList );
-
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLPageMasterStyleContext, SvXMLStyleContext );
-
-SdXMLPageMasterStyleContext::SdXMLPageMasterStyleContext(
- SdXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList, XML_STYLE_FAMILY_SD_PAGEMASTERSTYLECONEXT_ID),
- mnBorderBottom( 0L ),
- mnBorderLeft( 0L ),
- mnBorderRight( 0L ),
- mnBorderTop( 0L ),
- mnWidth( 0L ),
- mnHeight( 0L ),
- meOrientation(GetSdImport().IsDraw() ? view::PaperOrientation_PORTRAIT : view::PaperOrientation_LANDSCAPE)
-{
- // set family to something special at SvXMLStyleContext
- // for differences in search-methods
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex(i);
- OUString aLocalName;
- sal_uInt16 nPrefix = GetSdImport().GetNamespaceMap().GetKeyByAttrName(sAttrName, &aLocalName);
- OUString sValue = xAttrList->getValueByIndex(i);
- const SvXMLTokenMap& rAttrTokenMap = GetSdImport().GetPageMasterStyleAttrTokenMap();
-
- switch(rAttrTokenMap.Get(nPrefix, aLocalName))
- {
- case XML_TOK_PAGEMASTERSTYLE_MARGIN_TOP:
- {
- GetSdImport().GetMM100UnitConverter().convertMeasure(mnBorderTop, sValue);
- break;
- }
- case XML_TOK_PAGEMASTERSTYLE_MARGIN_BOTTOM:
- {
- GetSdImport().GetMM100UnitConverter().convertMeasure(mnBorderBottom, sValue);
- break;
- }
- case XML_TOK_PAGEMASTERSTYLE_MARGIN_LEFT:
- {
- GetSdImport().GetMM100UnitConverter().convertMeasure(mnBorderLeft, sValue);
- break;
- }
- case XML_TOK_PAGEMASTERSTYLE_MARGIN_RIGHT:
- {
- GetSdImport().GetMM100UnitConverter().convertMeasure(mnBorderRight, sValue);
- break;
- }
- case XML_TOK_PAGEMASTERSTYLE_PAGE_WIDTH:
- {
- GetSdImport().GetMM100UnitConverter().convertMeasure(mnWidth, sValue);
- break;
- }
- case XML_TOK_PAGEMASTERSTYLE_PAGE_HEIGHT:
- {
- GetSdImport().GetMM100UnitConverter().convertMeasure(mnHeight, sValue);
- break;
- }
- case XML_TOK_PAGEMASTERSTYLE_PAGE_ORIENTATION:
- {
- if( IsXMLToken( sValue, XML_PORTRAIT ) )
- meOrientation = view::PaperOrientation_PORTRAIT;
- else
- meOrientation = view::PaperOrientation_LANDSCAPE;
- break;
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLPageMasterStyleContext::~SdXMLPageMasterStyleContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLPageMasterContext, SvXMLStyleContext );
-
-SdXMLPageMasterContext::SdXMLPageMasterContext(
- SdXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList, XML_STYLE_FAMILY_SD_PAGEMASTERCONEXT_ID),
- mpPageMasterStyle( 0L )
-{
- // set family to something special at SvXMLStyleContext
- // for differences in search-methods
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex(i);
- OUString aLocalName;
- sal_uInt16 nPrefix = GetSdImport().GetNamespaceMap().GetKeyByAttrName(sAttrName, &aLocalName);
- OUString sValue = xAttrList->getValueByIndex(i);
- const SvXMLTokenMap& rAttrTokenMap = GetSdImport().GetPageMasterAttrTokenMap();
-
- switch(rAttrTokenMap.Get(nPrefix, aLocalName))
- {
- case XML_TOK_PAGEMASTER_NAME:
- {
- msName = sValue;
- break;
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLPageMasterContext::~SdXMLPageMasterContext()
-{
- // release remembered contexts, they are no longer needed
- if(mpPageMasterStyle)
- {
- mpPageMasterStyle->ReleaseRef();
- mpPageMasterStyle = 0L;
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext *SdXMLPageMasterContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = 0;
-
- if(nPrefix == XML_NAMESPACE_STYLE && IsXMLToken( rLocalName, XML_PROPERTIES) )
- {
- pContext = new SdXMLPageMasterStyleContext(GetSdImport(), nPrefix, rLocalName, xAttrList);
-
- // remember SdXMLPresentationPlaceholderContext for later evaluation
- if(pContext)
- {
- pContext->AddRef();
- DBG_ASSERT(!mpPageMasterStyle, "PageMasterStyle is set, there seem to be two of them (!)");
- mpPageMasterStyle = (SdXMLPageMasterStyleContext*)pContext;
- }
- }
-
- // call base class
- if(!pContext)
- pContext = SvXMLStyleContext::CreateChildContext(nPrefix, rLocalName, xAttrList);
-
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLPresentationPageLayoutContext, SvXMLStyleContext );
-
-SdXMLPresentationPageLayoutContext::SdXMLPresentationPageLayoutContext(
- SdXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList)
-: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList, XML_STYLE_FAMILY_SD_PRESENTATIONPAGELAYOUT_ID),
- mnTypeId( 20 ) // AUTOLAYOUT_NONE
-{
- // set family to somethiong special at SvXMLStyleContext
- // for differences in search-methods
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName );
-
- if(nPrefix == XML_NAMESPACE_STYLE && IsXMLToken( aLocalName, XML_NAME ) )
- {
- msName = xAttrList->getValueByIndex( i );
- }
- }
-}
-
-SdXMLPresentationPageLayoutContext::~SdXMLPresentationPageLayoutContext()
-{
-}
-
-SvXMLImportContext *SdXMLPresentationPageLayoutContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = 0;
-
- if(nPrefix == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_PLACEHOLDER ) )
- {
- // presentation:placeholder inside style:presentation-page-layout context
- pContext = new SdXMLPresentationPlaceholderContext(
- GetSdImport(), nPrefix, rLocalName, xAttrList);
-
- // remember SdXMLPresentationPlaceholderContext for later evaluation
- if(pContext)
- {
- pContext->AddRef();
- maList.Insert((SdXMLPresentationPlaceholderContext*)pContext, LIST_APPEND);
- }
- }
-
- // call base class
- if(!pContext)
- pContext = SvXMLStyleContext::CreateChildContext(nPrefix, rLocalName, xAttrList);
-
- return pContext;
-}
-
-void SdXMLPresentationPageLayoutContext::EndElement()
-{
- // build presentation page layout type here
- // calc mnTpeId due to content of maList
- // at the moment only use number of types used there
- if(maList.Count())
- {
- SdXMLPresentationPlaceholderContext* pObj0 = maList.GetObject(0);
- if(pObj0->GetName().equals(OUString(RTL_CONSTASCII_USTRINGPARAM("handout"))))
- {
- switch( maList.Count() )
- {
- case 1:
- mnTypeId = 22; // AUTOLAYOUT_HANDOUT1
- break;
- case 2:
- mnTypeId = 23; // AUTOLAYOUT_HANDOUT2
- break;
- case 3:
- mnTypeId = 24; // AUTOLAYOUT_HANDOUT3
- break;
- case 4:
- mnTypeId = 25; // AUTOLAYOUT_HANDOUT4
- break;
- default:
- mnTypeId = 26; // AUTOLAYOUT_HANDOUT6
- }
- }
- else
- {
- switch(maList.Count())
- {
- case 1:
- {
- mnTypeId = 19; // AUTOLAYOUT_ONLY_TITLE
- break;
- }
- case 2:
- {
- SdXMLPresentationPlaceholderContext* pObj1 = maList.GetObject(1);
-
- if(pObj1->GetName().equals(
- OUString(RTL_CONSTASCII_USTRINGPARAM("subtitle"))))
- {
- mnTypeId = 0; // AUTOLAYOUT_TITLE
- }
- else if(pObj1->GetName().equals(
- OUString(RTL_CONSTASCII_USTRINGPARAM("outline"))))
- {
- mnTypeId = 1; // AUTOLAYOUT_ENUM
- }
- else if(pObj1->GetName().equals(
- OUString(RTL_CONSTASCII_USTRINGPARAM("chart"))))
- {
- mnTypeId = 2; // AUTOLAYOUT_CHART
- }
- else if(pObj1->GetName().equals(
- OUString(RTL_CONSTASCII_USTRINGPARAM("table"))))
- {
- mnTypeId = 8; // AUTOLAYOUT_TAB
- }
- else if(pObj1->GetName().equals(
- OUString(RTL_CONSTASCII_USTRINGPARAM("object"))))
- {
- mnTypeId = 11; // AUTOLAYOUT_OBJ
- }
- else if(pObj1->GetName().equals(
- OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_outline"))))
- {
- if(pObj0->GetName().equals(OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_title"))))
- {
- // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
- mnTypeId = 28;
- }
- else
- {
- // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE
- mnTypeId = 29;
- }
- }
- else
- {
- mnTypeId = 21; // AUTOLAYOUT_NOTES
- }
- break;
- }
- case 3:
- {
- SdXMLPresentationPlaceholderContext* pObj1 = maList.GetObject(1);
- SdXMLPresentationPlaceholderContext* pObj2 = maList.GetObject(2);
-
- if(pObj1->GetName().equals(
- OUString(RTL_CONSTASCII_USTRINGPARAM("outline"))))
- {
- if(pObj2->GetName().equals(
- OUString(RTL_CONSTASCII_USTRINGPARAM("outline"))))
- {
- mnTypeId = 3; // AUTOLAYOUT_2TEXT
- }
- else if(pObj2->GetName().equals(
- OUString(RTL_CONSTASCII_USTRINGPARAM("chart"))))
- {
- mnTypeId = 4; // AUTOLAYOUT_TEXTCHART
- }
- else if(pObj2->GetName().equals(
- OUString(RTL_CONSTASCII_USTRINGPARAM("graphic"))))
- {
- mnTypeId = 6; // AUTOLAYOUT_TEXTCLIP
- }
- else
- {
- if(pObj1->GetX() < pObj2->GetX())
- {
- mnTypeId = 10; // AUTOLAYOUT_TEXTOBJ -> outline left, object right
- }
- else
- {
- mnTypeId = 17; // AUTOLAYOUT_TEXTOVEROBJ -> outline top, object right
- }
- }
- }
- else if(pObj1->GetName().equals(
- OUString(RTL_CONSTASCII_USTRINGPARAM("chart"))))
- {
- mnTypeId = 7; // AUTOLAYOUT_CHARTTEXT
- }
- else if(pObj1->GetName().equals(
- OUString(RTL_CONSTASCII_USTRINGPARAM("graphic"))))
- {
- if(pObj2->GetName().equals(OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_outline"))))
- {
- // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE_CLIPART
- mnTypeId = 30;
- }
- else
- {
- mnTypeId = 9; // AUTOLAYOUT_CLIPTEXT
- }
- }
- else if(pObj1->GetName().equals(
- OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_outline"))))
- {
- // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART
- mnTypeId = 27;
- }
- else
- {
- if(pObj1->GetX() < pObj2->GetX())
- {
- mnTypeId = 13; // AUTOLAYOUT_OBJTEXT -> left, right
- }
- else
- {
- mnTypeId = 14; // AUTOLAYOUT_OBJOVERTEXT -> top, bottom
- }
- }
- break;
- }
- case 4:
- {
- SdXMLPresentationPlaceholderContext* pObj1 = maList.GetObject(1);
- SdXMLPresentationPlaceholderContext* pObj2 = maList.GetObject(2);
-
- if(pObj1->GetName().equals(
- OUString(RTL_CONSTASCII_USTRINGPARAM("object"))))
- {
- if(pObj1->GetX() < pObj2->GetX())
- {
- mnTypeId = 16; // AUTOLAYOUT_2OBJOVERTEXT
- }
- else
- {
- mnTypeId = 15; // AUTOLAYOUT_2OBJTEXT
- }
- }
- else
- {
- mnTypeId = 12; // AUTOLAYOUT_TEXT2OBJ
- }
- break;
- }
- default: // 5 items
- {
- mnTypeId = 18; // AUTOLAYOUT_4OBJ
- break;
- }
- }
- }
-
- // release remembered contexts, they are no longer needed
- while(maList.Count())
- maList.Remove(maList.Count() - 1)->ReleaseRef();
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLPresentationPlaceholderContext::SdXMLPresentationPlaceholderContext(
- SdXMLImport& rImport,
- sal_uInt16 nPrfx, const
- OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList>& xAttrList)
-: SvXMLImportContext( rImport, nPrfx, rLName),
- mnX(0L),
- mnY(0L),
- mnWidth(1L),
- mnHeight(1L)
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex(i);
- OUString aLocalName;
- sal_uInt16 nPrefix = GetSdImport().GetNamespaceMap().GetKeyByAttrName(sAttrName, &aLocalName);
- OUString sValue = xAttrList->getValueByIndex(i);
- const SvXMLTokenMap& rAttrTokenMap = GetSdImport().GetPresentationPlaceholderAttrTokenMap();
-
- switch(rAttrTokenMap.Get(nPrefix, aLocalName))
- {
- case XML_TOK_PRESENTATIONPLACEHOLDER_OBJECTNAME:
- {
- msName = sValue;
- break;
- }
- case XML_TOK_PRESENTATIONPLACEHOLDER_X:
- {
- GetSdImport().GetMM100UnitConverter().convertMeasure(mnX, sValue);
- break;
- }
- case XML_TOK_PRESENTATIONPLACEHOLDER_Y:
- {
- GetSdImport().GetMM100UnitConverter().convertMeasure(mnY, sValue);
- break;
- }
- case XML_TOK_PRESENTATIONPLACEHOLDER_WIDTH:
- {
- GetSdImport().GetMM100UnitConverter().convertMeasure(mnWidth, sValue);
- break;
- }
- case XML_TOK_PRESENTATIONPLACEHOLDER_HEIGHT:
- {
- GetSdImport().GetMM100UnitConverter().convertMeasure(mnHeight, sValue);
- break;
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLPresentationPlaceholderContext::~SdXMLPresentationPlaceholderContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLMasterPageContext, SdXMLGenericPageContext );
-
-SdXMLMasterPageContext::SdXMLMasterPageContext(
- SdXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes)
-: SdXMLGenericPageContext( rImport, nPrfx, rLName, xAttrList, rShapes )
-{
- const sal_Bool bHandoutMaster = IsXMLToken( rLName, XML_HANDOUT_MASTER );
-
- const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for(sal_Int16 i=0; i < nAttrCount; i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetSdImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- OUString sValue = xAttrList->getValueByIndex( i );
- const SvXMLTokenMap& rAttrTokenMap = GetSdImport().GetMasterPageAttrTokenMap();
-
- switch(rAttrTokenMap.Get(nPrefix, aLocalName))
- {
- case XML_TOK_MASTERPAGE_NAME:
- {
- msName = sValue;
- break;
- }
- case XML_TOK_MASTERPAGE_PAGE_MASTER_NAME:
- {
- msPageMasterName = sValue;
- break;
- }
- case XML_TOK_MASTERPAGE_STYLE_NAME:
- {
- msStyleName = sValue;
- break;
- }
- case XML_TOK_MASTERPAGE_PAGE_LAYOUT_NAME:
- {
- maPageLayoutName = sValue;
- break;
- }
- }
- }
-
- GetImport().GetShapeImport()->startPage( GetLocalShapesContext() );
-
- // set page name?
- if(!bHandoutMaster && msName.getLength() && GetLocalShapesContext().is())
- {
- uno::Reference < container::XNamed > xNamed(GetLocalShapesContext(), uno::UNO_QUERY);
- if(xNamed.is())
- xNamed->setName(msName);
- }
-
- // set page-master?
- if(msPageMasterName.getLength())
- {
- 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!" );
- }
- }
- }
- }
- }
- }
- }
-
- SetLayout();
-
- DeleteAllShapes();
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLMasterPageContext::~SdXMLMasterPageContext()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-void SdXMLMasterPageContext::EndElement()
-{
- // set styles on master-page
- if(msName.getLength() && GetSdImport().GetShapeImport()->GetStylesContext())
- {
- SvXMLImportContext* pContext = GetSdImport().GetShapeImport()->GetStylesContext();
- if( pContext && pContext->ISA( SvXMLStyleContext ) )
- ((SdXMLStylesContext*)pContext)->SetMasterPageStyles(*this);
- }
-
- SdXMLGenericPageContext::EndElement();
- GetImport().GetShapeImport()->endPage(GetLocalShapesContext());
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLImportContext* SdXMLMasterPageContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext* pContext = 0;
- const SvXMLTokenMap& rTokenMap = GetSdImport().GetMasterPageElemTokenMap();
-
- // some special objects inside style:masterpage context
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- case XML_TOK_MASTERPAGE_STYLE:
- {
- if(GetSdImport().GetShapeImport()->GetStylesContext())
- {
- // style:style inside master-page context -> presentation style
- XMLShapeStyleContext* pNew = new XMLShapeStyleContext(
- GetSdImport(), nPrefix, rLocalName, xAttrList,
- *GetSdImport().GetShapeImport()->GetStylesContext(),
- XML_STYLE_FAMILY_SD_PRESENTATION_ID);
-
- // add this style to the outer StylesContext class for later processing
- if(pNew)
- {
- pContext = pNew;
- GetSdImport().GetShapeImport()->GetStylesContext()->AddStyle(*pNew);
- }
- }
- break;
- }
- case XML_TOK_MASTERPAGE_NOTES:
- {
- if( GetSdImport().IsImpress() )
- {
- // get notes page
- uno::Reference< presentation::XPresentationPage > xPresPage(GetLocalShapesContext(), uno::UNO_QUERY);
- if(xPresPage.is())
- {
- uno::Reference< drawing::XDrawPage > xNotesDrawPage(xPresPage->getNotesPage(), uno::UNO_QUERY);
- if(xNotesDrawPage.is())
- {
- uno::Reference< drawing::XShapes > xNewShapes(xNotesDrawPage, uno::UNO_QUERY);
- if(xNewShapes.is())
- {
- // presentation:notes inside master-page context
- pContext = new SdXMLNotesContext( GetSdImport(), nPrefix, rLocalName, xAttrList, xNewShapes);
- }
- }
- }
- }
- }
- }
-
- // call base class
- if(!pContext)
- pContext = SdXMLGenericPageContext::CreateChildContext(nPrefix, rLocalName, xAttrList);
-
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SdXMLStylesContext, SvXMLStyleContext );
-
-SdXMLStylesContext::SdXMLStylesContext(
- SdXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList,
- sal_Bool bIsAutoStyle)
-: SvXMLStylesContext(rImport, nPrfx, rLName, xAttrList),
- mbIsAutoStyle(bIsAutoStyle)
-{
- // #110680#
- // Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- Reference< lang::XMultiServiceFactory > xMSF = rImport.getServiceFactory();
-
- mpNumFormatter = new SvNumberFormatter( xMSF, LANGUAGE_SYSTEM );
-
- // #110680#
- // mpNumFmtHelper = new SvXMLNumFmtHelper( mpNumFormatter );
- mpNumFmtHelper = new SvXMLNumFmtHelper( mpNumFormatter, xMSF );
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SdXMLStylesContext::~SdXMLStylesContext()
-{
- delete mpNumFmtHelper;
- delete mpNumFormatter;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLStyleContext* SdXMLStylesContext::CreateStyleChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList)
-{
- SvXMLStyleContext* pContext = 0;
- const SvXMLTokenMap& rTokenMap = GetSdImport().GetStylesElemTokenMap();
-
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- case XML_TOK_STYLES_PAGE_MASTER:
- {
- // style:page-master inside office:styles context
- pContext = new SdXMLPageMasterContext(GetSdImport(), nPrefix, rLocalName, xAttrList);
- break;
- }
- case XML_TOK_STYLES_PRESENTATION_PAGE_LAYOUT:
- {
- // style:presentation-page-layout inside office:styles context
- pContext = new SdXMLPresentationPageLayoutContext(GetSdImport(), nPrefix, rLocalName, xAttrList);
- break;
- }
- }
-
- if(!pContext)
- {
- const SvXMLTokenMap& rTokenMap = mpNumFmtHelper->GetStylesElemTokenMap();
- sal_uInt16 nToken = rTokenMap.Get( nPrefix, rLocalName );
- switch (nToken)
- {
- case XML_TOK_STYLES_DATE_STYLE:
- case XML_TOK_STYLES_TIME_STYLE:
- // number:date-style or number:time-style
- pContext = new SdXMLNumberFormatImportContext( GetSdImport(), nPrefix, rLocalName, mpNumFmtHelper->getData(), nToken, xAttrList, *this );
- break;
-
- case XML_TOK_STYLES_NUMBER_STYLE:
- case XML_TOK_STYLES_CURRENCY_STYLE:
- case XML_TOK_STYLES_PERCENTAGE_STYLE:
- case XML_TOK_STYLES_BOOLEAN_STYLE:
- case XML_TOK_STYLES_TEXT_STYLE:
- pContext = new SvXMLNumFormatContext( GetSdImport(), nPrefix, rLocalName,
- mpNumFmtHelper->getData(), nToken, xAttrList, *this );
- break;
- }
- }
-
- // call base class
- if(!pContext)
- pContext = SvXMLStylesContext::CreateStyleChildContext(nPrefix, rLocalName, xAttrList);
-
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLStyleContext* SdXMLStylesContext::CreateStyleStyleChildContext(
- sal_uInt16 nFamily,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList)
-{
- SvXMLStyleContext* pContext = 0;
-
- switch( nFamily )
- {
- case XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID:
- pContext = new SdXMLDrawingPageStyleContext(GetSdImport(), nPrefix, rLocalName, xAttrList, *this );
- break;
- }
-
- // call base class
- if(!pContext)
- pContext = SvXMLStylesContext::CreateStyleStyleChildContext(nFamily, nPrefix, rLocalName, xAttrList);
-
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-SvXMLStyleContext* SdXMLStylesContext::CreateDefaultStyleStyleChildContext(
- sal_uInt16 nFamily,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< XAttributeList > & xAttrList )
-{
- SvXMLStyleContext* pContext = 0;
-
- switch( nFamily )
- {
- case XML_STYLE_FAMILY_SD_GRAPHICS_ID:
- pContext = new XMLGraphicsDefaultStyle(GetSdImport(), nPrefix, rLocalName, xAttrList, *this );
- break;
- }
-
- // call base class
- if(!pContext)
- pContext = SvXMLStylesContext::CreateDefaultStyleStyleChildContext(nFamily, nPrefix, rLocalName, xAttrList);
-
- return pContext;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-sal_uInt16 SdXMLStylesContext::GetFamily( const OUString& rFamily ) const
-{
-// if(rFamily.getLength())
-// {
-// if(rFamily.equals(OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME))))
-// return XML_STYLE_FAMILY_SD_GRAPHICS_ID;
-//
-// if(rFamily.equals(OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME))))
-// return XML_STYLE_FAMILY_SD_PRESENTATION_ID;
-//
-// if(rFamily.equals(OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_POOL_NAME))))
-// return XML_STYLE_FAMILY_SD_POOL_ID;
-//
-// if(rFamily.equals(OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME))))
-// return XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID;
-// }
-
- // call base class
- return SvXMLStylesContext::GetFamily(rFamily);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-UniReference< SvXMLImportPropertyMapper > SdXMLStylesContext::GetImportPropertyMapper(
- sal_uInt16 nFamily) const
-{
- UniReference < SvXMLImportPropertyMapper > xMapper;
-
-// if(XML_STYLE_FAMILY_SD_GRAPHICS_ID == nFamily
-// || XML_STYLE_FAMILY_SD_PRESENTATION_ID == nFamily
-// || XML_STYLE_FAMILY_SD_POOL_ID == nFamily)
-// {
-// if(!xPropImpPropMapper.is())
-// {
-// UniReference< XMLShapeImportHelper > aImpHelper = ((SvXMLImport&)GetImport()).GetShapeImport();
-// ((SdXMLStylesContext*)this)->xPropImpPropMapper =
-// new SvXMLImportPropertyMapper(aImpHelper->GetPropertySetMapper());
-// }
-// xMapper = xPropImpPropMapper;
-// return xMapper;
-// }
-
- if(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID == nFamily)
- {
- if(!xPresImpPropMapper.is())
- {
- UniReference< XMLShapeImportHelper > aImpHelper = ((SvXMLImport&)GetImport()).GetShapeImport();
- ((SdXMLStylesContext*)this)->xPresImpPropMapper =
- aImpHelper->GetPresPagePropsMapper();
- }
- xMapper = xPresImpPropMapper;
- return xMapper;
- }
-
- // call base class
- return SvXMLStylesContext::GetImportPropertyMapper(nFamily);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// Process all style and object info
-//
-void SdXMLStylesContext::EndElement()
-{
- if(mbIsAutoStyle)
- {
- // AutoStyles for text import
- GetImport().GetTextImport()->SetAutoStyles( this );
-
- // AutoStyles for chart
- GetImport().GetChartImport()->SetAutoStylesContext( this );
-
- // AutoStyles for forms
- GetImport().GetFormImport()->setAutoStyleContext( this );
-
- // associate AutoStyles with styles in preparation to setting Styles on shapes
- for(sal_uInt32 a(0L); a < GetStyleCount(); a++)
- {
- const SvXMLStyleContext* pStyle = GetStyle(a);
- if(pStyle && pStyle->ISA(XMLShapeStyleContext))
- {
- XMLShapeStyleContext* pDocStyle = (XMLShapeStyleContext*)pStyle;
-// pDocStyle->Filter();
-
- SvXMLStylesContext* pStylesContext = GetSdImport().GetShapeImport()->GetStylesContext();
- if( pStylesContext )
- {
- pStyle = pStylesContext->FindStyleChildContext(pStyle->GetFamily(), pStyle->GetParent());
-
- if(pStyle && pStyle->ISA(XMLShapeStyleContext))
- {
- XMLShapeStyleContext* pParentStyle = (XMLShapeStyleContext*)pStyle;
- if(pParentStyle->GetStyle().is())
- {
- pDocStyle->SetStyle(pParentStyle->GetStyle());
- }
- }
- }
- }
- }
-
- FinishStyles( false );
- }
- else
- {
- // Process styles list
- ImpSetGraphicStyles();
-
- // put style infos in the info set for other components ( content import f.e. )
- uno::Reference< beans::XPropertySet > xInfoSet( GetImport().getImportInfo() );
- if( xInfoSet.is() )
- {
- uno::Reference< beans::XPropertySetInfo > xInfoSetInfo( xInfoSet->getPropertySetInfo() );
-
- if( xInfoSetInfo->hasPropertyByName( OUString( RTL_CONSTASCII_USTRINGPARAM( "PageLayouts" ) ) ) )
- xInfoSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "PageLayouts" ) ), uno::makeAny( getPageLayouts() ) );
- }
-
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// set master-page styles (all with family="presentation" and a special
-// prefix) on given master-page.
-//
-void SdXMLStylesContext::SetMasterPageStyles(SdXMLMasterPageContext& rMaster) const
-{
- UniString sPrefix(rMaster.GetName(), (sal_uInt16)rMaster.GetName().getLength());
- sPrefix += sal_Unicode('-');
-
- if(GetSdImport().GetLocalDocStyleFamilies().is() && GetSdImport().GetLocalDocStyleFamilies()->hasByName(rMaster.GetName()))
- {
- uno::Any aAny(GetSdImport().GetLocalDocStyleFamilies()->getByName(rMaster.GetName()));
- uno::Reference< container::XNameAccess > xMasterPageStyles;
- aAny >>= xMasterPageStyles;
-
- if(xMasterPageStyles.is())
- {
- ImpSetGraphicStyles(xMasterPageStyles, XML_STYLE_FAMILY_SD_PRESENTATION_ID, sPrefix);
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// Process styles list:
-// set graphic styles (all with family="graphics"). Remember xStyle at list element.
-//
-void SdXMLStylesContext::ImpSetGraphicStyles() const
-{
- if(GetSdImport().GetLocalDocStyleFamilies().is())
- {
- const OUString sGraphicStyleName(OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)));
- uno::Any aAny(GetSdImport().GetLocalDocStyleFamilies()->getByName(sGraphicStyleName));
- uno::Reference< container::XNameAccess > xGraphicPageStyles;
- aAny >>= xGraphicPageStyles;
-
- if(xGraphicPageStyles.is())
- {
- UniString aPrefix;
- ImpSetGraphicStyles(xGraphicPageStyles, XML_STYLE_FAMILY_SD_GRAPHICS_ID, aPrefix);
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// help function used by ImpSetGraphicStyles() and ImpSetMasterPageStyles()
-//
-void SdXMLStylesContext::ImpSetGraphicStyles(
- uno::Reference< container::XNameAccess >& xPageStyles,
- sal_uInt16 nFamily,
- const UniString& rPrefix) const
-{
- xub_StrLen nPrefLen(rPrefix.Len());
- uno::Any aAny;
-
- sal_uInt32 a;
-
- // set defaults
- for( a = 0; a < GetStyleCount(); a++)
- {
- const SvXMLStyleContext* pStyle = GetStyle(a);
-
- if(nFamily == pStyle->GetFamily() && pStyle->IsDefaultStyle())
- {
- ((SvXMLStyleContext*)pStyle)->SetDefaults();
- }
- }
-
- // create all styles and set properties
- for( a = 0; a < GetStyleCount(); a++)
- {
- const SvXMLStyleContext* pStyle = GetStyle(a);
-
- if(nFamily == pStyle->GetFamily() && !pStyle->IsDefaultStyle())
- {
- const UniString aStyleName(pStyle->GetName(), (sal_uInt16)pStyle->GetName().getLength());
- sal_uInt16 nStylePrefLen = aStyleName.SearchBackward( sal_Unicode('-') ) + 1;
-
- if(!nPrefLen || ((nPrefLen == nStylePrefLen) && aStyleName.Equals(rPrefix, 0, nPrefLen)))
- {
- uno::Reference< style::XStyle > xStyle;
- const OUString aPureStyleName = nPrefLen ?
- pStyle->GetName().copy((sal_Int32)nPrefLen) : pStyle->GetName();
-
- if(xPageStyles->hasByName(aPureStyleName))
- {
- aAny = xPageStyles->getByName(aPureStyleName);
- aAny >>= xStyle;
-
- // set properties of existing styles to default
- uno::Reference< beans::XPropertySet > xPropSet( xStyle, uno::UNO_QUERY );
- uno::Reference< beans::XPropertySetInfo > xPropSetInfo;
- if( xPropSet.is() )
- xPropSetInfo = xPropSet->getPropertySetInfo();
-
- uno::Reference< beans::XPropertyState > xPropState( xStyle, uno::UNO_QUERY );
-
- if( xPropState.is() )
- {
- UniReference < XMLPropertySetMapper > xPrMap;
- UniReference < SvXMLImportPropertyMapper > xImpPrMap = GetImportPropertyMapper( nFamily );
- DBG_ASSERT( xImpPrMap.is(), "There is the import prop mapper" );
- if( xImpPrMap.is() )
- xPrMap = xImpPrMap->getPropertySetMapper();
- if( xPrMap.is() )
- {
- const sal_Int32 nCount = xPrMap->GetEntryCount();
- for( sal_Int32 i = 0; i < nCount; i++ )
- {
- const OUString& rName = xPrMap->GetEntryAPIName( i );
- if( xPropSetInfo->hasPropertyByName( rName ) && beans::PropertyState_DIRECT_VALUE == xPropState->getPropertyState( rName ) )
- {
- xPropState->setPropertyToDefault( rName );
- }
- }
- }
- }
- }
- else
- {
- // graphics style does not exist, create and add it
- uno::Reference< lang::XMultiServiceFactory > xServiceFact(GetSdImport().GetModel(), uno::UNO_QUERY);
- if(xServiceFact.is())
- {
- uno::Reference< style::XStyle > xNewStyle(
- xServiceFact->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.style.Style"))),
- uno::UNO_QUERY);
-
- if(xNewStyle.is())
- {
- // remember style
- xStyle = xNewStyle;
-
- // add new style to graphics style pool
- uno::Reference< container::XNameContainer > xInsertContainer(xPageStyles, uno::UNO_QUERY);
- if(xInsertContainer.is())
- {
- aAny <<= xStyle;
- xInsertContainer->insertByName(aPureStyleName, aAny);
- }
- }
- }
- }
-
- if(xStyle.is())
- {
- // set properties at style
- XMLShapeStyleContext* pPropStyle =
- (pStyle->ISA(XMLShapeStyleContext)) ? (XMLShapeStyleContext*)pStyle : 0L;
- uno::Reference< beans::XPropertySet > xPropSet(xStyle, uno::UNO_QUERY);
-
- if(xPropSet.is() && pPropStyle)
- {
- pPropStyle->FillPropertySet(xPropSet);
- pPropStyle->SetStyle(xStyle);
- }
- }
- }
- }
- }
-
- // now set parents for all styles (when necessary)
- for(a = 0L; a < GetStyleCount(); a++)
- {
- const SvXMLStyleContext* pStyle = GetStyle(a);
-
- if(pStyle && nFamily == pStyle->GetFamily())
- {
- const UniString aStyleName(pStyle->GetName(), (sal_uInt16)pStyle->GetName().getLength());
- sal_uInt16 nStylePrefLen = aStyleName.SearchBackward( sal_Unicode('-') ) + 1;
-
- if(pStyle->GetName().getLength() && (!nPrefLen || ((nPrefLen == nStylePrefLen) && aStyleName.Equals(rPrefix, 0, nPrefLen))))
- {
- try
- {
-
- uno::Reference< style::XStyle > xStyle;
- const OUString aPureStyleName = nPrefLen ? pStyle->GetName().copy((sal_Int32)nPrefLen) : pStyle->GetName();
- xPageStyles->getByName(aPureStyleName) >>= xStyle;
-
- if(xStyle.is())
- {
- // set parent style name
- xStyle->setParentStyle(pStyle->GetParent());
- }
- }
- catch( container::NoSuchElementException e )
- {
- }
- }
- }
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// helper function to create the uno component that hold the mappings from
-// xml auto layout name to internal autolayout id
-
-uno::Reference< container::XNameAccess > SdXMLStylesContext::getPageLayouts() const
-{
- uno::Reference< container::XNameContainer > xLayouts( comphelper::NameContainer_createInstance( ::getCppuType((const sal_Int32*)0)) );
-
- for(sal_uInt32 a(0L); a < GetStyleCount(); a++)
- {
- const SvXMLStyleContext* pStyle = GetStyle(a);
- if(pStyle && pStyle->ISA(SdXMLPresentationPageLayoutContext))
- {
- xLayouts->insertByName( pStyle->GetName(), uno::makeAny(
- (sal_Int32)((SdXMLPresentationPageLayoutContext*)pStyle)->GetTypeId() ) );
- }
- }
-
- return uno::Reference< container::XNameAccess >::query( xLayouts );
-}
-
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-TYPEINIT1( SdXMLMasterStylesContext, SvXMLImportContext );
-
-SdXMLMasterStylesContext::SdXMLMasterStylesContext(
- SdXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName)
-: SvXMLImportContext( rImport, nPrfx, rLName)
-{
-}
-
-SdXMLMasterStylesContext::~SdXMLMasterStylesContext()
-{
- while(maMasterPageList.Count())
- maMasterPageList.Remove(maMasterPageList.Count() - 1)->ReleaseRef();
-}
-
-SvXMLImportContext* SdXMLMasterStylesContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList)
-{
- SvXMLImportContext* pContext = 0;
-
- if(nPrefix == XML_NAMESPACE_STYLE
- && IsXMLToken( rLocalName, XML_MASTER_PAGE ) )
- {
- // style:masterpage inside office:styles context
- uno::Reference< drawing::XDrawPage > xNewMasterPage;
- uno::Reference< drawing::XDrawPages > xMasterPages(GetSdImport().GetLocalMasterPages(), uno::UNO_QUERY);
-
- if( xMasterPages.is() )
- {
- if(GetSdImport().GetNewMasterPageCount() + 1 > xMasterPages->getCount())
- {
- // new page, create and insert
- xNewMasterPage = xMasterPages->insertNewByIndex(xMasterPages->getCount());
- }
- else
- {
- // existing page, use it
- uno::Any aAny(xMasterPages->getByIndex(GetSdImport().GetNewMasterPageCount()));
- aAny >>= xNewMasterPage;
- }
-
- // increment global import page counter
- GetSdImport().IncrementNewMasterPageCount();
-
- if(xNewMasterPage.is())
- {
- uno::Reference< drawing::XShapes > xNewShapes(xNewMasterPage, uno::UNO_QUERY);
- if(xNewShapes.is() && GetSdImport().GetShapeImport()->GetStylesContext())
- {
- pContext = new SdXMLMasterPageContext(GetSdImport(),
- nPrefix, rLocalName, xAttrList, xNewShapes);
-
- if(pContext)
- {
- pContext->AddRef();
- maMasterPageList.Insert((SdXMLMasterPageContext*)pContext, LIST_APPEND);
- }
- }
- }
- }
- }
- else if(nPrefix == XML_NAMESPACE_STYLE
- && IsXMLToken( rLocalName, XML_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
- && IsXMLToken( rLocalName, XML_LAYER_SET ) )
- {
- pContext = new SdXMLLayerSetContext( GetImport(), nPrefix, rLocalName, xAttrList );
- }
-
- // call base class
- if(!pContext)
- pContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName, xAttrList);
-
- return pContext;
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/attriblistmerge.hxx b/binfilter/bf_xmloff/source/forms/attriblistmerge.hxx
deleted file mode 100644
index 372662109bd2..000000000000
--- a/binfilter/bf_xmloff/source/forms/attriblistmerge.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMS_ATTRIBLISTMERGE_HXX_
-#define _XMLOFF_FORMS_ATTRIBLISTMERGE_HXX_
-
-#include <comphelper/stl_types.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/xml/sax/XAttributeList.hpp>
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- //=====================================================================
- //= OAttribListMerger
- //=====================================================================
- typedef ::cppu::WeakImplHelper1 < ::com::sun::star::xml::sax::XAttributeList
- > OAttribListMerger_Base;
- /** implements the XAttributeList list by merging different source attribute lists
-
- <p>Currently, the time behavious is O(n), though it would be possible to change it to O(log n).</p>
- */
- class OAttribListMerger : public OAttribListMerger_Base
- {
- protected:
- ::osl::Mutex m_aMutex;
- DECLARE_STL_VECTOR( ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >, AttributeListArray );
- AttributeListArray m_aLists;
-
- ~OAttribListMerger() { }
-
- public:
- OAttribListMerger() { }
-
- // attribute list handling
- // (very thinn at the moment ... only adding lists is allowed ... add more if you need it :)
- void addList(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rList);
-
- // XAttributeList
- virtual sal_Int16 SAL_CALL getLength( ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getNameByIndex( sal_Int16 i ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTypeByIndex( sal_Int16 i ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getTypeByName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getValueByIndex( sal_Int16 i ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getValueByName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
-
- protected:
- sal_Bool seekToIndex(sal_Int16 _nGlobalIndex, ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rSubList, sal_Int16& _rLocalIndex);
- sal_Bool seekToName(const ::rtl::OUString& _rName, ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rSubList, sal_Int16& _rLocalIndex);
- };
-
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMS_ATTRIBLISTMERGE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/callbacks.hxx b/binfilter/bf_xmloff/source/forms/callbacks.hxx
deleted file mode 100644
index 18757f555cc9..000000000000
--- a/binfilter/bf_xmloff/source/forms/callbacks.hxx
+++ /dev/null
@@ -1,167 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMS_CALLBACKS_HXX_
-#define _XMLOFF_FORMS_CALLBACKS_HXX_
-
-#include <com/sun/star/container/XIndexAccess.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/script/ScriptEventDescriptor.hpp>
-#include <rtl/ref.hxx>
-namespace binfilter {
-
-class SvXMLImport;
-class SvXMLExport;
-class SvXMLExportPropertyMapper;
-class SvXMLStyleContext;
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- class OAttribute2Property;
-
- //=====================================================================
- //= IFormsExportContext
- //=====================================================================
- class IFormsExportContext
- {
- public:
- virtual SvXMLExport& getGlobalContext() = 0;
- virtual ::rtl::Reference< SvXMLExportPropertyMapper > getStylePropertyMapper() = 0;
-
- /** steps through a collection and exports all children of this collection
- */
- virtual void exportCollectionElements(
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& _rxCollection) = 0;
-
- virtual ::rtl::OUString getObjectStyleName(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject ) = 0;
- };
-
- //=====================================================================
- //= IControlIdMap
- //=====================================================================
- class IControlIdMap
- {
- public:
- /** register a control id
- */
- virtual void registerControlId(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControl,
- const ::rtl::OUString& _rId) = 0;
-
- /** register references to a control.
-
- <p>In the XML representation, the control which is refered by others stores the ids of these other
- controls, but in "real life" :) the referring controls store the referred one as property.</p>
-
- <p>This method allows a referred control to announce to ids of the referring ones.</p>
-
- @param _rxControl
- the referred control
- @param _rReferringControls
- a (comma separated) list of control ids of referring controls
- */
- virtual void registerControlReferences(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControl,
- const ::rtl::OUString& _rReferringControls) = 0;
- };
-
- //=====================================================================
- //= IFormsImportContext
- //=====================================================================
- class IFormsImportContext
- {
- public:
- virtual IControlIdMap& getControlIdMap() = 0;
- virtual OAttribute2Property& getAttributeMap() = 0;
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- getServiceFactory() = 0;
- virtual SvXMLImport& getGlobalContext() = 0;
-
- virtual const SvXMLStyleContext* getStyleElement(const ::rtl::OUString& _rStyleName) const = 0;
-
- virtual void enterEventContext() = 0;
- virtual void leaveEventContext() = 0;
-
- /** applies the given number style to the given object
- */
- virtual void applyControlNumberStyle(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel,
- const ::rtl::OUString& _rControlNumerStyleName
- ) = 0;
-
- /** registers a control model for later binding to a spreadsheet cell value
- */
- virtual void registerCellValueBinding(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel,
- const ::rtl::OUString& _rCellAddress
- ) = 0;
-
- /** registers a list-like control model for later binding to a spreadsheet cell range as list source
- */
- virtual void registerCellRangeListSource(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel,
- const ::rtl::OUString& _rCellRangeAddress
- ) = 0;
- };
-
- //=====================================================================
- //= IEventAttacherManager
- //=====================================================================
- class IEventAttacherManager
- {
- public:
- virtual void registerEvents(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxElement,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rEvents
- ) = 0;
- };
-
- //=====================================================================
- //= IEventAttacher
- //=====================================================================
- class IEventAttacher
- {
- public:
- virtual void registerEvents(
- const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rEvents
- ) = 0;
- };
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMS_CALLBACKS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/controlelement.hxx b/binfilter/bf_xmloff/source/forms/controlelement.hxx
deleted file mode 100644
index 6e85c264797c..000000000000
--- a/binfilter/bf_xmloff/source/forms/controlelement.hxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMS_CONTROLELEMENT_HXX_
-#define _XMLOFF_FORMS_CONTROLELEMENT_HXX_
-
-#include <sal/types.h>
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- //=====================================================================
- //= OControlElement
- //=====================================================================
- /** helper for translating between control types and XML tags
- */
- class OControlElement
- {
- public:
- enum ElementType
- {
- TEXT = 0,
- TEXT_AREA,
- PASSWORD,
- FILE,
- FORMATTED_TEXT,
- FIXED_TEXT,
- COMBOBOX,
- LISTBOX,
- BUTTON,
- IMAGE,
- CHECKBOX,
- RADIO,
- FRAME,
- IMAGE_FRAME,
- HIDDEN,
- GRID,
- GENERIC_CONTROL,
-
- UNKNOWN // must be the last element
- };
-
- protected:
- /** ctor.
- <p>This default constructor is protected, 'cause this class is not intended to be instantiated
- directly. Instead, the derived classes should be used.</p>
- */
- OControlElement() { }
-
- public:
- /** retrieves the tag name to be used to describe a control of the given type
-
- <p>The retuned string is the pure element name, without any namespace.</p>
-
- @param _eType
- the element type
- */
- static const sal_Char* getElementName(ElementType _eType);
- };
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMS_CONTROLELEMENT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/controlpropertyhdl.hxx b/binfilter/bf_xmloff/source/forms/controlpropertyhdl.hxx
deleted file mode 100644
index b5c49db47d89..000000000000
--- a/binfilter/bf_xmloff/source/forms/controlpropertyhdl.hxx
+++ /dev/null
@@ -1,100 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMS_CONTROLPROPERTYHDL_HXX_
-#define _XMLOFF_FORMS_CONTROLPROPERTYHDL_HXX_
-
-#include "prhdlfac.hxx"
-#include <rtl/ref.hxx>
-#include <rtl/ustring.hxx>
-#include "xmlexppr.hxx"
-#include "ControlBorderHandler.hxx"
-namespace binfilter {
-
-struct SvXMLEnumMapEntry;
-class XMLConstantsPropertyHandler;
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- class IFormsExportContext;
- class IFormsImportContext;
-
- //=====================================================================
- //= ORotationAngleHandler
- //=====================================================================
- class ORotationAngleHandler : public XMLPropertyHandler
- {
- public:
- ORotationAngleHandler();
-
- virtual sal_Bool importXML( const ::rtl::OUString& _rStrImpValue, ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& _rStrExpValue, const ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
- };
-
- //=====================================================================
- //= OFontWidthHandler
- //=====================================================================
- class OFontWidthHandler : public XMLPropertyHandler
- {
- public:
- OFontWidthHandler();
-
- virtual sal_Bool importXML( const ::rtl::OUString& _rStrImpValue, ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& _rStrExpValue, const ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
- };
-
- //=====================================================================
- //= OControlPropertyHandlerFactory
- //=====================================================================
- class OControlPropertyHandlerFactory : public XMLPropertyHandlerFactory
- {
- protected:
- mutable XMLConstantsPropertyHandler* m_pTextAlignHandler;
- mutable OControlBorderHandler* m_pControlBorderHandler;
- mutable ORotationAngleHandler* m_pRotationAngleHandler;
- mutable OFontWidthHandler* m_pFontWidthHandler;
- mutable XMLConstantsPropertyHandler* m_pFontEmphasisHandler;
- mutable XMLConstantsPropertyHandler* m_pFontReliefHandler;
-
- public:
- OControlPropertyHandlerFactory();
- virtual ~OControlPropertyHandlerFactory();
-
- virtual const XMLPropertyHandler* GetPropertyHandler(sal_Int32 _nType) const;
- };
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMS_CONTROLPROPERTYHDL_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/controlpropertymap.hxx b/binfilter/bf_xmloff/source/forms/controlpropertymap.hxx
deleted file mode 100644
index 4cb2dce369db..000000000000
--- a/binfilter/bf_xmloff/source/forms/controlpropertymap.hxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMS_CONTROLPROPERTYMAP_HXX_
-#define _XMLOFF_FORMS_CONTROLPROPERTYMAP_HXX_
-
-#include "xmlprmap.hxx"
-#include "xmlexppr.hxx"
-namespace binfilter {
-
-struct XMLPropertyMapEntry;
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- const XMLPropertyMapEntry* getControlStylePropertyMap( );
-
- void initializePropertyMaps();
-
- //=====================================================================
- //= OFormExportPropertyMapper
- //=====================================================================
- class OFormExportPropertyMapper : public SvXMLExportPropertyMapper
- {
- public:
- OFormExportPropertyMapper( const UniReference< XMLPropertySetMapper >& _rMapper );
-
- void handleSpecialItem(
- SvXMLAttributeList& _rAttrList,
- const XMLPropertyState& _rProperty,
- const SvXMLUnitConverter& _rUnitConverter,
- const SvXMLNamespaceMap& _rNamespaceMap,
- const ::std::vector< XMLPropertyState >* _pProperties,
- sal_uInt32 _nIdx
- ) const;
- };
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMS_CONTROLPROPERTYMAP_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/elementexport.hxx b/binfilter/bf_xmloff/source/forms/elementexport.hxx
deleted file mode 100644
index 44cbc2ad1b39..000000000000
--- a/binfilter/bf_xmloff/source/forms/elementexport.hxx
+++ /dev/null
@@ -1,290 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_ELEMENTEXPORT_HXX_
-#define _XMLOFF_ELEMENTEXPORT_HXX_
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/container/XIndexAccess.hpp>
-#include <com/sun/star/script/ScriptEventDescriptor.hpp>
-#include "propertyexport.hxx"
-#include "callbacks.hxx"
-#include "controlelement.hxx"
-#include "valueproperties.hxx"
-namespace binfilter {
-
-class SvXMLElementExport;
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- //=====================================================================
- //= OElementExport
- //=====================================================================
- class OElementExport : public OPropertyExport
- {
- protected:
- ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >
- m_aEvents;
-
- SvXMLElementExport* m_pXMLElement; // XML element doing the concrete startElement etc.
-
- public:
- OElementExport(IFormsExportContext& _rContext,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxProps,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rEvents);
- ~OElementExport();
-
- void doExport();
-
- protected:
- /// get the name of the XML element
- virtual const sal_Char* getXMLElementName() const = 0;
- /// examine the element we're exporting
- virtual void examine();
- /// export the attributes
- virtual void exportAttributes();
- /// export any sub tags
- virtual void exportSubTags();
-
- /** exports the events (as script:events tag)
- */
- void exportEvents();
-
- /** add the service-name attribute to the export context
- */
- virtual void exportServiceNameAttribute();
-
- /// start the XML element
- virtual void implStartElement(const sal_Char* _pName);
-
- /// ends the XML element
- virtual void implEndElement();
- };
-
- //=====================================================================
- //= OControlExport
- //=====================================================================
- /** Helper class for handling xml elements representing a form control
- */
- class OControlExport
- :public OControlElement
- ,public OValuePropertiesMetaData
- ,public OElementExport
- {
- protected:
- DECLARE_STL_STDKEY_SET(sal_Int16, Int16Set);
- // used below
-
- ::rtl::OUString m_sControlId; // the control id to use when exporting
- ::rtl::OUString m_sReferringControls; // list of referring controls (i.e. their id's)
- sal_Int16 m_nClassId; // class id of the control we're representing
- ElementType m_eType; // (XML) type of the control we're representing
- sal_Int32 m_nIncludeCommon; // common control attributes to include
- sal_Int32 m_nIncludeDatabase; // common database attributes to include
- sal_Int32 m_nIncludeSpecial; // special attributes to include
- sal_Int32 m_nIncludeEvents; // events to include
- sal_Int32 m_nIncludeBindings; // binding attributes to include
-
- SvXMLElementExport* m_pOuterElement; // XML element doing the concrete startElement etc. for the outer element
-
- public:
- /** constructs an object capable of exporting controls
-
- <p>You need at least two pre-requisites from outside: The control to be exported needs to have a class id
- assigned, and you need the list control-ids of all the controls referring to this one as LabelControl.<br/>
- This information can't be collected when known only the control itself and not it's complete context.</p>
-
- @param _rControlId
- the control id to use when exporting the control
- @param _rReferringControls
- the comma-separated list of control-ids of all the controls referring to this one as LabelControl
- */
- OControlExport(IFormsExportContext& _rContext,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControl,
- const ::rtl::OUString& _rControlId,
- const ::rtl::OUString& _rReferringControls,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rxEvents);
- ~OControlExport();
-
- protected:
- /// start the XML element
- virtual void implStartElement(const sal_Char* _pName);
-
- /// ends the XML element
- virtual void implEndElement();
-
- /// get the name of the outer XML element
- virtual const sal_Char* getOuterXMLElementName() const;
-
- // get the name of the XML element
- virtual const sal_Char* getXMLElementName() const;
-
- /** examine the control. Some kind of CtorImpl.
- */
- virtual void examine();
-
- /// exports the attributes for the outer element
- void exportOuterAttributes();
-
- /// exports the attributes for the inner element
- void exportInnerAttributes();
-
- /// export the attributes
- virtual void exportAttributes();
-
- /** writes everything which needs to be represented as sub tag
- */
- void exportSubTags() throw (::com::sun::star::uno::Exception);
-
- /** adds common control attributes to the XMLExport context given
-
- <p>The attribute list of the context is not cleared initially, this is the responsibility of the caller.</p>
- */
- void exportCommonControlAttributes();
-
- /** adds database attributes to the XMLExport context given
-
- <p>The attribute list of the context is not cleared initially, this is the responsibility of the caller.</p>
- */
- void exportDatabaseAttributes();
-
- /** adds the XML attributes which are related to binding controls to
- external values and/or list sources
- */
- void exportBindingAtributes();
-
- /** adds attributes which are special to a control type to the export context's attribute list
- */
- void exportSpecialAttributes();
-
- /** exports the ListSource property of a control as attribute
-
- <p>The ListSource property may be exported in different ways: For a ComboBox, it is an attribute
- of the form:combobox element.</p>
-
- <p>For a ListBox, it's an attribute if the ListSourceType states that the ListBox does <em>not</em>
- display a value list. In case of a value list, the ListSource is not exported, and the pairs of
- StringItem/ValueItem are exported as sub-elements.<br/>
- (For a value list ListBox, As every setting of the ListSource immediately sets the ValueList to the
- same value, so nothing is lost when exporting this).</p>
-
- <p>It's really strange, isn't it? Don't know why we have this behaviour in our controls ...</p>
-
- <p>This method does the attribute part: It exports the ListSource property as attribute, not caring
- about whether the object is a ComboBox or a ListBox.</p>
- */
- void exportListSourceAsAttribute();
-
- /** exports the ListSource property of a control as XML elements
-
- @see exportListSourceAsAttribute
- */
- void exportListSourceAsElements();
-
- /** get's a Sequence&lt; sal_Int16 &gt; property value as set of sal_Int16's
- @param _rPropertyName
- the property name to use
- @param _rOut
- out parameter. The set of integers.
- */
- void getSequenceInt16PropertyAsSet(const ::rtl::OUString& _rPropertyName, Int16Set& _rOut);
-
- /** exports the attribute which descrives a cell value binding of a control
- in a spreadsheet document
- */
- void exportCellBindingAttributes( bool _bIncludeListLinkageType );
-
- /** exports the attribute which descrives a cell range which acts as list source for
- a list-like control
- */
- void exportCellListSourceRange( );
- };
-
- //=====================================================================
- //= OColumnExport
- //=====================================================================
- /** Helper class for exporting a grid column
- */
- class OColumnExport : public OControlExport
- {
- public:
- /** ctor
- @see OColumnExport::OColumnExport
- */
- OColumnExport(IFormsExportContext& _rContext,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControl,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rxEvents);
-
- ~OColumnExport();
-
- protected:
- // OControlExport overridables
- virtual const sal_Char* getOuterXMLElementName() const;
- virtual void exportServiceNameAttribute();
- virtual void exportAttributes();
-
- // OElementExport overridables
- virtual void examine();
- };
-
- //=====================================================================
- //= OFormExport
- //=====================================================================
- /** Helper class for handling xml elements representing a form
-
- <p>In opposite to the class <type>OControlExport</type>, OFormExport is unable to export a <em>complete</em>
- form. Instead the client has to care for sub elements of the form itself.</p>
- */
- class OFormExport
- :public OControlElement
- ,public OElementExport
- {
- public:
- /** constructs an object capable of exporting controls
- */
- OFormExport(IFormsExportContext& _rContext,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxForm,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rxEvents
- );
-
- protected:
- virtual const sal_Char* getXMLElementName() const;
- virtual void exportSubTags();
- virtual void exportAttributes();
- };
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_ELEMENTEXPORT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/elementimport.hxx b/binfilter/bf_xmloff/source/forms/elementimport.hxx
deleted file mode 100644
index 5ea7244b38ce..000000000000
--- a/binfilter/bf_xmloff/source/forms/elementimport.hxx
+++ /dev/null
@@ -1,659 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMS_ELEMENTIMPORT_HXX_
-#define _XMLOFF_FORMS_ELEMENTIMPORT_HXX_
-
-#include "propertyimport.hxx"
-#include "controlelement.hxx"
-#include "valueproperties.hxx"
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/form/XGridColumnFactory.hpp>
-#include <com/sun/star/script/XEventAttacherManager.hpp>
-#include <comphelper/stl_types.hxx>
-#include "eventimport.hxx"
-#include "logging.hxx"
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- class IControlIdMap;
- class IFormsImportContext;
- class OControlStyleContext;
-
- //=====================================================================
- //= OElementNameMap
- //=====================================================================
- const OControlElement::ElementType& operator ++(OControlElement::ElementType& _e);
-
- /** helper class which allows fast translation of xml tag names into element types.
- */
- class OElementNameMap : public OControlElement
- {
- protected:
- DECLARE_STL_USTRINGACCESS_MAP( ElementType, MapString2Element );
- static MapString2Element s_sElementTranslations;
-
- protected:
- OElementNameMap() { }
-
- public:
- static ElementType getElementType(const ::rtl::OUString& _rName);
- };
-
- //=====================================================================
- //= OElementImport
- //=====================================================================
- /** implements common behaviour for importing forms, controls and columns
- */
- class OElementImport
- :public OPropertyImport
- ,public OAttributeMetaData
- ,public IEventAttacher
- ,public OStackedLogging
- {
- protected:
- ::rtl::OUString m_sServiceName; // the service name as extracted from the service-name attribute
- ::rtl::OUString m_sName; // the name of the object (redundant, already contained in the base class' array)
- IFormsImportContext& m_rFormImport; // the form import context
- IEventAttacherManager& m_rEventManager; // the event attacher manager
-
- const OControlStyleContext* m_pStyleElement; // the XML element which describes the style we encountered
- // while reading our element
-
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
- m_xParentContainer;
- // the parent container to insert the new element into
-
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
- m_xElement; // the element we're creating. Valid after StartElement
-
- public:
- /** ctor
- @param _rImport
- the importer
- @param _rEventManager
- the event attacher manager for the control beeing imported
- @param _nPrefix
- the namespace prefix
- @param _rName
- the element name
- @param _rAttributeMap
- the attribute map to be used for translating attributes into properties
- @param _rxParentContainer
- the container in which the new element should be inserted
- */
- OElementImport(
- IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager,
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer
- );
-
- protected:
- // SvXMLImportContext overridables
- virtual void StartElement(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
- virtual void EndElement();
-
- // OPropertyImport overridables
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
- const ::rtl::OUString& _rLocalName,
- const ::rtl::OUString& _rValue);
-
- // IEventAttacher
- virtual void registerEvents(
- const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rEvents
- );
-
- /** create the (uninitialized) element which is to represent the read data
-
- <p>The default implementation uses <member>m_xORB</member> to create a object with <member>m_sServiceName</member>.
- */
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
- createElement();
-
- protected:
- /** can be used to handle properties where the attribute default and the property default differ.
- <p>In such case, if the property had the attribute default upon writing, nothing is read, so upon reading,
- the property is still at it's own default (which is not the attribute default).<p/>
- <p>This method, if told the attribute and the property, and the (implied) attribute default, sets the
- property value as if the attribute was encountered.</p>
- @see encounteredAttribute
- */
- void simulateDefaultedAttribute(const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName, const sal_Char* _pAttributeDefault);
-
- private:
- ::rtl::OUString implGetDefaultName() const;
-
- /** sets the style properties which have been read for the element (if any)
- */
- void implSetStyleProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject );
- };
-
- //=====================================================================
- //= OControlImport
- //=====================================================================
- /** helper class for importing the description of a single control
- */
- class OControlImport
- :public OElementImport
- ,public OValuePropertiesMetaData
- {
- protected:
- ::rtl::OUString m_sControlId;
- OControlElement::ElementType m_eElementType;
-
- PropertyValueArray m_aValueProperties;
- // the value properties (value, current-value, min-value, max-value) require some special
- // handling
-
- // we fake the attributes our base class gets: we add the attributes of the outer wrapper
- // element which encloses us
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >
- m_xOuterAttributes;
-
- /** the address of the calc cell which the control model should be bound to,
- if applicable
- */
- ::rtl::OUString m_sBoundCellAddress;
-
- protected:
- // for use by derived classes only
- OControlImport(
- IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager,
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer
- );
-
- public:
- OControlImport(
- IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager,
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
- OControlElement::ElementType _eType
- );
-
- // SvXMLImportContext overridables
- virtual void StartElement(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
- virtual void EndElement();
-
- // OPropertyImport overridables
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
- const ::rtl::OUString& _rLocalName,
- const ::rtl::OUString& _rValue);
-
- void addOuterAttributes(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxOuterAttribs);
-
- protected:
- void setElementType(OControlElement::ElementType _eType) { m_eElementType = _eType; }
-
- protected:
- void implTranslateValueProperty(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >& _rxPropInfo,
- ::com::sun::star::beans::PropertyValue& /* [in/out] */ _rPropValue);
-
- /** registers the given cell address as value binding address for our element
-
- <p>The default implementation simply calls registerCellValueBinding at our import
- context, but you may want to override this behaviour.</p>
-
- @param _rBoundCellAddress
- the cell address to register for our element. Must not be <NULL/>.
- @precond
- we have a valid element (m_xElement)
- */
- virtual void doRegisterCellValueBinding( const ::rtl::OUString& _rBoundCellAddress );
-
- protected:
- //added by BerryJia for fixing bug102407 2002-11-5
- // OElementImport overridables
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
- createElement();
-
- };
-
- //=====================================================================
- //= OControlWrapperImport
- //=====================================================================
- /** helper class importing a &lt;form:column&gt; or &lt;form:control&gt; element.
- */
- class OControlWrapperImport : public SvXMLImportContext
- {
- protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >
- m_xOwnAttributes;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
- m_xParentContainer;
- IFormsImportContext& m_rFormImport;
- IEventAttacherManager& m_rEventManager;
-
- public:
- OControlWrapperImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer);
-
- // SvXMLImportContext overridables
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
- virtual void StartElement(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
-
- protected:
- virtual OControlImport* implCreateChildContext(
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- OControlElement::ElementType _eType);
- };
-
- //=====================================================================
- //= OReferredControlImport
- //=====================================================================
- class OReferredControlImport : public OControlImport
- {
- protected:
- ::rtl::OUString m_sReferringControls; // the list of ids of controls referring to the one beeing imported
-
- public:
- OReferredControlImport(
- IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
- OControlElement::ElementType _eType
- );
-
- // SvXMLImportContext overridables
- virtual void StartElement(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
-
- // OPropertyImport overridables
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
- const ::rtl::OUString& _rLocalName,
- const ::rtl::OUString& _rValue);
- };
-
- //=====================================================================
- //= OPasswordImport
- //=====================================================================
- class OPasswordImport : public OControlImport
- {
- public:
- OPasswordImport(
- IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
- OControlElement::ElementType _eType
- );
-
- // OPropertyImport overridables
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
- const ::rtl::OUString& _rLocalName,
- const ::rtl::OUString& _rValue);
- };
-
- //=====================================================================
- //= ORadioImport
- //=====================================================================
- class ORadioImport : public OControlImport
- {
- public:
- ORadioImport(
- IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
- OControlElement::ElementType _eType
- );
-
- protected:
- // OPropertyImport overridables
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
- const ::rtl::OUString& _rLocalName,
- const ::rtl::OUString& _rValue);
- };
-
- //=====================================================================
- //= OURLReferenceImport
- //=====================================================================
- /** a specialized version of the <type>OControlImport</type> class, which is able
- to handle attributes which denote URLs (and stored relative)
- */
- class OURLReferenceImport : public OControlImport
- {
- public:
- OURLReferenceImport(
- IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
- OControlElement::ElementType _eType
- );
-
- protected:
- // OPropertyImport overridables
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
- const ::rtl::OUString& _rLocalName,
- const ::rtl::OUString& _rValue);
- };
-
- //=====================================================================
- //= OButtonImport
- //=====================================================================
- /** A specialized version of the <type>OControlImport</type> class, which handles
- the target frame for image and command buttons
- */
- class OButtonImport : public OURLReferenceImport
- {
- public:
- OButtonImport(
- IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
- OControlElement::ElementType _eType
- );
-
- protected:
- // SvXMLImportContext overridables
- virtual void StartElement(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
- };
-
- //=====================================================================
- //= OTextLikeImport
- //=====================================================================
- /** A specialized version of the <type>OControlImport</type> class, which handles
- text like controls which have the convert-empty-to-null attribute</p>
- */
- class OTextLikeImport : public OControlImport
- {
- public:
- OTextLikeImport(
- IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
- OControlElement::ElementType _eType
- );
-
- // SvXMLImportContext overridables
- virtual void StartElement(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
- };
-
- //=====================================================================
- //= OListAndComboImport
- //=====================================================================
- /** A specialized version of the <type>OControlImport</type> class, which handles
- attributes / sub elements which are special to list and combo boxes
- */
- class OListAndComboImport : public OControlImport
- {
- friend class OListOptionImport;
- friend class OComboItemImport;
-
- protected:
- ::com::sun::star::uno::Sequence< ::rtl::OUString >
- m_aListSource;
- ::com::sun::star::uno::Sequence< ::rtl::OUString >
- m_aValueList;
-
- ::com::sun::star::uno::Sequence< sal_Int16 >
- m_aSelectedSeq;
- ::com::sun::star::uno::Sequence< sal_Int16 >
- m_aDefaultSelectedSeq;
-
- ::rtl::OUString m_sCellListSource; /// the cell range which acts as list source for the control
-
- sal_Int32 m_nEmptyListItems; /// number of empty list items encountered during reading
- sal_Int32 m_nEmptyValueItems; /// number of empty value items encountered during reading
-
- sal_Bool m_bEncounteredLSAttrib;
- sal_Bool m_bLinkWithIndexes; /** <TRUE/> if and only if we should use a cell value binding
- which exchanges the selection index (instead of the selection text
- */
-
- public:
- OListAndComboImport(
- IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
- OControlElement::ElementType _eType
- );
-
- // SvXMLImportContext overridables
- virtual void StartElement(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
- virtual void EndElement();
-
- // OPropertyImport overridables
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
- const ::rtl::OUString& _rLocalName,
- const ::rtl::OUString& _rValue);
-
- // OControlImport ovrridables
- virtual void doRegisterCellValueBinding( const ::rtl::OUString& _rBoundCellAddress );
-
- protected:
- void implPushBackLabel(const ::rtl::OUString& _rLabel);
- void implPushBackValue(const ::rtl::OUString& _rValue);
-
- void implEmptyLabelFound();
- void implEmptyValueFound();
-
- void implSelectCurrentItem();
- void implDefaultSelectCurrentItem();
- };
- SV_DECL_IMPL_REF(OListAndComboImport);
-
- //=====================================================================
- //= OListOptionImport
- //=====================================================================
- /** helper class for importing a single &lt;form:option&gt; element.
- */
- class OListOptionImport
- :public SvXMLImportContext
- ,public OAttributeMetaData
- {
- OListAndComboImportRef m_xListBoxImport;
-
- public:
- OListOptionImport(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const OListAndComboImportRef& _rListBox);
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
- };
-
- //=====================================================================
- //= OComboItemImport
- //=====================================================================
- /** helper class for importing a single &lt;form:item&gt; element.
- */
- class OComboItemImport
- :public SvXMLImportContext
- ,public OAttributeMetaData
- {
- OListAndComboImportRef m_xListBoxImport;
-
- public:
- OComboItemImport(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const OListAndComboImportRef& _rListBox);
-
- protected:
- // SvXMLImportContext overridables
- virtual void StartElement(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
- };
-
- //=====================================================================
- //= OContainerImport
- //=====================================================================
- // BASE must be a derivee of OElementImport
- template <class BASE>
- class OContainerImport
- :public BASE
- ,public ODefaultEventAttacherManager
- {
- protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
- m_xMeAsContainer;
- ::rtl::OUString m_sWrapperElementName;
-
- protected:
- OContainerImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
- const sal_Char* _pWrapperElementName)
- :BASE(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer)
- ,m_sWrapperElementName(::rtl::OUString::createFromAscii(_pWrapperElementName))
- {
- }
-
- // SvXMLImportContext overridables
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
- virtual void EndElement();
-
- protected:
- // OElementImport overridables
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
- createElement();
-
- // create the child context for the given control type
- virtual SvXMLImportContext* implCreateControlWrapper(
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName) = 0;
- };
-
- //=====================================================================
- //= OColumnImport
- //=====================================================================
- /** helper class importing a single grid column (without the &lt;form:column&gt; element wrapping
- the column).
-
- <p>BASE (the template argument) must be a derivee of OControlImport</p>
- */
- template <class BASE>
- class OColumnImport : public BASE
- {
- protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::form::XGridColumnFactory >
- m_xColumnFactory;
-
- public:
- OColumnImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
- OControlElement::ElementType _eType,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxOuterAttribs);
-
- protected:
- // OElementImport overridables
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
- createElement();
- };
-
- //=====================================================================
- //= OColumnWrapperImport
- //=====================================================================
- class OColumnWrapperImport : public OControlWrapperImport
- {
- public:
- OColumnWrapperImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer);
- protected:
- virtual OControlImport* implCreateChildContext(
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- OControlElement::ElementType _eType);
- };
-
- //=====================================================================
- //= OGridImport
- //=====================================================================
- typedef OContainerImport< OControlImport > OGridImport_Base;
- /** helper class importing a single &lt;form:grid&gt; element
- */
- class OGridImport : public OGridImport_Base
- {
- public:
- OGridImport(
- IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
- OControlElement::ElementType _eType);
-
- protected:
- // OContainerImport overridables
- virtual SvXMLImportContext* implCreateControlWrapper(
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName);
- };
-
- //=====================================================================
- //= OFormImport
- //=====================================================================
- typedef OContainerImport< OElementImport > OFormImport_Base;
- /** helper class importing a single &lt;form:form&gt; element
- */
- class OFormImport : public OFormImport_Base
- {
- public:
- OFormImport(
- IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer
- );
-
- protected:
- // SvXMLImportContext overridables
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
- virtual void StartElement(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
- virtual void EndElement();
-
- // OContainerImport overridables
- virtual SvXMLImportContext* implCreateControlWrapper(
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName);
-
- // OPropertyImport overridables
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
- const ::rtl::OUString& _rLocalName,
- const ::rtl::OUString& _rValue);
-
-
- void implTranslateStringListProperty(const ::rtl::OUString& _rPropertyName, const ::rtl::OUString& _rValue);
- };
-
-#define _INCLUDING_FROM_ELEMENTIMPORT_HXX_
-#include "elementimport_impl.hxx"
-#undef _INCLUDING_FROM_ELEMENTIMPORT_HXX_
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMS_ELEMENTIMPORT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/elementimport_impl.hxx b/binfilter/bf_xmloff/source/forms/elementimport_impl.hxx
deleted file mode 100644
index 1975bd61cdb6..000000000000
--- a/binfilter/bf_xmloff/source/forms/elementimport_impl.hxx
+++ /dev/null
@@ -1,124 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// no include protection. This file is included from elementimport.hxx only.
-
-#ifndef _INCLUDING_FROM_ELEMENTIMPORT_HXX_
-#error "do not include this file directly!"
-#endif
-
-// no namespace. Same as above: this file is included from elementimport.hxx only,
-// and this is done inside the namespace
-
-//=========================================================================
-//= OContainerImport
-//=========================================================================
-//-------------------------------------------------------------------------
-template <class BASE>
-SvXMLImportContext* OContainerImport< BASE >::CreateChildContext(
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList)
-{
- // maybe it's a sub control
- if (_rLocalName == m_sWrapperElementName)
- if (m_xMeAsContainer.is())
- return implCreateControlWrapper(_nPrefix, _rLocalName);
- else
- {
- OSL_ENSURE(sal_False, "OContainerImport::CreateChildContext: don't have an element!");
- return NULL;
- }
-
- return BASE::CreateChildContext(_nPrefix, _rLocalName, _rxAttrList);
-}
-
-//-------------------------------------------------------------------------
-template <class BASE>
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
- OContainerImport< BASE >::createElement()
-{
- // let the base class create the object
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xReturn = BASE::createElement();
- if (!xReturn.is())
- return xReturn;
-
- // ensure that the object is a XNameContainer (we strongly need this for inserting child elements)
- m_xMeAsContainer = ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >(xReturn, ::com::sun::star::uno::UNO_QUERY);
- if (!m_xMeAsContainer.is())
- {
- OSL_ENSURE(sal_False, "OContainerImport::createElement: invalid element (no XNameContainer) created!");
- xReturn.clear();
- }
-
- return xReturn;
-}
-
-//-------------------------------------------------------------------------
-template <class BASE>
-void OContainerImport< BASE >::EndElement()
-{
- BASE::EndElement();
-
- // now that we have all children, attach the events
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > xIndexContainer(m_xMeAsContainer, ::com::sun::star::uno::UNO_QUERY);
- if (xIndexContainer.is())
- ODefaultEventAttacherManager::setEvents(xIndexContainer);
-}
-
-//=========================================================================
-//= OColumnImport
-//=========================================================================
-//-------------------------------------------------------------------------
-template <class BASE>
-OColumnImport< BASE >::OColumnImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
- OControlElement::ElementType _eType,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxOuterAttribs)
- :BASE(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer, _eType)
- ,m_xColumnFactory(_rxParentContainer, ::com::sun::star::uno::UNO_QUERY)
-{
- OSL_ENSURE(m_xColumnFactory.is(), "OColumnImport::OColumnImport: invalid parent container (no factory)!");
-}
-
-//-------------------------------------------------------------------------
-// OElementImport overridables
-template <class BASE>
-::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > OColumnImport< BASE >::createElement()
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xReturn;
- // no call to the base class' method. We have to use the grid column factory
- if (m_xColumnFactory.is())
- {
- // create the column
- xReturn = m_xColumnFactory->createColumn(this->m_sServiceName);
- OSL_ENSURE(xReturn.is(), "OColumnImport::createElement: the factory returned an invalid object!");
- }
- return xReturn;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/eventexport.hxx b/binfilter/bf_xmloff/source/forms/eventexport.hxx
deleted file mode 100644
index bfc39e7c98b7..000000000000
--- a/binfilter/bf_xmloff/source/forms/eventexport.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMS_EVENTEXPORT_HXX_
-#define _XMLOFF_FORMS_EVENTEXPORT_HXX_
-
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/script/ScriptEventDescriptor.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <comphelper/stl_types.hxx>
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- //=====================================================================
- //= OEventDescriptorMapper
- //=====================================================================
- typedef ::cppu::WeakImplHelper1 < ::com::sun::star::container::XNameReplace
- > OEventDescriptorMapper_Base;
- /** helper class wrapping different script event representations
-
- <p>In the form layer, the script events are represented by <type scope="com.sun.star.script">ScriptEventDescriptor</type>
- instances. The office applications, on the other hand, represent their a single script event as sequence
- of <type scope="com.sun.star.beans">PropertyValue</type>s, where all events of a given object are
- accessible through a <type scope="com.sun.star.container">XNameReplace</type> interface.</p>
- <p>This class maps the first representation of events of a single object to the second one.</p>
- <p>This way, we can use the helper classes here in the project.</p>
- */
- class OEventDescriptorMapper : public OEventDescriptorMapper_Base
- {
- protected:
- DECLARE_STL_USTRINGACCESS_MAP( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >, MapString2PropertyValueSequence );
- MapString2PropertyValueSequence m_aMappedEvents;
-
- public:
- OEventDescriptorMapper(
- const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rEvents);
-
- // XNameReplace
- virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- // XNameAccess
- virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
-
- // XElementAccess
- virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
- };
-
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMS_EVENTEXPORT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/eventimport.hxx b/binfilter/bf_xmloff/source/forms/eventimport.hxx
deleted file mode 100644
index 116640472365..000000000000
--- a/binfilter/bf_xmloff/source/forms/eventimport.hxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMS_EVENTIMPORT_HXX_
-#define _XMLOFF_FORMS_EVENTIMPORT_HXX_
-
-#include "XMLEventsImportContext.hxx"
-#include "callbacks.hxx"
-#include "ifacecompare.hxx"
-#include <com/sun/star/container/XIndexAccess.hpp>
-namespace binfilter {
-
-class SvXMLImport;
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- //=====================================================================
- //= OFormEventsImportContext
- //=====================================================================
- class OFormEventsImportContext : public XMLEventsImportContext
- {
- protected:
- IEventAttacher& m_rEventAttacher;
-
- public:
- OFormEventsImportContext(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- IEventAttacher& _rEventAttacher);
-
- protected:
- virtual void EndElement();
- };
-
- //=====================================================================
- //= ODefaultEventAttacherManager
- //=====================================================================
- class ODefaultEventAttacherManager : public IEventAttacherManager
- {
- protected:
- DECLARE_STL_MAP(
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >, // map from
- ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >, // map to
- OPropertySetCompare, // compare method
- MapPropertySet2ScriptSequence); // class name
- // usually an event attacher manager will need to collect all script events registered, 'cause
- // the _real_ XEventAttacherManager handles it's events by index, but out indicies are not fixed
- // until _all_ controls have been inserted.
-
- MapPropertySet2ScriptSequence m_aEvents;
-
- public:
- // IEventAttacherManager
- virtual void registerEvents(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxElement,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rEvents
- );
-
- protected:
- void setEvents(
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& _rxContainer
- );
- };
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMS_EVENTIMPORT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/formattributes.hxx b/binfilter/bf_xmloff/source/forms/formattributes.hxx
deleted file mode 100644
index 1cde1f1a3a7b..000000000000
--- a/binfilter/bf_xmloff/source/forms/formattributes.hxx
+++ /dev/null
@@ -1,345 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMATTRIBUTES_HXX_
-#define _XMLOFF_FORMATTRIBUTES_HXX_
-
-#include <sal/types.h>
-#include <comphelper/stl_types.hxx>
-namespace binfilter {
-
-class SvXMLExport;
-struct SvXMLEnumMapEntry;
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- // flags for common control attributes
- #define CCA_NAME 0x00000001
- #define CCA_SERVICE_NAME 0x00000002
- #define CCA_BUTTON_TYPE 0x00000004
- #define CCA_CONTROL_ID 0x00000008
- #define CCA_CURRENT_SELECTED 0x00000010
- #define CCA_CURRENT_VALUE 0x00000020
- #define CCA_DISABLED 0x00000040
- #define CCA_DROPDOWN 0x00000080
- #define CCA_FOR 0x00000100
- #define CCA_IMAGE_DATA 0x00000200
- #define CCA_LABEL 0x00000400
- #define CCA_MAX_LENGTH 0x00000800
- #define CCA_PRINTABLE 0x00001000
- #define CCA_READONLY 0x00002000
- #define CCA_SELECTED 0x00004000
- #define CCA_SIZE 0x00008000
- #define CCA_TAB_INDEX 0x00010000
- #define CCA_TARGET_FRAME 0x00020000
- #define CCA_TARGET_LOCATION 0x00040000
- #define CCA_TAB_STOP 0x00080000
- #define CCA_TITLE 0x00100000
- #define CCA_VALUE 0x00200000
-
- // flags for database control atttributes
- #define DA_BOUND_COLUMN 0x00000001
- #define DA_CONVERT_EMPTY 0x00000002
- #define DA_DATA_FIELD 0x00000004
- #define DA_LIST_SOURCE 0x00000008
- #define DA_LIST_SOURCE_TYPE 0x00000010
-
- // flags for binding related control attributes
- #define BA_LINKED_CELL 0x00000001
- #define BA_LIST_LINKING_TYPE 0x00000002
- #define BA_LIST_CELL_RANGE 0x00000004
-
- // flags for event attributes
- #define EA_CONTROL_EVENTS 0x00000001
- #define EA_ON_CHANGE 0x00000002
- #define EA_ON_CLICK 0x00000004
- #define EA_ON_DBLCLICK 0x00000008
- #define EA_ON_SELECT 0x00000010
-
- /// attributes in the xml tag representing a form
- enum FormAttributes
- {
- faName,
- faServiceName,
- faAction,
- faEnctype,
- faMethod,
- faTargetFrame,
- faAllowDeletes,
- faAllowInserts,
- faAllowUpdates,
- faApplyFilter,
- faCommand,
- faCommandType,
- faEscapeProcessing,
- faDatasource,
- faDetailFiels,
- faFilter,
- faIgnoreResult,
- faMasterFields,
- faNavigationMode,
- faOrder,
- faTabbingCycle
- };
-
- // any other attributes, which are special to some control types
- #define SCA_ECHO_CHAR 0x00000001
- #define SCA_MAX_VALUE 0x00000002
- #define SCA_MIN_VALUE 0x00000004
- #define SCA_VALIDATION 0x00000008
- #define SCA_MULTI_LINE 0x00000020
- #define SCA_AUTOMATIC_COMPLETION 0x00000080
- #define SCA_MULTIPLE 0x00000100
- #define SCA_DEFAULT_BUTTON 0x00000200
- #define SCA_CURRENT_STATE 0x00000400
- #define SCA_IS_TRISTATE 0x00000800
- #define SCA_STATE 0x00001000
- #define SCA_COLUMN_STYLE_NAME 0x00002000
-
- // attributes of the office:forms element
- enum OfficeFormsAttributes
- {
- ofaAutomaticFocus,
- ofaApplyDesignMode
- };
-
- //=====================================================================
- //= OAttributeMetaData
- //=====================================================================
- /** allows the translation of attribute ids into strings.
-
- <p>This class does not allow to connect xml attributes to property names or
- something like that, it only deals with the xml side</p>
- */
- class OAttributeMetaData
- {
- protected:
- /** ctor.
- <p>This default constructor is protected, 'cause this class is not intended to be instantiated
- directly. Instead, the derived classes should be used.</p>
- */
- OAttributeMetaData() { }
-
- protected:
- /** calculates the xml attribute representation of a common control attribute.
- @param _nId
- the id of the attribute. Has to be one of the CCA_* constants.
- */
- static const sal_Char* getCommonControlAttributeName(sal_Int32 _nId);
-
- /** calculates the xml namespace key to use for a common control attribute
- @param _nId
- the id of the attribute. Has to be one of the CCA_* constants.
- */
- static sal_uInt16 getCommonControlAttributeNamespace(sal_Int32 _nId);
-
- /** retrieves the name of an attribute of a form xml representation
- @param _eAttrib
- enum value specifying the attribute
- */
- static const sal_Char* getFormAttributeName(FormAttributes _eAttrib);
-
- /** calculates the xml namespace key to use for a attribute of a form xml representation
- @param _eAttrib
- enum value specifying the attribute
- */
- static sal_uInt16 getFormAttributeNamespace(FormAttributes _eAttrib);
-
- /** calculates the xml attribute representation of a database attribute.
- @param _nId
- the id of the attribute. Has to be one of the DA_* constants.
- */
- static const sal_Char* getDatabaseAttributeName(sal_Int32 _nId);
-
- /** calculates the xml namespace key to use for a database attribute.
- @param _nId
- the id of the attribute. Has to be one of the DA_* constants.
- */
- static sal_uInt16 getDatabaseAttributeNamespace(sal_Int32 _nId);
-
- /** calculates the xml attribute representation of a special attribute.
- @param _nId
- the id of the attribute. Has to be one of the SCA_* constants.
- */
- static const sal_Char* getSpecialAttributeName(sal_Int32 _nId);
-
- /** calculates the xml attribute representation of a binding attribute.
- @param _nId
- the id of the attribute. Has to be one of the BA_* constants.
- */
- static const sal_Char* getBindingAttributeName(sal_Int32 _nId);
-
- /** calculates the xml namespace key to use for a binding attribute.
- @param _nId
- the id of the attribute. Has to be one of the BA_* constants.
- */
- static sal_uInt16 getBindingAttributeNamespace(sal_Int32 _nId);
-
- /** calculates the xml namespace key to use for a special attribute.
- @param _nId
- the id of the attribute. Has to be one of the SCA_* constants.
- */
- static sal_uInt16 getSpecialAttributeNamespace(sal_Int32 _nId);
-
- /** calculates the xml attribute representation of a attribute of the office:forms element
- @param _nId
- the id of the attribute
- */
- static const sal_Char* getOfficeFormsAttributeName(OfficeFormsAttributes _eAttrib);
-
- /** calculates the xml namedspace key of a attribute of the office:forms element
- @param _nId
- the id of the attribute
- */
- static sal_uInt16 getOfficeFormsAttributeNamespace(OfficeFormsAttributes _eAttrib);
- };
-
- //=====================================================================
- //= OAttribute2Property
- //=====================================================================
- /** some kind of opposite to the OAttributeMetaData class. Able to translate
- attributes into property names/types
-
- <p>The construction of this class is rather expensive (or at least it's initialization from outside),
- so it should be shared</p>
- */
- class OAttribute2Property
- {
- public:
- // TODO: maybe the following struct should be used for exports, too. In this case we would not need to
- // store it's instances in a map, but in a vector for faster access.
- struct AttributeAssignment
- {
- ::rtl::OUString sAttributeName; // the attribute name
- ::rtl::OUString sPropertyName; // the property name
- ::com::sun::star::uno::Type aPropertyType; // the property type
- ::rtl::OUString sAttributeDefault; // the default if the attribute is not present
-
- // entries which are special to some value types
- const SvXMLEnumMapEntry* pEnumMap; // the enum map, if appliable
- sal_Bool bInverseSemantics; // for booleanss: attribute and property value have the same or an inverse semantics?
-
- AttributeAssignment() : pEnumMap(NULL), bInverseSemantics(sal_False) { }
- };
-
- protected:
- DECLARE_STL_USTRINGACCESS_MAP( AttributeAssignment, AttributeAssignments );
- AttributeAssignments m_aKnownProperties;
-
- public:
- OAttribute2Property();
- virtual ~OAttribute2Property();
-
- /** return the AttributeAssignment which corresponds to the given attribute
-
- @param _rAttribName
- the name of the attrribute
- @return
- a pointer to the <type>AttributeAssignment</type> structure as requested, NULL if the attribute
- does not represent a property.
- */
- const AttributeAssignment* getAttributeTranslation(
- const ::rtl::OUString& _rAttribName);
-
- /** add a attribute assignment referring to a string property to the map
- @param _pAttributeName
- the name of the attrribute
- @param _rPropertyName
- the name of the property assigned to the attribute
- @param _pAttributeDefault
- the default value for the attribute, if any. May be NULL, in this case the default is assumed to be
- an empty string.
- */
- void addStringProperty(
- const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName,
- const sal_Char* _pAttributeDefault = NULL);
-
- /** add a attribute assignment referring to a boolean property to the map
-
- @param _pAttributeName
- the name of the attrribute
- @param _rPropertyName
- the name of the property assigned to the attribute
- @param _bAttributeDefault
- the default value for the attribute.
- @param _bInverseSemantics
- if <TRUE/>, a attribute value of <TRUE/> means a property value of <FALSE/> and vice verse.<br/>
- if <FALSE/>, the attribute value is used as property value directly
- */
- void addBooleanProperty(
- const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName,
- const sal_Bool _bAttributeDefault, const sal_Bool _bInverseSemantics = sal_False);
-
- /** add a attribute assignment referring to an int16 property to the map
-
- @param _pAttributeName
- the name of the attrribute
- @param _rPropertyName
- the name of the property assigned to the attribute
- @param _nAttributeDefault
- the default value for the attribute.
- */
- void addInt16Property(
- const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName,
- const sal_Int16 _nAttributeDefault);
-
- /** add a attribute assignment referring to an enum property to the map
-
- @param _pAttributeName
- the name of the attrribute
- @param _rPropertyName
- the name of the property assigned to the attribute
- @param _nAttributeDefault
- the default value for the attribute, as (32bit) integer
- @param _pValueMap
- the map to translate strings into enum values
- @param _pType
- the type of the property. May be NULL, in this case 32bit integer is assumed.
- */
- void addEnumProperty(
- const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName,
- const sal_uInt16 _nAttributeDefault, const SvXMLEnumMapEntry* _pValueMap,
- const ::com::sun::star::uno::Type* _pType = NULL);
-
- protected:
- /// some common code for the various add*Property methods
- AttributeAssignment& implAdd(
- const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName,
- const ::com::sun::star::uno::Type& _rType, const ::rtl::OUString& _rDefaultString);
- };
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMATTRIBUTES_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/formcellbinding.hxx b/binfilter/bf_xmloff/source/forms/formcellbinding.hxx
deleted file mode 100644
index 1eae3774b723..000000000000
--- a/binfilter/bf_xmloff/source/forms/formcellbinding.hxx
+++ /dev/null
@@ -1,283 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef XMLOFF_FORMS_FORMCELLBINDING
-#define XMLOFF_FORMS_FORMCELLBINDING
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
-#include <com/sun/star/table/CellAddress.hpp>
-#include <com/sun/star/table/CellRangeAddress.hpp>
-#include <drafts/com/sun/star/form/XValueBinding.hpp>
-#include <drafts/com/sun/star/form/XListEntrySource.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-namespace binfilter {
-
-//............................................................................
-namespace xmloff
-{
-//............................................................................
-
- //========================================================================
- //= FormCellBindingHelper
- //========================================================================
- /** encapsulates functionality related to binding a form control to a spreadsheet cell
- */
- class FormCellBindingHelper
- {
- protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
- m_xControlModel; // the model we work for
- ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument >
- m_xDocument; // the document where the model lives
-
- public:
- /** determines whether the given control model lives in a spreadsheet document
- <p>If this method returns <FALSE/>, you cannot instantiate a CellBindingHelper with
- this model, since then no of it's functionality will be available.</p>
- */
- static sal_Bool livesInSpreadsheetDocument(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel
- );
-
- /** ctor
- @param _rxControlModel
- the control model which is or will be bound
- @param _rxDocument
- the document. If this is <NULL/>, the document will be obtained from the model
- itself by walkong up the chain of its ancestors.<br/>
- This parameter can be used if the control model is not (yet) part of a document
- model.
- */
- FormCellBindingHelper(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxDocument
- );
-
- public:
- /** gets a cell binding for the given address
- @precond
- isCellBindingAllowed returns <TRUE/>
- */
- ::com::sun::star::uno::Reference< ::drafts::com::sun::star::form::XValueBinding >
- createCellBindingFromStringAddress(
- const ::rtl::OUString& _rAddress,
- bool _bUseIntegerBinding
- ) const;
-
- /** gets a cell range list source binding for the given address
- */
- ::com::sun::star::uno::Reference< ::drafts::com::sun::star::form::XListEntrySource >
- createCellListSourceFromStringAddress( const ::rtl::OUString& _rAddress ) const;
-
- /** creates a string representation for the given value binding's address
-
- <p>If the sheet of the bound cell is the same as the sheet which our control belongs
- to, then the sheet name is omitted in the resulting string representation.</p>
-
- @precond
- The binding is a valid cell binding, or <NULL/>
- @see isCellBinding
- */
- ::rtl::OUString getStringAddressFromCellBinding(
- const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::form::XValueBinding >& _rxBinding
- ) const;
-
- /** creates a string representation for the given list source's range address
-
- <p>If the sheet of the cell range which acts as list source is the same as the
- sheet which our control belongs to, then the sheet name is omitted in the
- resulting string representation.</p>
-
- @precond
- The object is a valid cell range list source, or <NULL/>
- @see isCellRangeListSource
- */
- ::rtl::OUString getStringAddressFromCellListSource(
- const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::form::XListEntrySource >& _rxSource
- ) const;
-
- /** returns the current binding of our control model, if any.
- */
- ::com::sun::star::uno::Reference< ::drafts::com::sun::star::form::XValueBinding >
- getCurrentBinding( ) const;
-
- /** returns the current external list source of the control model, if any
- */
- ::com::sun::star::uno::Reference< ::drafts::com::sun::star::form::XListEntrySource >
- getCurrentListSource( ) const;
-
- /** sets a new binding for our control model
- @precond
- the control model is bindable (which is implied by <member>isCellBindingAllowed</member>
- returning <TRUE/>)
- */
- void setBinding(
- const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::form::XValueBinding >& _rxBinding
- );
-
- /** sets a list source for our control model
- @precond
- the control model is a list sink (which is implied by <member>isListCellRangeAllowed</member>
- returning <TRUE/>)
- */
- void setListSource(
- const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::form::XListEntrySource >& _rxSource
- );
-
- /** checks whether it's possible to bind the control model to a spreadsheet cell
- */
- bool isCellBindingAllowed( ) const;
-
- /** checks whether within the given document, it's possible to bind control models to spreadsheet cells
- */
- static bool isCellBindingAllowed(
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxDocument
- );
-
- /** checks whether it's possible to bind the control model to a range of spreadsheet cells
- supplying the list entries
- */
- bool isListCellRangeAllowed( ) const;
-
- /** checks whether within the given document, it's possible to bind the control model to a range of
- spreadsheet cells supplying the list entries
- */
- static bool isListCellRangeAllowed(
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxDocument
- );
-
- /** checks whether a given binding is a spreadsheet cell binding
- */
- bool isCellBinding(
- const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::form::XValueBinding >& _rxBinding
- ) const;
-
- /** checks whether a given binding is a spreadsheet cell binding, exchanging
- integer values
- */
- bool isCellIntegerBinding(
- const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::form::XValueBinding >& _rxBinding
- ) const;
-
- /** checks whether a given list source is a spreadsheet cell list source
- */
- bool isCellRangeListSource(
- const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::form::XListEntrySource >& _rxSource
- ) const;
-
- protected:
- /** creates an address object from a string representation of a cell address
- */
- bool convertStringAddress(
- const ::rtl::OUString& _rAddressDescription,
- ::com::sun::star::table::CellAddress& /* [out] */ _rAddress,
- sal_Int16 _nAssumeSheet = -1
- ) const;
-
- /** creates an address range object from a string representation of a cell range address
- */
- bool convertStringAddress(
- const ::rtl::OUString& _rAddressDescription,
- ::com::sun::star::table::CellRangeAddress& /* [out] */ _rAddress
- ) const;
-
- /** determines if our document is a spreadsheet document, *and* can supply
- the given service
- */
- bool isSpreadsheetDocumentWhichSupplies( const ::rtl::OUString& _rService ) const SAL_THROW(());
-
- /** determines if our document is a spreadsheet document, *and* can supply
- the given service
- */
- static bool isSpreadsheetDocumentWhichSupplies(
- const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument >& _rxDocument,
- const ::rtl::OUString& _rService
- ) SAL_THROW(());
-
- /** checkes whether a given component supports a given servive
- */
- bool doesComponentSupport(
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent,
- const ::rtl::OUString& _rService
- ) const;
-
- /** uses the document (it's factory interface, respectively) to create a component instance
- @param _rService
- the service name
- @param _rArgumentName
- the name of the single argument to pass during creation. May be empty, in this case
- no arguments are passed
- @param _rArgumentValue
- the value of the instantiation argument. Not evaluated if <arg>_rArgumentName</arg>
- is empty.
- */
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
- createDocumentDependentInstance(
- const ::rtl::OUString& _rService,
- const ::rtl::OUString& _rArgumentName,
- const ::com::sun::star::uno::Any& _rArgumentValue
- ) const;
-
- /** converts an address representation into another one
-
- @param _rInputProperty
- the input property name for the conversion service
- @param _rInputValue
- the input property value for the conversion service
- @param _rOutputProperty
- the output property name for the conversion service
- @param _rOutputValue
- the output property value for the conversion service
- @param _bIsRange
- if <TRUE/>, the RangeAddressConversion service will be used, else
- the AddressConversion service
-
- @return
- <TRUE/> if any only if the conversion was successfull
-
- @see ::com::sun::star::table::CellAddressConversion
- @see ::com::sun::star::table::CellRangeAddressConversion
- */
- bool doConvertAddressRepresentations(
- const ::rtl::OUString& _rInputProperty,
- const ::com::sun::star::uno::Any& _rInputValue,
- const ::rtl::OUString& _rOutputProperty,
- ::com::sun::star::uno::Any& _rOutputValue,
- bool _bIsRange
- ) const SAL_THROW(());
- };
-
-//............................................................................
-} // namespace xmloff
-//............................................................................
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/formenums.hxx b/binfilter/bf_xmloff/source/forms/formenums.hxx
deleted file mode 100644
index c1564836c4a9..000000000000
--- a/binfilter/bf_xmloff/source/forms/formenums.hxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMENUMS_HXX_
-#define _XMLOFF_FORMENUMS_HXX_
-
-#include "xmlement.hxx"
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- //=====================================================================
- //= OEnumMapper
- //=====================================================================
- class OEnumMapper
- {
- public:
- enum EnumProperties
- {
- epSubmitEncoding = 0,
- epSubmitMethod,
- epCommandType,
- epNavigationType,
- epTabCyle,
- epButtonType,
- epListSourceType,
- epCheckState,
- epTextAlign,
- epBorderWidth,
- epFontEmphasis,
- epFontRelief,
- epListLinkageType,
-
- KNOWN_ENUM_PROPERTIES
- };
-
- private:
- static const SvXMLEnumMapEntry* s_pEnumMap[KNOWN_ENUM_PROPERTIES];
-
- public:
- static const SvXMLEnumMapEntry* getEnumMap(EnumProperties _eProperty);
- };
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMENUMS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/formevents.hxx b/binfilter/bf_xmloff/source/forms/formevents.hxx
deleted file mode 100644
index 8d1699595606..000000000000
--- a/binfilter/bf_xmloff/source/forms/formevents.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-namespace binfilter {
-
-#ifndef _XMLOFF_FORMS_FORMEVENTS_HXX_
-#define _XMLOFF_FORMS_FORMEVENTS_HXX_
-
-struct XMLEventNameTranslation;
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- //=====================================================================
- //= event translation table
- //=====================================================================
- extern const XMLEventNameTranslation* g_pFormsEventTranslation;
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMS_FORMEVENTS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/formstyles.hxx b/binfilter/bf_xmloff/source/forms/formstyles.hxx
deleted file mode 100644
index ea47ecf79bc6..000000000000
--- a/binfilter/bf_xmloff/source/forms/formstyles.hxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef XMLOFF_FORMSTYLES_HXX
-#define XMLOFF_FORMSTYLES_HXX
-
-#include "prstylei.hxx"
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- //=====================================================================
- //= OControlStyleContext
- //=====================================================================
- class OControlStyleContext : public XMLPropStyleContext
- {
- protected:
- ::rtl::OUString m_sNumberStyleName;
-
- public:
- OControlStyleContext(
- SvXMLImport& _rImport,
- const sal_uInt16 _Prefix,
- const ::rtl::OUString& _rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList,
- SvXMLStylesContext& _rParentStyles,
- const sal_uInt16 _nFamily,
- const sal_Bool _bDefaultStyle
- );
-
- inline const ::rtl::OUString& getNumberStyleName( ) const { return m_sNumberStyleName; }
-
- protected:
- virtual void SetAttribute(
- sal_uInt16 _nPrefixKey,
- const ::rtl::OUString& _rLocalName,
- const ::rtl::OUString& _rValue
- );
- };
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // XMLOFF_FORMSTYLES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/ifacecompare.hxx b/binfilter/bf_xmloff/source/forms/ifacecompare.hxx
deleted file mode 100644
index da8f38ca1bdc..000000000000
--- a/binfilter/bf_xmloff/source/forms/ifacecompare.hxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMS_IFACECOMPARE_HXX_
-#define _XMLOFF_FORMS_IFACECOMPARE_HXX_
-
-#include <comphelper/stl_types.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/drawing/XDrawPage.hpp>
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- //=====================================================================
- //= OInterfaceCompare
- //=====================================================================
- /** is stl-compliant structure for comparing Reference&lt; &lt;iface&gt; &gt; instances
- */
- template < class IAFCE >
- struct OInterfaceCompare
- :public ::std::binary_function < ::com::sun::star::uno::Reference< IAFCE >
- , ::com::sun::star::uno::Reference< IAFCE >
- , bool
- >
- {
- bool operator() (const ::com::sun::star::uno::Reference< IAFCE >& lhs, const ::com::sun::star::uno::Reference< IAFCE >& rhs) const
- {
- return lhs.get() < rhs.get();
- // this does not make any sense if you see the semantics of the pointer returned by get:
- // It's a pointer to a point in memory where an interface implementation lies.
- // But for our purpose (provide a reliable less-operator which can be used with the STL), this is
- // sufficient ....
- }
- };
-
- typedef OInterfaceCompare< ::com::sun::star::beans::XPropertySet > OPropertySetCompare;
- typedef OInterfaceCompare< ::com::sun::star::drawing::XDrawPage > ODrawPageCompare;
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMS_IFACECOMPARE_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/layerexport.hxx b/binfilter/bf_xmloff/source/forms/layerexport.hxx
deleted file mode 100644
index 8fa709e4a1ba..000000000000
--- a/binfilter/bf_xmloff/source/forms/layerexport.hxx
+++ /dev/null
@@ -1,296 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMS_LAYEREXPORT_HXX_
-#define _XMLOFF_FORMS_LAYEREXPORT_HXX_
-
-#include <com/sun/star/util/XNumberFormats.hpp>
-#include <com/sun/star/awt/XControlModel.hpp>
-#include "callbacks.hxx"
-#include "ifacecompare.hxx"
-namespace binfilter {
-
-class SvXMLExport;
-class SvXMLNumFmtExport;
-class XMLPropertyHandlerFactory;
-class SvXMLExportPropertyMapper;
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- typedef ::std::set< ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >, ::comphelper::OInterfaceCompare< ::com::sun::star::beans::XPropertySet > >
- PropertySetBag;
- //=====================================================================
- //= OFormLayerXMLExport_Impl
- //=====================================================================
- /** the implementation class for OFormLayerXMLExport
- */
- class OFormLayerXMLExport_Impl
- :public IFormsExportContext
- {
- friend class OFormLayerXMLExport;
-
- protected:
- SvXMLExport& m_rContext;
- SvXMLNumFmtExport* m_pControlNumberStyles;
-
- // ignore list for control models
- PropertySetBag m_aIgnoreList;
-
- // style handling
- ::rtl::Reference< XMLPropertyHandlerFactory > m_xPropertyHandlerFactory;
- ::rtl::Reference< SvXMLExportPropertyMapper > m_xExportMapper;
-
- // we need our own number formats supplier:
- // Controls which have a number formats do not work with the formats supplier of the document they reside
- // in, instead they use the formats of the data source their form is associated with. If there is no
- // such form or no such data source, they work with an own formatter.
- // Even more, time and date fields do not work with a central formatter at all, they have their own one
- // (which is shared internally, but this is a (hidden) implementation detail.)
- //
- // To not contaminate the global (document) number formats supplier (which could be obtained from the context),
- // we have an own one.
- // (Contaminate means: If a user adds a user-defined format to a formatted field, this format is stored in
- // in the data source's formats supplier. To export this _and_ reuse existing structures, we would need to
- // add this format to the global (document) formats supplier.
- // In case of an export we could do some cleanup afterwards, but in case of an import, there is no such
- // chance, as (if other user-defined formats exist in the document as well) we can't distinguish
- // between user-defined formats really beeded for the doc (i.e. in a calc cell) and formats only added
- // to the supplier because the controls needed it.
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats >
- m_xControlNumberFormats;
-
- DECLARE_STL_MAP( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >, ::rtl::OUString, OPropertySetCompare, MapPropertySet2String);
- // maps objects (property sets) to strings, e.g. control ids.
- DECLARE_STL_MAP( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >, MapPropertySet2String, ODrawPageCompare, MapPropertySet2Map);
- // map pages to maps (of property sets to strings)
-
- MapPropertySet2Map m_aControlIds;
- // the control ids of all control on all pages we ever examined
-
- MapPropertySet2Map m_aReferringControls;
- // for a given page (iter->first), and a given control (iter->second->first), this is the comma-separated
- // lists of ids of the controls refering to the control given.
-
- MapPropertySet2MapIterator
- m_aCurrentPageIds;
- // the iterator for the control id map for the page beeing handled
- MapPropertySet2MapIterator
- m_aCurrentPageReferring;
- // the same for the map of referring controls
-
- // TODO: To avoid this construct above, and to have a cleaner implementation, an class encapsulating the
- // export of a single page should be introduced.
-
- DECLARE_STL_MAP( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >, sal_Int32, OPropertySetCompare, MapPropertySet2Int);
- MapPropertySet2Int m_aControlNumberFormats;
- // maps controls to format keys, which are relative to our own formats supplier
-
- MapPropertySet2String m_aGridColumnStyles;
- // style names of grid columns
-
- public:
- OFormLayerXMLExport_Impl(SvXMLExport& _rContext);
-
- protected:
- /** exports one single grid column
- */
- void exportGridColumn(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rEvents
- );
-
- /** exports one single control
- */
- void exportControl(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControl,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rEvents
- );
-
- /** exports one single form
- */
- void exportForm(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxProps,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rEvents
- );
-
- /** seek to the page given.
-
- <p>This must be called before you can retrieve any ids for controls on the page.</p>
-
- @see
- getControlId
- */
- sal_Bool seekPage(
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage);
-
- /** get the id of the given control.
-
- <p>You must have sought to the page of the control before calling this.</p>
- */
- ::rtl::OUString
- getControlId(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControl);
-
- /** retrieves the style name for the control's number style.
-
- <p>For performance reasons, this method is allowed to be called for any controls, even those which
- do not have a number style. In this case, an empty string is returned.</p>
- */
- ::rtl::OUString
- getControlNumberStyle( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControl );
-
- // IFormsExportContext
- virtual void exportCollectionElements(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& _rxCollection);
- virtual SvXMLExport& getGlobalContext();
- virtual ::rtl::OUString getObjectStyleName(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject );
- virtual ::rtl::Reference< SvXMLExportPropertyMapper > getStylePropertyMapper();
-
- /** clear any structures which have been build in the recent <method>examine</method> calls.
- */
- void clear();
-
- /** examine a forms collection.
-
- <p>The method will collect control ids and add styles to the export context as necessary.</p>
-
- <p>Every control in the object hierarchy given will be assigned to a unique id, which is stored for later
- use.</p>
-
- <p>In addition, any references the controls may have between each other, are collected and stored for
- later use.</p>
-
- <p>Upon calling this method, the id map will be cleared before collecting the new ids, so any ids
- you collected previously will be lost</p>
-
- @param _rxDrawPage
- the draw page which's forms collection should be examined
-
- @see getControlId
- @see exportControl
- @see exportForms
- */
- void examineForms(
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage);
-
- /** export a forms collection of a draw page
-
- <p>The method will obtain the forms collection of the page and call
- <method>exportCollectionElements</method>.</p>
- */
- void exportForms(
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage);
-
- /** exports the automatic control number styles
- */
- void exportAutoControlNumberStyles();
-
- /** exports the auto-styles collected during the examineForms calls
- */
- void exportAutoStyles();
-
- protected:
- sal_Bool implCheckPage(
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage,
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& _rxForms);
-
- /** moves the m_aCurrentPage* members to the positions specifying the given page.
-
- @return <TRUE/> if there already were structures for the given page
- */
- sal_Bool implMoveIterators(
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage,
- sal_Bool _bClear);
-
- /** check the object given if it's a control, if so, examine it.
- @return <TRUE/> if the object has been handled
- */
- sal_Bool checkExamineControl(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject);
-
- /** examines the control's number format, so later the format style can be referred
-
- <p>remembers the format key for the control, so it can later be asked for in getControlNumberStyle</p>
- */
- void examineControlNumberFormat(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControl);
-
- /** examines the control's number format, so later the format style can be referred
-
- <p>does not remember the information returned in any way</p>
- */
- sal_Int32 implExamineControlNumberFormat( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject );
-
- /** collects AutoStyles for grid columns
- */
- void collectGridAutoStyles( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControl );
-
- /** ensures that the number format of the given control exist in our own formats supplier.
-
- <p>The given control is examined for it's format (i.e. it's FormatKey/FormatsSupplier properties),
- and the format is added (if necessary) to m_xControlNumberFormats</p>.
-
- @return
- the format key of the control's format relative to our own formats supplier
-
- */
- sal_Int32 ensureTranslateFormat(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxFormattedControl);
-
- /// returns the instance exporting our control's number styles
- SvXMLNumFmtExport* getControlNumberStyleExport();
-
- /// ensures that the instance exporting our control's number styles exists
- void ensureControlNumberStyleExport();
-
- /** determines the number format style for the given object without remembering it
- */
- ::rtl::OUString
- getImmediateNumberStyle( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject );
-
- /** returns the prefix to be used for control number styles
- */
- static const ::rtl::OUString& getControlNumberStyleNamePrefix();
-
- /** exclude the given control (model) from export.
-
- <p>If your document contains form controls which are not to be exported for whatever reason,
- you need to announce the models of these controls (can be retrieved from XControlShape::getControl)
- to the form layer exporter.<br/>
- Of course you have to do this before calling <member>exportForms</member></p>
- */
- void excludeFromExport( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > _rxControl );
- };
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMS_LAYEREXPORT_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/layerimport.hxx b/binfilter/bf_xmloff/source/forms/layerimport.hxx
deleted file mode 100644
index 2286334673a3..000000000000
--- a/binfilter/bf_xmloff/source/forms/layerimport.hxx
+++ /dev/null
@@ -1,217 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMS_LAYERIMPORT_HXX_
-#define _XMLOFF_FORMS_LAYERIMPORT_HXX_
-
-#include <com/sun/star/xml/sax/XAttributeList.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <rtl/ref.hxx>
-#include "formattributes.hxx"
-#include "callbacks.hxx"
-#include "eventimport.hxx"
-#include <tools/ref.hxx>
-namespace binfilter {
-
-class SvXMLImport;
-class SvXMLImportContext;
-class XMLPropertyHandlerFactory;
-class SvXMLImportPropertyMapper;
-class XMLPropStyleContext;
-
-SV_DECL_REF( SvXMLStylesContext ) //STRIP007;
- // unfortunately, we can't put this into our namespace, as the macro expands to (amongst others) a forward
- // declaration of the class name, which then would be in the namespace, too
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- class OAttribute2Property;
-
- //=====================================================================
- //= ControlReference
- //=====================================================================
- /// a structure containing a property set (the referred control) and a string (the list of referring controls)
-/* struct ControlReference
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
- xReferredControl;
- ::rtl::OUString
- sReferringControls;
-
- ControlReference(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxReferredControl,
- const ::rtl::OUString& _rReferringControls)
- :xReferredControl(_rxReferredControl)
- ,sReferringControls(_rReferringControls)
- {
- }
- };
-*/
-
- //=====================================================================
- //= OFormLayerXMLImport_Impl
- //=====================================================================
- class OFormLayerXMLImport_Impl
- :public OAttributeMetaData
- ,public IControlIdMap
- ,public IFormsImportContext
- ,public ODefaultEventAttacherManager
- {
- friend class OFormLayerXMLImport;
-
- protected:
- SvXMLImport& m_rImporter;
- OAttribute2Property m_aAttributeMetaData;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
- m_xForms; // the forms of the currently imported page
- SvXMLStylesContext* m_pAutoStyles;
-
- protected:
- // style handling
- ::rtl::Reference< XMLPropertyHandlerFactory > m_xPropertyHandlerFactory;
- ::rtl::Reference< SvXMLImportPropertyMapper > m_xImportMapper;
-
- DECLARE_STL_USTRINGACCESS_MAP( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >, MapString2PropertySet );
- DECLARE_STL_MAP( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >, MapString2PropertySet, ODrawPageCompare, MapDrawPage2Map);
-
- MapDrawPage2Map m_aControlIds; // ids of the controls on all known page
- MapDrawPage2MapIterator m_aCurrentPageIds; // ifs of the controls on the current page
-
- typedef ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >, ::rtl::OUString >
- ModelStringPair;
- ::std::vector< ModelStringPair >
- m_aControlReferences; // control reference descriptions for current page
- ::std::vector< ModelStringPair >
- m_aCellValueBindings; // information about controls bound to spreadsheet cells
- ::std::vector< ModelStringPair >
- m_aCellRangeListSources;// information about controls bound to spreadsheet cell range list sources
-
- public:
- // IControlIdMap
- virtual void registerControlId(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControl,
- const ::rtl::OUString& _rId);
- virtual void registerControlReferences(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControl,
- const ::rtl::OUString& _rReferringControls);
-
- // IFormsImportContext
- virtual IControlIdMap& getControlIdMap();
- virtual OAttribute2Property& getAttributeMap();
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- getServiceFactory();
- virtual SvXMLImport& getGlobalContext();
- const SvXMLStyleContext* getStyleElement(const ::rtl::OUString& _rStyleName) const;
- virtual void enterEventContext();
- virtual void leaveEventContext();
- void applyControlNumberStyle(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel,
- const ::rtl::OUString& _rControlNumerStyleName
- );
- virtual void registerCellValueBinding(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel,
- const ::rtl::OUString& _rCellAddress
- );
-
- virtual void registerCellRangeListSource(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel,
- const ::rtl::OUString& _rCellRangeAddress
- );
-
- protected:
- OFormLayerXMLImport_Impl(SvXMLImport& _rImporter);
- ~OFormLayerXMLImport_Impl();
-
- /** retrieves the property mapper form form related auto styles.
- */
- ::rtl::Reference< SvXMLImportPropertyMapper > getStylePropertyMapper() const;
-
- /** start importing the forms of the given page
- */
- void startPage(
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage);
-
- /** end importing the forms of the current page
- */
- void endPage();
-
- /** creates an import context for the office:forms element
- */
- SvXMLImportContext* createOfficeFormsContext(
- SvXMLImport& _rImport,
- sal_uInt16 _nPrefix,
- const ::rtl::OUString& _rLocalName);
-
- /** create an <type>SvXMLImportContext</type> instance which is able to import the &lt;form:form&gt;
- element.
- */
- SvXMLImportContext* createContext(
- const sal_uInt16 _nPrefix,
- const ::rtl::OUString& _rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttribs);
-
- /**
- */
- XMLPropStyleContext* createControlStyleContext(
- sal_uInt16 _nPrefix,
- const ::rtl::OUString& _rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList,
- SvXMLStylesContext& _rParentStyles,
- sal_uInt16 _nFamily = 0,
- sal_Bool _bDefaultStyle = sal_False
- );
-
- /** get the control with the given id
- */
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
- lookupControlId(const ::rtl::OUString& _rControlId);
-
- /** announces the auto-style context to the form importer
- */
- void setAutoStyleContext(SvXMLStylesContext* _pNewContext);
-
- /** to be called when the document has been completely imported
-
- <p>For some documents (currently: only some spreadsheet documents) it's necessary
- do to a post processing, since not all information from the file can be processed
- if the document is not completed, yet.</p>
- */
- void documentDone( );
- };
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMS_LAYERIMPORT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/logging.hxx b/binfilter/bf_xmloff/source/forms/logging.hxx
deleted file mode 100644
index 18c713b8105d..000000000000
--- a/binfilter/bf_xmloff/source/forms/logging.hxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef XMLOFF_FORMS_LOGGING_HXX
-#define XMLOFF_FORMS_LOGGING_HXX
-
-#include <sal/types.h>
-#include <stack>
-namespace rtl { class Logfile; }
-namespace binfilter {
-
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
-#ifdef TIMELOG
-
- //=====================================================================
- //= OStackedLogging
- //=====================================================================
- class OStackedLogging
- {
- private:
- ::std::stack< ::rtl::Logfile* > m_aLogger;
-
- protected:
- OStackedLogging() { }
-
- protected:
- void enterContext( const sal_Char* _pContextName );
- void leaveTopContext( );
- };
-
-#define ENTER_LOG_CONTEXT( name ) enterContext( name )
-#define LEAVE_LOG_CONTEXT( ) leaveTopContext( )
-
-#else
- struct OStackedLogging { };
-
-#define ENTER_LOG_CONTEXT( name )
-#define LEAVE_LOG_CONTEXT( )
-
-#endif
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // XMLOFF_FORMS_LOGGING_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/makefile.mk b/binfilter/bf_xmloff/source/forms/makefile.mk
deleted file mode 100644
index dd5a9fbbf956..000000000000
--- a/binfilter/bf_xmloff/source/forms/makefile.mk
+++ /dev/null
@@ -1,71 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
-
-PRJ=..$/..$/..
-
-PRJNAME=binfilter
-TARGET=xmloff_forms
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-INC+= -I$(PRJ)$/inc$/bf_xmloff
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/xmloff_formstyles.obj \
- $(SLO)$/xmloff_officeforms.obj \
- $(SLO)$/xmloff_formevents.obj \
- $(SLO)$/xmloff_eventimport.obj \
- $(SLO)$/xmloff_eventexport.obj \
- $(SLO)$/xmloff_controlpropertyhdl.obj \
- $(SLO)$/xmloff_controlpropertymap.obj \
- $(SLO)$/xmloff_valueproperties.obj \
- $(SLO)$/xmloff_attriblistmerge.obj \
- $(SLO)$/xmloff_controlelement.obj \
- $(SLO)$/xmloff_formlayerexport.obj \
- $(SLO)$/xmloff_layerexport.obj \
- $(SLO)$/xmloff_elementexport.obj \
- $(SLO)$/xmloff_propertyexport.obj \
- $(SLO)$/xmloff_elementimport.obj \
- $(SLO)$/xmloff_layerimport.obj \
- $(SLO)$/xmloff_propertyimport.obj \
- $(SLO)$/xmloff_formlayerimport.obj \
- $(SLO)$/xmloff_formattributes.obj \
- $(SLO)$/xmloff_formenums.obj \
- $(SLO)$/xmloff_strings.obj \
- $(SLO)$/xmloff_logging.obj \
- $(SLO)$/xmloff_formcellbinding.obj \
-
-# --- Tagets -------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/binfilter/bf_xmloff/source/forms/officeforms.hxx b/binfilter/bf_xmloff/source/forms/officeforms.hxx
deleted file mode 100644
index 2a4e8746d462..000000000000
--- a/binfilter/bf_xmloff/source/forms/officeforms.hxx
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMS_OFFICEFORMS_HXX_
-#define _XMLOFF_FORMS_OFFICEFORMS_HXX_
-
-#include "formattributes.hxx"
-#include "xmlictxt.hxx"
-#include "logging.hxx"
-namespace binfilter {
-
-class SvXMLElementExport;
-class SvXMLExport;
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- //=====================================================================
- //= OFormsRootImport
- //=====================================================================
- class OFormsRootImport
- :public SvXMLImportContext
- ,public OAttributeMetaData
- ,public OStackedLogging
- {
- public:
- TYPEINFO();
-
- OFormsRootImport( SvXMLImport& _rImport, sal_uInt16 _nPrfx, const ::rtl::OUString& _rLocalName);
- virtual ~OFormsRootImport();
-
- // SvXMLImportContext overriabled
- virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList );
- virtual void EndElement();
-
- protected:
- void implImportBool(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttributes,
- OfficeFormsAttributes _eAttribute,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxProps,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >& _rxPropInfo,
- const ::rtl::OUString& _rPropName,
- sal_Bool _bDefault
- );
- };
-
- //=====================================================================
- //= OFormsRootExport
- //=====================================================================
- class OFormsRootExport : public OAttributeMetaData
- {
- private:
- SvXMLElementExport* m_pImplElement;
-
- public:
- OFormsRootExport( SvXMLExport& _rExp );
- ~OFormsRootExport();
-
- private:
- void addModelAttributes(SvXMLExport& _rExp) SAL_THROW(());
-
- void implExportBool(
- SvXMLExport& _rExp,
- OfficeFormsAttributes _eAttribute,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxProps,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >& _rxPropInfo,
- const ::rtl::OUString& _rPropName,
- sal_Bool _bDefault
- );
- };
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMS_OFFICEFORMS_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/propertyexport.hxx b/binfilter/bf_xmloff/source/forms/propertyexport.hxx
deleted file mode 100644
index 683e6e22d929..000000000000
--- a/binfilter/bf_xmloff/source/forms/propertyexport.hxx
+++ /dev/null
@@ -1,389 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMS_PROPERTYEXPORT_HXX_
-#define _XMLOFF_FORMS_PROPERTYEXPORT_HXX_
-
-#include "formattributes.hxx"
-#include <comphelper/stl_types.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <callbacks.hxx>
-#include "callbacks.hxx"
-#include "strings.hxx"
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
-#define BOOLATTR_DEFAULT_FALSE 0x00
-#define BOOLATTR_DEFAULT_TRUE 0x01
-#define BOOLATTR_DEFAULT_VOID 0x02
-#define BOOLATTR_DEFAULT_MASK 0x03
-
-#define BOOLATTR_INVERSE_SEMANTICS 0x04
- // if sal_True, indicates that the semantic of the property refered by <arg>_pPropertyName</arg>
- // is inverse to the semantic of the XML attribute.<br/>
- // I.e. if the property value is <TRUE/>, <FALSE/> has to be written and vice versa.
- // <p>Be careful with <arg>_bDefault</arg> and <arg>_bInverseSemantics</arg>: if <arg>_bInverseSemantics</arg>
- // is <TRUE/>, the current property value is inverted <em>before</em> comparing it to the default.</p>
-
- class IFormsExportContext;
- //=====================================================================
- //= OPropertyExport
- //=====================================================================
- /** provides export related tools for attribute handling
-
- <p>(The name is somewhat misleading. It's not only a PropertyExport, but in real a ElementExport.
- Anyway.)</p>
- */
- class OPropertyExport : public OAttributeMetaData
- {
- private:
- DECLARE_STL_STDKEY_SET(::rtl::OUString, StringSet);
- StringSet m_aRemainingProps;
- // see examinePersistence
-
- void exportRelativeTargetLocation(const ConstAsciiString& _sPropertyName,sal_Int32 _nProperty);
-
- protected:
- IFormsExportContext& m_rContext;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
- m_xProps;
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
- m_xPropertyInfo;
-
- // caching
- ::rtl::OUString m_sValueTrue;
- ::rtl::OUString m_sValueFalse;
-
- public:
- /** constructs an object capable of handling attributes for export
- @param _rContext
- the export context to which's attribute list the property translation should be added
- @param m_xControl
- the property set to be exported
- */
- OPropertyExport(IFormsExportContext& _rContext,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxProps);
-
- protected:
- /** examines a property set given for all properties which's value are to made persistent
-
- <p>upon return the <method>m_aRemainingProps</method> will be filled with the names of all properties
- which need to be stored</p>
- */
- void examinePersistence();
-
- /**
- */
- void exportRemainingProperties();
-
- /** indicates that a property has been handled by a derived class, without using the helper methods of this
- class.
-
- <p>Calling this method is necessary in case you use the suggested mechanism for the generic export of
- properties. This means that you want to use <method>exportRemainingProperties</method>, which exports
- all properties which need to ('cause they haven't been exported with one of the other type-specific
- methods).</p>
-
- <p>In this case you should call exportedProperty for every property you export yourself, so the property
- will be flagged as <em>already handled</em></p>
- */
- void exportedProperty(const ::rtl::OUString& _rPropertyName)
- { m_aRemainingProps.erase(_rPropertyName); }
-
- /** add an attribute which is represented by a string property to the export context
-
- @param _nNamespaceKey
- the key of the namespace to use for the attribute name. Is used with the namespace map
- provided by the export context.
- @param _pAttributeName
- the name of the attribute to add. Must not contain any namespace
- @param _pPropertyName
- the name of the property to ask the control for
- */
- void exportStringPropertyAttribute(
- const sal_uInt16 _nNamespaceKey,
- const sal_Char* _pAttributeName,
- const ::rtl::OUString& _rPropertyName
- );
-
- /** add an attribute which is represented by a boolean property to the export context
-
- @param _nNamespaceKey
- the key of the namespace to use for the attribute name. Is used with the namespace map
- provided by the export context.
- @param _pAttributeName
- the name of the attribute to add. Must not contain any namespace (it's added automatically)
- @param _pPropertyName
- the name of the property to ask the control for
- @param _nBooleanAttributeFlags
- specifies the default and the "alignment" (inverse semantics) of the boolean property
- */
- void exportBooleanPropertyAttribute(
- const sal_uInt16 _nNamespaceKey,
- const sal_Char* _pAttributeName,
- const ::rtl::OUString& _rPropertyName,
- const sal_Int8 _nBooleanAttributeFlags);
-
- /** add an attribute which is represented by a sal_Int16 property to the export context
-
- @param _nNamespaceKey
- the key of the namespace to use for the attribute name. Is used with the namespace map
- provided by the export context.
- @param _pAttributeName
- the name of the attribute to add. Must not contain any namespace (it's added automatically)
- @param _pPropertyName
- the name of the property to ask the control for
- @param _nDefault
- the default of the attribute. If the current property value equals this default, no
- attribute is added.
- */
- void exportInt16PropertyAttribute(
- const sal_uInt16 _nNamespaceKey,
- const sal_Char* _pAttributeName,
- const ::rtl::OUString& _rPropertyName,
- const sal_Int16 _nDefault);
-
- /** add an attribute which is represented by a enum property to the export context
-
- @param _nNamespaceKey
- the key of the namespace to use for the attribute name. Is used with the namespace map
- provided by the export context.
- @param _pAttributeName
- the name of the attribute to add. Must not contain any namespace (it's added automatically)
- @param _pPropertyName
- the name of the property to ask the control for
- @param _pValueMap
- the map to use when converting the property value to an attribute value
- @param _nDefault
- the default of the attribute. If the current property value equals this default, no
- attribute is added.
- */
- void exportEnumPropertyAttribute(
- const sal_uInt16 _nNamespaceKey,
- const sal_Char* _pAttributeName,
- const sal_Char* _pPropertyName,
- const SvXMLEnumMapEntry* _pValueMap,
- const sal_Int32 _nDefault,
- const sal_Bool _bVoidDefault = sal_False);
-
- // some very special methods for some very special attribute/property pairs
-
- /** add the hlink:target-frame attribute to the export context.
-
- <p>The value of this attribute is extracted from the TargetFrame property of the object given.</p>
-
- <p>The property needs a special handling because conflicts between the default values for the attribute
- and the property.</p>
- */
- void exportTargetFrameAttribute();
-
- /** add the form:href attribute to the export context.
-
- <p>The value of this attribute is extracted from the TargetURL property of the object given.</p>
-
- <p>The property needs a special handling because the URL's need to be made relative</p>
- */
- inline void exportTargetLocationAttribute() { exportRelativeTargetLocation(PROPERTY_TARGETURL,CCA_TARGET_LOCATION); }
-
- /** add the form:image attribute to the export context.
-
- <p>The value of this attribute is extracted from the ImageURL property of the object given.</p>
-
- <p>The property needs a special handling because the URL's need to be made relative</p>
- */
- inline void exportImageDataAttribute() { exportRelativeTargetLocation(PROPERTY_IMAGEURL,CCA_IMAGE_DATA); }
-
- /** flag the style properties as 'already exported'
-
- <p>We don't have style support right now, so the only thing the method does is removing the style-relevant
- properties from the list of yet-to-be-exported properties (<member>m_aRemainingProps</member>)</p>
- */
- void flagStyleProperties();
-
- /** add an arbitrary attribute extracted from an arbitrary property to the export context
-
- <p>The current value of the property specified wiht <arg>_pPropertyName</arg> is taken and converted
- into a string, no matter what type it has. (Okay, there are the usual limitations: We know Date, Datetime,
- double, integer ... to name just a few).</p>
-
- <p>In case the property value is <NULL/> (void), no attribute is added</p>
-
- <p>In case the property value is an empty string, and the property is a not allowed to be <NULL/> (void),
- no attribute is added</p>
-
- <p>In case the property value is a sequence of any type, no attribute is added, 'cause sequences can't be
- transported as attribute. In the debug version, an additional assertion will occur if you nonetheless try
- to do this.</p>
-
- @param _nNamespaceKey
- the key of the namespace to use for the attribute name. Is used with the namespace map
- provided by the export context.
- @param _pAttributeName
- the name of the attribute to add. Must not contain any namespace (it's added automatically)
- @param _pPropertyName
- the name of the property to ask the object for
- */
- void exportGenericPropertyAttribute(
- const sal_uInt16 _nAttributeNamespaceKey,
- const sal_Char* _pAttributeName,
- const sal_Char* _pPropertyName);
-
- /** exports a property value, which is a string sequence, as attribute
-
- <p>The elements of the string sequence given are quoted and concatenated, with the characters used for
- this to be choosen by the caller</p>
-
- <p>If you use the quote character, no check (except assertions) is made if one of the list items
- containes the quote character</p>
-
- <p>If you don't use the quote character, no check (except assertions) is made if one of the list items
- containes the separator character (which would be deadly when reimporting the string)</p>
-
- @param _nNamespaceKey
- the key of the namespace to use for the attribute name. Is used with the namespace map
- provided by the export context.
- @param _pAttributeName
- the name of the attribute to add. Must not contain any namespace (it's added automatically)
- @param _pPropertyName
- the name of the property to ask the object for
- @param _aQuoteCharacter
- the character to use to quote the sequence elements with. May be 0, in this case no quoting happens
- @param _aListSeparator
- the character to use to separate the list entries
- */
- void exportStringSequenceAttribute(
- const sal_uInt16 _nAttributeNamespaceKey,
- const sal_Char* _pAttributeName,
- const ::rtl::OUString& _rPropertyName,
- const sal_Unicode _aQuoteCharacter = '"',
- const sal_Unicode _aListSeparator = ',');
-
- /** tries to convert an arbitrary <type scope="com.sun:star.uno">Any</type> into an string
-
- <p>If the type contained in the Any is not supported, the returned string will be empty. In the
- debug version, an additional assertion occurs.</p>
-
- @param _rValue
- the value to convert
- */
- ::rtl::OUString implConvertAny(
- const ::com::sun::star::uno::Any& _rValue);
-
- /**
- @return
- string which can be used in the <code>form:property</code> element's <code>type</code> attribute
- to describe the type of a value.<br/>
- Possible types returned are
- <ul>
- <li><b>boolean</b>: <arg>_rValue</arg> was interpreted as boolean value before converting
- it into a string</li>
- <li><b>short</b>: <arg>_rValue</arg> was interpreted as 16 bit integer value before
- converting it into a string</li>
- <li><b>int</b>: <arg>_rValue</arg> was interpreted as 32 bit integer value before
- converting it into a string</li>
- <li><b>long</b>: <arg>_rValue</arg> was interpreted as 64 bit integer value before
- converting it into a string</li>
- <li><b>double</b>: <arg>_rValue</arg> was interpreted as 64 bit floating point value before
- converting it into a string</li>
- <li><b>string</b>: <arg>_rValue</arg> did not need any conversion as it already was a string</li>
- </ul>
- If the type is not convertable, an empty string is returned
- */
- ::rtl::OUString implGetPropertyXMLType(const ::com::sun::star::uno::Type& _rType);
-
-#ifdef DBG_UTIL
- void AddAttribute(sal_uInt16 _nPrefix, const sal_Char* _pName, const ::rtl::OUString& _rValue);
- void AddAttributeASCII( sal_uInt16 nPrefix, const sal_Char *pName, const sal_Char *pValue );
-#else
- // in the product version, inline this, so it does not cost us extra time calling into our method
- inline void AddAttribute(sal_uInt16 _nPrefix, const sal_Char* _pName, const ::rtl::OUString& _rValue)
- { m_rContext.getGlobalContext().AddAttribute(_nPrefix, _pName, _rValue); }
- inline void AddAttributeASCII( sal_uInt16 _nPrefix, const sal_Char* _pName, const sal_Char *pValue )
- { m_rContext.getGlobalContext().AddAttributeASCII(_nPrefix, _pName, pValue); }
-#endif
-
-#ifdef DBG_UTIL
- protected:
- /** check a given property set for the existence and type correctness of a given property
-
- <p>This method is available in the non-product version only.</p>
-
- @param _rPropertyName
- the name of the property to ask the control model for
- @param _pType
- the expected type of the property. May be NULL, in this case no type check is made.
- @return sal_True, if the property exists and is of the correct type
- */
- void dbg_implCheckProperty(
- const ::rtl::OUString& _rPropertyName,
- const ::com::sun::star::uno::Type* _pType);
-
-// void dbg_implCheckProperty(
-// const sal_Char* _rPropertyName,
-// const ::com::sun::star::uno::Type* _pType)
-// {
-// dbg_implCheckProperty(::rtl::OUString::createFromAscii(_rPropertyName), _pType);
-// }
-#endif
- };
-
- //=====================================================================
- //= helper
- //=====================================================================
-#ifdef DBG_UTIL
- #define DBG_CHECK_PROPERTY(name, type) \
- dbg_implCheckProperty(name, &::getCppuType(static_cast< type* >(NULL)))
-
- #define DBG_CHECK_PROPERTY_NO_TYPE(name) \
- dbg_implCheckProperty(name, NULL)
-
- #define DBG_CHECK_PROPERTY_ASCII( name, type ) \
- dbg_implCheckProperty( ::rtl::OUString::createFromAscii( name ), &::getCppuType(static_cast< type* >(NULL)))
-
- #define DBG_CHECK_PROPERTY_ASCII_NO_TYPE( name ) \
- dbg_implCheckProperty( ::rtl::OUString::createFromAscii( name ), NULL )
-#else
- #define DBG_CHECK_PROPERTY(name, type)
- #define DBG_CHECK_PROPERTY_NO_TYPE(name)
- #define DBG_CHECK_PROPERTY_ASCII_NO_TYPE( name )
-#endif
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMS_PROPERTYEXPORT_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/propertyimport.hxx b/binfilter/bf_xmloff/source/forms/propertyimport.hxx
deleted file mode 100644
index 80d15d7d9407..000000000000
--- a/binfilter/bf_xmloff/source/forms/propertyimport.hxx
+++ /dev/null
@@ -1,236 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMS_PROPERTYIMPORT_HXX_
-#define _XMLOFF_FORMS_PROPERTYIMPORT_HXX_
-
-#include "xmlictxt.hxx"
-#include "formattributes.hxx"
-#include <rtl/ref.hxx>
-
-#include <comphelper/stl_types.hxx>
-#include <com/sun/star/beans/PropertyValue.hpp>
-namespace com { namespace sun { namespace star { namespace util {
- struct Time;
- struct Date;
-} } } }
-
-namespace binfilter {
-
-
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- class IFormsImportContext;
- //=====================================================================
- //= OPropertyImport
- //=====================================================================
- /** Helper class for importing property values
-
- <p>This class imports properties which are stored as attributes as well as properties which
- are stored in </em>&lt;form:properties&gt;</em> elements.</p>
- */
- class OPropertyImport : public SvXMLImportContext
- {
- friend class OSinglePropertyContext;
-
- protected:
- DECLARE_STL_VECTOR( ::com::sun::star::beans::PropertyValue, PropertyValueArray );
- PropertyValueArray m_aValues;
- // the values which the instance collects between StartElement and EndElement
-
- DECLARE_STL_STDKEY_SET( ::rtl::OUString, StringSet );
- StringSet m_aEncounteredAttributes;
-
- IFormsImportContext& m_rContext;
-
- sal_Bool m_bTrackAttributes;
-
- // TODO: think about the restriction that the class does not know anything about the object it is importing.
- // Perhaps this object should be known to the class, so setting the properties ('normal' ones as well as
- // style properties) can be done in our own EndElement instead of letting derived classes do this.
-
- public:
- OPropertyImport(IFormsImportContext& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName);
-
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
- virtual void Characters(const ::rtl::OUString& _rChars);
-
- protected:
- /** handle one single attribute.
-
- <p>This is called for every attribute of the element. This class' implementaion checks if the attribute
- describes a property, if so, it is added to <member>m_aValues</member>.</p>
-
- <p>All non-property attributes should be handled in derived classes.</p>
-
- @param _nNamespaceKey
- key of the namespace used in the attribute
- @param _rLocalName
- local (relative to the namespace) attribute name
- @param _rValue
- attribute value
- */
- virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
- const ::rtl::OUString& _rLocalName,
- const ::rtl::OUString& _rValue);
-
- /** determine if the element imported by the object had an given attribute.
- <p>Please be aware of the fact that the name given must be a local name, i.e. not contain a namespace.
- All form relevant attributes are in the same namespace, so this would be an redundant information.</p>
- */
- sal_Bool encounteredAttribute(const ::rtl::OUString& _rAttributeName) const;
-
- /** determine if the element imported by the object had an given attribute.
- <p>Please be aware of the fact that the name given must be a local name, i.e. not contain a namespace.
- All form relevant attributes are in the same namespace, so this would be an redundant information.</p>
- */
- sal_Bool encounteredAttribute(const sal_Char* _pAttributeName) const { return encounteredAttribute(::rtl::OUString::createFromAscii(_pAttributeName)); }
-
- /** enables the tracking of the encountered attributes
- <p>The tracking will raise the import costs a little but, but it's cheaper than
- derived classes tracking this themself.</p>
- */
- void enableTrackAttributes() { m_bTrackAttributes = sal_True; }
-
- void implPushBackPropertyValue(const ::com::sun::star::beans::PropertyValue& _rProp)
- { m_aValues.push_back(_rProp); }
-
- static ::com::sun::star::uno::Any convertString(
- SvXMLImport& _rImporter,
- const ::com::sun::star::uno::Type& _rExpectedType,
- const ::rtl::OUString& _rReadCharacters,
- const SvXMLEnumMapEntry* _pEnumMap = NULL,
- const sal_Bool _bInvertBoolean = sal_False
- );
-
- private:
- static ::com::sun::star::util::Time implGetTime(double _nValue);
- static ::com::sun::star::util::Date implGetDate(double _nValue);
- };
- SV_DECL_IMPL_REF( OPropertyImport )
-
- //=====================================================================
- //= OPropertyElementsContext
- //=====================================================================
- /** helper class for importing the &lt;form:properties&gt; element
- */
- class OPropertyElementsContext : public SvXMLImportContext
- {
- protected:
- OPropertyImportRef m_xPropertyImporter; // to add the properties
-
- public:
- OPropertyElementsContext(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const OPropertyImportRef& _rPropertyImporter);
-
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
-
-#if OSL_DEBUG_LEVEL > 0
- virtual void StartElement(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
- virtual void Characters(const ::rtl::OUString& _rChars);
-#endif
- };
-
- //=====================================================================
- //= OSinglePropertyContext
- //=====================================================================
- SV_DECL_REF( OAccumulateCharacters )
- /** helper class for importing a single &lt;form:property&gt; element
- */
- class OSinglePropertyContext : public SvXMLImportContext
- {
- OPropertyImportRef m_xPropertyImporter; // to add the properties
- OAccumulateCharactersRef m_xValueReader; // the class reading the characters
- ::com::sun::star::beans::PropertyValue
- m_aPropValue; // the property the instance imports currently
- ::com::sun::star::uno::Type m_aPropType; // the type of the property the instance imports currently
-
- public:
- OSinglePropertyContext(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const OPropertyImportRef& _rPropertyImporter);
-
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
-#if OSL_DEBUG_LEVEL > 0
- virtual void Characters(const ::rtl::OUString& _rChars);
-#endif
- virtual void EndElement();
- };
-
- //=====================================================================
- //= OAccumulateCharacters
- //=====================================================================
- /** helper class which accumulates the characters it gets
- */
- class OAccumulateCharacters : public SvXMLImportContext
- {
- protected:
- ::rtl::OUString m_sCharacters;
- sal_Bool m_bPropertyIsVoid; //added by BerryJia for Bug102407
-
- public:
- OAccumulateCharacters(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName);
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
-
- // SvXMLImportContext overridables
- virtual void Characters(const ::rtl::OUString& _rChars);
-
- //added by BerryJia for Bug102407
- sal_Bool isVoid();
-
- ::rtl::OUString getCharacters() const { return m_sCharacters; }
- };
- SV_IMPL_REF( OAccumulateCharacters )
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMS_PROPERTYIMPORT_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/strings.hxx b/binfilter/bf_xmloff/source/forms/strings.hxx
deleted file mode 100644
index 2dfd17f7411e..000000000000
--- a/binfilter/bf_xmloff/source/forms/strings.hxx
+++ /dev/null
@@ -1,264 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMS_STRINGS_HXX_
-#define _XMLOFF_FORMS_STRINGS_HXX_
-
-#include <sal/types.h>
-#include <rtl/ustring.hxx>
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- //============================================================
- //= a helper for static ascii pseudo-unicode strings
- //============================================================
- struct ConstAsciiString
- {
- const sal_Char* ascii;
- sal_Int32 length;
-
- inline const ::rtl::OUString* operator& () const;
- inline operator const ::rtl::OUString& () const { return *(&(*this)); }
- inline operator const sal_Char* () const { return ascii; }
-
- inline ConstAsciiString(const sal_Char* _pAsciiZeroTerminated, const sal_Int32 _nLength);
- inline ~ConstAsciiString();
-
- private:
- mutable ::rtl::OUString* m_pString;
-
- private:
- ConstAsciiString(); // never implemented
- };
-
- //------------------------------------------------------------
- inline ConstAsciiString::ConstAsciiString(const sal_Char* _pAsciiZeroTerminated, const sal_Int32 _nLength)
- :ascii( _pAsciiZeroTerminated )
- ,length( _nLength )
- ,m_pString( NULL )
- {
- }
-
- //------------------------------------------------------------
- inline ConstAsciiString::~ConstAsciiString()
- {
- if ( m_pString )
- {
- delete m_pString;
- m_pString = NULL;
- }
- }
-
- //------------------------------------------------------------
- inline const ::rtl::OUString* ConstAsciiString::operator& () const
- {
- if ( !m_pString )
- m_pString = new ::rtl::OUString( ascii, length, RTL_TEXTENCODING_ASCII_US );
- return m_pString;
- }
-
-#ifndef XMLFORM_IMPLEMENT_STRINGS
- #define XMLFORM_CONSTASCII_STRING(ident, string) extern const ConstAsciiString ident
-#else
- #define XMLFORM_CONSTASCII_STRING(ident, string) extern const ConstAsciiString ident(string, sizeof(string)-1)
-#endif
-
- //============================================================
- //= string constants
- //============================================================
-
- // properties
- XMLFORM_CONSTASCII_STRING( PROPERTY_CLASSID, "ClassId" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_ECHOCHAR, "EchoChar" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_MULTILINE, "MultiLine" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_NAME, "Name" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGEURL, "ImageURL" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_LABEL, "Label" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_TARGETFRAME, "TargetFrame" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_TARGETURL, "TargetURL" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_TITLE, "Tag" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_DROPDOWN, "Dropdown" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_PRINTABLE, "Printable" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_READONLY, "ReadOnly" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_DEFAULT_STATE, "DefaultState" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_TABSTOP, "Tabstop" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_STATE, "State" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_ENABLED, "Enabled" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_MAXTEXTLENGTH, "MaxTextLen" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_LINECOUNT, "LineCount" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_TABINDEX, "TabIndex" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_COMMAND, "Command" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_DATASOURCENAME, "DataSourceName" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_FILTER, "Filter" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_ORDER, "Order" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_ALLOWDELETES, "AllowDeletes" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_ALLOWINSERTS, "AllowInserts" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_ALLOWUPDATES, "AllowUpdates" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_APPLYFILTER, "ApplyFilter" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_ESCAPEPROCESSING, "EscapeProcessing" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_IGNORERESULT, "IgnoreResult" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_SUBMIT_ENCODING, "SubmitEncoding" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_SUBMIT_METHOD, "SubmitMethod" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_COMMAND_TYPE, "CommandType" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_NAVIGATION, "NavigationBarMode" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_CYCLE, "Cycle" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_BUTTONTYPE, "ButtonType" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_DATAFIELD, "DataField" );
- XMLFORM_CONSTASCII_STRING( PROPERTY_BOUNDCOLUMN, "BoundColumn");
- XMLFORM_CONSTASCII_STRING( PROPERTY_EMPTY_IS_NULL, "ConvertEmptyToNull");
- XMLFORM_CONSTASCII_STRING( PROPERTY_LISTSOURCE, "ListSource");
- XMLFORM_CONSTASCII_STRING( PROPERTY_LISTSOURCETYPE, "ListSourceType");
- XMLFORM_CONSTASCII_STRING( PROPERTY_ECHO_CHAR, "EchoChar");
- XMLFORM_CONSTASCII_STRING( PROPERTY_STRICTFORMAT, "StrictFormat");
- XMLFORM_CONSTASCII_STRING( PROPERTY_AUTOCOMPLETE, "Autocomplete");
- XMLFORM_CONSTASCII_STRING( PROPERTY_MULTISELECTION, "MultiSelection");
- XMLFORM_CONSTASCII_STRING( PROPERTY_DEFAULTBUTTON, "DefaultButton");
- XMLFORM_CONSTASCII_STRING( PROPERTY_TRISTATE, "TriState");
- XMLFORM_CONSTASCII_STRING( PROPERTY_CONTROLLABEL, "LabelControl");
- XMLFORM_CONSTASCII_STRING( PROPERTY_STRING_ITEM_LIST, "StringItemList");
- XMLFORM_CONSTASCII_STRING( PROPERTY_VALUE_SEQ, "ValueItemList");
- XMLFORM_CONSTASCII_STRING( PROPERTY_DEFAULT_SELECT_SEQ, "DefaultSelection");
- XMLFORM_CONSTASCII_STRING( PROPERTY_SELECT_SEQ, "SelectedItems");
- XMLFORM_CONSTASCII_STRING( PROPERTY_DATE_MIN, "DateMin");
- XMLFORM_CONSTASCII_STRING( PROPERTY_DATE_MAX, "DateMax");
- XMLFORM_CONSTASCII_STRING( PROPERTY_TIME_MIN, "TimeMin");
- XMLFORM_CONSTASCII_STRING( PROPERTY_TIME_MAX, "TimeMax");
- XMLFORM_CONSTASCII_STRING( PROPERTY_VALUE_MIN, "ValueMin");
- XMLFORM_CONSTASCII_STRING( PROPERTY_VALUE_MAX, "ValueMax");
- XMLFORM_CONSTASCII_STRING( PROPERTY_EFFECTIVE_MIN, "EffectiveMin");
- XMLFORM_CONSTASCII_STRING( PROPERTY_EFFECTIVE_MAX, "EffectiveMax");
- XMLFORM_CONSTASCII_STRING( PROPERTY_DEFAULT_DATE, "DefaultDate");
- XMLFORM_CONSTASCII_STRING( PROPERTY_DATE, "Date");
- XMLFORM_CONSTASCII_STRING( PROPERTY_DEFAULT_TIME, "DefaultTime");
- XMLFORM_CONSTASCII_STRING( PROPERTY_TIME, "Time");
- XMLFORM_CONSTASCII_STRING( PROPERTY_DEFAULT_VALUE, "DefaultValue");
- XMLFORM_CONSTASCII_STRING( PROPERTY_VALUE, "Value");
- XMLFORM_CONSTASCII_STRING( PROPERTY_HIDDEN_VALUE, "HiddenValue");
- XMLFORM_CONSTASCII_STRING( PROPERTY_DEFAULT_TEXT, "DefaultText");
- XMLFORM_CONSTASCII_STRING( PROPERTY_TEXT, "Text");
- XMLFORM_CONSTASCII_STRING( PROPERTY_EFFECTIVE_VALUE, "EffectiveValue");
- XMLFORM_CONSTASCII_STRING( PROPERTY_EFFECTIVE_DEFAULT, "EffectiveDefault");
- XMLFORM_CONSTASCII_STRING( PROPERTY_REFVALUE, "RefValue");
- XMLFORM_CONSTASCII_STRING( PROPERTY_URL, "URL");
- XMLFORM_CONSTASCII_STRING( PROPERTY_FONT, "FontDescriptor");
- XMLFORM_CONSTASCII_STRING( PROPERTY_BACKGROUNDCOLOR, "BackgroundColor");
- XMLFORM_CONSTASCII_STRING( PROPERTY_MASTERFIELDS, "MasterFields");
- XMLFORM_CONSTASCII_STRING( PROPERTY_DETAILFIELDS, "DetailFields");
- XMLFORM_CONSTASCII_STRING( PROPERTY_COLUMNSERVICENAME, "ColumnServiceName");
- XMLFORM_CONSTASCII_STRING( PROPERTY_FORMATKEY, "FormatKey");
- XMLFORM_CONSTASCII_STRING( PROPERTY_ALIGN, "Align");
- XMLFORM_CONSTASCII_STRING( PROPERTY_BORDER, "Border");
- XMLFORM_CONSTASCII_STRING( PROPERTY_AUTOCONTROLFOCUS, "AutomaticControlFocus");
- XMLFORM_CONSTASCII_STRING( PROPERTY_APPLYDESIGNMODE, "ApplyFormDesignMode");
- XMLFORM_CONSTASCII_STRING( PROPERTY_FORMATSSUPPLIER, "FormatsSupplier");
- XMLFORM_CONSTASCII_STRING( PROPERTY_LOCALE, "Locale");
- XMLFORM_CONSTASCII_STRING( PROPERTY_FORMATSTRING, "FormatString");
- XMLFORM_CONSTASCII_STRING( PROPERTY_DATEFORMAT, "DateFormat");
- XMLFORM_CONSTASCII_STRING( PROPERTY_TIMEFORMAT, "TimeFormat");
- XMLFORM_CONSTASCII_STRING( PROPERTY_PERSISTENCE_MAXTEXTLENGTH, "PersistenceMaxTextLength");
-
- XMLFORM_CONSTASCII_STRING( PROPERTY_BOUND_CELL, "BoundCell");
- XMLFORM_CONSTASCII_STRING( PROPERTY_LIST_CELL_RANGE, "CellRange");
- XMLFORM_CONSTASCII_STRING( PROPERTY_ADDRESS, "Address");
- XMLFORM_CONSTASCII_STRING( PROPERTY_FILE_REPRESENTATION,"PersistentRepresentation");
-
- // services
- XMLFORM_CONSTASCII_STRING( SERVICE_FORMSCOLLECTION, "com.sun.star.form.Forms" );
- XMLFORM_CONSTASCII_STRING( SERVICE_NUMBERFORMATSSUPPLIER, "com.sun.star.util.NumberFormatsSupplier" );
- XMLFORM_CONSTASCII_STRING( SERVICE_SPREADSHEET_DOCUMENT, "com.sun.star.sheet.SpreadsheetDocument");
- XMLFORM_CONSTASCII_STRING( SERVICE_CELLVALUEBINDING, "drafts.com.sun.star.table.CellValueBinding" );
- XMLFORM_CONSTASCII_STRING( SERVICE_LISTINDEXCELLBINDING, "drafts.com.sun.star.table.ListPositionCellBinding" );
- XMLFORM_CONSTASCII_STRING( SERVICE_CELLRANGELISTSOURCE, "drafts.com.sun.star.table.CellRangeListSource" );
- XMLFORM_CONSTASCII_STRING( SERVICE_ADDRESS_CONVERSION, "com.sun.star.table.CellAddressConversion");
- XMLFORM_CONSTASCII_STRING( SERVICE_RANGEADDRESS_CONVERSION, "com.sun.star.table.CellRangeAddressConversion");
-
- // old service names (compatibility)
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_FORM, "stardiv.one.form.component.Form");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_EDIT, "stardiv.one.form.component.Edit");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_LISTBOX, "stardiv.one.form.component.ListBox");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_COMBOBOX, "stardiv.one.form.component.ComboBox");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_RADIOBUTTON, "stardiv.one.form.component.RadioButton");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_GROUPBOX, "stardiv.one.form.component.GroupBox");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_FIXEDTEXT, "stardiv.one.form.component.FixedText");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_COMMANDBUTTON, "stardiv.one.form.component.CommandButton");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_CHECKBOX, "stardiv.one.form.component.CheckBox");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_GRID, "stardiv.one.form.component.Grid");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_IMAGEBUTTON, "stardiv.one.form.component.ImageButton");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_FILECONTROL, "stardiv.one.form.component.FileControl");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_TIMEFIELD, "stardiv.one.form.component.TimeField");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_DATEFIELD, "stardiv.one.form.component.DateField");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_NUMERICFIELD, "stardiv.one.form.component.NumericField");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_CURRENCYFIELD, "stardiv.one.form.component.CurrencyField");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_PATTERNFIELD, "stardiv.one.form.component.PatternField");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_HIDDENCONTROL, "stardiv.one.form.component.Hidden");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_IMAGECONTROL, "stardiv.one.form.component.ImageControl");
- XMLFORM_CONSTASCII_STRING( SERVICE_PERSISTENT_COMPONENT_FORMATTEDFIELD, "stardiv.one.form.component.FormattedField");
-
- // new service names, the old ones are translated into this new ones
- XMLFORM_CONSTASCII_STRING( SERVICE_FORM, "com.sun.star.form.component.Form");
- XMLFORM_CONSTASCII_STRING( SERVICE_EDIT, "com.sun.star.form.component.TextField");
- XMLFORM_CONSTASCII_STRING( SERVICE_LISTBOX, "com.sun.star.form.component.ListBox");
- XMLFORM_CONSTASCII_STRING( SERVICE_COMBOBOX, "com.sun.star.form.component.ComboBox");
- XMLFORM_CONSTASCII_STRING( SERVICE_RADIOBUTTON, "com.sun.star.form.component.RadioButton");
- XMLFORM_CONSTASCII_STRING( SERVICE_GROUPBOX, "com.sun.star.form.component.GroupBox");
- XMLFORM_CONSTASCII_STRING( SERVICE_FIXEDTEXT, "com.sun.star.form.component.FixedText");
- XMLFORM_CONSTASCII_STRING( SERVICE_COMMANDBUTTON, "com.sun.star.form.component.CommandButton");
- XMLFORM_CONSTASCII_STRING( SERVICE_CHECKBOX, "com.sun.star.form.component.CheckBox");
- XMLFORM_CONSTASCII_STRING( SERVICE_GRID, "com.sun.star.form.component.GridControl");
- XMLFORM_CONSTASCII_STRING( SERVICE_IMAGEBUTTON, "com.sun.star.form.component.ImageButton");
- XMLFORM_CONSTASCII_STRING( SERVICE_FILECONTROL, "com.sun.star.form.component.FileControl");
- XMLFORM_CONSTASCII_STRING( SERVICE_TIMEFIELD, "com.sun.star.form.component.TimeField");
- XMLFORM_CONSTASCII_STRING( SERVICE_DATEFIELD, "com.sun.star.form.component.DateField");
- XMLFORM_CONSTASCII_STRING( SERVICE_NUMERICFIELD, "com.sun.star.form.component.NumericField");
- XMLFORM_CONSTASCII_STRING( SERVICE_CURRENCYFIELD, "com.sun.star.form.component.CurrencyField");
- XMLFORM_CONSTASCII_STRING( SERVICE_PATTERNFIELD, "com.sun.star.form.component.PatternField");
- XMLFORM_CONSTASCII_STRING( SERVICE_HIDDENCONTROL, "com.sun.star.form.component.HiddenControl");
- XMLFORM_CONSTASCII_STRING( SERVICE_IMAGECONTROL, "com.sun.star.form.component.DatabaseImageControl");
- XMLFORM_CONSTASCII_STRING( SERVICE_FORMATTEDFIELD, "com.sun.star.form.component.FormattedField" );
-
- // various strings
- XMLFORM_CONSTASCII_STRING( EVENT_NAME_SEPARATOR, "::" );
- XMLFORM_CONSTASCII_STRING( EVENT_TYPE, "EventType" );
- XMLFORM_CONSTASCII_STRING( EVENT_LIBRARY, "Library" );
- XMLFORM_CONSTASCII_STRING( EVENT_LOCALMACRONAME, "MacroName" );
- XMLFORM_CONSTASCII_STRING( EVENT_STAROFFICE, "StarOffice" );
- XMLFORM_CONSTASCII_STRING( EVENT_STARBASIC, "StarBasic" );
- XMLFORM_CONSTASCII_STRING( EVENT_APPLICATION, "application" );
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMS_STRINGS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/valueproperties.hxx b/binfilter/bf_xmloff/source/forms/valueproperties.hxx
deleted file mode 100644
index c75ac13b0a09..000000000000
--- a/binfilter/bf_xmloff/source/forms/valueproperties.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMS_VALUEPROPERTIES_HXX_
-#define _XMLOFF_FORMS_VALUEPROPERTIES_HXX_
-
-#include "controlelement.hxx"
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- //=====================================================================
- //= OValuePropertiesMetaData
- //=====================================================================
- class OValuePropertiesMetaData
- {
- protected:
- OValuePropertiesMetaData() { }
-
- public:
- /** calculate the property names for the <em>current-value</em> and the <em>value</em> attribute.
-
- <p>If controls of the given FormComponentType do not have any of the properties requested,
- the respective out parameter will be set to NULL.</p>
- */
- static void getValuePropertyNames(
- OControlElement::ElementType _eType,
- sal_Int16 _nFormComponentType,
- sal_Char const * & _rpCurrentValuePropertyName,
- sal_Char const * & _rpValuePropertyName);
-
- /** calculate the property names for the <em>min-value</em> and the <em>max-value</em> attribute.
-
- <p>If controls of the given FormComponentType do not have any of the properties requested,
- the respective out parameter will be set to NULL.</p>
- */
- static void getValueLimitPropertyNames(
- sal_Int16 _nFormComponentType,
- sal_Char const * & _rpMinValuePropertyName,
- sal_Char const * & _rpMaxValuePropertyName);
-
- /** calculate the names of the properties which, at runtime, are used for <em>value</em> and
- <em>default value</em>.
- */
- static void getRuntimeValuePropertyNames(
- OControlElement::ElementType _eType,
- sal_Int16 _nFormComponentType,
- sal_Char const * & _rpValuePropertyName,
- sal_Char const * & _rpDefaultValuePropertyName);
- };
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FORMS_VALUEPROPERTIES_HXX_
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_attriblistmerge.cxx b/binfilter/bf_xmloff/source/forms/xmloff_attriblistmerge.cxx
deleted file mode 100644
index e203a76c99e2..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_attriblistmerge.cxx
+++ /dev/null
@@ -1,174 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "attriblistmerge.hxx"
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::xml;
-
- //=====================================================================
- //= OAttribListMerger
- //=====================================================================
- //---------------------------------------------------------------------
- void OAttribListMerger::addList(const Reference< sax::XAttributeList >& _rxList)
- {
- OSL_ENSURE(_rxList.is(), "OAttribListMerger::addList: invalid list!");
- if (_rxList.is())
- m_aLists.push_back(_rxList);
- }
-
- //---------------------------------------------------------------------
- sal_Bool OAttribListMerger::seekToIndex(sal_Int16 _nGlobalIndex, Reference< sax::XAttributeList >& _rSubList, sal_Int16& _rLocalIndex)
- {
- sal_Int16 nLeftOver = _nGlobalIndex;
- ConstAttributeListArrayIterator aLookupSublist;
-
- for ( aLookupSublist = m_aLists.begin();
- (aLookupSublist != m_aLists.end()) && (nLeftOver >= (*aLookupSublist)->getLength());
- ++aLookupSublist
- )
- nLeftOver -= (*aLookupSublist)->getLength();
-
- if (aLookupSublist == m_aLists.end())
- {
- OSL_ENSURE(sal_False, "OAttribListMerger::seekToIndex: invalid index!");
- return sal_False;
- }
- _rSubList = *aLookupSublist;
- _rLocalIndex = nLeftOver;
- return sal_True;
- }
-
- //---------------------------------------------------------------------
- sal_Bool OAttribListMerger::seekToName(const ::rtl::OUString& _rName, Reference< sax::XAttributeList >& _rSubList, sal_Int16& _rLocalIndex)
- {
- for ( ConstAttributeListArrayIterator aLookupSublist = m_aLists.begin();
- aLookupSublist != m_aLists.end();
- ++aLookupSublist
- )
- for (sal_Int16 i=0; i<(*aLookupSublist)->getLength(); ++i)
- if ((*aLookupSublist)->getNameByIndex(i) == _rName)
- {
- _rSubList = *aLookupSublist;
- _rLocalIndex = i;
- return sal_True;
- }
-
- OSL_ENSURE(sal_False, "OAttribListMerger::seekToName: did not find the name!");
- return sal_False;
- }
-
- //---------------------------------------------------------------------
- sal_Int16 SAL_CALL OAttribListMerger::getLength( ) throw(RuntimeException)
- {
- sal_Int16 nCount = 0;
- for ( ConstAttributeListArrayIterator aAccumulate = m_aLists.begin();
- aAccumulate != m_aLists.end();
- ++aAccumulate
- )
- nCount += (*aAccumulate)->getLength();
- return nCount;
- }
-
- //---------------------------------------------------------------------
- ::rtl::OUString SAL_CALL OAttribListMerger::getNameByIndex( sal_Int16 i ) throw(RuntimeException)
- {
- Reference< sax::XAttributeList > xSubList;
- sal_Int16 nLocalIndex;
-
- if (!seekToIndex(i, xSubList, nLocalIndex))
- return ::rtl::OUString();
-
- return xSubList->getNameByIndex(nLocalIndex);
- }
-
- //---------------------------------------------------------------------
- ::rtl::OUString SAL_CALL OAttribListMerger::getTypeByIndex( sal_Int16 i ) throw(RuntimeException)
- {
- Reference< sax::XAttributeList > xSubList;
- sal_Int16 nLocalIndex;
-
- if (!seekToIndex(i, xSubList, nLocalIndex))
- return ::rtl::OUString();
-
- return xSubList->getTypeByIndex(nLocalIndex);
- }
-
- //---------------------------------------------------------------------
- ::rtl::OUString SAL_CALL OAttribListMerger::getTypeByName( const ::rtl::OUString& _rName ) throw(RuntimeException)
- {
- Reference< sax::XAttributeList > xSubList;
- sal_Int16 nLocalIndex;
-
- if (!seekToName(_rName, xSubList, nLocalIndex))
- return ::rtl::OUString();
-
- // though we're in getTypeByName here, we reroute this to the getTypeByIndex of the sub list,
- // assuming that this is faster
- return xSubList->getTypeByIndex(nLocalIndex);
- }
-
- //---------------------------------------------------------------------
- ::rtl::OUString SAL_CALL OAttribListMerger::getValueByIndex( sal_Int16 i ) throw(RuntimeException)
- {
- Reference< sax::XAttributeList > xSubList;
- sal_Int16 nLocalIndex;
-
- if (!seekToIndex(i, xSubList, nLocalIndex))
- return ::rtl::OUString();
-
- return xSubList->getValueByIndex(nLocalIndex);
- }
-
- //---------------------------------------------------------------------
- ::rtl::OUString SAL_CALL OAttribListMerger::getValueByName( const ::rtl::OUString& _rName ) throw(RuntimeException)
- {
- Reference< sax::XAttributeList > xSubList;
- sal_Int16 nLocalIndex;
-
- if (!seekToName(_rName, xSubList, nLocalIndex))
- return ::rtl::OUString();
-
- // though we're in getValueByName here, we reroute this to the getValueByIndex of the sub list,
- // assuming that this is faster
- return xSubList->getValueByIndex(nLocalIndex);
- }
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_controlelement.cxx b/binfilter/bf_xmloff/source/forms/xmloff_controlelement.cxx
deleted file mode 100644
index a21a14054b66..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_controlelement.cxx
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "controlelement.hxx"
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- //=====================================================================
- //= OControlElement
- //=====================================================================
- //---------------------------------------------------------------------
- const sal_Char* OControlElement::getElementName(ElementType _eType)
- {
- switch (_eType)
- {
- case TEXT: return "text";
- case TEXT_AREA: return "textarea";
- case PASSWORD: return "password";
- case FILE: return "file";
- case FORMATTED_TEXT: return "formatted-text";
- case FIXED_TEXT: return "fixed-text";
- case COMBOBOX: return "combobox";
- case LISTBOX: return "listbox";
- case BUTTON: return "button";
- case IMAGE: return "image";
- case CHECKBOX: return "checkbox";
- case RADIO: return "radio";
- case FRAME: return "frame";
- case IMAGE_FRAME: return "image-frame";
- case HIDDEN: return "hidden";
- case GRID: return "grid";
-
- default: return "generic-control";
- }
- }
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_controlpropertyhdl.cxx b/binfilter/bf_xmloff/source/forms/xmloff_controlpropertyhdl.cxx
deleted file mode 100644
index 201ff61996d6..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_controlpropertyhdl.cxx
+++ /dev/null
@@ -1,329 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "controlpropertyhdl.hxx"
-#include <com/sun/star/awt/FontEmphasisMark.hpp>
-#include "formenums.hxx"
-#include "xmluconv.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <osl/diagnose.h>
-#include "XMLConstantsPropertyHandler.hxx"
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::awt;
- using namespace ::com::sun::star::beans;
- using namespace ::binfilter::xmloff::token;
-
- //=====================================================================
- //= OControlPropertyHandlerFactory
- //=====================================================================
- //---------------------------------------------------------------------
- OControlPropertyHandlerFactory::OControlPropertyHandlerFactory()
- :m_pTextAlignHandler(NULL)
- ,m_pControlBorderHandler(NULL)
- ,m_pRotationAngleHandler(NULL)
- ,m_pFontWidthHandler(NULL)
- ,m_pFontEmphasisHandler(NULL)
- ,m_pFontReliefHandler(NULL)
- {
- }
-
- //---------------------------------------------------------------------
- OControlPropertyHandlerFactory::~OControlPropertyHandlerFactory()
- {
- delete m_pTextAlignHandler;
- delete m_pControlBorderHandler;
- delete m_pRotationAngleHandler;
- delete m_pFontWidthHandler;
- delete m_pFontEmphasisHandler;
- delete m_pFontReliefHandler;
- }
-
- //---------------------------------------------------------------------
- const XMLPropertyHandler* OControlPropertyHandlerFactory::GetPropertyHandler(sal_Int32 _nType) const
- {
- const XMLPropertyHandler* pHandler = NULL;
-
- switch (_nType)
- {
- case XML_TYPE_TEXT_ALIGN:
- if (!m_pTextAlignHandler)
- m_pTextAlignHandler = new XMLConstantsPropertyHandler(OEnumMapper::getEnumMap(OEnumMapper::epTextAlign), XML_TOKEN_INVALID );
- pHandler = m_pTextAlignHandler;
- break;
-
- case XML_TYPE_CONTROL_BORDER:
- if (!m_pControlBorderHandler)
- m_pControlBorderHandler = new OControlBorderHandler;
- pHandler = m_pControlBorderHandler;
- break;
-
- case XML_TYPE_ROTATION_ANGLE:
- if (!m_pRotationAngleHandler)
- m_pRotationAngleHandler = new ORotationAngleHandler;
- pHandler = m_pRotationAngleHandler;
- break;
-
- case XML_TYPE_FONT_WIDTH:
- if (!m_pFontWidthHandler)
- m_pFontWidthHandler = new OFontWidthHandler;
- pHandler = m_pFontWidthHandler;
- break;
-
- case XML_TYPE_CONTROL_TEXT_EMPHASIZE:
- if (!m_pFontEmphasisHandler)
- m_pFontEmphasisHandler = new XMLConstantsPropertyHandler( OEnumMapper::getEnumMap(OEnumMapper::epFontEmphasis), XML_NONE );
- pHandler = m_pFontEmphasisHandler;
- break;
-
- case XML_TYPE_TEXT_FONT_RELIEF:
- if (!m_pFontReliefHandler)
- m_pFontReliefHandler = new XMLConstantsPropertyHandler( OEnumMapper::getEnumMap(OEnumMapper::epFontRelief), XML_NONE );
- pHandler = m_pFontReliefHandler;
- break;
- }
-
- if (!pHandler)
- pHandler = XMLPropertyHandlerFactory::GetPropertyHandler(_nType);
- return pHandler;
- }
-
- //=====================================================================
- //= OControlTextEmphasisHandler
- //=====================================================================
- OControlTextEmphasisHandler::OControlTextEmphasisHandler()
- {
- }
-
- //---------------------------------------------------------------------
- sal_Bool OControlTextEmphasisHandler::exportXML( ::rtl::OUString& _rStrExpValue, const Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const
- {
- ::rtl::OUStringBuffer aReturn;
- sal_Bool bSuccess = sal_False;
- sal_Int16 nFontEmphasis;
- if (_rValue >>= nFontEmphasis)
- {
- // the type
- sal_Int16 nType = nFontEmphasis & ~(FontEmphasisMark::ABOVE | FontEmphasisMark::BELOW);
- // the position of the mark
- sal_Bool bBelow = 0 != (nFontEmphasis & FontEmphasisMark::BELOW);
-
- // convert
- if (bSuccess = _rUnitConverter.convertEnum(aReturn, nType, OEnumMapper::getEnumMap(OEnumMapper::epFontEmphasis), XML_NONE))
- {
- aReturn.append( (sal_Unicode)' ' );
- aReturn.append( GetXMLToken(bBelow ? XML_BELOW : XML_ABOVE) );
-
- _rStrExpValue = aReturn.makeStringAndClear();
- }
- }
-
- return bSuccess;
- }
-
- //---------------------------------------------------------------------
- sal_Bool OControlTextEmphasisHandler::importXML( const ::rtl::OUString& _rStrImpValue, Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const
- {
- sal_Bool bSuccess = sal_True;
- sal_uInt16 nEmphasis = FontEmphasisMark::NONE;
-
- sal_Bool bBelow = sal_False;
- sal_Bool bHasPos = sal_False, bHasType = sal_False;
-
- ::rtl::OUString sToken;
- SvXMLTokenEnumerator aTokenEnum(_rStrImpValue);
- while (aTokenEnum.getNextToken(sToken))
- {
- if (!bHasPos)
- {
- if (IsXMLToken(sToken, XML_ABOVE))
- {
- bBelow = sal_False;
- bHasPos = sal_True;
- }
- else if (IsXMLToken(sToken, XML_BELOW))
- {
- bBelow = sal_True;
- bHasPos = sal_True;
- }
- }
- if (!bHasType)
- {
- if (_rUnitConverter.convertEnum(nEmphasis, sToken, OEnumMapper::getEnumMap(OEnumMapper::epFontEmphasis)))
- {
- bHasType = sal_True;
- }
- else
- {
- bSuccess = sal_False;
- break;
- }
- }
- }
-
- if (bSuccess)
- {
- nEmphasis |= bBelow ? FontEmphasisMark::BELOW : FontEmphasisMark::ABOVE;
- _rValue <<= (sal_Int16)nEmphasis;
- }
-
- return bSuccess;
- }
-
- //=====================================================================
- //= OControlBorderHandler
- //=====================================================================
- //---------------------------------------------------------------------
- OControlBorderHandler::OControlBorderHandler()
- {
- }
-
- //---------------------------------------------------------------------
- sal_Bool OControlBorderHandler::importXML( const ::rtl::OUString& _rStrImpValue, Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const
- {
- ::rtl::OUString sToken;
- SvXMLTokenEnumerator aTokens(_rStrImpValue);
-
- sal_uInt16 nConvertedStyle = (sal_uInt16)-1;
-
- sal_Bool bConversionSuccess = sal_False;
- while ( !bConversionSuccess // could not interpret the previous token (ignored it)
- && aTokens.getNextToken(sToken) // have a new token
- && (0 != sToken.getLength()) // really have a new token
- )
- {
- bConversionSuccess = _rUnitConverter.convertEnum(nConvertedStyle, sToken, OEnumMapper::getEnumMap(OEnumMapper::epBorderWidth));
- }
-
- if (!bConversionSuccess)
- return sal_False;
-
- // if we're here, the string could have had more or less than the requested 3 tokens, but we ignore this.
- // At least we have a valid style, which is everything we're interested in.
- _rValue <<= (sal_Int16)nConvertedStyle;
- return sal_True;
- }
-
- //---------------------------------------------------------------------
- sal_Bool OControlBorderHandler::exportXML( ::rtl::OUString& _rStrExpValue, const Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const
- {
- sal_Bool bSuccess = sal_False;
- sal_Int16 nBorder = 0;
-
- ::rtl::OUStringBuffer aOut;
- bSuccess = (_rValue >>= nBorder)
- && _rUnitConverter.convertEnum(aOut, nBorder, OEnumMapper::getEnumMap(OEnumMapper::epBorderWidth));
-
- _rStrExpValue = aOut.makeStringAndClear();
- return bSuccess;
- }
-
- //=====================================================================
- //= OFontWidthHandler
- //=====================================================================
- //---------------------------------------------------------------------
- OFontWidthHandler::OFontWidthHandler()
- {
- }
-
- //---------------------------------------------------------------------
- sal_Bool OFontWidthHandler::importXML( const ::rtl::OUString& _rStrImpValue, Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const
- {
- sal_Bool bSuccess = sal_False;
-
- sal_Int32 nWidth = 0;
- if (bSuccess = _rUnitConverter.convertMeasure(nWidth, _rStrImpValue, MAP_POINT))
- _rValue <<= (sal_Int16)nWidth;
-
- return bSuccess;
- }
-
- //---------------------------------------------------------------------
- sal_Bool OFontWidthHandler::exportXML( ::rtl::OUString& _rStrExpValue, const Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const
- {
- sal_Int16 nWidth = 0;
- ::rtl::OUStringBuffer aResult;
- if (_rValue >>= nWidth)
- _rUnitConverter.convertMeasure(aResult, nWidth, MAP_POINT, MAP_POINT);
- _rStrExpValue = aResult.makeStringAndClear();
-
- return _rStrExpValue.getLength() != 0;
- }
-
- //=====================================================================
- //= ORotationAngleHandler
- //=====================================================================
- //---------------------------------------------------------------------
- ORotationAngleHandler::ORotationAngleHandler()
- {
- }
-
- //---------------------------------------------------------------------
- sal_Bool ORotationAngleHandler::importXML( const ::rtl::OUString& _rStrImpValue, Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const
- {
- sal_Bool bSucces = sal_False;
-
- double fValue;
- if (bSucces = _rUnitConverter.convertDouble(fValue, _rStrImpValue))
- {
- fValue *= 10;
- _rValue <<= (float)fValue;
- }
-
- return bSucces;
- }
-
- //---------------------------------------------------------------------
- sal_Bool ORotationAngleHandler::exportXML( ::rtl::OUString& _rStrExpValue, const Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const
- {
- float fAngle;
- sal_Bool bSuccess = sal_False;
-
- if (bSuccess = (_rValue >>= fAngle))
- {
- ::rtl::OUStringBuffer sValue;
- _rUnitConverter.convertDouble(sValue, ((double)fAngle) / 10);
- _rStrExpValue = sValue.makeStringAndClear();
- }
-
- return bSuccess;
- }
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_controlpropertymap.cxx b/binfilter/bf_xmloff/source/forms/xmloff_controlpropertymap.cxx
deleted file mode 100644
index e61ee13ead50..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_controlpropertymap.cxx
+++ /dev/null
@@ -1,149 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "xmlnmspe.hxx"
-#ifndef __SGI_STL_ALGORITHM
-#include <algorithm>
-#endif
-
-#include "strings.hxx"
-#include "contextid.hxx"
-
-#include "controlpropertymap.hxx"
-
-#include <string.h>
-namespace binfilter {
-
-using namespace ::binfilter::xmloff::token;
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
-#define MAP_ASCII( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type, context }
-#define MAP_CONST( name, prefix, token, type, context ) { name.ascii, name.length, prefix, token, type, context }
-#define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0 }
-
- XMLPropertyMapEntry* getControlStylePropertyMap_Access( )
- {
- static XMLPropertyMapEntry aControlStyleProperties[] =
- {
- MAP_CONST( PROPERTY_BACKGROUNDCOLOR, XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_COLOR, 0 ),
- MAP_CONST( PROPERTY_ALIGN, XML_NAMESPACE_STYLE, XML_TEXT_ALIGN, XML_TYPE_TEXT_ALIGN, 0 ),
- MAP_CONST( PROPERTY_BORDER, XML_NAMESPACE_FO, XML_BORDER, XML_TYPE_CONTROL_BORDER, 0 ),
- MAP_ASCII( "FontCharWidth", XML_NAMESPACE_STYLE, XML_FONT_CHAR_WIDTH, XML_TYPE_NUMBER16, 0 ),
- MAP_ASCII( "FontCharset", XML_NAMESPACE_STYLE, XML_FONT_CHARSET, XML_TYPE_TEXT_FONTENCODING, 0 ),
- MAP_ASCII( "FontFamily", XML_NAMESPACE_STYLE, XML_FONT_FAMILY_GENERIC, XML_TYPE_TEXT_FONTFAMILY, 0 ),
- MAP_ASCII( "FontHeight", XML_NAMESPACE_FO, XML_FONT_SIZE, XML_TYPE_CHAR_HEIGHT, 0 ),
- MAP_ASCII( "FontKerning", XML_NAMESPACE_STYLE, XML_LETTER_KERNING, XML_TYPE_BOOL, 0 ),
- MAP_ASCII( "FontName", XML_NAMESPACE_STYLE, XML_FONT_NAME, XML_TYPE_STRING, 0 ),
- MAP_ASCII( "FontOrientation", XML_NAMESPACE_STYLE, XML_ROTATION_ANGLE, XML_TYPE_ROTATION_ANGLE, 0 ),
- MAP_ASCII( "FontPitch", XML_NAMESPACE_STYLE, XML_FONT_PITCH, XML_TYPE_TEXT_FONTPITCH, 0 ),
- MAP_ASCII( "FontSlant", XML_NAMESPACE_FO, XML_FONT_STYLE, XML_TYPE_TEXT_POSTURE, 0 ),
- MAP_ASCII( "FontStrikeout", XML_NAMESPACE_STYLE, XML_TEXT_CROSSING_OUT, XML_TYPE_TEXT_CROSSEDOUT, 0 ),
- MAP_ASCII( "FontStyleName", XML_NAMESPACE_STYLE, XML_FONT_STYLE_NAME, XML_TYPE_STRING, 0 ),
- MAP_ASCII( "FontUnderline", XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE, XML_TYPE_TEXT_UNDERLINE, 0 ),
- MAP_ASCII( "FontWeight", XML_NAMESPACE_FO, XML_FONT_WEIGHT, XML_TYPE_TEXT_WEIGHT, 0 ),
- MAP_ASCII( "FontWidth", XML_NAMESPACE_STYLE, XML_FONT_WIDTH, XML_TYPE_FONT_WIDTH, 0 ),
- MAP_ASCII( "FontWordLineMode", XML_NAMESPACE_FO, XML_SCORE_SPACES, XML_TYPE_NBOOL, 0 ),
- MAP_ASCII( "TextColor", XML_NAMESPACE_FO, XML_COLOR, XML_TYPE_COLOR, 0 ),
- MAP_CONST( PROPERTY_FORMATKEY, XML_NAMESPACE_STYLE, XML_DATA_STYLE_NAME, XML_TYPE_STRING | MID_FLAG_NO_PROPERTY_EXPORT | MID_FLAG_SPECIAL_ITEM, CTF_FORMS_DATA_STYLE ),
- MAP_ASCII( "FontEmphasisMark", XML_NAMESPACE_STYLE, XML_TEXT_EMPHASIZE, XML_TYPE_CONTROL_TEXT_EMPHASIZE, 0 ),
- MAP_ASCII( "FontRelief", XML_NAMESPACE_STYLE, XML_FONT_RELIEF, XML_TYPE_TEXT_FONT_RELIEF|MID_FLAG_MULTI_PROPERTY, 0 ),
- MAP_ASCII( "TextLineColor", XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_COLOR, XML_TYPE_TEXT_UNDERLINE_COLOR|MID_FLAG_MULTI_PROPERTY, 0 ),
- MAP_END()
- };
-
- return aControlStyleProperties;
- }
-
- const XMLPropertyMapEntry* getControlStylePropertyMap( )
- {
- return getControlStylePropertyMap_Access();
- }
-
- //=====================================================================
- //---------------------------------------------------------------------
- struct XMLPropertyMapEntryLess
- {
- sal_Bool operator()(const XMLPropertyMapEntry& _rLeft, const XMLPropertyMapEntry& _rRight)
- {
- return strcmp(_rLeft.msApiName, _rRight.msApiName) < 0;
- }
- };
-
- //---------------------------------------------------------------------
- void implSortMap(XMLPropertyMapEntry* _pMap)
- {
- // determine the last element
- XMLPropertyMapEntry* pEnd;
-
- for (pEnd = _pMap; pEnd->msApiName; ++pEnd)
- ;
- ::std::sort(_pMap, pEnd, XMLPropertyMapEntryLess());
- }
-
- //---------------------------------------------------------------------
- void initializePropertyMaps()
- {
- static sal_Bool bSorted = sal_False;
- if (!bSorted)
- {
- implSortMap(getControlStylePropertyMap_Access());
- bSorted = sal_True;
- }
- }
-
- //=====================================================================
- //= OFormExportPropertyMapper
- //=====================================================================
- //---------------------------------------------------------------------
- OFormExportPropertyMapper::OFormExportPropertyMapper( const UniReference< XMLPropertySetMapper >& _rMapper )
- :SvXMLExportPropertyMapper( _rMapper )
- {
- }
-
- //---------------------------------------------------------------------
- void OFormExportPropertyMapper::handleSpecialItem( SvXMLAttributeList& _rAttrList, const XMLPropertyState& _rProperty, const SvXMLUnitConverter& _rUnitConverter,
- const SvXMLNamespaceMap& _rNamespaceMap, const ::std::vector< XMLPropertyState >* _pProperties,
- sal_uInt32 _nIdx ) const
- {
- // ignore the number style of grid columns - this is formatted elsewhere
- if ( CTF_FORMS_DATA_STYLE != getPropertySetMapper()->GetEntryContextId( _rProperty.mnIndex ) )
- SvXMLExportPropertyMapper::handleSpecialItem( _rAttrList, _rProperty, _rUnitConverter, _rNamespaceMap, _pProperties, _nIdx );
- }
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_elementexport.cxx b/binfilter/bf_xmloff/source/forms/xmloff_elementexport.cxx
deleted file mode 100644
index f227e068d9e4..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_elementexport.cxx
+++ /dev/null
@@ -1,1659 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <stdio.h>
-
-#include <sal/macros.h>
-#include <xmlexp.hxx>
-#include "elementexport.hxx"
-#include "xmluconv.hxx"
-#include <comphelper/extract.hxx>
-#include "eventexport.hxx"
-#include <com/sun/star/io/XPersistObject.hpp>
-#include <com/sun/star/form/FormComponentType.hpp>
-#include "formenums.hxx"
-#include <com/sun/star/form/FormSubmitEncoding.hpp>
-#include <com/sun/star/form/FormSubmitMethod.hpp>
-#include <com/sun/star/sdb/CommandType.hpp>
-#include <com/sun/star/form/NavigationBarMode.hpp>
-#include <com/sun/star/form/TabulatorCycle.hpp>
-#include <com/sun/star/form/FormButtonType.hpp>
-#include <com/sun/star/form/ListSourceType.hpp>
-#include <vcl/wintypes.hxx> // for check states
-#include "XMLEventExport.hxx"
-#include <xmlnmspe.hxx>
-#ifndef XMLOFF_FORMS_FORMCELLBINDING
-#include "formcellbinding.hxx"
-#endif
-
-#include <drafts/com/sun/star/form/XListEntrySink.hpp>
-
-#include <algorithm>
-namespace binfilter {
-
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::sdb;
- using namespace ::com::sun::star::form;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::container;
- using namespace ::com::sun::star::script;
- using namespace ::com::sun::star::io;
- using namespace ::com::sun::star::table;
- using namespace ::drafts::com::sun::star::form;
-
- //=====================================================================
- //= OElementExport
- //=====================================================================
- OElementExport::OElementExport(IFormsExportContext& _rContext, const Reference< XPropertySet >& _rxProps,
- const Sequence< ScriptEventDescriptor >& _rEvents)
- :OPropertyExport(_rContext, _rxProps)
- ,m_aEvents(_rEvents)
- ,m_pXMLElement(NULL)
- {
- }
-
- //---------------------------------------------------------------------
- OElementExport::~OElementExport()
- {
- implEndElement();
- }
-
- //---------------------------------------------------------------------
- void OElementExport::doExport()
- {
- // collect some general information about the element
- examine();
-
- // first add the attributes necessary for the element
- m_rContext.getGlobalContext().ClearAttrList();
-
- // add the attributes
- exportAttributes();
-
- // start the XML element
- implStartElement(getXMLElementName());
-
- // the sub elements (mostly control type dependent)
- exportSubTags();
-
- implEndElement();
- }
-
- //---------------------------------------------------------------------
- void OElementExport::examine()
- {
- // nothing to do here
- }
-
- //---------------------------------------------------------------------
- void OElementExport::exportAttributes()
- {
- // nothing to do here
- }
-
- //---------------------------------------------------------------------
- void OElementExport::exportSubTags()
- {
- // the properties which where not exported 'til now
- exportRemainingProperties();
-
- // the script:events sub tags
- exportEvents();
- }
-
- //---------------------------------------------------------------------
- void OElementExport::implStartElement(const sal_Char* _pName)
- {
- m_pXMLElement = new SvXMLElementExport(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, _pName, sal_True, sal_True);
- }
-
- //---------------------------------------------------------------------
- void OElementExport::implEndElement()
- {
- delete m_pXMLElement;
- m_pXMLElement = NULL;
- }
-
- //---------------------------------------------------------------------
- void OElementExport::exportServiceNameAttribute()
- {
- Reference< XPersistObject > xPersistence(m_xProps, UNO_QUERY);
- if (!xPersistence.is())
- {
- OSL_ENSURE(sal_False, "OElementExport::exportServiceNameAttribute: no XPersistObject!");
- return;
- }
-
- ::rtl::OUString sServiceName = xPersistence->getServiceName();
- // we don't want to write the old service name directly: it's a name used for compatibility reasons, but
- // as we start some kind of new file format here (with this xml export), we don't care about
- // compatibility ...
- // So we translate the old persistence service name into new ones, if possible
-
- ::rtl::OUString sToWriteServiceName = sServiceName;
-#define CHECK_N_TRANSLATE( name ) \
- else if (0 == sServiceName.compareToAscii(SERVICE_PERSISTENT_COMPONENT_##name)) \
- sToWriteServiceName = SERVICE_##name
-
- if (sal_False)
- ;
- CHECK_N_TRANSLATE( FORM );
- CHECK_N_TRANSLATE( FORM );
- CHECK_N_TRANSLATE( LISTBOX );
- CHECK_N_TRANSLATE( COMBOBOX );
- CHECK_N_TRANSLATE( RADIOBUTTON );
- CHECK_N_TRANSLATE( GROUPBOX );
- CHECK_N_TRANSLATE( FIXEDTEXT );
- CHECK_N_TRANSLATE( COMMANDBUTTON );
- CHECK_N_TRANSLATE( CHECKBOX );
- CHECK_N_TRANSLATE( GRID );
- CHECK_N_TRANSLATE( IMAGEBUTTON );
- CHECK_N_TRANSLATE( FILECONTROL );
- CHECK_N_TRANSLATE( TIMEFIELD );
- CHECK_N_TRANSLATE( DATEFIELD );
- CHECK_N_TRANSLATE( NUMERICFIELD );
- CHECK_N_TRANSLATE( CURRENCYFIELD );
- CHECK_N_TRANSLATE( PATTERNFIELD );
- CHECK_N_TRANSLATE( HIDDENCONTROL );
- CHECK_N_TRANSLATE( IMAGECONTROL );
- CHECK_N_TRANSLATE( FORMATTEDFIELD );
- else if (0 == sServiceName.compareToAscii(SERVICE_PERSISTENT_COMPONENT_EDIT))
- { // special handling for the edit field: we have two controls using this as persistence service name
- sToWriteServiceName = SERVICE_EDIT;
- Reference< XServiceInfo > xSI(m_xProps, UNO_QUERY);
- if (xSI.is() && xSI->supportsService(SERVICE_FORMATTEDFIELD))
- sToWriteServiceName = SERVICE_FORMATTEDFIELD;
- }
-#ifdef DBG_UTIL
- Reference< XServiceInfo > xSI(m_xProps, UNO_QUERY);
- OSL_ENSURE(xSI.is() && xSI->supportsService(sToWriteServiceName),
- "OElementExport::exportServiceNameAttribute: wrong service name translation!");
-
-#endif
-
- // now write this
- AddAttribute(
- getCommonControlAttributeNamespace(CCA_SERVICE_NAME),
- getCommonControlAttributeName(CCA_SERVICE_NAME),
- sToWriteServiceName);
- }
-
- //---------------------------------------------------------------------
- void OElementExport::exportEvents()
- {
- if (!m_aEvents.getLength())
- // nothing to do
- return;
-
- Reference< XNameReplace > xWrapper = new OEventDescriptorMapper(m_aEvents);
- m_rContext.getGlobalContext().GetEventExport().Export(xWrapper);
- }
-
- //=====================================================================
- //= OControlExport
- //=====================================================================
- //---------------------------------------------------------------------
- OControlExport::OControlExport(IFormsExportContext& _rContext, const Reference< XPropertySet >& _rxControl,
- const ::rtl::OUString& _rControlId, const ::rtl::OUString& _rReferringControls,
- const Sequence< ScriptEventDescriptor >& _rEvents)
- :OElementExport(_rContext, _rxControl, _rEvents)
- ,m_sControlId(_rControlId)
- ,m_sReferringControls(_rReferringControls)
- ,m_nIncludeCommon(0)
- ,m_nIncludeDatabase(0)
- ,m_nIncludeSpecial(0)
- ,m_nIncludeEvents(0)
- ,m_nIncludeBindings(0)
- ,m_nClassId(FormComponentType::CONTROL)
- ,m_pOuterElement(NULL)
- {
- OSL_ENSURE(m_xProps.is(), "OControlExport::OControlExport: invalid arguments!");
- }
-
- //---------------------------------------------------------------------
- OControlExport::~OControlExport()
- {
- implEndElement();
- }
-
- //---------------------------------------------------------------------
- void OControlExport::exportOuterAttributes()
- {
- // the control id
- if (CCA_NAME & m_nIncludeCommon)
- {
- exportStringPropertyAttribute(
- getCommonControlAttributeNamespace(CCA_NAME),
- getCommonControlAttributeName(CCA_NAME),
- PROPERTY_NAME
- );
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeCommon = m_nIncludeCommon & ~CCA_NAME;
- #endif
- }
-
- // the service name
- if (m_nIncludeCommon & CCA_SERVICE_NAME)
- {
- exportServiceNameAttribute();
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeCommon = m_nIncludeCommon & ~CCA_SERVICE_NAME;
- #endif
- }
-
- // the control id
- if (CCA_CONTROL_ID & m_nIncludeCommon)
- {
- OSL_ENSURE(m_sControlId.getLength(), "OControlExport::exportCommonControlAttributes: have no control id for the control!");
- AddAttribute(
- getCommonControlAttributeNamespace(CCA_CONTROL_ID),
- getCommonControlAttributeName(CCA_CONTROL_ID),
- m_sControlId);
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeCommon = m_nIncludeCommon & ~CCA_CONTROL_ID;
- #endif
- }
- }
-
- //---------------------------------------------------------------------
- void OControlExport::exportInnerAttributes()
- {
- // common control attributes
- exportCommonControlAttributes();
-
- // common database attributes
- exportDatabaseAttributes();
-
- // attributes related to external bindings
- exportBindingAtributes();
-
- // attributes special to the respective control type
- exportSpecialAttributes();
-
- // add the style references to the attributes
- flagStyleProperties();
- }
-
- //---------------------------------------------------------------------
- void OControlExport::exportAttributes()
- {
- exportOuterAttributes();
- }
-
- //---------------------------------------------------------------------
- void OControlExport::exportSubTags() throw (Exception)
- {
- // the ListSource related properties do not need to be exported in a generic way, exportListSourceAsElements
- // will handle this (if necessary)
- exportedProperty(PROPERTY_STRING_ITEM_LIST);
- exportedProperty(PROPERTY_VALUE_SEQ);
- exportedProperty(PROPERTY_SELECT_SEQ);
- exportedProperty(PROPERTY_DEFAULT_SELECT_SEQ);
- exportedProperty(PROPERTY_LISTSOURCE);
-
- // for the upcoming exportRemainingProperties:
- // if a control has the LabelControl property, this is not stored with the control itself, but instead with
- // the control which is referenced by this property. As the base class' exportRemainingProperties doesn't
- // know anything about this, we need to prevent that it tries to export this property
- exportedProperty(PROPERTY_CONTROLLABEL);
-
- // let the base class export the remaining properties and the events
- OElementExport::exportSubTags();
-
- // special sub tags for some controls
- switch (m_eType)
- {
- case LISTBOX:
- // a list box description has sub elements: the options
- exportListSourceAsElements();
- break;
- case GRID:
- { // a grid control requires us to store all columns as sub elements
- Reference< XIndexAccess > xColumnContainer(m_xProps, UNO_QUERY);
- OSL_ENSURE(xColumnContainer.is(), "OControlExport::exportSubTags: a grid control which is no IndexAccess?!!");
- if (xColumnContainer.is())
- m_rContext.exportCollectionElements(xColumnContainer);
- }
- break;
- case COMBOBOX:
- { // a combox box description has sub elements: the items
- DBG_CHECK_PROPERTY( PROPERTY_STRING_ITEM_LIST, Sequence< ::rtl::OUString > );
-
- // get the item list
- Sequence< ::rtl::OUString > aListItems;
- m_xProps->getPropertyValue(PROPERTY_STRING_ITEM_LIST) >>= aListItems;
- // loop through it and write the sub elements
- const ::rtl::OUString* pListItems = aListItems.getConstArray();
- for (sal_Int32 i=0; i<aListItems.getLength(); ++i, ++pListItems)
- {
- m_rContext.getGlobalContext().ClearAttrList();
- AddAttribute(
- getCommonControlAttributeNamespace(CCA_LABEL),
- getCommonControlAttributeName(CCA_LABEL),
- *pListItems);
- SvXMLElementExport aFormElement(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, "item", sal_True, sal_True);
- }
- }
- break;
- }
- }
-
- //---------------------------------------------------------------------
- void OControlExport::exportCommonControlAttributes()
- {
- sal_Int32 i=0;
-
- // I decided to handle all the properties here with some static arrays describing the property-attribute
- // relations. This leads to somewhat ugly code :), but the only alternative I can think of right now
- // would require maps and O(log n) searches, which seems somewhat expensive as this code is used
- // very frequently.
-
- // the extra indents for the respective blocks are to ensure that there is no copy'n'paste error, using
- // map identifiers from the wrong block
-
- // --------------------------------------------------------------------
- // some string properties
- {
- // the attribute ids of all properties which are expected to be of type string
- static sal_Int32 nStringPropertyAttributeIds[] =
- {
- CCA_LABEL, CCA_TITLE
- };
- // the names of all properties which are expected to be of type string
- static ::rtl::OUString aStringPropertyNames[] =
- {
- PROPERTY_LABEL, PROPERTY_TITLE
- };
- OSL_ENSURE( SAL_N_ELEMENTS(aStringPropertyNames) == SAL_N_ELEMENTS(nStringPropertyAttributeIds),
- "OControlExport::exportCommonControlAttributes: somebody tampered with the maps (1)!");
-
- for (i = 0; i < SAL_N_ELEMENTS(nStringPropertyAttributeIds); ++i)
- if (nStringPropertyAttributeIds[i] & m_nIncludeCommon)
- {
- exportStringPropertyAttribute(
- getCommonControlAttributeNamespace(nStringPropertyAttributeIds[i]),
- getCommonControlAttributeName(nStringPropertyAttributeIds[i]),
- aStringPropertyNames[i]
- );
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeCommon = m_nIncludeCommon & ~nStringPropertyAttributeIds[i];
- #endif
- }
- }
-
- // --------------------------------------------------------------------
- // some boolean properties
- {
- static sal_Int32 nBooleanPropertyAttributeIds[] =
- { // attribute flags
- CCA_CURRENT_SELECTED, CCA_DISABLED, CCA_DROPDOWN, CCA_PRINTABLE, CCA_READONLY, CCA_SELECTED, CCA_TAB_STOP
- };
- static const ::rtl::OUString* pBooleanPropertyNames[] =
- { // property names
- &PROPERTY_STATE, &PROPERTY_ENABLED, &PROPERTY_DROPDOWN, &PROPERTY_PRINTABLE, &PROPERTY_READONLY, &PROPERTY_DEFAULT_STATE, &PROPERTY_TABSTOP
- };
- static sal_Bool nBooleanPropertyAttrFlags[] =
- { // attribute defaults
- BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_FALSE | BOOLATTR_INVERSE_SEMANTICS, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_TRUE, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_VOID
- };
- #ifdef DBG_UTIL
- sal_Int32 nIdCount = SAL_N_ELEMENTS(nBooleanPropertyAttributeIds);
- sal_Int32 nNameCount = SAL_N_ELEMENTS(pBooleanPropertyNames);
- sal_Int32 nFlagsCount = SAL_N_ELEMENTS(nBooleanPropertyAttrFlags);
- OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nFlagsCount),
- "OControlExport::exportCommonControlAttributes: somebody tampered with the maps (2)!");
- #endif
- for (i=0; i<SAL_N_ELEMENTS(nBooleanPropertyAttributeIds); ++i)
- if (nBooleanPropertyAttributeIds[i] & m_nIncludeCommon)
- {
- exportBooleanPropertyAttribute(
- getCommonControlAttributeNamespace(nBooleanPropertyAttributeIds[i]),
- getCommonControlAttributeName(nBooleanPropertyAttributeIds[i]),
- *(pBooleanPropertyNames[i]),
- nBooleanPropertyAttrFlags[i]);
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeCommon = m_nIncludeCommon & ~nBooleanPropertyAttributeIds[i];
- #endif
- }
- }
-
-
- // --------------------------------------------------------------------
- // some integer properties
- {
- // now the common handling
- static sal_Int32 nIntegerPropertyAttributeIds[] =
- { // attribute flags
- CCA_SIZE, CCA_TAB_INDEX
- };
- static const ::rtl::OUString* pIntegerPropertyNames[] =
- { // property names
- &PROPERTY_LINECOUNT, &PROPERTY_TABINDEX
- };
- static const sal_Int16 nIntegerPropertyAttrDefaults[] =
- { // attribute defaults
- 5, 0
- };
-
- if ( m_nIncludeCommon & CCA_MAX_LENGTH )
- exportedProperty(PROPERTY_MAXTEXTLENGTH);
-
- #ifdef DBG_UTIL
- sal_Int32 nIdCount = SAL_N_ELEMENTS(nIntegerPropertyAttributeIds);
- sal_Int32 nNameCount = SAL_N_ELEMENTS(pIntegerPropertyNames);
- sal_Int32 nDefaultCount = SAL_N_ELEMENTS(nIntegerPropertyAttrDefaults);
- OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nDefaultCount),
- "OControlExport::exportCommonControlAttributes: somebody tampered with the maps (3)!");
- #endif
- for (i=0; i<SAL_N_ELEMENTS(nIntegerPropertyAttributeIds); ++i)
- if (nIntegerPropertyAttributeIds[i] & m_nIncludeCommon)
- {
- exportInt16PropertyAttribute(
- getCommonControlAttributeNamespace(nIntegerPropertyAttributeIds[i]),
- getCommonControlAttributeName(nIntegerPropertyAttributeIds[i]),
- *(pIntegerPropertyNames[i]),
- nIntegerPropertyAttrDefaults[i]);
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeCommon = m_nIncludeCommon & ~nIntegerPropertyAttributeIds[i];
- #endif
- }
-
-
- }
-
- // --------------------------------------------------------------------
- // some enum properties
- {
- // (only one a at the moment)
- if (m_nIncludeCommon & CCA_BUTTON_TYPE)
- {
- exportEnumPropertyAttribute(
- getCommonControlAttributeNamespace(CCA_BUTTON_TYPE),
- getCommonControlAttributeName(CCA_BUTTON_TYPE),
- PROPERTY_BUTTONTYPE,
- OEnumMapper::getEnumMap(OEnumMapper::epButtonType),
- FormButtonType_PUSH);
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeCommon = m_nIncludeCommon & ~CCA_BUTTON_TYPE;
- #endif
- }
- }
-
- // --------------------------------------------------------------------
- // some properties which require a special handling
-
- // the target frame
- if (m_nIncludeCommon & CCA_TARGET_FRAME)
- {
- exportTargetFrameAttribute();
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeCommon = m_nIncludeCommon & ~CCA_TARGET_FRAME;
- #endif
- }
-
- // max text length
- if ( m_nIncludeCommon & CCA_MAX_LENGTH )
- {
- // normally, the respective property would be "MaxTextLen"
- // However, if the model has a property "PersistenceMaxTextLength", then we prefer this
-
- // determine the name of the property to export
- ::rtl::OUString sTextLenPropertyName = PROPERTY_MAXTEXTLENGTH;
- if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_PERSISTENCE_MAXTEXTLENGTH ) )
- sTextLenPropertyName = PROPERTY_PERSISTENCE_MAXTEXTLENGTH;
-
- // export it
- exportInt16PropertyAttribute(
- getCommonControlAttributeNamespace( CCA_MAX_LENGTH ),
- getCommonControlAttributeName( CCA_MAX_LENGTH ),
- sTextLenPropertyName,
- 0
- );
-
- // in either way, both properties count as "exported"
- exportedProperty( PROPERTY_MAXTEXTLENGTH );
- exportedProperty( PROPERTY_PERSISTENCE_MAXTEXTLENGTH );
-
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeCommon = m_nIncludeCommon & ~CCA_MAX_LENGTH;
- #endif
- }
-
- if (m_nIncludeCommon & CCA_TARGET_LOCATION)
- {
- exportTargetLocationAttribute();
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeCommon = m_nIncludeCommon & ~CCA_TARGET_LOCATION;
- #endif
- }
-
- // OJ #99721#
- if (m_nIncludeCommon & CCA_IMAGE_DATA)
- {
- exportImageDataAttribute();
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeCommon = m_nIncludeCommon & ~CCA_IMAGE_DATA;
- #endif
- }
-
- // the for attribute
- // the target frame
- if (m_nIncludeCommon & CCA_FOR)
- {
- if (m_sReferringControls.getLength())
- { // there is at least one control referring to the one we're handling currently
- AddAttribute(
- getCommonControlAttributeNamespace(CCA_FOR),
- getCommonControlAttributeName(CCA_FOR),
- m_sReferringControls);
- }
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeCommon = m_nIncludeCommon & ~CCA_FOR;
- #endif
- }
-
- if ((CCA_CURRENT_VALUE | CCA_VALUE) & m_nIncludeCommon)
- {
- const sal_Char* pCurrentValuePropertyName = NULL;
- const sal_Char* pValuePropertyName = NULL;
-
- // get the property names
- getValuePropertyNames(m_eType, m_nClassId, pCurrentValuePropertyName, pValuePropertyName);
-
- static const sal_Char* pCurrentValueAttributeName = getCommonControlAttributeName(CCA_CURRENT_VALUE);
- static const sal_Char* pValueAttributeName = getCommonControlAttributeName(CCA_VALUE);
- static const sal_uInt16 nCurrentValueAttributeNamespaceKey = getCommonControlAttributeNamespace(CCA_CURRENT_VALUE);
- static const sal_uInt16 nValueAttributeNamespaceKey = getCommonControlAttributeNamespace(CCA_VALUE);
-
- // add the atrtributes if necessary and possible
- if (pCurrentValuePropertyName && (CCA_CURRENT_VALUE & m_nIncludeCommon))
- exportGenericPropertyAttribute(
- nCurrentValueAttributeNamespaceKey,
- pCurrentValueAttributeName,
- pCurrentValuePropertyName);
-
- if (pValuePropertyName && (CCA_VALUE & m_nIncludeCommon))
- exportGenericPropertyAttribute(
- nValueAttributeNamespaceKey,
- pValueAttributeName,
- pValuePropertyName);
-
- OSL_ENSURE((NULL == pValuePropertyName) == (0 == (CCA_VALUE & m_nIncludeCommon)),
- "OControlExport::exportCommonControlAttributes: no property found for the value attribute!");
- OSL_ENSURE((NULL == pCurrentValuePropertyName ) == (0 == (CCA_CURRENT_VALUE & m_nIncludeCommon)),
- "OControlExport::exportCommonControlAttributes: no property found for the current-value attribute!");
-
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeCommon = m_nIncludeCommon & ~(CCA_CURRENT_VALUE | CCA_VALUE);
- #endif
- }
-
- OSL_ENSURE(0 == m_nIncludeCommon,
- "OControlExport::exportCommonControlAttributes: forgot some flags!");
- // in the dbg_util version, we should have removed every bit we handled from the mask, so it should
- // be 0 now ...
- }
-
- //---------------------------------------------------------------------
- void OControlExport::exportDatabaseAttributes()
- {
-#if OSL_DEBUG_LEVEL > 0
- sal_Int32 nIncludeDatabase = m_nIncludeDatabase;
-#endif
- // the only string property: DataField
- if (DA_DATA_FIELD & m_nIncludeDatabase)
- {
- exportStringPropertyAttribute(
- getDatabaseAttributeNamespace(DA_DATA_FIELD),
- getDatabaseAttributeName(DA_DATA_FIELD),
- PROPERTY_DATAFIELD);
- #if OSL_DEBUG_LEVEL > 0
- // reset the bit for later checking
- nIncludeDatabase = nIncludeDatabase & ~DA_DATA_FIELD;
- #endif
- }
-
- // the only int16 property: BoundColumn
- if (DA_BOUND_COLUMN & m_nIncludeDatabase)
- {
- exportInt16PropertyAttribute(
- getDatabaseAttributeNamespace(DA_BOUND_COLUMN),
- getDatabaseAttributeName(DA_BOUND_COLUMN),
- PROPERTY_BOUNDCOLUMN,
- 0);
- #if OSL_DEBUG_LEVEL > 0
- // reset the bit for later checking
- nIncludeDatabase = nIncludeDatabase & ~DA_BOUND_COLUMN;
- #endif
- }
-
- // the only boolean property: ConvertEmptyToNull
- if (DA_CONVERT_EMPTY & m_nIncludeDatabase)
- {
- exportBooleanPropertyAttribute(
- getDatabaseAttributeNamespace(DA_CONVERT_EMPTY),
- getDatabaseAttributeName(DA_CONVERT_EMPTY),
- PROPERTY_EMPTY_IS_NULL,
- BOOLATTR_DEFAULT_FALSE
- );
- #if OSL_DEBUG_LEVEL > 0
- // reset the bit for later checking
- nIncludeDatabase = nIncludeDatabase & ~DA_CONVERT_EMPTY;
- #endif
- }
-
- // the only enum property: ListSourceType
- if (DA_LIST_SOURCE_TYPE & m_nIncludeDatabase)
- {
- exportEnumPropertyAttribute(
- getDatabaseAttributeNamespace(DA_LIST_SOURCE_TYPE),
- getDatabaseAttributeName(DA_LIST_SOURCE_TYPE),
- PROPERTY_LISTSOURCETYPE,
- OEnumMapper::getEnumMap(OEnumMapper::epListSourceType),
- ListSourceType_VALUELIST
- );
- #if OSL_DEBUG_LEVEL > 0
- // reset the bit for later checking
- nIncludeDatabase = nIncludeDatabase & ~DA_LIST_SOURCE_TYPE;
- #endif
- }
-
- if (m_nIncludeDatabase & DA_LIST_SOURCE)
- {
- exportListSourceAsAttribute();
- #if OSL_DEBUG_LEVEL > 0
- // reset the bit for later checking
- nIncludeDatabase = nIncludeDatabase & ~DA_LIST_SOURCE;
- #endif
- }
-
-#if OSL_DEBUG_LEVEL > 0
- OSL_ENSURE(0 == nIncludeDatabase,
- "OControlExport::exportDatabaseAttributes: forgot some flags!");
- // in the dbg_util version, we should have removed every bit we handled from the mask, so it should
- // be 0 now ...
-#endif
- }
-
- //---------------------------------------------------------------------
- void OControlExport::exportBindingAtributes()
- {
-#if OSL_DEBUG_LEVEL > 0
- sal_Int32 nIncludeBinding = m_nIncludeBindings;
-#endif
-
- // ....................................................
- if ( m_nIncludeBindings & BA_LINKED_CELL )
- {
- exportCellBindingAttributes( ( m_nIncludeBindings & BA_LIST_LINKING_TYPE ) != 0 );
- #if OSL_DEBUG_LEVEL > 0
- // reset the bit for later checking
- nIncludeBinding = nIncludeBinding & ~( BA_LINKED_CELL | BA_LIST_LINKING_TYPE );
- #endif
- }
-
- // ....................................................
- if ( m_nIncludeBindings & BA_LIST_CELL_RANGE )
- {
- exportCellListSourceRange();
- #if OSL_DEBUG_LEVEL > 0
- // reset the bit for later checking
- nIncludeBinding = nIncludeBinding & ~BA_LIST_CELL_RANGE;
- #endif
- }
-
-
- OSL_ENSURE( 0 == nIncludeBinding,
- "OControlExport::exportBindingAtributes: forgot some flags!");
- // in the debug version, we should have removed every bit we handled from the mask, so it should
- // be 0 now ...
- }
-
- //---------------------------------------------------------------------
- void OControlExport::exportSpecialAttributes()
- {
- sal_Int32 i=0;
-
- // ----------------------
- // the boolean properties
- {
- static sal_Int32 nBooleanPropertyAttributeIds[] =
- { // attribute flags
- SCA_VALIDATION, SCA_MULTI_LINE, SCA_AUTOMATIC_COMPLETION, SCA_MULTIPLE, SCA_DEFAULT_BUTTON, SCA_IS_TRISTATE
- };
- static const ::rtl::OUString* pBooleanPropertyNames[] =
- { // property names
- &PROPERTY_STRICTFORMAT, &PROPERTY_MULTILINE, &PROPERTY_AUTOCOMPLETE, &PROPERTY_MULTISELECTION, &PROPERTY_DEFAULTBUTTON, &PROPERTY_TRISTATE
- };
- sal_Int32 nIdCount = SAL_N_ELEMENTS(nBooleanPropertyAttributeIds);
- #ifdef DBG_UTIL
- sal_Int32 nNameCount = SAL_N_ELEMENTS(pBooleanPropertyNames);
- OSL_ENSURE((nIdCount == nNameCount),
- "OControlExport::exportSpecialAttributes: somebody tampered with the maps (1)!");
- #endif
- for (i=0; i<nIdCount; ++i)
- if (nBooleanPropertyAttributeIds[i] & m_nIncludeSpecial)
- {
- exportBooleanPropertyAttribute(
- getSpecialAttributeNamespace(nBooleanPropertyAttributeIds[i]),
- getSpecialAttributeName(nBooleanPropertyAttributeIds[i]),
- *(pBooleanPropertyNames[i]),
- BOOLATTR_DEFAULT_FALSE // all of the attributes are defaulted to "false"
- );
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeSpecial = m_nIncludeSpecial & ~nBooleanPropertyAttributeIds[i];
- #endif
- }
- }
-
- // -------------------
- // the enum properties
- {
- if (SCA_STATE & m_nIncludeSpecial)
- {
- exportEnumPropertyAttribute(
- getSpecialAttributeNamespace(SCA_STATE),
- getSpecialAttributeName(SCA_STATE),
- PROPERTY_DEFAULT_STATE,
- OEnumMapper::getEnumMap(OEnumMapper::epCheckState),
- STATE_NOCHECK);
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeSpecial = m_nIncludeSpecial & ~SCA_STATE;
- #endif
- }
-
- if (SCA_CURRENT_STATE & m_nIncludeSpecial)
- {
- exportEnumPropertyAttribute(
- getSpecialAttributeNamespace(SCA_CURRENT_STATE),
- getSpecialAttributeName(SCA_CURRENT_STATE),
- PROPERTY_STATE,
- OEnumMapper::getEnumMap(OEnumMapper::epCheckState),
- STATE_NOCHECK);
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeSpecial = m_nIncludeSpecial & ~SCA_CURRENT_STATE;
- #endif
- }
- }
-
- // ----------------------------------
- // the EchoChar property needs special handling, cause it's a Int16, but must be stored as one-character-string
- {
- if (SCA_ECHO_CHAR & m_nIncludeSpecial)
- {
- DBG_CHECK_PROPERTY( PROPERTY_ECHO_CHAR, sal_Int16 );
- sal_Int16 nValue(0);
- m_xProps->getPropertyValue(PROPERTY_ECHO_CHAR) >>= nValue;
- if (nValue)
- {
- ::rtl::OUString sCharacter(reinterpret_cast<const sal_Unicode*>(&nValue), 1);
- AddAttribute(
- getSpecialAttributeNamespace(SCA_ECHO_CHAR),
- getSpecialAttributeName(SCA_ECHO_CHAR),
- sCharacter);
- }
- exportedProperty(PROPERTY_ECHO_CHAR);
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeSpecial = m_nIncludeSpecial & ~SCA_ECHO_CHAR;
- #endif
- }
- }
-
- // ----------------------------------
- if ((SCA_MIN_VALUE | SCA_MAX_VALUE) & m_nIncludeSpecial)
- {
- // need to export the min value and the max value as attributes
- // It depends on the real type (FormComponentType) of the control, which properties hold these
- // values
- const sal_Char* pMinValuePropertyName = NULL;
- const sal_Char* pMaxValuePropertyName = NULL;
- getValueLimitPropertyNames(m_nClassId, pMinValuePropertyName, pMaxValuePropertyName);
-
- OSL_ENSURE((NULL == pMinValuePropertyName) == (0 == (SCA_MIN_VALUE & m_nIncludeSpecial)),
- "OControlExport::exportCommonControlAttributes: no property found for the min value attribute!");
- OSL_ENSURE((NULL == pMaxValuePropertyName) == (0 == (SCA_MAX_VALUE & m_nIncludeSpecial)),
- "OControlExport::exportCommonControlAttributes: no property found for the min value attribute!");
-
- // add the two attributes
- static const sal_Char* pMinValueAttributeName = getSpecialAttributeName(SCA_MIN_VALUE);
- static const sal_Char* pMaxValueAttributeName = getSpecialAttributeName(SCA_MAX_VALUE);
- static const sal_uInt16 nMinValueNamespaceKey = getSpecialAttributeNamespace(SCA_MIN_VALUE);
- static const sal_uInt16 nMaxValueNamespaceKey = getSpecialAttributeNamespace(SCA_MAX_VALUE);
-
- if (pMinValuePropertyName && (SCA_MIN_VALUE & m_nIncludeSpecial))
- exportGenericPropertyAttribute(
- nMinValueNamespaceKey,
- pMinValueAttributeName,
- pMinValuePropertyName);
-
- if (pMaxValuePropertyName && (SCA_MAX_VALUE & m_nIncludeSpecial))
- exportGenericPropertyAttribute(
- nMaxValueNamespaceKey,
- pMaxValueAttributeName,
- pMaxValuePropertyName);
- #ifdef DBG_UTIL
- // reset the bit for later checking
- m_nIncludeSpecial = m_nIncludeSpecial & ~(SCA_MIN_VALUE | SCA_MAX_VALUE);
- #endif
- }
-
- OSL_ENSURE(0 == m_nIncludeSpecial,
- "OControlExport::exportSpecialAttributes: forgot some flags!");
- // in the dbg_util version, we should have removed every bit we handled from the mask, so it should
- // be 0 now ...
- }
-
- //---------------------------------------------------------------------
- void OControlExport::exportListSourceAsAttribute()
- {
- // DA_LIST_SOURCE needs some special handling
- DBG_CHECK_PROPERTY_NO_TYPE( PROPERTY_LISTSOURCE );
-
- ::rtl::OUString sListSource;
- Any aListSource = m_xProps->getPropertyValue(PROPERTY_LISTSOURCE);
- if (!(aListSource >>= sListSource))
- {
- Sequence< ::rtl::OUString > aListSourceSequence;
- aListSource >>= aListSourceSequence;
- if (aListSourceSequence.getLength())
- sListSource = aListSourceSequence[0];
- }
-
- if (sListSource.getLength())
- { // the ListSource property needs to be exported as attribute, and it is not empty
- AddAttribute(
- getDatabaseAttributeNamespace(DA_LIST_SOURCE),
- getDatabaseAttributeName(DA_LIST_SOURCE),
- sListSource);
- }
- }
-
- //---------------------------------------------------------------------
- void OControlExport::getSequenceInt16PropertyAsSet(const ::rtl::OUString& _rPropertyName, Int16Set& _rOut)
- {
- Sequence< sal_Int16 > aValueSequence;
- DBG_CHECK_PROPERTY(_rPropertyName, Sequence< sal_Int16 >);
- m_xProps->getPropertyValue(_rPropertyName) >>= aValueSequence;
-
- const sal_Int16* pValues = aValueSequence.getConstArray();
- for (sal_Int32 i=0; i<aValueSequence.getLength(); ++i, ++pValues)
- _rOut.insert(*pValues);
- }
-
- //---------------------------------------------------------------------
- void OControlExport::exportListSourceAsElements()
- {
- // the string lists
- Sequence< ::rtl::OUString > aItems, aValues;
- DBG_CHECK_PROPERTY( PROPERTY_STRING_ITEM_LIST, Sequence< ::rtl::OUString > );
- m_xProps->getPropertyValue(PROPERTY_STRING_ITEM_LIST) >>= aItems;
-
- DBG_CHECK_PROPERTY( PROPERTY_LISTSOURCE, Sequence< ::rtl::OUString > );
- if ( 0 == ( m_nIncludeDatabase & DA_LIST_SOURCE ) )
- m_xProps->getPropertyValue(PROPERTY_LISTSOURCE) >>= aValues;
- // if we exported the list source as attribute, we do not repeat it as sub elements
-
- // the selection lists
- Int16Set aSelection, aDefaultSelection;
- getSequenceInt16PropertyAsSet(PROPERTY_SELECT_SEQ, aSelection);
- getSequenceInt16PropertyAsSet(PROPERTY_DEFAULT_SELECT_SEQ, aDefaultSelection);
-
- // the string for "true" and "false"
- ::rtl::OUString sTrue;
- ::rtl::OUStringBuffer sBuffer;
- m_rContext.getGlobalContext().GetMM100UnitConverter().convertBool(sBuffer, sal_True);
- sTrue = sBuffer.makeStringAndClear();
-
- // loop through both lists ('til the maximum of both lengths)
- const ::rtl::OUString* pItems = aItems.getConstArray();
- const ::rtl::OUString* pValues = aValues.getConstArray();
-
- sal_Int32 nItems = aItems.getLength();
- sal_Int32 nValues = aValues.getLength();
-
- sal_Int16 nMaxLen = (sal_Int16)std::max(nItems, nValues);
-
- for (sal_Int16 i=0; i<nMaxLen; ++i )
- {
- m_rContext.getGlobalContext().ClearAttrList();
- if (i < nItems)
- {
- // there is an item at this position
- AddAttribute(
- getCommonControlAttributeNamespace(CCA_LABEL),
- getCommonControlAttributeName(CCA_LABEL),
- *pItems);
- ++pItems;
- }
- if (i < nValues)
- {
- // there is an value at this position
- AddAttribute(
- getCommonControlAttributeNamespace(CCA_VALUE),
- getCommonControlAttributeName(CCA_VALUE),
- *pValues);
- ++pValues;
- }
-
- Int16SetIterator aSelectedPos = aSelection.find(i);
- if (aSelection.end() != aSelectedPos)
- { // the item at this position is selected
- AddAttribute(
- getCommonControlAttributeNamespace(CCA_CURRENT_SELECTED),
- getCommonControlAttributeName(CCA_CURRENT_SELECTED),
- sTrue
- );
- aSelection.erase(aSelectedPos);
- }
-
- Int16SetIterator aDefaultSelectedPos = aDefaultSelection.find(i);
- if (aDefaultSelection.end() != aDefaultSelectedPos)
- { // the item at this position is selected as default
- AddAttribute(
- getCommonControlAttributeNamespace(CCA_SELECTED),
- getCommonControlAttributeName(CCA_SELECTED),
- sTrue
- );
- aDefaultSelection.erase(aDefaultSelectedPos);
- }
- SvXMLElementExport aFormElement(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, "option", sal_True, sal_True);
- }
-
- // There may be more "selected" or "default-selected" items than there are in the lists in real,
- // so we need to store some additional "form:option" items which have no name and no label, but
- // one or both of the selected flags.
- // 21.05.2001 - 85388 - frank.schoenheit@germany.sun.com
-
- if (aSelection.size() || aDefaultSelection.size())
- {
- sal_Int16 nLastSelected = -1;
- if (aSelection.size())
- nLastSelected = *(--aSelection.end());
-
- sal_Int16 nLastDefaultSelected = -1;
- if (aDefaultSelection.size())
- nLastDefaultSelected = *(--aDefaultSelection.end());
-
- // the maximum element in both sets
- sal_Int16 nLastReferredEntry = ::std::max(nLastSelected, nLastDefaultSelected);
- OSL_ENSURE(nLastReferredEntry >= nMaxLen, "OControlExport::exportListSourceAsElements: inconsistence!");
- // if the maximum (selected or default selected) entry number is less than the maximum item count
- // in both lists, the entry number should have been removed from the set
-
- for (sal_Int16 i=nMaxLen; i<=nLastReferredEntry; ++i)
- {
- if (aSelection.end() != aSelection.find(i))
- { // the (not existent) item at this position is selected
- AddAttribute(
- getCommonControlAttributeNamespace(CCA_CURRENT_SELECTED),
- getCommonControlAttributeName(CCA_CURRENT_SELECTED),
- sTrue
- );
- }
-
- if (aDefaultSelection.end() != aDefaultSelection.find(i))
- { // the (not existent) item at this position is selected as default
- AddAttribute(
- getCommonControlAttributeNamespace(CCA_SELECTED),
- getCommonControlAttributeName(CCA_SELECTED),
- sTrue
- );
- }
- SvXMLElementExport aFormElement(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, "option", sal_True, sal_True);
- }
- }
- }
-
- //---------------------------------------------------------------------
- void OControlExport::implStartElement(const sal_Char* _pName)
- {
- // before we let the base class start it's outer element, we add a wrapper element
- m_pOuterElement = new SvXMLElementExport(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, getOuterXMLElementName(), sal_True, sal_True);
-
- // add the attributes for the inner element
- exportInnerAttributes();
-
- // and start the inner element
- OElementExport::implStartElement(_pName);
- }
-
- //---------------------------------------------------------------------
- void OControlExport::implEndElement()
- {
- // end the inner element
- OElementExport::implEndElement();
-
- // end the outer element
- delete m_pOuterElement;
- m_pOuterElement = NULL;
- }
-
- //---------------------------------------------------------------------
- const sal_Char* OControlExport::getOuterXMLElementName() const
- {
- return "control";
- }
-
- //---------------------------------------------------------------------
- const sal_Char* OControlExport::getXMLElementName() const
- {
- return getElementName(m_eType);
- }
-
- //---------------------------------------------------------------------
- void OControlExport::examine()
- {
- // get the class id to decide which kind of element we need in the XML stream
- m_nClassId = FormComponentType::CONTROL;
- DBG_CHECK_PROPERTY( PROPERTY_CLASSID, sal_Int16 );
- m_xProps->getPropertyValue(PROPERTY_CLASSID) >>= m_nClassId;
- switch (m_nClassId)
- {
- case FormComponentType::DATEFIELD:
- case FormComponentType::TIMEFIELD:
- case FormComponentType::NUMERICFIELD:
- case FormComponentType::CURRENCYFIELD:
- case FormComponentType::PATTERNFIELD:
- m_eType = FORMATTED_TEXT;
- // NO BREAK
- case FormComponentType::TEXTFIELD:
- { // it's some kind of edit. To know which type we need further investigation
-
- if (FORMATTED_TEXT != m_eType)
- { // not coming from the previous cases which had a class id .ne. TEXTFIELD
-
- // check if it's a formatted field
- if (m_xPropertyInfo->hasPropertyByName(PROPERTY_FORMATKEY))
- {
- m_eType = FORMATTED_TEXT;
- }
- else
- {
- // all other controls are represented by an ordinary edit control, but which XML control type
- // it is depends on the current values of some properties
-
- // if the EchoChar string is not empty, it is a password field
- sal_Int16 nEchoChar = 0;
- if (m_xPropertyInfo->hasPropertyByName(PROPERTY_ECHOCHAR))
- // grid columns do not have this property ....
- m_xProps->getPropertyValue(PROPERTY_ECHOCHAR) >>= nEchoChar;
- if (nEchoChar)
- {
- m_eType = PASSWORD;
- m_nIncludeSpecial |= SCA_ECHO_CHAR;
- }
- else
- {
- // if the MultiLine property is sal_True, it is a TextArea
- sal_Bool bMultiLine = sal_False;
- if (m_xPropertyInfo->hasPropertyByName(PROPERTY_MULTILINE))
- // grid columns do not have this property ....
- bMultiLine = ::cppu::any2bool(m_xProps->getPropertyValue(PROPERTY_MULTILINE));
- if (bMultiLine)
- m_eType = TEXT_AREA;
- else
- // the only case left is represented by a Text element
- m_eType = TEXT;
- }
- }
- }
-
- // attributes which are common to all the four types:
- // common attributes
- m_nIncludeCommon =
- CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED |
- CCA_PRINTABLE | CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE |
- CCA_VALUE;
- // database attributes
- m_nIncludeDatabase = DA_DATA_FIELD;
- // event attributes
- m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE | EA_ON_SELECT;
-
- // only text and pattern fields have a ConvertEmptyToNull property
- if ((m_nClassId == FormComponentType::TEXTFIELD) || (m_nClassId == FormComponentType::PATTERNFIELD))
- m_nIncludeDatabase |= DA_CONVERT_EMPTY;
-
- // all controls but the file control fields have a readonly property
- if (m_nClassId != FormComponentType::FILECONTROL)
- m_nIncludeCommon |= CCA_READONLY;
-
- // a text field has a max text len
- if (m_nClassId == FormComponentType::TEXTFIELD)
- m_nIncludeCommon |= CCA_MAX_LENGTH;
-
- // max and min values and validation:
- if (FORMATTED_TEXT == m_eType)
- { // in general all control represented as formatted-text have these props
- if (FormComponentType::PATTERNFIELD != m_nClassId)
- // but the PatternField does not have value limits
- m_nIncludeSpecial |= SCA_MAX_VALUE | SCA_MIN_VALUE;
-
- if (FormComponentType::TEXTFIELD != m_nClassId)
- // and the FormattedField does not have a validation flag
- m_nIncludeSpecial |= SCA_VALIDATION;
- }
-
- // if it's not a password field, the CurrentValue needs to be stored, too
- if (PASSWORD != m_eType)
- m_nIncludeCommon |= CCA_CURRENT_VALUE;
- }
- break;
-
- case FormComponentType::FILECONTROL:
- m_eType = FILE;
- m_nIncludeCommon =
- CCA_NAME | CCA_SERVICE_NAME | CCA_CURRENT_VALUE | CCA_DISABLED |
- CCA_PRINTABLE | CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE |
- CCA_VALUE;
- m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE | EA_ON_SELECT;
- break;
-
- case FormComponentType::FIXEDTEXT:
- m_eType = FIXED_TEXT;
- m_nIncludeCommon =
- CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_LABEL |
- CCA_PRINTABLE | CCA_TITLE | CCA_FOR;
- m_nIncludeSpecial = SCA_MULTI_LINE;
- m_nIncludeEvents = EA_CONTROL_EVENTS;
- break;
-
- case FormComponentType::COMBOBOX:
- m_eType = COMBOBOX;
- m_nIncludeCommon =
- CCA_NAME | CCA_SERVICE_NAME | CCA_CURRENT_VALUE |
- CCA_DISABLED | CCA_DROPDOWN | CCA_MAX_LENGTH | CCA_PRINTABLE | CCA_READONLY | CCA_SIZE |
- CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE | CCA_VALUE;
- m_nIncludeSpecial = SCA_AUTOMATIC_COMPLETION;
- m_nIncludeDatabase = DA_CONVERT_EMPTY | DA_DATA_FIELD | DA_LIST_SOURCE | DA_LIST_SOURCE_TYPE;
- m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE | EA_ON_SELECT;
- break;
-
- case FormComponentType::LISTBOX:
- m_eType = LISTBOX;
- m_nIncludeCommon =
- CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_DROPDOWN |
- CCA_PRINTABLE | CCA_SIZE | CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE;
- m_nIncludeSpecial = SCA_MULTIPLE;
- m_nIncludeDatabase = DA_BOUND_COLUMN | DA_DATA_FIELD | DA_LIST_SOURCE_TYPE;
- m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE | EA_ON_CLICK | EA_ON_DBLCLICK;
- // check if we need to export the ListSource as attribute
- {
- // for a list box, if the ListSourceType is VALUE_LIST, no ListSource is stored, but instead
- // a sequence of pairs which is build from the StringItemList and the ValueList
- ListSourceType eListSourceType = ListSourceType_VALUELIST;
- #if OSL_DEBUG_LEVEL > 0
- sal_Bool bSuccess =
- #endif
- m_xProps->getPropertyValue(PROPERTY_LISTSOURCETYPE) >>= eListSourceType;
- OSL_ENSURE(bSuccess, "OControlExport::examineControl: could not retrieve the ListSourceType!");
- if (ListSourceType_VALUELIST != eListSourceType)
- {
- m_nIncludeDatabase |= DA_LIST_SOURCE;
- }
- }
-
- break;
-
- case FormComponentType::COMMANDBUTTON:
- m_eType = BUTTON;
- m_nIncludeCommon |= CCA_TAB_STOP | CCA_LABEL;
- m_nIncludeSpecial = SCA_DEFAULT_BUTTON;
- // NO BREAK !
- case FormComponentType::IMAGEBUTTON:
- if (BUTTON != m_eType)
- // not coming from the previous case
- m_eType = IMAGE;
- m_nIncludeCommon |=
- CCA_NAME | CCA_SERVICE_NAME | CCA_BUTTON_TYPE | CCA_DISABLED |
- CCA_IMAGE_DATA | CCA_PRINTABLE | CCA_TAB_INDEX | CCA_TARGET_FRAME |
- CCA_TARGET_LOCATION | CCA_TITLE;
- m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CLICK | EA_ON_DBLCLICK;
- break;
-
- case FormComponentType::CHECKBOX:
- m_eType = CHECKBOX;
- m_nIncludeSpecial = SCA_CURRENT_STATE | SCA_IS_TRISTATE | SCA_STATE;
- // NO BREAK !
- case FormComponentType::RADIOBUTTON:
- m_nIncludeCommon =
- CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_LABEL |
- CCA_PRINTABLE | CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE | CCA_VALUE;
- if (CHECKBOX != m_eType)
- { // not coming from the previous case
- m_eType = RADIO;
- m_nIncludeCommon |= CCA_CURRENT_SELECTED | CCA_SELECTED;
- }
- m_nIncludeDatabase = DA_DATA_FIELD;
- m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE;
- break;
-
- case FormComponentType::GROUPBOX:
- m_eType = FRAME;
- m_nIncludeCommon =
- CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_LABEL |
- CCA_PRINTABLE | CCA_TITLE | CCA_FOR;
- m_nIncludeEvents = EA_CONTROL_EVENTS;
- break;
-
- case FormComponentType::IMAGECONTROL:
- m_eType = IMAGE_FRAME;
- m_nIncludeCommon =
- CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_IMAGE_DATA |
- CCA_PRINTABLE | CCA_READONLY | CCA_TITLE;
- m_nIncludeDatabase = DA_DATA_FIELD;
- m_nIncludeEvents = EA_CONTROL_EVENTS;
- break;
-
- case FormComponentType::HIDDENCONTROL:
- m_eType = HIDDEN;
- m_nIncludeCommon =
- CCA_NAME | CCA_SERVICE_NAME | CCA_VALUE;
- break;
-
- case FormComponentType::GRIDCONTROL:
- m_eType = GRID;
- m_nIncludeCommon =
- CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_PRINTABLE |
- CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE;
- m_nIncludeEvents = EA_CONTROL_EVENTS;
- break;
-
- case FormComponentType::CONTROL:
- m_eType = GENERIC_CONTROL;
- // unknown control type
- m_nIncludeCommon = CCA_NAME | CCA_SERVICE_NAME;
- // at least a name should be there, 'cause without a name the control could never have been
- // inserted into it's parent container
- // In addition, the service name is absolutely necessary to create the control upon reading.
- m_nIncludeEvents = EA_CONTROL_EVENTS;
- // we always should be able to export events - this is not control type dependent
- break;
-
- default:
- OSL_ENSURE(sal_False, "OControlExport::examineControl: unknown control type (class id)!");
- break;
- }
-
- // in general, all control types need to export the control id
- m_nIncludeCommon |= CCA_CONTROL_ID;
-
- // is is a control bound to a calc cell?
- if ( FormCellBindingHelper::livesInSpreadsheetDocument( m_xProps ) )
- {
- FormCellBindingHelper aHelper( m_xProps, NULL );
- {
- if ( aHelper.isCellBinding( aHelper.getCurrentBinding( ) ) )
- {
- m_nIncludeBindings |= BA_LINKED_CELL;
- if ( m_nClassId == FormComponentType::LISTBOX )
- m_nIncludeBindings |= BA_LIST_LINKING_TYPE;
- }
- }
-
- // is it a list-like control which uses a calc cell range as list source?
- {
- if ( aHelper.isCellRangeListSource( aHelper.getCurrentListSource( ) ) )
- m_nIncludeBindings |= BA_LIST_CELL_RANGE;
- }
- }
- }
-
- //---------------------------------------------------------------------
- void OControlExport::exportCellBindingAttributes( bool _bIncludeListLinkageType )
- {
- try
- {
- FormCellBindingHelper aHelper( m_xProps, NULL );
- Reference< XValueBinding > xBinding( aHelper.getCurrentBinding() );
- OSL_ENSURE( xBinding.is(), "OControlExport::exportCellBindingAttributes: invalid bindable or invalid binding!" );
- if ( xBinding.is() )
- {
- // ....................................................
- AddAttribute(
- getBindingAttributeNamespace( BA_LINKED_CELL ),
- getBindingAttributeName( BA_LINKED_CELL ),
- aHelper.getStringAddressFromCellBinding( xBinding )
- );
-
- // ....................................................
- if ( _bIncludeListLinkageType )
- {
- sal_Int16 nLinkageType = aHelper.isCellIntegerBinding( xBinding ) ? 1 : 0;
-
- ::rtl::OUStringBuffer sBuffer;
- m_rContext.getGlobalContext().GetMM100UnitConverter().convertEnum(
- sBuffer,
- (sal_uInt16)nLinkageType,
- OEnumMapper::getEnumMap( OEnumMapper::epListLinkageType )
- );
-
- AddAttribute(
- getBindingAttributeNamespace( BA_LIST_LINKING_TYPE ),
- getBindingAttributeName( BA_LIST_LINKING_TYPE ),
- sBuffer.makeStringAndClear()
- );
- }
-
- }
- }
- catch( const Exception& )
- {
- OSL_ENSURE( sal_False, "OControlExport::exportCellBindingAttributes: caught an exception!" );
- }
- }
-
- //---------------------------------------------------------------------
- void OControlExport::exportCellListSourceRange( )
- {
- try
- {
- Reference< XListEntrySink > xSink( m_xProps, UNO_QUERY );
- Reference< XListEntrySource > xSource;
- if ( xSink.is() )
- xSource = xSource.query( xSink->getListEntrySource() );
- OSL_ENSURE( xSource.is(), "OControlExport::exportCellListSourceRange: list source or sink!" );
- if ( xSource.is() )
- {
- FormCellBindingHelper aHelper( m_xProps, NULL );
-
- AddAttribute(
- getBindingAttributeNamespace( BA_LIST_CELL_RANGE ),
- getBindingAttributeName( BA_LIST_CELL_RANGE ),
- aHelper.getStringAddressFromCellListSource( xSource )
- );
- }
- }
- catch( const Exception& )
- {
- OSL_ENSURE( sal_False, "OControlExport::exportCellListSourceRange: caught an exception!" );
- }
- }
-
- //=====================================================================
- //= OColumnExport
- //=====================================================================
- //---------------------------------------------------------------------
- OColumnExport::OColumnExport(IFormsExportContext& _rContext, const Reference< XPropertySet >& _rxControl,
- const Sequence< ScriptEventDescriptor >& _rEvents)
- :OControlExport(_rContext, _rxControl, ::rtl::OUString(), ::rtl::OUString(), _rEvents)
- {
- }
-
- //---------------------------------------------------------------------
- OColumnExport::~OColumnExport()
- {
- implEndElement();
- }
-
- //---------------------------------------------------------------------
- void OColumnExport::exportServiceNameAttribute()
- {
- // the attribute "service name" (which has a slightly different meaning for columns
- DBG_CHECK_PROPERTY( PROPERTY_COLUMNSERVICENAME, ::rtl::OUString );
- ::rtl::OUString sColumnServiceName;
- m_xProps->getPropertyValue(PROPERTY_COLUMNSERVICENAME) >>= sColumnServiceName;
- // the service name is a full qualified one (i.e. com.sun.star.form.TextField), but the
- // real service name for the column (for use with the XGridColumnFactory) is only the last
- // token of this complete name.
- sal_Int32 nLastSep = sColumnServiceName.lastIndexOf('.');
- OSL_ENSURE(-1 != nLastSep, "OColumnExport::startExportElement: invalid service name!");
- sColumnServiceName = sColumnServiceName.copy(nLastSep + 1);
- // add the attribute
- AddAttribute(getCommonControlAttributeNamespace(CCA_SERVICE_NAME), getCommonControlAttributeName(CCA_SERVICE_NAME), sColumnServiceName);
- // flag the property as "handled"
- exportedProperty(PROPERTY_COLUMNSERVICENAME);
-
- }
-
- //---------------------------------------------------------------------
- const sal_Char* OColumnExport::getOuterXMLElementName() const
- {
- return "column";
- }
-
- //---------------------------------------------------------------------
- void OColumnExport::exportAttributes()
- {
- OControlExport::exportAttributes();
-
- // the attribute "label"
- exportStringPropertyAttribute(
- getCommonControlAttributeNamespace(CCA_LABEL),
- getCommonControlAttributeName(CCA_LABEL),
- PROPERTY_LABEL);
-
- // the style attribute
- ::rtl::OUString sStyleName = m_rContext.getObjectStyleName( m_xProps );
- if ( sStyleName.getLength() )
- {
- AddAttribute(
- getSpecialAttributeNamespace( SCA_COLUMN_STYLE_NAME ),
- getSpecialAttributeName( SCA_COLUMN_STYLE_NAME ),
- sStyleName
- );
- }
- }
-
- //---------------------------------------------------------------------
- void OColumnExport::examine()
- {
- OControlExport::examine();
-
- // grid columns miss some properties of the controls they're representing
- m_nIncludeCommon &= ~(CCA_CONTROL_ID | CCA_FOR | CCA_PRINTABLE | CCA_TAB_INDEX | CCA_TAB_STOP | CCA_LABEL);
- m_nIncludeSpecial &= ~(SCA_ECHO_CHAR | SCA_AUTOMATIC_COMPLETION | SCA_MULTIPLE | SCA_MULTI_LINE | SCA_IS_TRISTATE);
-
- if (FormComponentType::DATEFIELD != m_nClassId)
- // except date fields, no column has the DropDown property
- m_nIncludeCommon &= ~CCA_DROPDOWN;
- }
-
- //=====================================================================
- //= OFormExport
- //=====================================================================
- //---------------------------------------------------------------------
- OFormExport::OFormExport(IFormsExportContext& _rContext, const Reference< XPropertySet >& _rxForm,
- const Sequence< ScriptEventDescriptor >& _rEvents)
- :OElementExport(_rContext, _rxForm, _rEvents)
- {
- OSL_ENSURE(m_xProps.is(), "OFormExport::OFormExport: invalid arguments!");
- }
-
- //---------------------------------------------------------------------
- const sal_Char* OFormExport::getXMLElementName() const
- {
- return "form";
- }
-
- //---------------------------------------------------------------------
- void OFormExport::exportSubTags()
- {
- // let the base class export the remaining properties and the events
- OElementExport::exportSubTags();
-
- // loop through all children
- Reference< XIndexAccess > xCollection(m_xProps, UNO_QUERY);
- OSL_ENSURE(xCollection.is(), "OFormLayerXMLExport::implExportForm: a form which is not an index access? Suspicíous!");
-
- if (xCollection.is())
- m_rContext.exportCollectionElements(xCollection);
- }
-
- //---------------------------------------------------------------------
- void OFormExport::exportAttributes()
- {
- sal_Int32 i=0;
-
- // ---------------------
- // the string properties
- {
- static FormAttributes eStringPropertyIds[] =
- {
- faName, /*faAction,*/ faCommand, faDatasource, faFilter, faOrder
- };
- static ::rtl::OUString aStringPropertyNames[] =
- {
- PROPERTY_NAME, /*PROPERTY_TARGETURL,*/ PROPERTY_COMMAND, PROPERTY_DATASOURCENAME, PROPERTY_FILTER, PROPERTY_ORDER
- };
- sal_Int32 nIdCount = SAL_N_ELEMENTS(eStringPropertyIds);
- #ifdef DBG_UTIL
- sal_Int32 nNameCount = SAL_N_ELEMENTS(aStringPropertyNames);
- OSL_ENSURE((nIdCount == nNameCount),
- "OFormExport::exportAttributes: somebody tampered with the maps (1)!");
- #endif
- for (i=0; i<nIdCount; ++i)
- exportStringPropertyAttribute(
- getFormAttributeNamespace(eStringPropertyIds[i]),
- getFormAttributeName(eStringPropertyIds[i]),
- aStringPropertyNames[i]);
- }
-
- // ----------------------
- // the boolean properties
- {
- static FormAttributes eBooleanPropertyIds[] =
- {
- faAllowDeletes, faAllowInserts, faAllowUpdates, faApplyFilter, faEscapeProcessing, faIgnoreResult
- };
- static const ::rtl::OUString* pBooleanPropertyNames[] =
- {
- &PROPERTY_ALLOWDELETES, &PROPERTY_ALLOWINSERTS, &PROPERTY_ALLOWUPDATES, &PROPERTY_APPLYFILTER, &PROPERTY_ESCAPEPROCESSING, &PROPERTY_IGNORERESULT
- };
- static sal_Int8 nBooleanPropertyAttrFlags[] =
- {
- BOOLATTR_DEFAULT_TRUE, BOOLATTR_DEFAULT_TRUE, BOOLATTR_DEFAULT_TRUE, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_TRUE, BOOLATTR_DEFAULT_FALSE
- };
- sal_Int32 nIdCount = SAL_N_ELEMENTS(eBooleanPropertyIds);
- #ifdef DBG_UTIL
- sal_Int32 nNameCount = SAL_N_ELEMENTS(pBooleanPropertyNames);
- sal_Int32 nFlagsCount = SAL_N_ELEMENTS(nBooleanPropertyAttrFlags);
- OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nFlagsCount),
- "OFormExport::exportAttributes: somebody tampered with the maps (2)!");
- #endif
- for (i=0; i<nIdCount; ++i)
- exportBooleanPropertyAttribute(
- getFormAttributeNamespace(eBooleanPropertyIds[i]),
- getFormAttributeName(eBooleanPropertyIds[i]),
- *(pBooleanPropertyNames[i]),
- nBooleanPropertyAttrFlags[i]
- );
- }
-
- // -------------------
- // the enum properties
- {
- static FormAttributes eEnumPropertyIds[] =
- {
- faEnctype, faMethod, faCommandType, faNavigationMode, faTabbingCycle
- };
- static const sal_Char* pEnumPropertyNames[] =
- {
- PROPERTY_SUBMIT_ENCODING, PROPERTY_SUBMIT_METHOD, PROPERTY_COMMAND_TYPE, PROPERTY_NAVIGATION, PROPERTY_CYCLE
- };
- static OEnumMapper::EnumProperties eEnumPropertyMaps[] =
- {
- OEnumMapper::epSubmitEncoding, OEnumMapper::epSubmitMethod, OEnumMapper::epCommandType, OEnumMapper::epNavigationType, OEnumMapper::epTabCyle
- };
- static sal_Int32 nEnumPropertyAttrDefaults[] =
- {
- FormSubmitEncoding_URL, FormSubmitMethod_GET, CommandType::COMMAND, NavigationBarMode_CURRENT, TabulatorCycle_RECORDS
- };
- static sal_Bool nEnumPropertyAttrDefaultFlags[] =
- {
- sal_False, sal_False, sal_False, sal_False, sal_True
- };
- sal_Int32 nIdCount = SAL_N_ELEMENTS(eEnumPropertyIds);
- #ifdef DBG_UTIL
- sal_Int32 nNameCount = SAL_N_ELEMENTS(pEnumPropertyNames);
- sal_Int32 nDefaultCount = SAL_N_ELEMENTS(nEnumPropertyAttrDefaults);
- sal_Int32 nDefaultFlagCount = SAL_N_ELEMENTS(nEnumPropertyAttrDefaultFlags);
- sal_Int32 nMapCount = SAL_N_ELEMENTS(eEnumPropertyMaps);
- OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nDefaultCount) && (nDefaultCount == nDefaultFlagCount) && (nDefaultFlagCount == nMapCount),
- "OFormExport::exportAttributes: somebody tampered with the maps (3)!");
- #endif
- for (i=0; i<nIdCount; ++i)
- exportEnumPropertyAttribute(
- getFormAttributeNamespace(eEnumPropertyIds[i]),
- getFormAttributeName(eEnumPropertyIds[i]),
- pEnumPropertyNames[i],
- OEnumMapper::getEnumMap(eEnumPropertyMaps[i]),
- nEnumPropertyAttrDefaults[i],
- nEnumPropertyAttrDefaultFlags[i]
- );
- }
-
- // the service name
- exportServiceNameAttribute();
- // the target frame
- exportTargetFrameAttribute();
- // the target URL
- exportTargetLocationAttribute();
-
- // master fields
- exportStringSequenceAttribute(
- getFormAttributeNamespace(faMasterFields),
- getFormAttributeName(faMasterFields),
- PROPERTY_MASTERFIELDS);
- // detail fields
- exportStringSequenceAttribute(
- getFormAttributeNamespace(faDetailFiels),
- getFormAttributeName(faDetailFiels),
- PROPERTY_DETAILFIELDS);
- }
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_elementimport.cxx b/binfilter/bf_xmloff/source/forms/xmloff_elementimport.cxx
deleted file mode 100644
index c0ec1783ede1..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_elementimport.cxx
+++ /dev/null
@@ -1,1455 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <algorithm>
-
-#include "elementimport.hxx"
-#include "xmlimp.hxx"
-#include "nmspmap.hxx"
-#include "xmluconv.hxx"
-#include "strings.hxx"
-#include "attriblistmerge.hxx"
-#include "xmlnmspe.hxx"
-#include "formstyles.hxx"
-#include "formenums.hxx"
-
-#include <comphelper/extract.hxx>
-#include <com/sun/star/util/XCloneable.hpp>
-#include <com/sun/star/form/FormComponentType.hpp>
-
-#include <algorithm>
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::container;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::script;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::form;
- using namespace ::com::sun::star::xml;
- using namespace ::com::sun::star::util;
-
-#define PROPID_VALUE 1
-#define PROPID_CURRENT_VALUE 2
-#define PROPID_MIN_VALUE 3
-#define PROPID_MAX_VALUE 4
-
- //=====================================================================
- struct PropertyValueLess
- {
- sal_Bool operator()(const PropertyValue& _rLeft, const PropertyValue& _rRight)
- {
- return _rLeft.Name < _rRight.Name;
- }
- };
-
- //=====================================================================
- template <class ELEMENT>
- void pushBackSequenceElement(Sequence< ELEMENT >& _rContainer, const ELEMENT& _rElement)
- {
- sal_Int32 nLen = _rContainer.getLength();
- _rContainer.realloc(nLen + 1);
- _rContainer[nLen] = _rElement;
- }
-
- //=====================================================================
- //= OElementNameMap
- //=====================================================================
- //---------------------------------------------------------------------
- OElementNameMap::MapString2Element OElementNameMap::s_sElementTranslations;
-
- //---------------------------------------------------------------------
- const OControlElement::ElementType& operator ++(OControlElement::ElementType& _e)
- {
- OControlElement::ElementType e = _e;
- sal_Int32 nAsInt = static_cast<sal_Int32>(e);
- _e = static_cast<OControlElement::ElementType>( ++nAsInt );
- return _e;
- }
-
- //---------------------------------------------------------------------
- OControlElement::ElementType OElementNameMap::getElementType(const ::rtl::OUString& _rName)
- {
- if (0 == s_sElementTranslations.size())
- { // initialize
- for (ElementType eType=(ElementType)0; eType<UNKNOWN; ++eType)
- s_sElementTranslations[::rtl::OUString::createFromAscii(getElementName(eType))] = eType;
- }
- ConstMapString2ElementIterator aPos = s_sElementTranslations.find(_rName);
- if (s_sElementTranslations.end() != aPos)
- return aPos->second;
- return UNKNOWN;
- }
-
- //=====================================================================
- //= OElementImport
- //=====================================================================
- //---------------------------------------------------------------------
- OElementImport::OElementImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const Reference< XNameContainer >& _rxParentContainer)
- :OPropertyImport(_rImport, _nPrefix, _rName)
- ,m_xParentContainer(_rxParentContainer)
- ,m_rFormImport(_rImport)
- ,m_rEventManager(_rEventManager)
- ,m_pStyleElement( NULL )
- {
- OSL_ENSURE(m_xParentContainer.is(), "OElementImport::OElementImport: invalid parent container!");
- }
-
- //---------------------------------------------------------------------
- void OElementImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList)
- {
- ENTER_LOG_CONTEXT( "xmloff::OElementImport - importing one element" );
- // call the base class. This should give us enough information (especially the service name)
- // to create our UNO element
- OPropertyImport::StartElement(_rxAttrList);
-
- // create the element
- m_xElement = createElement();
- }
-
- //---------------------------------------------------------------------
- SvXMLImportContext* OElementImport::CreateChildContext(sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const Reference< sax::XAttributeList >& _rxAttrList)
- {
- static const ::rtl::OUString s_sEventTagName = ::rtl::OUString::createFromAscii("events");
- if ((s_sEventTagName == _rLocalName) && (XML_NAMESPACE_OFFICE == _nPrefix))
- return new OFormEventsImportContext(m_rFormImport.getGlobalContext(), _nPrefix, _rLocalName, *this);
-
- return OPropertyImport::CreateChildContext(_nPrefix, _rLocalName, _rxAttrList);
- }
-
- //---------------------------------------------------------------------
- void OElementImport::EndElement()
- {
- OSL_ENSURE(m_xElement.is(), "OElementImport::EndElement: invalid element created!");
- if (!m_xElement.is())
- return;
-
- // set all the properties we collected
-#if OSL_DEBUG_LEVEL > 0
- // check if the object has all the properties
- // (We do this in the non-pro version only. Doing it all the time would be much to expensive)
- Reference< XPropertySetInfo > xPropInfo = m_xElement->getPropertySetInfo();
- if (xPropInfo.is())
- {
- for ( ConstPropertyValueArrayIterator aCheck = m_aValues.begin();
- aCheck != m_aValues.end();
- ++aCheck
- )
- {
- OSL_ENSURE(xPropInfo->hasPropertyByName(aCheck->Name),
- ::rtl::OString("OElementImport::EndElement: read a property (")
- += ::rtl::OString(aCheck->Name.getStr(), aCheck->Name.getLength(), RTL_TEXTENCODING_ASCII_US)
- += ::rtl::OString(") which does not exist on the element!"));
- }
- }
-#endif
- OSL_ENSURE(m_aValues.size(), "OElementImport::EndElement: no properties read!");
-
- // set the properties
- Reference< XMultiPropertySet > xMultiProps(m_xElement, UNO_QUERY);
- sal_Bool bSuccess = sal_False;
- if (xMultiProps.is())
- {
- // translate our properties so that the XMultiPropertySet can handle them
-
- // sort our property value array so that we can use it in a setPropertyValues
- ::std::sort( m_aValues.begin(), m_aValues.end(), PropertyValueLess());
-
- // the names
- Sequence< ::rtl::OUString > aNames(m_aValues.size());
- ::rtl::OUString* pNames = aNames.getArray();
- // the values
- Sequence< Any > aValues(m_aValues.size());
- Any* pValues = aValues.getArray();
- // copy
-
- for ( ConstPropertyValueArrayIterator aPropValues = m_aValues.begin();
- aPropValues != m_aValues.end();
- ++aPropValues, ++pNames, ++pValues
- )
- {
- *pNames = aPropValues->Name;
- *pValues = aPropValues->Value;
- }
-
- try
- {
- xMultiProps->setPropertyValues(aNames, aValues);
- bSuccess = sal_True;
- }
- catch(Exception&)
- {
- OSL_ENSURE(sal_False, "OElementImport::EndElement: could not set the properties (using the XMultiPropertySet)!");
- }
- }
-
- if (!bSuccess)
- { // no XMultiPropertySet or setting all properties at once failed
- for ( ConstPropertyValueArrayIterator aPropValues = m_aValues.begin();
- aPropValues != m_aValues.end();
- ++aPropValues
- )
- {
- // this try/catch here is expensive, but because this is just a fallback which should normally not be
- // used it's acceptable this way ...
- try
- {
- m_xElement->setPropertyValue(aPropValues->Name, aPropValues->Value);
- }
- catch(Exception&)
- {
- OSL_ENSURE(sal_False,
- ::rtl::OString("OElementImport::EndElement: could not set the property \"")
- += ::rtl::OString(aPropValues->Name.getStr(), aPropValues->Name.getLength(), RTL_TEXTENCODING_ASCII_US)
- += ::rtl::OString("\"!"));
- }
- }
- }
-
- // set the style properties
- if ( m_pStyleElement && m_xElement.is() )
- {
- const_cast< OControlStyleContext* >( m_pStyleElement )->FillPropertySet( m_xElement );
-
- ::rtl::OUString sNumberStyleName = const_cast< OControlStyleContext* >( m_pStyleElement )->getNumberStyleName( );
- if ( sNumberStyleName.getLength() )
- // the style also has a number (sub) style
- m_rContext.applyControlNumberStyle( m_xElement, sNumberStyleName );
- }
-
- // insert the element into the parent container
- if (!m_sName.getLength())
- {
- OSL_ENSURE(sal_False, "OElementImport::EndElement: did not find a name attribute!");
- m_sName = implGetDefaultName();
- }
-
- m_xParentContainer->insertByName(m_sName, makeAny(m_xElement));
- LEAVE_LOG_CONTEXT( );
- }
-
- //---------------------------------------------------------------------
- ::rtl::OUString OElementImport::implGetDefaultName() const
- {
- // no optimization here. If this method gets called, the XML stream did not contain a name for the
- // element, which is a heavy error. So in this case we don't care for performance
- Sequence< ::rtl::OUString > aNames = m_xParentContainer->getElementNames();
- static const ::rtl::OUString sUnnamedName = ::rtl::OUString::createFromAscii("unnamed");
-
- ::rtl::OUString sReturn;
- const ::rtl::OUString* pNames = NULL;
- const ::rtl::OUString* pNamesEnd = aNames.getConstArray() + aNames.getLength();
- for (sal_Int32 i=0; i<32768; ++i) // the limit is nearly arbitrary ...
- {
- // assemble the new name (suggestion)
- sReturn = sUnnamedName;
- sReturn += ::rtl::OUString::valueOf(i);
- // check the existence (this is the bad performance part ....)
- for (pNames = aNames.getConstArray(); pNames<pNamesEnd; ++pNames)
- {
- if (*pNames == sReturn)
- {
- break;
- }
- }
- if (pNames<pNamesEnd)
- // found the name
- continue;
- return sReturn;
- }
- OSL_ENSURE(sal_False, "OElementImport::implGetDefaultName: did not find a free name!");
- return sUnnamedName;
- }
-
- //---------------------------------------------------------------------
- void OElementImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
- {
- static const ::rtl::OUString s_sServiceNameAttribute = ::rtl::OUString::createFromAscii(getCommonControlAttributeName(CCA_SERVICE_NAME));
- static const ::rtl::OUString s_sNameAttribute = ::rtl::OUString::createFromAscii(getCommonControlAttributeName(CCA_NAME));
-
- if (!m_sServiceName.getLength() && (_rLocalName == s_sServiceNameAttribute))
- { // it's the service name
- m_sServiceName = _rValue;
- }
- else
- {
- if (!m_sName.getLength() && (_rLocalName == s_sNameAttribute))
- // remember the name for later use in EndElement
- m_sName = _rValue;
-
- // maybe it's the style attribute?
- if ( 0 == _rLocalName.compareToAscii( getSpecialAttributeName( SCA_COLUMN_STYLE_NAME ) ) )
- {
- const SvXMLStyleContext* pStyleContext = m_rContext.getStyleElement( _rValue );
- OSL_ENSURE( pStyleContext, "OPropertyImport::handleAttribute: do not know the style!" );
- // remember the element for later usage.
- m_pStyleElement = static_cast< const OControlStyleContext* >( pStyleContext );
- }
- else
- // let the base class handle it
- OPropertyImport::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
- }
- }
-
- //---------------------------------------------------------------------
- Reference< XPropertySet > OElementImport::createElement()
- {
- Reference< XPropertySet > xReturn;
- if (m_sServiceName.getLength())
- {
- Reference< XInterface > xPure = m_rFormImport.getServiceFactory()->createInstance(m_sServiceName);
- OSL_ENSURE(xPure.is(),
- ::rtl::OString("OElementImport::createElement: service factory gave me no object (service name: ")
- += ::rtl::OString(m_sServiceName.getStr(), m_sServiceName.getLength(), RTL_TEXTENCODING_ASCII_US)
- += ::rtl::OString(")!"));
- xReturn = Reference< XPropertySet >(xPure, UNO_QUERY);
- }
- else
- OSL_ENSURE(sal_False, "OElementImport::createElement: no service name to create an element!");
-
- return xReturn;
- }
-
- //---------------------------------------------------------------------
- void OElementImport::registerEvents(const Sequence< ScriptEventDescriptor >& _rEvents)
- {
- OSL_ENSURE(m_xElement.is(), "OElementImport::registerEvents: no element to register events for!");
- m_rEventManager.registerEvents(m_xElement, _rEvents);
- }
-
- //---------------------------------------------------------------------
- void OElementImport::simulateDefaultedAttribute(const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName, const sal_Char* _pAttributeDefault)
- {
- Reference< XPropertySetInfo > xPropsInfo = m_xElement->getPropertySetInfo();
- OSL_ENSURE( xPropsInfo.is(), "OPropertyImport::simulateDefaultedAttribute: the component should be more gossipy about it's properties!" );
-
- if ( !xPropsInfo.is() || xPropsInfo->hasPropertyByName( _rPropertyName ) )
- {
- ::rtl::OUString sLocalAttrName = ::rtl::OUString::createFromAscii(_pAttributeName);
- if ( !encounteredAttribute( sLocalAttrName ) )
- handleAttribute( XML_NAMESPACE_FORM, sLocalAttrName, ::rtl::OUString::createFromAscii( _pAttributeDefault ) );
- }
- }
-
- //=====================================================================
- //= OControlImport
- //=====================================================================
- //---------------------------------------------------------------------
- OControlImport::OControlImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const Reference< XNameContainer >& _rxParentContainer)
- :OElementImport(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer)
- ,m_eElementType(OControlElement::UNKNOWN)
- {
- }
-
- //---------------------------------------------------------------------
- OControlImport::OControlImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const Reference< XNameContainer >& _rxParentContainer, OControlElement::ElementType _eType)
- :OElementImport(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer)
- ,m_eElementType(_eType)
- {
- }
-
- //---------------------------------------------------------------------
- void OControlImport::addOuterAttributes(const Reference< sax::XAttributeList >& _rxOuterAttribs)
- {
- OSL_ENSURE(!m_xOuterAttributes.is(), "OControlImport::addOuterAttributes: already have these attributes!");
- m_xOuterAttributes = _rxOuterAttribs;
- }
-
- //---------------------------------------------------------------------
- void OControlImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
- {
- // the control id
- static const ::rtl::OUString s_sControlIdAttribute = ::rtl::OUString::createFromAscii(getCommonControlAttributeName(CCA_CONTROL_ID));
-
- // the value attributes
- static const ::rtl::OUString s_sValueAttribute = ::rtl::OUString::createFromAscii(getCommonControlAttributeName(CCA_VALUE));
- static const ::rtl::OUString s_sCurrentValueAttribute = ::rtl::OUString::createFromAscii(getCommonControlAttributeName(CCA_CURRENT_VALUE));
- static const ::rtl::OUString s_sMinValueAttribute = ::rtl::OUString::createFromAscii(getSpecialAttributeName(SCA_MIN_VALUE));
- static const ::rtl::OUString s_sMaxValueAttribute = ::rtl::OUString::createFromAscii(getSpecialAttributeName(SCA_MAX_VALUE));
-
- if (!m_sControlId.getLength() && (_rLocalName == s_sControlIdAttribute))
- { // it's the control id
- m_sControlId = _rValue;
- }
- else if ( _rLocalName.equalsAscii( getBindingAttributeName( BA_LINKED_CELL ) ) )
- {
- m_sBoundCellAddress = _rValue;
- }
- else
- {
- sal_Int32 nHandle;
- if ( ((_rLocalName == s_sValueAttribute) && (nHandle = PROPID_VALUE))
- || ((_rLocalName == s_sCurrentValueAttribute) && (nHandle = PROPID_CURRENT_VALUE))
- || ((_rLocalName == s_sMinValueAttribute) && (nHandle = PROPID_MIN_VALUE))
- || ((_rLocalName == s_sMaxValueAttribute) && (nHandle = PROPID_MAX_VALUE))
- // it's no == in the second part, it's an assignment!!!!!
- )
- {
- // for the moment, simply remember the name and the value
- PropertyValue aProp;
- aProp.Name = _rLocalName;
- aProp.Handle = nHandle;
- aProp.Value <<= _rValue;
- m_aValueProperties.push_back(aProp);
- }
- else
- OElementImport::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
- }
- }
-
- //---------------------------------------------------------------------
- void OControlImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList)
- {
- // merge the attribute lists
- OAttribListMerger* pMerger = new OAttribListMerger;
- // our own one
- pMerger->addList(_rxAttrList);
- // and the ones of our enclosing element
- pMerger->addList(m_xOuterAttributes);
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > xAttributes = pMerger;
-
- // let the base class handle all the attributes
- OElementImport::StartElement(xAttributes);
-
- if (m_aValueProperties.size() && m_xElement.is())
- {
- // get the property set info
- Reference< XPropertySetInfo > xPropsInfo = m_xElement->getPropertySetInfo();
- if (!xPropsInfo.is())
- {
- OSL_ENSURE(sal_False, "OControlImport::StartElement: no PropertySetInfo!");
- return;
- }
-
- const sal_Char* pValueProperty = NULL;
- const sal_Char* pCurrentValueProperty = NULL;
- const sal_Char* pMinValueProperty = NULL;
- const sal_Char* pMaxValueProperty = NULL;
-
- sal_Bool bRetrievedValues = sal_False;
- sal_Bool bRetrievedValueLimits = sal_False;
-
- // get the class id of our element
- sal_Int16 nClassId = FormComponentType::CONTROL;
- m_xElement->getPropertyValue(PROPERTY_CLASSID) >>= nClassId;
-
- // translate the value properties we collected in handleAttributes
- for ( PropertyValueArrayIterator aValueProps = m_aValueProperties.begin();
- aValueProps != m_aValueProperties.end();
- ++aValueProps
- )
- {
- switch (aValueProps->Handle)
- {
- case PROPID_VALUE:
- case PROPID_CURRENT_VALUE:
- {
- // get the property names
- if (!bRetrievedValues)
- {
- getValuePropertyNames(m_eElementType, nClassId, pCurrentValueProperty, pValueProperty);
- bRetrievedValues = sal_True;
- }
- OSL_ENSURE((PROPID_VALUE != aValueProps->Handle) || pValueProperty,
- "OControlImport::StartElement: the control does not have a value property!");
- OSL_ENSURE((PROPID_CURRENT_VALUE != aValueProps->Handle) || pCurrentValueProperty,
- "OControlImport::StartElement: the control does not have a current-value property!");
-
- // transfer the name
- if (PROPID_VALUE == aValueProps->Handle)
- aValueProps->Name = ::rtl::OUString::createFromAscii(pValueProperty);
- else
- aValueProps->Name = ::rtl::OUString::createFromAscii(pCurrentValueProperty);
- }
- break;
- case PROPID_MIN_VALUE:
- case PROPID_MAX_VALUE:
- {
- // get the property names
- if (!bRetrievedValueLimits)
- {
- getValueLimitPropertyNames(nClassId, pMinValueProperty, pMaxValueProperty);
- bRetrievedValueLimits = sal_True;
- }
- OSL_ENSURE((PROPID_MIN_VALUE != aValueProps->Handle) || pMinValueProperty,
- "OControlImport::StartElement: the control does not have a value property!");
- OSL_ENSURE((PROPID_MAX_VALUE != aValueProps->Handle) || pMaxValueProperty,
- "OControlImport::StartElement: the control does not have a current-value property!");
-
- // transfer the name
- if (PROPID_MIN_VALUE == aValueProps->Handle)
- aValueProps->Name = ::rtl::OUString::createFromAscii(pMinValueProperty);
- else
- aValueProps->Name = ::rtl::OUString::createFromAscii(pMaxValueProperty);
- }
- break;
- }
-
- // translate the value
- implTranslateValueProperty(xPropsInfo, *aValueProps);
- // add the property to the base class' array
- implPushBackPropertyValue(*aValueProps);
- }
- }
- }
-
- //---------------------------------------------------------------------
- void OControlImport::implTranslateValueProperty(const Reference< XPropertySetInfo >& _rxPropInfo,
- PropertyValue& _rPropValue)
- {
- OSL_ENSURE(_rxPropInfo->hasPropertyByName(_rPropValue.Name),
- "OControlImport::implTranslateValueProperty: invalid property name!");
-
- // retrieve the type of the property
- Property aProp = _rxPropInfo->getPropertyByName(_rPropValue.Name);
- // the untranslated string value as read in handleAttribute
- ::rtl::OUString sValue;
- #if OSL_DEBUG_LEVEL > 0
- sal_Bool bSuccess =
- #endif
- _rPropValue.Value >>= sValue;
- OSL_ENSURE(bSuccess, "OControlImport::implTranslateValueProperty: supposed to be called with non-translated string values!");
-
- if (TypeClass_ANY == aProp.Type.getTypeClass())
- {
- // we have exactly 2 properties where this type class is allowed:
- OSL_ENSURE(
- (0 == _rPropValue.Name.compareToAscii(PROPERTY_EFFECTIVE_VALUE))
- || (0 == _rPropValue.Name.compareToAscii(PROPERTY_EFFECTIVE_DEFAULT)),
- "OControlImport::implTranslateValueProperty: invalid property type/name combination!");
-
- // Both properties are allowed to have a double or a string value,
- // so first try to convert the string into a number
- double nValue;
- if (GetImport().GetMM100UnitConverter().convertDouble(nValue, sValue))
- _rPropValue.Value <<= nValue;
- else
- _rPropValue.Value <<= sValue;
- }
- else
- _rPropValue.Value = convertString(GetImport(), aProp.Type, sValue);
- }
-
- //---------------------------------------------------------------------
- void OControlImport::EndElement()
- {
- OSL_ENSURE(m_xElement.is(), "OControlImport::EndElement: invalid control!");
- if ( !m_xElement.is() )
- return;
-
- // register our control with it's id
- if (m_sControlId.getLength())
- m_rFormImport.getControlIdMap().registerControlId(m_xElement, m_sControlId);
- // it's allowed to have no control id. In this case we're importing a column
-
- // one more pre-work to do:
- // when we set default values, then by definition the respective value is set
- // to this default value, too. This means if the sequence contains for example
- // a DefaultText value, then the Text will be affected by this, too.
- // In case the Text is not part of the property sequence (or occurs _before_
- // the DefaultText, which can happen for other value/default-value property names),
- // this means that the Text (the value property) is incorrectly imported.
- // #102475# - 04.09.2002 - fs@openoffice.org
-
- sal_Bool bRestoreValuePropertyValue = sal_False;
- Any aValuePropertyValue;
-
- sal_Int16 nClassId = FormComponentType::CONTROL;
- try
- {
- // get the class id of our element
- m_xElement->getPropertyValue(PROPERTY_CLASSID) >>= nClassId;
- }
- catch( const Exception& )
- {
- OSL_ENSURE( sal_False, "OControlImport::EndElement: caught an exception while retrieving the class id!" );
- }
-
- const sal_Char* pValueProperty = NULL;
- const sal_Char* pDefaultValueProperty = NULL;
- getRuntimeValuePropertyNames(m_eElementType, nClassId, pValueProperty, pDefaultValueProperty);
- if ( pDefaultValueProperty && pValueProperty )
- {
- sal_Bool bNonDefaultValuePropertyValue = sal_False;
- // is the "value property" part of the sequence?
-
- // look up this property in our sequence
- for ( ConstPropertyValueArrayIterator aCheck = m_aValues.begin();
- ( aCheck != m_aValues.end() );
- ++aCheck
- )
- {
- if ( aCheck->Name.equalsAscii( pDefaultValueProperty ) )
- bRestoreValuePropertyValue = sal_True;
- else if ( aCheck->Name.equalsAscii( pValueProperty ) )
- {
- bNonDefaultValuePropertyValue = sal_True;
- // we need to restore the value property we found here, nothing else
- aValuePropertyValue = aCheck->Value;
- }
- }
-
- if ( bRestoreValuePropertyValue && !bNonDefaultValuePropertyValue )
- {
- // found it -> need to remember (and restore) the "value property value", which is not set explicitly
- try
- {
- aValuePropertyValue = m_xElement->getPropertyValue( ::rtl::OUString::createFromAscii( pValueProperty ) );
- }
- catch( const Exception& )
- {
- OSL_ENSURE( sal_False, "OControlImport::EndElement: caught an exception while retrieving the current value property!" );
- }
- }
- }
-
- // let the base class set all the values
- OElementImport::EndElement();
-
- // restore the "value property value", if necessary
- if ( bRestoreValuePropertyValue && pValueProperty )
- {
- try
- {
- m_xElement->setPropertyValue( ::rtl::OUString::createFromAscii( pValueProperty ), aValuePropertyValue );
- }
- catch( const Exception& )
- {
- OSL_ENSURE( sal_False, "OControlImport::EndElement: caught an exception while restoring the value property!" );
- }
- }
-
- // the external cell binding, if applicable
- if ( m_xElement.is() && m_sBoundCellAddress.getLength() )
- doRegisterCellValueBinding( m_sBoundCellAddress );
- }
-
- //---------------------------------------------------------------------
- void OControlImport::doRegisterCellValueBinding( const ::rtl::OUString& _rBoundCellAddress )
- {
- OSL_PRECOND( m_xElement.is(), "OControlImport::doRegisterCellValueBinding: invalid element!" );
- OSL_PRECOND( _rBoundCellAddress.getLength(),
- "OControlImport::doRegisterCellValueBinding: invalid address!" );
-
- m_rContext.registerCellValueBinding( m_xElement, _rBoundCellAddress );
- }
-
- //---------------------------------------------------------------------
- //added by BerryJia for fixing bug102407 2002-11-5
- Reference< XPropertySet > OControlImport::createElement()
- {
- Reference<XPropertySet> xPropSet = OElementImport::createElement();
- if(xPropSet.is())
- {
- Reference<XPropertySetInfo> xInfo(xPropSet->getPropertySetInfo());
- if(xInfo.is() && xInfo->hasPropertyByName(PROPERTY_ALIGN))
- {
- Any aValue;
- xPropSet->setPropertyValue(PROPERTY_ALIGN,aValue);
- }
- }
- return xPropSet;
- }
- //=====================================================================
- //= OReferredControlImport
- //=====================================================================
- //---------------------------------------------------------------------
- OReferredControlImport::OReferredControlImport(
- IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const Reference< XNameContainer >& _rxParentContainer,
- OControlElement::ElementType _eType)
- :OControlImport(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer)
- {
- }
-
- //---------------------------------------------------------------------
- void OReferredControlImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList)
- {
- OControlImport::StartElement(_rxAttrList);
-
- // the base class should have created the control, so we can register it
- if (m_sReferringControls.getLength())
- m_rFormImport.getControlIdMap().registerControlReferences(m_xElement, m_sReferringControls);
- }
-
- //---------------------------------------------------------------------
- void OReferredControlImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName,
- const ::rtl::OUString& _rValue)
- {
- static const ::rtl::OUString s_sReferenceAttributeName = ::rtl::OUString::createFromAscii(getCommonControlAttributeName(CCA_FOR));
- if (_rLocalName == s_sReferenceAttributeName)
- m_sReferringControls = _rValue;
- else
- OControlImport::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
- }
-
- //=====================================================================
- //= OPasswordImport
- //=====================================================================
- //---------------------------------------------------------------------
- OPasswordImport::OPasswordImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const Reference< XNameContainer >& _rxParentContainer, OControlElement::ElementType _eType)
- :OControlImport(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer, _eType)
- {
- }
-
- //---------------------------------------------------------------------
- void OPasswordImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
- {
- static const ::rtl::OUString s_sEchoCharAttributeName = ::rtl::OUString::createFromAscii(getSpecialAttributeName(SCA_ECHO_CHAR));
- if (_rLocalName == s_sEchoCharAttributeName)
- {
- // need a special handling for the EchoChar property
- PropertyValue aEchoChar;
- aEchoChar.Name = PROPERTY_ECHOCHAR;
- OSL_ENSURE(_rValue.getLength() == 1, "OPasswordImport::handleAttribute: invalid echo char attribute!");
- // we ourself should not have written values other than of length 1
- if (_rValue.getLength() >= 1)
- aEchoChar.Value <<= (sal_Int16)_rValue.getStr()[0];
- else
- aEchoChar.Value <<= (sal_Int16)0;
- implPushBackPropertyValue(aEchoChar);
- }
- else
- OControlImport::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
- }
-
- //=====================================================================
- //= ORadioImport
- //=====================================================================
- //---------------------------------------------------------------------
- ORadioImport::ORadioImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const Reference< XNameContainer >& _rxParentContainer, OControlElement::ElementType _eType)
- :OControlImport(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer, _eType)
- {
- }
-
- //---------------------------------------------------------------------
- void ORadioImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
- {
- // need special handling for the State & CurrentState properties:
- // they're stored as booleans, but expected to be int16 properties
- static const ::rtl::OUString s_sCurrentSelected = ::rtl::OUString::createFromAscii(getCommonControlAttributeName(CCA_CURRENT_SELECTED));
- static const ::rtl::OUString s_sSelected = ::rtl::OUString::createFromAscii(getCommonControlAttributeName(CCA_SELECTED));
- if ((_rLocalName == s_sCurrentSelected) || (_rLocalName == s_sSelected))
- {
- const OAttribute2Property::AttributeAssignment* pProperty = m_rContext.getAttributeMap().getAttributeTranslation(_rLocalName);
- OSL_ENSURE(pProperty, "ORadioImport::handleAttribute: invalid property map!");
- if (pProperty)
- {
- Any aBooleanValue = convertString(m_rContext.getGlobalContext(), pProperty->aPropertyType, _rValue, pProperty->pEnumMap);
-
- // create and store a new PropertyValue
- PropertyValue aNewValue;
- aNewValue.Name = pProperty->sPropertyName;
- aNewValue.Value <<= (sal_Int16)::cppu::any2bool(aBooleanValue);
-
- implPushBackPropertyValue(aNewValue);
- }
- }
- else
- OControlImport::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
- }
-
- //=====================================================================
- //= OURLReferenceImport
- //=====================================================================
- OURLReferenceImport::OURLReferenceImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const Reference< XNameContainer >& _rxParentContainer,
- OControlElement::ElementType _eType)
- :OControlImport(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer, _eType)
- {
- }
-
- //---------------------------------------------------------------------
- void OURLReferenceImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
- {
- static const sal_Char* s_pTargetLocationAttributeName = getCommonControlAttributeName( CCA_TARGET_LOCATION );
- static const sal_Char* s_pImageDataAttributeName = getCommonControlAttributeName( CCA_IMAGE_DATA );
-
- // need to make the URL absolute if
- // * it's the image-data attribute
- // * it's the target-location attribute, and we're dealign with an object which has the respective property
- sal_Bool bMakeAbsolute =
- ( 0 == _rLocalName.compareToAscii( s_pImageDataAttributeName ) )
- || ( ( 0 == _rLocalName.compareToAscii( s_pTargetLocationAttributeName ) )
- && ( ( OControlElement::BUTTON == m_eElementType )
- || ( OControlElement::IMAGE == m_eElementType )
- )
- );
-
- if ( bMakeAbsolute )
- {
- // make a global URL out of the local one
- ::rtl::OUString sAdjustedValue = m_rContext.getGlobalContext().GetAbsoluteReference( _rValue );
- OControlImport::handleAttribute( _nNamespaceKey, _rLocalName, sAdjustedValue );
- }
- else
- OControlImport::handleAttribute( _nNamespaceKey, _rLocalName, _rValue );
- }
-
- //=====================================================================
- //= OButtonImport
- //=====================================================================
- //---------------------------------------------------------------------
- OButtonImport::OButtonImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const Reference< XNameContainer >& _rxParentContainer,
- OControlElement::ElementType _eType)
- :OURLReferenceImport(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer, _eType)
- {
- enableTrackAttributes();
- }
-
- //---------------------------------------------------------------------
- void OButtonImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList)
- {
- OControlImport::StartElement(_rxAttrList);
-
- // handle the target-frame attribute
- simulateDefaultedAttribute(getCommonControlAttributeName(CCA_TARGET_FRAME), PROPERTY_TARGETFRAME, "_blank");
- }
-
- //=====================================================================
- //= OTextLikeImport
- //=====================================================================
- //---------------------------------------------------------------------
- OTextLikeImport::OTextLikeImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const Reference< XNameContainer >& _rxParentContainer,
- OControlElement::ElementType _eType)
- :OControlImport(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer, _eType)
- {
- enableTrackAttributes();
- }
-
- //---------------------------------------------------------------------
- void OTextLikeImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList)
- {
- OControlImport::StartElement(_rxAttrList);
-
- // handle the convert-empty-to-null attribute, which's default is different from the property default
- sal_Bool bHaveEmptyIsNull = sal_False;
- // unfortunately, different classes are imported by this class ('cause they're represented by the
- // same XML element), though not all of them know this property.
- // So we have to do a check ...
- if (m_xElement.is())
- {
- Reference< XPropertySetInfo > xProps = m_xElement->getPropertySetInfo();
- if (xProps.is())
- bHaveEmptyIsNull = xProps->hasPropertyByName(PROPERTY_EMPTY_IS_NULL);
- }
-
- if (bHaveEmptyIsNull)
- simulateDefaultedAttribute(getDatabaseAttributeName(DA_CONVERT_EMPTY), PROPERTY_EMPTY_IS_NULL, "false");
- }
-
- //=====================================================================
- //= OListAndComboImport
- //=====================================================================
- //---------------------------------------------------------------------
- OListAndComboImport::OListAndComboImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const Reference< XNameContainer >& _rxParentContainer,
- OControlElement::ElementType _eType)
- :OControlImport(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer, _eType)
- ,m_nEmptyListItems( 0 )
- ,m_nEmptyValueItems( 0 )
- ,m_bEncounteredLSAttrib( sal_False )
- ,m_bLinkWithIndexes( sal_False )
- {
- if (OControlElement::COMBOBOX == m_eElementType)
- enableTrackAttributes();
- }
-
- //---------------------------------------------------------------------
- SvXMLImportContext* OListAndComboImport::CreateChildContext(sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const Reference< sax::XAttributeList >& _rxAttrList)
- {
- // is it the "option" sub tag of a listbox ?
- static const ::rtl::OUString s_sOptionElementName = ::rtl::OUString::createFromAscii("option");
- if (s_sOptionElementName == _rLocalName)
- return new OListOptionImport(GetImport(), _nPrefix, _rLocalName, this);
-
- // is it the "item" sub tag of a combobox ?
- static const ::rtl::OUString s_sItemElementName = ::rtl::OUString::createFromAscii("item");
- if (s_sItemElementName == _rLocalName)
- return new OComboItemImport(GetImport(), _nPrefix, _rLocalName, this);
-
- // everything else
- return OControlImport::CreateChildContext(_nPrefix, _rLocalName, _rxAttrList);
- }
-
- //---------------------------------------------------------------------
- void OListAndComboImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList)
- {
- m_bLinkWithIndexes = sal_False;
-
- OControlImport::StartElement(_rxAttrList);
-
- if (OControlElement::COMBOBOX == m_eElementType)
- {
- // for the auto-completion
- // the attribute default does not equal the property default, so in case we did not read this attribute,
- // we have to simulate it
- simulateDefaultedAttribute( getSpecialAttributeName( SCA_AUTOMATIC_COMPLETION ), PROPERTY_AUTOCOMPLETE, "false");
-
- // same for the convert-empty-to-null attribute, which's default is different from the property default
- simulateDefaultedAttribute( getDatabaseAttributeName( DA_CONVERT_EMPTY ), PROPERTY_EMPTY_IS_NULL, "false");
- }
- }
-
- //---------------------------------------------------------------------
- void OListAndComboImport::EndElement()
- {
- // append the list source property the the properties sequence of our importer
- // the string item list
- PropertyValue aItemList;
- aItemList.Name = PROPERTY_STRING_ITEM_LIST;
- aItemList.Value <<= m_aListSource;
- implPushBackPropertyValue(aItemList);
-
- if (OControlElement::LISTBOX == m_eElementType)
- {
- OSL_ENSURE((m_aListSource.getLength() + m_nEmptyListItems) == (m_aValueList.getLength() + m_nEmptyValueItems),
- "OListAndComboImport::EndElement: inconsistence between labels and values!");
-
- if ( !m_bEncounteredLSAttrib )
- {
- // the value sequence
- PropertyValue aValueList;
- aValueList.Name = PROPERTY_LISTSOURCE;
- aValueList.Value <<= m_aValueList;
- implPushBackPropertyValue(aValueList);
- }
-
- // the select sequence
- PropertyValue aSelected;
- aSelected.Name = PROPERTY_SELECT_SEQ;
- aSelected.Value <<= m_aSelectedSeq;
- implPushBackPropertyValue(aSelected);
-
- // the default select sequence
- PropertyValue aDefaultSelected;
- aDefaultSelected.Name = PROPERTY_DEFAULT_SELECT_SEQ;
- aDefaultSelected.Value <<= m_aDefaultSelectedSeq;
- implPushBackPropertyValue(aDefaultSelected);
- }
-
- OControlImport::EndElement();
-
- // the external list source, if applicable
- if ( m_xElement.is() && m_sCellListSource.getLength() )
- m_rContext.registerCellRangeListSource( m_xElement, m_sCellListSource );
- }
-
- //---------------------------------------------------------------------
- void OListAndComboImport::doRegisterCellValueBinding( const ::rtl::OUString& _rBoundCellAddress )
- {
- ::rtl::OUString sBoundCellAddress( _rBoundCellAddress );
- if ( m_bLinkWithIndexes )
- {
- // This is a HACK. We register a string which is no valid address, but allows
- // (somewhere else) to determine that a non-standard binding should be created.
- // This hack is acceptable for OOo 1.1.1, since the file format for value
- // bindings of form controls is to be changed afterwards, anyway.
- sBoundCellAddress += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ":index" ) );
- }
-
- OControlImport::doRegisterCellValueBinding( sBoundCellAddress );
- }
-
- //---------------------------------------------------------------------
- void OListAndComboImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
- {
- static const ::rtl::OUString s_sListSourceAttributeName = ::rtl::OUString::createFromAscii(getDatabaseAttributeName(DA_LIST_SOURCE));
- if (s_sListSourceAttributeName == _rLocalName)
- {
- PropertyValue aListSource;
- aListSource.Name = PROPERTY_LISTSOURCE;
-
- // it's the ListSource attribute
- m_bEncounteredLSAttrib = sal_True;
- if ( OControlElement::COMBOBOX == m_eElementType )
- {
- aListSource.Value <<= _rValue;
- }
- else
- {
- // a listbox which has a list-source attribute must have a list-source-type of something
- // not equal to ValueList.
- // In this case, the list-source value is simply the one and only element of the ListSource property.
- Sequence< ::rtl::OUString > aListSourcePropValue( 1 );
- aListSourcePropValue[0] = _rValue;
- aListSource.Value <<= aListSourcePropValue;
- }
-
- implPushBackPropertyValue( aListSource );
- }
- else if ( _rLocalName.equalsAscii( getBindingAttributeName( BA_LIST_CELL_RANGE ) ) )
- {
- m_sCellListSource = _rValue;
- }
- else if ( _rLocalName.equalsAscii( getBindingAttributeName( BA_LIST_LINKING_TYPE ) ) )
- {
- sal_Int16 nLinkageType = 0;
- convertString(
- m_rContext.getGlobalContext(),
- ::getCppuType( static_cast< sal_Int16* >( NULL ) ),
- _rValue,
- OEnumMapper::getEnumMap( OEnumMapper::epListLinkageType )
- ) >>= nLinkageType;
-
- m_bLinkWithIndexes = ( nLinkageType != 0 );
- }
- else
- OControlImport::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
- }
-
- //---------------------------------------------------------------------
- void OListAndComboImport::implPushBackLabel(const ::rtl::OUString& _rLabel)
- {
- OSL_ENSURE(!m_nEmptyListItems, "OListAndComboImport::implPushBackValue: label list is already done!");
- if (!m_nEmptyListItems)
- pushBackSequenceElement(m_aListSource, _rLabel);
- }
-
- //---------------------------------------------------------------------
- void OListAndComboImport::implPushBackValue(const ::rtl::OUString& _rValue)
- {
- OSL_ENSURE(!m_nEmptyValueItems, "OListAndComboImport::implPushBackValue: value list is already done!");
- if (!m_nEmptyValueItems)
- {
- OSL_ENSURE( !m_bEncounteredLSAttrib, "OListAndComboImport::implPushBackValue: invalid structure! Did you save this document with a version prior SRC641 m?" );
- // We already had the list-source attribute, which means that the ListSourceType is
- // not ValueList, which means that the ListSource should contain only one string in
- // the first element of the sequence
- // All other values in the file are invalid
-
- pushBackSequenceElement( m_aValueList, _rValue );
- }
- }
-
- //---------------------------------------------------------------------
- void OListAndComboImport::implEmptyLabelFound()
- {
- ++m_nEmptyListItems;
- }
-
- //---------------------------------------------------------------------
- void OListAndComboImport::implEmptyValueFound()
- {
- ++m_nEmptyValueItems;
- }
-
- //---------------------------------------------------------------------
- void OListAndComboImport::implSelectCurrentItem()
- {
- OSL_ENSURE((m_aListSource.getLength() + m_nEmptyListItems) == (m_aValueList.getLength() + m_nEmptyValueItems),
- "OListAndComboImport::implSelectCurrentItem: inconsistence between labels and values!");
-
- sal_Int16 nItemNumber = (sal_Int16)(m_aListSource.getLength() - 1 + m_nEmptyListItems);
- pushBackSequenceElement(m_aSelectedSeq, nItemNumber);
- }
-
- //---------------------------------------------------------------------
- void OListAndComboImport::implDefaultSelectCurrentItem()
- {
- OSL_ENSURE((m_aListSource.getLength() + m_nEmptyListItems) == (m_aValueList.getLength() + m_nEmptyValueItems),
- "OListAndComboImport::implDefaultSelectCurrentItem: inconsistence between labels and values!");
-
- sal_Int16 nItemNumber = (sal_Int16)(m_aListSource.getLength() - 1 + m_nEmptyListItems);
- pushBackSequenceElement(m_aDefaultSelectedSeq, nItemNumber);
- }
-
- //=====================================================================
- //= OListOptionImport
- //=====================================================================
- //---------------------------------------------------------------------
- OListOptionImport::OListOptionImport(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const OListAndComboImportRef& _rListBox)
- :SvXMLImportContext(_rImport, _nPrefix, _rName)
- ,m_xListBoxImport(_rListBox)
- {
- }
-
- //---------------------------------------------------------------------
- void OListOptionImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList)
- {
- // the label and the value
- const ::rtl::OUString sLabelAttribute = GetImport().GetNamespaceMap().GetQNameByKey(
- GetPrefix(), ::rtl::OUString::createFromAscii("label"));
- const ::rtl::OUString sValueAttribute = GetImport().GetNamespaceMap().GetQNameByKey(
- GetPrefix(), ::rtl::OUString::createFromAscii("value"));
-
- // -------------------
- // the label attribute
- ::rtl::OUString sValue = _rxAttrList->getValueByName(sLabelAttribute);
- sal_Bool bNonexistentAttribute = sal_False;
- if (!sValue.getLength())
- if (0 == _rxAttrList->getTypeByName(sLabelAttribute).getLength())
- // this attribute does not really exist
- bNonexistentAttribute = sal_True;
-
- if (bNonexistentAttribute)
- m_xListBoxImport->implEmptyLabelFound();
- else
- m_xListBoxImport->implPushBackLabel( sValue );
-
- // -------------------
- // the value attribute
- sValue = _rxAttrList->getValueByName(sValueAttribute);
- bNonexistentAttribute = sal_False;
- if (!sValue.getLength())
- if (0 == _rxAttrList->getTypeByName(sValueAttribute).getLength())
- // this attribute does not really exist
- bNonexistentAttribute = sal_True;
-
- if (bNonexistentAttribute)
- m_xListBoxImport->implEmptyValueFound();
- else
- m_xListBoxImport->implPushBackValue( sValue );
-
- // the current-selected and selected
- const ::rtl::OUString sSelectedAttribute = GetImport().GetNamespaceMap().GetQNameByKey(
- GetPrefix(), ::rtl::OUString::createFromAscii(getCommonControlAttributeName(CCA_CURRENT_SELECTED)));
- const ::rtl::OUString sDefaultSelectedAttribute = GetImport().GetNamespaceMap().GetQNameByKey(
- GetPrefix(), ::rtl::OUString::createFromAscii(getCommonControlAttributeName(CCA_SELECTED)));
-
- // propagate the selected flag
- sal_Bool bSelected;
- GetImport().GetMM100UnitConverter().convertBool(bSelected, _rxAttrList->getValueByName(sSelectedAttribute));
- if (bSelected)
- m_xListBoxImport->implSelectCurrentItem();
-
- // same for the default selected
- sal_Bool bDefaultSelected;
- GetImport().GetMM100UnitConverter().convertBool(bDefaultSelected, _rxAttrList->getValueByName(sDefaultSelectedAttribute));
- if (bDefaultSelected)
- m_xListBoxImport->implDefaultSelectCurrentItem();
-
- SvXMLImportContext::StartElement(_rxAttrList);
- }
-
- //=====================================================================
- //= OComboItemImport
- //=====================================================================
- //---------------------------------------------------------------------
- OComboItemImport::OComboItemImport(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const OListAndComboImportRef& _rListBox)
- :SvXMLImportContext(_rImport, _nPrefix, _rName)
- ,m_xListBoxImport(_rListBox)
- {
- }
-
- //---------------------------------------------------------------------
- void OComboItemImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList)
- {
- const ::rtl::OUString sLabelAttributeName = GetImport().GetNamespaceMap().GetQNameByKey(
- GetPrefix(), ::rtl::OUString::createFromAscii(getCommonControlAttributeName(CCA_LABEL)));
- m_xListBoxImport->implPushBackLabel(_rxAttrList->getValueByName(sLabelAttributeName));
-
- SvXMLImportContext::StartElement(_rxAttrList);
- }
-
- //=====================================================================
- //= OControlWrapperImport
- //=====================================================================
- //---------------------------------------------------------------------
- OControlWrapperImport::OControlWrapperImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const Reference< XNameContainer >& _rxParentContainer)
- :SvXMLImportContext(_rImport.getGlobalContext(), _nPrefix, _rName)
- ,m_rFormImport(_rImport)
- ,m_xParentContainer(_rxParentContainer)
- ,m_rEventManager(_rEventManager)
- {
- }
-
- //---------------------------------------------------------------------
- SvXMLImportContext* OControlWrapperImport::CreateChildContext(sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const Reference< sax::XAttributeList >& _rxAttrList)
- {
- OControlImport* pReturn = implCreateChildContext(_nPrefix, _rLocalName, OElementNameMap::getElementType(_rLocalName));
- if (pReturn)
- {
- OSL_ENSURE(m_xOwnAttributes.is(), "OControlWrapperImport::CreateChildContext: had no form:column element!");
- pReturn->addOuterAttributes(m_xOwnAttributes);
- }
- return pReturn;
- }
-
- //---------------------------------------------------------------------
- void OControlWrapperImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList)
- {
- OSL_ENSURE(!m_xOwnAttributes.is(), "OControlWrapperImport::StartElement: aready have the cloned list!");
-
- // clone the attributes
- Reference< XCloneable > xCloneList(_rxAttrList, UNO_QUERY);
- OSL_ENSURE(xCloneList.is(), "OControlWrapperImport::StartElement: AttributeList not cloneable!");
- m_xOwnAttributes = Reference< sax::XAttributeList >(xCloneList->createClone(), UNO_QUERY);
- OSL_ENSURE(m_xOwnAttributes.is(), "OControlWrapperImport::StartElement: no cloned list!");
-
- // forward an empty attribute list to the base class
- // (the attributes are merged into the ones of the upcoming xml element which really describes the control)
- SvXMLImportContext::StartElement(new OAttribListMerger);
- }
-
- //---------------------------------------------------------------------
- OControlImport* OControlWrapperImport::implCreateChildContext(
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- OControlElement::ElementType _eType)
- {
- switch (_eType)
- {
- case OControlElement::TEXT:
- case OControlElement::TEXT_AREA:
- case OControlElement::FORMATTED_TEXT:
- return new OTextLikeImport(m_rFormImport, m_rEventManager, _nPrefix, _rLocalName, m_xParentContainer, _eType);
-
- case OControlElement::BUTTON:
- case OControlElement::IMAGE:
- return new OButtonImport(m_rFormImport, m_rEventManager, _nPrefix, _rLocalName, m_xParentContainer, _eType);
-
- case OControlElement::IMAGE_FRAME:
- return new OURLReferenceImport( m_rFormImport, m_rEventManager, _nPrefix, _rLocalName, m_xParentContainer, _eType );
-
- case OControlElement::COMBOBOX:
- case OControlElement::LISTBOX:
- return new OListAndComboImport(m_rFormImport, m_rEventManager, _nPrefix, _rLocalName, m_xParentContainer, _eType);
-
- case OControlElement::RADIO:
- return new ORadioImport(m_rFormImport, m_rEventManager, _nPrefix, _rLocalName, m_xParentContainer, _eType);
-
- case OControlElement::PASSWORD:
- return new OPasswordImport(m_rFormImport, m_rEventManager, _nPrefix, _rLocalName, m_xParentContainer, _eType);
-
- case OControlElement::FRAME:
- case OControlElement::FIXED_TEXT:
- return new OReferredControlImport(m_rFormImport, m_rEventManager, _nPrefix, _rLocalName, m_xParentContainer, _eType);
-
- case OControlElement::GRID:
- return new OGridImport(m_rFormImport, m_rEventManager, _nPrefix, _rLocalName, m_xParentContainer, _eType);
-
- default:
- return new OControlImport(m_rFormImport, m_rEventManager, _nPrefix, _rLocalName, m_xParentContainer, _eType);
- }
- }
-
- //=====================================================================
- //= OColumnWrapperImport
- //=====================================================================
- //---------------------------------------------------------------------
- OColumnWrapperImport::OColumnWrapperImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const Reference< XNameContainer >& _rxParentContainer)
- :OControlWrapperImport(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer)
- {
- }
-
- //---------------------------------------------------------------------
- OControlImport* OColumnWrapperImport::implCreateChildContext(
- sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- OControlElement::ElementType _eType)
- {
- OSL_ENSURE( (OControlElement::TEXT == _eType)
- || (OControlElement::TEXT_AREA == _eType)
- || (OControlElement::FORMATTED_TEXT == _eType)
- || (OControlElement::CHECKBOX == _eType)
- || (OControlElement::LISTBOX == _eType)
- || (OControlElement::COMBOBOX == _eType),
- "OColumnWrapperImport::implCreateChildContext: invalid or unrecognized sub element!");
-
- switch (_eType)
- {
- case OControlElement::COMBOBOX:
- case OControlElement::LISTBOX:
- return new OColumnImport<OListAndComboImport>(m_rFormImport, m_rEventManager, _nPrefix, _rLocalName, m_xParentContainer, _eType, m_xOwnAttributes);
-
- case OControlElement::PASSWORD:
- return new OColumnImport<OPasswordImport>(m_rFormImport, m_rEventManager, _nPrefix, _rLocalName, m_xParentContainer, _eType, m_xOwnAttributes);
-
- default:
- return new OColumnImport<OControlImport>(m_rFormImport, m_rEventManager, _nPrefix, _rLocalName, m_xParentContainer, _eType, m_xOwnAttributes);
- }
- }
-
- //=====================================================================
- //= OGridImport
- //=====================================================================
- //---------------------------------------------------------------------
- OGridImport::OGridImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const Reference< XNameContainer >& _rxParentContainer,
- OControlElement::ElementType _eType)
- :OGridImport_Base(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer, "column")
- {
- setElementType(_eType);
- }
-
- //---------------------------------------------------------------------
- SvXMLImportContext* OGridImport::implCreateControlWrapper(sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName)
- {
- return new OColumnWrapperImport(m_rFormImport, *this, _nPrefix, _rLocalName, m_xMeAsContainer);
- }
-
- //=====================================================================
- //= OFormImport
- //=====================================================================
- //---------------------------------------------------------------------
- OFormImport::OFormImport(IFormsImportContext& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const Reference< XNameContainer >& _rxParentContainer)
- :OFormImport_Base(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer, "control")
- {
- enableTrackAttributes();
- }
-
- //---------------------------------------------------------------------
- SvXMLImportContext* OFormImport::CreateChildContext(sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const Reference< sax::XAttributeList >& _rxAttrList)
- {
- static const ::rtl::OUString s_sFormElementName = ::rtl::OUString::createFromAscii("form");
- if (s_sFormElementName.equals(_rLocalName))
- return new OFormImport(m_rFormImport, *this, _nPrefix, _rLocalName, m_xMeAsContainer);
-
- return OFormImport_Base::CreateChildContext(_nPrefix, _rLocalName, _rxAttrList);
- }
-
- //---------------------------------------------------------------------
- void OFormImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList)
- {
- m_rFormImport.enterEventContext();
- OFormImport_Base::StartElement(_rxAttrList);
-
- // handle the target-frame attribute
- simulateDefaultedAttribute(getCommonControlAttributeName(CCA_TARGET_FRAME), PROPERTY_TARGETFRAME, "_blank");
- }
-
- //---------------------------------------------------------------------
- void OFormImport::EndElement()
- {
- OFormImport_Base::EndElement();
- m_rFormImport.leaveEventContext();
- }
-
- //---------------------------------------------------------------------
- SvXMLImportContext* OFormImport::implCreateControlWrapper(sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName)
- {
- return new OControlWrapperImport(m_rFormImport, *this, _nPrefix, _rLocalName, m_xMeAsContainer);
- }
-
- //---------------------------------------------------------------------
- void OFormImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
- {
- // handle the master/details field attributes (they're way too special to let the OPropertyImport handle them)
- static const ::rtl::OUString s_sMasterFieldsAttributeName = ::rtl::OUString::createFromAscii(getFormAttributeName(faMasterFields));
- static const ::rtl::OUString s_sDetailFieldsAttributeName = ::rtl::OUString::createFromAscii(getFormAttributeName(faDetailFiels));
- if (s_sMasterFieldsAttributeName == _rLocalName)
- implTranslateStringListProperty(PROPERTY_MASTERFIELDS, _rValue);
- else if (s_sDetailFieldsAttributeName == _rLocalName)
- implTranslateStringListProperty(PROPERTY_DETAILFIELDS, _rValue);
- else
- OFormImport_Base::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
- }
-
- //---------------------------------------------------------------------
- void OFormImport::implTranslateStringListProperty(const ::rtl::OUString& _rPropertyName, const ::rtl::OUString& _rValue)
- {
- PropertyValue aProp;
- aProp.Name = _rPropertyName;
-
- Sequence< ::rtl::OUString > aList;
-
- // split up the value string
- if (_rValue.getLength())
- {
- // For the moment, we build a vector instead of a Sequence. It's easier to handle because of it's
- // push_back method
- ::std::vector< ::rtl::OUString > aElements;
- // estimate the number of tokens
- sal_Int32 nEstimate = 0, nLength = _rValue.getLength();
- const sal_Unicode* pChars = _rValue.getStr();
- for (sal_Int32 i=0; i<nLength; ++i, ++pChars)
- if (*pChars == ',')
- ++nEstimate;
- aElements.reserve(nEstimate + 1);
- // that's the worst case. If the string contains the separator character _quoted_, we reserved to much ...
-
-
- SvXMLUnitConverter& rConverter = GetImport().GetMM100UnitConverter();
- sal_Int32 nElementStart = 0;
- sal_Int32 nNextSep = 0;
- sal_Int32 nElementLength;
- ::rtl::OUString sElement;
- do
- {
- // extract the current element
- nNextSep = rConverter.indexOfComma(_rValue, nElementStart);
- if (-1 == nNextSep)
- nNextSep = nLength;
- sElement = _rValue.copy(nElementStart, nNextSep - nElementStart);
-
- nElementLength = sElement.getLength();
- // when writing the sequence, we quoted the single elements with " characters
- OSL_ENSURE( (nElementLength >= 2)
- && (sElement.getStr()[0] == '"')
- && (sElement.getStr()[nElementLength - 1] == '"'),
- "OFormImport::implTranslateStringListProperty: invalid quoted element name.");
- sElement = sElement.copy(1, nElementLength - 2);
-
- aElements.push_back(sElement);
-
- // swith to the next element
- nElementStart = 1 + nNextSep;
- }
- while (nElementStart < nLength);
-
- ::rtl::OUString *pElements = aElements.empty() ? 0 : &aElements[0];
- aList = Sequence< ::rtl::OUString >(pElements, aElements.size());
- }
- else
- {
- OSL_ENSURE(sal_False, "OFormImport::implTranslateStringListProperty: invalid value (empty)!");
- }
-
- aProp.Value <<= aList;
-
- // add the property to the base class' array
- implPushBackPropertyValue(aProp);
- }
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_eventexport.cxx b/binfilter/bf_xmloff/source/forms/xmloff_eventexport.cxx
deleted file mode 100644
index a85ac40fc611..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_eventexport.cxx
+++ /dev/null
@@ -1,159 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "eventexport.hxx"
-#include <osl/diagnose.h>
-#include "strings.hxx"
-#include <tools/debug.hxx>
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::script;
- using namespace ::com::sun::star::container;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::lang;
-
- //=====================================================================
- //= OEventDescriptorMapper
- //=====================================================================
- //---------------------------------------------------------------------
- OEventDescriptorMapper::OEventDescriptorMapper(const Sequence< ScriptEventDescriptor >& _rEvents)
- {
- sal_Int32 nEvents = _rEvents.getLength();
-
- // translate the events
- const ScriptEventDescriptor* pEvents = _rEvents.getConstArray();
- ::rtl::OUString sName;
- ::rtl::OUString sLibrary, sLocalMacroName;
- sal_Int32 nNameSeparatorPos(-1);
- for (sal_Int32 i=0; i<nEvents; ++i, ++pEvents)
- {
- // the name of the event is build from listener interface and listener method name
- sName = pEvents->ListenerType;
- sName += EVENT_NAME_SEPARATOR;
- sName += pEvents->EventMethod;
-
- Sequence< PropertyValue >& rMappedEvent = m_aMappedEvents[sName];
-
- sLocalMacroName = pEvents->ScriptCode;
- sLibrary = ::rtl::OUString();
- if ( 0 == pEvents->ScriptType.compareToAscii( EVENT_STARBASIC ) )
- { // for StarBasic, the library name is part of the ScriptCode
- sal_Int32 nPrefixLen = sLocalMacroName.indexOf( ':' );
- DBG_ASSERT( 0 <= nPrefixLen, "OEventDescriptorMapper::OEventDescriptorMapper: invalid script code prefix!" );
- if ( 0 <= nPrefixLen )
- {
- // the export handler for StarBasic expects "StarOffice", not "application" for application modules ...
- sLibrary = sLocalMacroName.copy( 0, nPrefixLen );
- if ( sLibrary.equalsAscii( EVENT_APPLICATION ) )
- sLibrary = EVENT_STAROFFICE;
-
- sLocalMacroName = sLocalMacroName.copy( nPrefixLen + 1 );
- }
- }
-
- // tree property values to describe one event ...
- rMappedEvent.realloc( sLibrary.getLength() ? 3 : 2 );
-
- // ... the type
- rMappedEvent[0] = PropertyValue(EVENT_TYPE, -1, makeAny(pEvents->ScriptType), PropertyState_DIRECT_VALUE);
-
- // and the macro name
- rMappedEvent[1] = PropertyValue(EVENT_LOCALMACRONAME, -1, makeAny(sLocalMacroName), PropertyState_DIRECT_VALUE);
-
- // the library
- if ( sLibrary.getLength() )
- rMappedEvent[2] = PropertyValue(EVENT_LIBRARY, -1, makeAny(sLibrary), PropertyState_DIRECT_VALUE);
- }
- }
-
- //---------------------------------------------------------------------
- void SAL_CALL OEventDescriptorMapper::replaceByName( const ::rtl::OUString& _rNamee, const Any& _rElement ) throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException)
- {
- throw IllegalArgumentException(
- ::rtl::OUString::createFromAscii("replacing is not implemented for this wrapper class."), static_cast< ::cppu::OWeakObject* >(this), 1);
- }
-
- //---------------------------------------------------------------------
- Any SAL_CALL OEventDescriptorMapper::getByName( const ::rtl::OUString& _rName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException)
- {
- ConstMapString2PropertyValueSequenceIterator aPos = m_aMappedEvents.find(_rName);
- if (m_aMappedEvents.end() == aPos)
- throw NoSuchElementException(
- ::rtl::OUString::createFromAscii("There is no element named ") += _rName,
- static_cast< ::cppu::OWeakObject* >(this));
-
- return makeAny(aPos->second);
- }
-
- //---------------------------------------------------------------------
- Sequence< ::rtl::OUString > SAL_CALL OEventDescriptorMapper::getElementNames( ) throw(RuntimeException)
- {
- Sequence< ::rtl::OUString > aReturn(m_aMappedEvents.size());
- ::rtl::OUString* pReturn = aReturn.getArray();
- for ( ConstMapString2PropertyValueSequenceIterator aCollect = m_aMappedEvents.begin();
- aCollect != m_aMappedEvents.end();
- ++aCollect, ++pReturn
- )
- *pReturn = aCollect->first;
-
- return aReturn;
- }
-
- //---------------------------------------------------------------------
- sal_Bool SAL_CALL OEventDescriptorMapper::hasByName( const ::rtl::OUString& _rName ) throw(RuntimeException)
- {
- ConstMapString2PropertyValueSequenceIterator aPos = m_aMappedEvents.find(_rName);
- return m_aMappedEvents.end() != aPos;
- }
-
- //---------------------------------------------------------------------
- Type SAL_CALL OEventDescriptorMapper::getElementType( ) throw(RuntimeException)
- {
- return ::getCppuType(static_cast< PropertyValue* >(NULL));
- }
-
- //---------------------------------------------------------------------
- sal_Bool SAL_CALL OEventDescriptorMapper::hasElements( ) throw(RuntimeException)
- {
- return 0 != m_aMappedEvents.size();
- }
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_eventimport.cxx b/binfilter/bf_xmloff/source/forms/xmloff_eventimport.cxx
deleted file mode 100644
index 2c04402a5246..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_eventimport.cxx
+++ /dev/null
@@ -1,159 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "eventimport.hxx"
-#include <com/sun/star/script/XEventAttacherManager.hpp>
-#include <comphelper/extract.hxx>
-#include "strings.hxx"
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::script;
- using namespace ::com::sun::star::container;
-
- //=====================================================================
- //= OFormEventsImportContext
- //=====================================================================
- //---------------------------------------------------------------------
- OFormEventsImportContext::OFormEventsImportContext(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, IEventAttacher& _rEventAttacher)
- :XMLEventsImportContext(_rImport, _nPrefix, _rLocalName)
- ,m_rEventAttacher(_rEventAttacher)
- {
- }
-
- //---------------------------------------------------------------------
- void OFormEventsImportContext::EndElement()
- {
- Sequence< ScriptEventDescriptor > aTranslated(aCollectEvents.size());
- ScriptEventDescriptor* pTranslated = aTranslated.getArray();
-
- // loop through the collected events and translate them
- const PropertyValue* pEventDescription;
- const PropertyValue* pEventDescriptionEnd;
- sal_Int32 nSeparatorPos = -1;
- for ( EventsVector::const_iterator aEvent = aCollectEvents.begin();
- aEvent != aCollectEvents.end();
- ++aEvent, ++pTranslated
- )
- {
- // the name of the event is built from ListenerType::EventMethod
- nSeparatorPos = aEvent->first.indexOf(EVENT_NAME_SEPARATOR);
- OSL_ENSURE(-1 != nSeparatorPos, "OFormEventsImportContext::EndElement: invalid (unrecognized) event name!");
- pTranslated->ListenerType = aEvent->first.copy(0, nSeparatorPos);
- pTranslated->EventMethod = aEvent->first.copy(nSeparatorPos + EVENT_NAME_SEPARATOR.length);
-
- ::rtl::OUString sLibrary;
-
- // the local macro name and the event type are specified as properties
- pEventDescription = aEvent->second.getConstArray();
- pEventDescriptionEnd = pEventDescription + aEvent->second.getLength();
- for (;pEventDescription != pEventDescriptionEnd; ++pEventDescription)
- {
- if (0 == pEventDescription->Name.compareToAscii(EVENT_LOCALMACRONAME))
- pEventDescription->Value >>= pTranslated->ScriptCode;
- else if (0 == pEventDescription->Name.compareToAscii(EVENT_TYPE))
- pEventDescription->Value >>= pTranslated->ScriptType;
- else if ( 0 == pEventDescription->Name.compareToAscii( EVENT_LIBRARY ) )
- pEventDescription->Value >>= sLibrary;
- }
-
- if ( 0 == pTranslated->ScriptType.compareToAscii( EVENT_STARBASIC ) )
- {
- if ( 0 == sLibrary.compareToAscii( EVENT_STAROFFICE ) )
- sLibrary = EVENT_APPLICATION;
-
- if ( sLibrary.getLength() )
- {
- // for StarBasic, the library is prepended
- sal_Unicode cLibSeparator = ':';
- sLibrary += ::rtl::OUString( &cLibSeparator, 1 );
- }
- sLibrary += pTranslated->ScriptCode;
- pTranslated->ScriptCode = sLibrary;
- }
- }
-
- // register the events
- m_rEventAttacher.registerEvents(aTranslated);
-
- XMLEventsImportContext::EndElement();
- }
-
- //=====================================================================
- //= ODefaultEventAttacherManager
- //=====================================================================
- //-------------------------------------------------------------------------
- void ODefaultEventAttacherManager::registerEvents(const Reference< XPropertySet >& _rxElement,
- const Sequence< ScriptEventDescriptor >& _rEvents)
- {
- OSL_ENSURE(m_aEvents.end() == m_aEvents.find(_rxElement),
- "ODefaultEventAttacherManager::registerEvents: already have events for this object!");
- // for the moment, only remember the script events
- m_aEvents[_rxElement] = _rEvents;
- }
-
- //-------------------------------------------------------------------------
- void ODefaultEventAttacherManager::setEvents(const Reference< XIndexAccess >& _rxContainer)
- {
- Reference< XEventAttacherManager > xEventManager(_rxContainer, UNO_QUERY);
- if (!xEventManager.is())
- {
- OSL_ENSURE(sal_False, "ODefaultEventAttacherManager::setEvents: invalid argument!");
- return;
- }
-
- // loop through all elements
- sal_Int32 nCount = _rxContainer->getCount();
- Reference< XPropertySet > xCurrent;
- ConstMapPropertySet2ScriptSequenceIterator aRegisteredEventsPos;
- for (sal_Int32 i=0; i<nCount; ++i)
- {
- ::cppu::extractInterface(xCurrent, _rxContainer->getByIndex(i));
- if (xCurrent.is())
- {
- aRegisteredEventsPos = m_aEvents.find(xCurrent);
- if (m_aEvents.end() != aRegisteredEventsPos)
- xEventManager->registerScriptEvents(i, aRegisteredEventsPos->second);
- }
- }
- }
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_formattributes.cxx b/binfilter/bf_xmloff/source/forms/xmloff_formattributes.cxx
deleted file mode 100644
index 75b186b69046..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_formattributes.cxx
+++ /dev/null
@@ -1,324 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "formattributes.hxx"
-#include "xmlnmspe.hxx"
-#include "xmluconv.hxx"
-#include <rtl/ustrbuf.hxx>
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::beans;
-
-
- //=====================================================================
- //= OAttributeMetaData
- //=====================================================================
- //---------------------------------------------------------------------
- const sal_Char* OAttributeMetaData::getCommonControlAttributeName(sal_Int32 _nId)
- {
- switch (_nId)
- {
- case CCA_NAME: return "name";
- case CCA_SERVICE_NAME: return "service-name";
- case CCA_BUTTON_TYPE: return "button-type";
- case CCA_CONTROL_ID: return "id";
- case CCA_CURRENT_SELECTED: return "current-selected";
- case CCA_CURRENT_VALUE: return "current-value";
- case CCA_DISABLED: return "disabled";
- case CCA_DROPDOWN: return "dropdown";
- case CCA_FOR: return "for";
- case CCA_IMAGE_DATA: return "image-data";
- case CCA_LABEL: return "label";
- case CCA_MAX_LENGTH: return "max-length";
- case CCA_PRINTABLE: return "printable";
- case CCA_READONLY: return "readonly";
- case CCA_SELECTED: return "selected";
- case CCA_SIZE: return "size";
- case CCA_TAB_INDEX: return "tab-index";
- case CCA_TARGET_FRAME: return "target-frame";
- case CCA_TARGET_LOCATION: return "href"; // the only special thing here: TargetLocation is represented by an xlink:href attribute
- case CCA_TAB_STOP: return "tab-stop";
- case CCA_TITLE: return "title";
- case CCA_VALUE: return "value";
- default:
- OSL_ENSURE(sal_False, "OAttributeMetaData::getCommonControlAttributeName: invalid id (maybe you or-ed two flags?)!");
- }
- return "";
- }
-
- //---------------------------------------------------------------------
- sal_uInt16 OAttributeMetaData::getCommonControlAttributeNamespace(sal_Int32 _nId)
- {
- if (CCA_TARGET_LOCATION == _nId)
- return XML_NAMESPACE_XLINK;
-
- if (CCA_TARGET_FRAME == _nId)
- return XML_NAMESPACE_OFFICE;
-
- return XML_NAMESPACE_FORM;
- }
-
- //---------------------------------------------------------------------
- const sal_Char* OAttributeMetaData::getFormAttributeName(FormAttributes _eAttrib)
- {
- switch (_eAttrib)
- {
- case faName: return "name";
- case faServiceName: return "service-name";
- case faAction: return "href"; // the only special thing here: Action is represented by an xlink:href attribute
- case faEnctype: return "enctype";
- case faMethod: return "method";
- case faTargetFrame: return "target-frame";
- case faAllowDeletes: return "allow-deletes";
- case faAllowInserts: return "allow-inserts";
- case faAllowUpdates: return "allow-updates";
- case faApplyFilter: return "apply-filter";
- case faCommand: return "command";
- case faCommandType: return "command-type";
- case faEscapeProcessing:return "escape-processing";
- case faDatasource: return "datasource";
- case faDetailFiels: return "detail-fields";
- case faFilter: return "filter";
- case faIgnoreResult: return "ignore-result";
- case faMasterFields: return "master-fields";
- case faNavigationMode: return "navigation-mode";
- case faOrder: return "order";
- case faTabbingCycle: return "tab-cycle";
- default:
- OSL_ENSURE(sal_False, "OAttributeMetaData::getFormAttributeName: invalid id!");
- }
- return "";
- }
-
- //---------------------------------------------------------------------
- sal_uInt16 OAttributeMetaData::getFormAttributeNamespace(FormAttributes _eAttrib)
- {
- if (faAction == _eAttrib)
- return XML_NAMESPACE_XLINK;
-
- if (faTargetFrame == _eAttrib)
- return XML_NAMESPACE_OFFICE;
-
- return XML_NAMESPACE_FORM;
- }
-
- //---------------------------------------------------------------------
- const sal_Char* OAttributeMetaData::getDatabaseAttributeName(sal_Int32 _nId)
- {
- switch (_nId)
- {
- case DA_BOUND_COLUMN: return "bound-column";
- case DA_CONVERT_EMPTY: return "convert-empty-to-null";
- case DA_DATA_FIELD: return "data-field";
- case DA_LIST_SOURCE: return "list-source";
- case DA_LIST_SOURCE_TYPE: return "list-source-type";
- default:
- OSL_ENSURE(sal_False, "OAttributeMetaData::getDatabaseAttributeName: invalid id (maybe you or-ed two flags?)!");
- }
- return "";
- }
-
- //---------------------------------------------------------------------
- sal_uInt16 OAttributeMetaData::getDatabaseAttributeNamespace(sal_Int32 /*_nId*/)
- {
- // nothing special here
- return XML_NAMESPACE_FORM;
- }
-
- //---------------------------------------------------------------------
- const sal_Char* OAttributeMetaData::getBindingAttributeName(sal_Int32 _nId)
- {
- switch (_nId)
- {
- case BA_LINKED_CELL: return "linked-cell";
- case BA_LIST_LINKING_TYPE: return "list-linkage-type";
- case BA_LIST_CELL_RANGE: return "source-cell-range";
- default:
- OSL_ENSURE(sal_False, "OAttributeMetaData::getBindingAttributeName: invalid id (maybe you or-ed two flags?)!");
- }
- return "";
- }
-
- //---------------------------------------------------------------------
- sal_uInt16 OAttributeMetaData::getBindingAttributeNamespace(sal_Int32 _nId)
- {
- // nothing special here
- return XML_NAMESPACE_FORM;
- }
-
- //---------------------------------------------------------------------
- const sal_Char* OAttributeMetaData::getSpecialAttributeName(sal_Int32 _nId)
- {
- switch (_nId)
- {
- case SCA_ECHO_CHAR: return "echo-char";
- case SCA_MAX_VALUE: return "max-value";
- case SCA_MIN_VALUE: return "min-value";
- case SCA_VALIDATION: return "validation";
- case SCA_MULTI_LINE: return "multi-line";
- case SCA_AUTOMATIC_COMPLETION: return "auto-complete";
- case SCA_MULTIPLE: return "multiple";
- case SCA_DEFAULT_BUTTON: return "default-button";
- case SCA_CURRENT_STATE: return "current-state";
- case SCA_IS_TRISTATE: return "is-tristate";
- case SCA_STATE: return "state";
- case SCA_COLUMN_STYLE_NAME: return "column-style-name";
- default:
- OSL_ENSURE(sal_False, "OAttributeMetaData::getSpecialAttributeName: invalid id (maybe you or-ed two flags?)!");
- }
- return "";
- }
-
- //---------------------------------------------------------------------
- sal_uInt16 OAttributeMetaData::getSpecialAttributeNamespace(sal_Int32 /*_nId*/)
- {
- // nothing special here
- return XML_NAMESPACE_FORM;
- }
-
- //---------------------------------------------------------------------
- const sal_Char* OAttributeMetaData::getOfficeFormsAttributeName(OfficeFormsAttributes _eAttrib)
- {
- switch (_eAttrib)
- {
- case ofaAutomaticFocus: return "automatic-focus";
- case ofaApplyDesignMode: return "apply-design-mode";
- default:
- OSL_ENSURE(sal_False, "OAttributeMetaData::getOfficeFormsAttributeName: invalid id!");
- }
- return "";
- }
-
- //---------------------------------------------------------------------
- sal_uInt16 OAttributeMetaData::getOfficeFormsAttributeNamespace(OfficeFormsAttributes /* _eAttrib */)
- {
- // nothing special here
- return XML_NAMESPACE_FORM;
- }
-
- //=====================================================================
- //= OAttribute2Property
- //=====================================================================
- //---------------------------------------------------------------------
- OAttribute2Property::OAttribute2Property()
- {
- }
-
- //---------------------------------------------------------------------
- OAttribute2Property::~OAttribute2Property()
- {
- }
-
- //---------------------------------------------------------------------
- const OAttribute2Property::AttributeAssignment* OAttribute2Property::getAttributeTranslation(
- const ::rtl::OUString& _rAttribName)
- {
- ConstAttributeAssignmentsIterator aPos = m_aKnownProperties.find(_rAttribName);
- if (m_aKnownProperties.end() != aPos)
- return &aPos->second;
- return NULL;
- }
-
- //---------------------------------------------------------------------
- void OAttribute2Property::addStringProperty(
- const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName,
- const sal_Char* _pAttributeDefault)
- {
- implAdd(_pAttributeName, _rPropertyName, ::getCppuType( static_cast< ::rtl::OUString* >(NULL) ),
- _pAttributeDefault ? ::rtl::OUString::createFromAscii(_pAttributeDefault) : ::rtl::OUString());
- }
-
- //---------------------------------------------------------------------
- void OAttribute2Property::addBooleanProperty(
- const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName,
- const sal_Bool _bAttributeDefault, const sal_Bool _bInverseSemantics)
- {
- ::rtl::OUStringBuffer aDefault;
- SvXMLUnitConverter::convertBool(aDefault, _bAttributeDefault);
- AttributeAssignment& aAssignment = implAdd(_pAttributeName, _rPropertyName, ::getBooleanCppuType(), aDefault.makeStringAndClear());
- aAssignment.bInverseSemantics = _bInverseSemantics;
- }
-
- //---------------------------------------------------------------------
- void OAttribute2Property::addInt16Property(
- const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName,
- const sal_Int16 _nAttributeDefault)
- {
- ::rtl::OUStringBuffer aDefault;
- SvXMLUnitConverter::convertNumber(aDefault, (sal_Int32)_nAttributeDefault);
- implAdd(_pAttributeName, _rPropertyName, ::getCppuType( static_cast< sal_Int16* >(NULL) ), aDefault.makeStringAndClear());
- }
-
- //---------------------------------------------------------------------
- void OAttribute2Property::addEnumProperty(
- const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName,
- const sal_uInt16 _nAttributeDefault, const SvXMLEnumMapEntry* _pValueMap,
- const ::com::sun::star::uno::Type* _pType)
- {
- ::rtl::OUStringBuffer aDefault;
- SvXMLUnitConverter::convertEnum(aDefault, _nAttributeDefault, _pValueMap);
- AttributeAssignment& aAssignment = implAdd(_pAttributeName, _rPropertyName,
- _pType ? *_pType : ::getCppuType( static_cast< sal_Int32* >(NULL) ),
- // this assumes that the setPropertyValue for enums can handle int32's ....
- aDefault.makeStringAndClear());
- aAssignment.pEnumMap = _pValueMap;
- }
-
- //---------------------------------------------------------------------
- OAttribute2Property::AttributeAssignment& OAttribute2Property::implAdd(
- const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName,
- const ::com::sun::star::uno::Type& _rType, const ::rtl::OUString& _rDefaultString)
- {
- OSL_ENSURE(m_aKnownProperties.end() == m_aKnownProperties.find(::rtl::OUString::createFromAscii(_pAttributeName)),
- "OAttribute2Property::implAdd: already have this attribute!");
-
- ::rtl::OUString sAttributeName = ::rtl::OUString::createFromAscii(_pAttributeName);
-
- AttributeAssignment aAssignment;
- aAssignment.sAttributeName = sAttributeName;
- aAssignment.sPropertyName = _rPropertyName;
- aAssignment.aPropertyType = _rType;
-
- // redundance, the accessor is stored in aAssignment.sAttributeName, too
- return m_aKnownProperties[sAttributeName] = aAssignment;
- }
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_formcellbinding.cxx b/binfilter/bf_xmloff/source/forms/xmloff_formcellbinding.cxx
deleted file mode 100644
index b649e26d118c..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_formcellbinding.cxx
+++ /dev/null
@@ -1,484 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef XMLOFF_FORMS_FORMCELLBINDING
-#include "formcellbinding.hxx"
-#endif
-
-#include <drafts/com/sun/star/form/XBindableValue.hpp>
-#include <drafts/com/sun/star/form/XListEntrySink.hpp>
-#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
-#include <com/sun/star/form/XForm.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-#include "strings.hxx"
-
-#include <osl/diagnose.h>
-
-#include <functional>
-#include <algorithm>
-namespace binfilter {
-
-//............................................................................
-namespace xmloff
-{
-//............................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::frame;
- using namespace ::com::sun::star::sheet;
- using namespace ::com::sun::star::container;
- using namespace ::com::sun::star::drawing;
- using namespace ::com::sun::star::table;
- using namespace ::com::sun::star::form;
- using namespace ::com::sun::star::lang;
- using namespace ::drafts::com::sun::star::form;
-
- namespace
- {
- //....................................................................
- template< class TYPE >
- Reference< TYPE > getTypedModelNode( const Reference< XInterface >& _rxModelNode )
- {
- Reference< TYPE > xTypedNode( _rxModelNode, UNO_QUERY );
- if ( xTypedNode.is() )
- return xTypedNode;
- else
- {
- Reference< XChild > xChild( _rxModelNode, UNO_QUERY );
- if ( xChild.is() )
- return getTypedModelNode< TYPE >( xChild->getParent() );
- else
- return NULL;
- }
- }
-
- //....................................................................
- Reference< XModel > getDocument( const Reference< XInterface >& _rxModelNode )
- {
- return getTypedModelNode< XModel >( _rxModelNode );
- }
-
- //....................................................................
- struct StringCompare : public ::std::unary_function< ::rtl::OUString, bool >
- {
- private:
- ::rtl::OUString m_sReference;
-
- public:
- StringCompare( const ::rtl::OUString& _rReference ) : m_sReference( _rReference ) { }
-
- inline bool operator()( const ::rtl::OUString& _rCompare )
- {
- return ( _rCompare == m_sReference ) ? true : false;
- }
- };
- }
-
- //========================================================================
- //= FormCellBindingHelper
- //========================================================================
- //------------------------------------------------------------------------
- FormCellBindingHelper::FormCellBindingHelper( const Reference< XPropertySet >& _rxControlModel, const Reference< XModel >& _rxDocument )
- :m_xControlModel( _rxControlModel )
- ,m_xDocument( _rxDocument, UNO_QUERY )
- {
- OSL_ENSURE( m_xControlModel.is(), "FormCellBindingHelper::FormCellBindingHelper: invalid control model!" );
-
- if ( !m_xDocument.is() )
- m_xDocument = m_xDocument.query( getDocument( m_xControlModel ) );
- OSL_ENSURE( m_xDocument.is(), "FormCellBindingHelper::FormCellBindingHelper: Did not find the spreadsheet document!" );
- }
-
- //------------------------------------------------------------------------
- sal_Bool FormCellBindingHelper::livesInSpreadsheetDocument( const Reference< XPropertySet >& _rxControlModel )
- {
- Reference< XSpreadsheetDocument > xDocument( getDocument( _rxControlModel ), UNO_QUERY );
- return xDocument.is();
- }
-
- //------------------------------------------------------------------------
- bool FormCellBindingHelper::convertStringAddress( const ::rtl::OUString& _rAddressDescription, CellAddress& /* [out] */ _rAddress, sal_Int16 _nAssumeSheet ) const
- {
- Any aAddress;
- return doConvertAddressRepresentations(
- PROPERTY_FILE_REPRESENTATION,
- makeAny( _rAddressDescription ),
- PROPERTY_ADDRESS,
- aAddress,
- false
- )
- && ( aAddress >>= _rAddress );
- }
-
- //------------------------------------------------------------------------
- bool FormCellBindingHelper::convertStringAddress( const ::rtl::OUString& _rAddressDescription,
- CellRangeAddress& /* [out] */ _rAddress ) const
- {
- Any aAddress;
- return doConvertAddressRepresentations(
- PROPERTY_FILE_REPRESENTATION,
- makeAny( _rAddressDescription ),
- PROPERTY_ADDRESS,
- aAddress,
- true
- )
- && ( aAddress >>= _rAddress );
- }
-
- //------------------------------------------------------------------------
- Reference< XValueBinding > FormCellBindingHelper::createCellBindingFromStringAddress( const ::rtl::OUString& _rAddress, bool _bUseIntegerBinding ) const
- {
- Reference< XValueBinding > xBinding;
- if ( !m_xDocument.is() )
- // very bad ...
- return xBinding;
-
- // get the UNO representation of the address
- CellAddress aAddress;
- if ( !_rAddress.getLength() || !convertStringAddress( _rAddress, aAddress ) )
- return xBinding;
-
- xBinding = xBinding.query( createDocumentDependentInstance(
- _bUseIntegerBinding ? SERVICE_LISTINDEXCELLBINDING : SERVICE_CELLVALUEBINDING,
- PROPERTY_BOUND_CELL,
- makeAny( aAddress )
- ) );
-
- return xBinding;
- }
-
- //------------------------------------------------------------------------
- Reference< XListEntrySource > FormCellBindingHelper::createCellListSourceFromStringAddress( const ::rtl::OUString& _rAddress ) const
- {
- Reference< XListEntrySource > xSource;
-
- CellRangeAddress aRangeAddress;
- if ( !convertStringAddress( _rAddress, aRangeAddress ) )
- return xSource;
-
- // create a range object for this address
- xSource = xSource.query( createDocumentDependentInstance(
- SERVICE_CELLRANGELISTSOURCE,
- PROPERTY_LIST_CELL_RANGE,
- makeAny( aRangeAddress )
- ) );
-
- return xSource;
- }
-
- //------------------------------------------------------------------------
- ::rtl::OUString FormCellBindingHelper::getStringAddressFromCellBinding( const Reference< XValueBinding >& _rxBinding ) const
- {
- OSL_PRECOND( !_rxBinding.is() || isCellBinding( _rxBinding ), "FormCellBindingHelper::getStringAddressFromCellBinding: this is no cell binding!" );
-
- ::rtl::OUString sAddress;
- try
- {
- Reference< XPropertySet > xBindingProps( _rxBinding, UNO_QUERY );
- OSL_ENSURE( xBindingProps.is() || !_rxBinding.is(), "FormCellBindingHelper::getStringAddressFromCellBinding: no property set for the binding!" );
- if ( xBindingProps.is() )
- {
- CellAddress aAddress;
- xBindingProps->getPropertyValue( PROPERTY_BOUND_CELL ) >>= aAddress;
-
- Any aStringAddress;
- doConvertAddressRepresentations( PROPERTY_ADDRESS, makeAny( aAddress ),
- PROPERTY_FILE_REPRESENTATION, aStringAddress, false );
-
- aStringAddress >>= sAddress;
- }
- }
- catch( const Exception& )
- {
- OSL_ENSURE( sal_False, "FormCellBindingHelper::getStringAddressFromCellBinding: caught an exception!" );
- }
-
- return sAddress;
- }
-
- //------------------------------------------------------------------------
- ::rtl::OUString FormCellBindingHelper::getStringAddressFromCellListSource( const Reference< XListEntrySource >& _rxSource ) const
- {
- OSL_PRECOND( !_rxSource.is() || isCellRangeListSource( _rxSource ), "FormCellBindingHelper::getStringAddressFromCellListSource: this is no cell list source!" );
-
- ::rtl::OUString sAddress;
- try
- {
- Reference< XPropertySet > xSourceProps( _rxSource, UNO_QUERY );
- OSL_ENSURE( xSourceProps.is() || !_rxSource.is(), "FormCellBindingHelper::getStringAddressFromCellListSource: no property set for the list source!" );
- if ( xSourceProps.is() )
- {
- CellRangeAddress aRangeAddress;
- xSourceProps->getPropertyValue( PROPERTY_LIST_CELL_RANGE ) >>= aRangeAddress;
-
- Any aStringAddress;
- doConvertAddressRepresentations( PROPERTY_ADDRESS, makeAny( aRangeAddress ),
- PROPERTY_FILE_REPRESENTATION, aStringAddress, true );
- aStringAddress >>= sAddress;
- }
- }
- catch( const Exception& )
- {
- OSL_ENSURE( sal_False, "FormCellBindingHelper::getStringAddressFromCellListSource: caught an exception!" );
- }
-
- return sAddress;
- }
-
- //------------------------------------------------------------------------
- bool FormCellBindingHelper::isSpreadsheetDocumentWhichSupplies( const Reference< XSpreadsheetDocument >& _rxDocument, const ::rtl::OUString& _rService ) SAL_THROW(())
- {
- bool bYesItIs = false;
-
- try
- {
- Reference< XServiceInfo > xSI( _rxDocument, UNO_QUERY );
- if ( xSI.is() && xSI->supportsService( SERVICE_SPREADSHEET_DOCUMENT ) )
- {
- Reference< XMultiServiceFactory > xDocumentFactory( _rxDocument, UNO_QUERY );
- OSL_ENSURE( xDocumentFactory.is(), "FormCellBindingHelper::isSpreadsheetDocumentWhichSupplies: spreadsheet document, but no factory?" );
-
- Sequence< ::rtl::OUString > aAvailableServices;
- if ( xDocumentFactory.is() )
- aAvailableServices = xDocumentFactory->getAvailableServiceNames( );
-
- const ::rtl::OUString* pFound = ::std::find_if(
- aAvailableServices.getConstArray(),
- aAvailableServices.getConstArray() + aAvailableServices.getLength(),
- StringCompare( _rService )
- );
- if ( pFound - aAvailableServices.getConstArray() < aAvailableServices.getLength() )
- {
- bYesItIs = true;
- }
- }
- }
- catch( const Exception& )
- {
- OSL_ENSURE( sal_False, "FormCellBindingHelper::isSpreadsheetDocumentWhichSupplies: caught an exception!" );
- }
-
- return bYesItIs;
- }
-
- //------------------------------------------------------------------------
- bool FormCellBindingHelper::isSpreadsheetDocumentWhichSupplies( const ::rtl::OUString& _rService ) const SAL_THROW(())
- {
- return isSpreadsheetDocumentWhichSupplies( m_xDocument, _rService );
- }
-
- //------------------------------------------------------------------------
- bool FormCellBindingHelper::isListCellRangeAllowed( const Reference< XModel >& _rxDocument )
- {
- return isSpreadsheetDocumentWhichSupplies(
- Reference< XSpreadsheetDocument >( _rxDocument, UNO_QUERY ),
- SERVICE_CELLRANGELISTSOURCE
- );
- }
-
- //------------------------------------------------------------------------
- bool FormCellBindingHelper::isListCellRangeAllowed( ) const
- {
- bool bAllow( false );
-
- Reference< XListEntrySink > xSink( m_xControlModel, UNO_QUERY );
- if ( xSink.is() )
- {
- bAllow = isSpreadsheetDocumentWhichSupplies( SERVICE_CELLRANGELISTSOURCE );
- }
-
- return bAllow;
- }
-
- //------------------------------------------------------------------------
- bool FormCellBindingHelper::isCellBindingAllowed( ) const
- {
- bool bAllow( false );
-
- Reference< XBindableValue > xBindable( m_xControlModel, UNO_QUERY );
- if ( xBindable.is() )
- {
- // the control can potentially be bound to an external value
- // Does it live within a Calc document, and is able to supply CellBindings?
- bAllow = isSpreadsheetDocumentWhichSupplies( SERVICE_CELLVALUEBINDING );
- }
-
- return bAllow;
- }
-
- //------------------------------------------------------------------------
- bool FormCellBindingHelper::isCellBindingAllowed( const Reference< XModel >& _rxDocument )
- {
- return isSpreadsheetDocumentWhichSupplies(
- Reference< XSpreadsheetDocument >( _rxDocument, UNO_QUERY ),
- SERVICE_CELLVALUEBINDING
- );
- }
-
- //------------------------------------------------------------------------
- bool FormCellBindingHelper::isCellBinding( const Reference< XValueBinding >& _rxBinding ) const
- {
- return doesComponentSupport( _rxBinding.get(), SERVICE_CELLVALUEBINDING );
- }
-
- //------------------------------------------------------------------------
- bool FormCellBindingHelper::isCellIntegerBinding( const Reference< XValueBinding >& _rxBinding ) const
- {
- return doesComponentSupport( _rxBinding.get(), SERVICE_LISTINDEXCELLBINDING );
- }
-
- //------------------------------------------------------------------------
- bool FormCellBindingHelper::isCellRangeListSource( const Reference< XListEntrySource >& _rxSource ) const
- {
- return doesComponentSupport( _rxSource.get(), SERVICE_CELLRANGELISTSOURCE );
- }
-
- //------------------------------------------------------------------------
- bool FormCellBindingHelper::doesComponentSupport( const Reference< XInterface >& _rxComponent, const ::rtl::OUString& _rService ) const
- {
- bool bDoes = false;
- Reference< XServiceInfo > xSI( _rxComponent, UNO_QUERY );
- bDoes = xSI.is() && xSI->supportsService( _rService );
- return bDoes;
- }
-
- //------------------------------------------------------------------------
- Reference< XValueBinding > FormCellBindingHelper::getCurrentBinding( ) const
- {
- Reference< XValueBinding > xBinding;
- Reference< XBindableValue > xBindable( m_xControlModel, UNO_QUERY );
- if ( xBindable.is() )
- xBinding = xBindable->getValueBinding();
- return xBinding;
- }
-
- //------------------------------------------------------------------------
- Reference< XListEntrySource > FormCellBindingHelper::getCurrentListSource( ) const
- {
- Reference< XListEntrySource > xSource;
- Reference< XListEntrySink > xSink( m_xControlModel, UNO_QUERY );
- if ( xSink.is() )
- xSource = xSink->getListEntrySource();
- return xSource;
- }
-
- //------------------------------------------------------------------------
- void FormCellBindingHelper::setBinding( const Reference< XValueBinding >& _rxBinding )
- {
- Reference< XBindableValue > xBindable( m_xControlModel, UNO_QUERY );
- OSL_PRECOND( xBindable.is(), "FormCellBindingHelper::setBinding: the object is not bindable!" );
- if ( xBindable.is() )
- xBindable->setValueBinding( _rxBinding );
- }
-
- //------------------------------------------------------------------------
- void FormCellBindingHelper::setListSource( const Reference< XListEntrySource >& _rxSource )
- {
- Reference< XListEntrySink > xSink( m_xControlModel, UNO_QUERY );
- OSL_PRECOND( xSink.is(), "FormCellBindingHelper::setListSource: the object is no list entry sink!" );
- if ( xSink.is() )
- xSink->setListEntrySource( _rxSource );
- }
-
- //------------------------------------------------------------------------
- Reference< XInterface > FormCellBindingHelper::createDocumentDependentInstance( const ::rtl::OUString& _rService, const ::rtl::OUString& _rArgumentName,
- const Any& _rArgumentValue ) const
- {
- Reference< XInterface > xReturn;
-
- Reference< XMultiServiceFactory > xDocumentFactory( m_xDocument, UNO_QUERY );
- OSL_ENSURE( xDocumentFactory.is(), "FormCellBindingHelper::createDocumentDependentInstance: no document service factory!" );
- if ( xDocumentFactory.is() )
- {
- try
- {
- if ( _rArgumentName.getLength() )
- {
- NamedValue aArg;
- aArg.Name = _rArgumentName;
- aArg.Value = _rArgumentValue;
-
- Sequence< Any > aArgs( 1 );
- aArgs[ 0 ] <<= aArg;
-
- xReturn = xDocumentFactory->createInstanceWithArguments( _rService, aArgs );
- }
- else
- {
- xReturn = xDocumentFactory->createInstance( _rService );
- }
- }
- catch ( const Exception& )
- {
- OSL_ENSURE( sal_False, "FormCellBindingHelper::createDocumentDependentInstance: could not create the binding at the document!" );
- }
- }
- return xReturn;
- }
-
- //------------------------------------------------------------------------
- bool FormCellBindingHelper::doConvertAddressRepresentations( const ::rtl::OUString& _rInputProperty, const Any& _rInputValue,
- const ::rtl::OUString& _rOutputProperty, Any& _rOutputValue, bool _bIsRange ) const SAL_THROW(())
- {
- bool bSuccess = false;
-
- Reference< XPropertySet > xConverter(
- createDocumentDependentInstance(
- _bIsRange ? SERVICE_RANGEADDRESS_CONVERSION : SERVICE_ADDRESS_CONVERSION,
- ::rtl::OUString(),
- Any()
- ),
- UNO_QUERY
- );
- OSL_ENSURE( xConverter.is(), "FormCellBindingHelper::doConvertAddressRepresentations: could not get a converter service!" );
- if ( xConverter.is() )
- {
- try
- {
- xConverter->setPropertyValue( _rInputProperty, _rInputValue );
- _rOutputValue = xConverter->getPropertyValue( _rOutputProperty );
- bSuccess = true;
- }
- catch( const Exception& )
- {
- OSL_ENSURE( sal_False, "FormCellBindingHelper::doConvertAddressRepresentations: caught an exception!" );
- }
- }
-
- return bSuccess;
- }
-
-//............................................................................
-} // namespace xmloff
-//............................................................................
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_formenums.cxx b/binfilter/bf_xmloff/source/forms/xmloff_formenums.cxx
deleted file mode 100644
index 100278303fd4..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_formenums.cxx
+++ /dev/null
@@ -1,274 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "formenums.hxx"
-#include <osl/diagnose.h>
-
-#include <com/sun/star/form/FormSubmitEncoding.hpp>
-#include <com/sun/star/form/FormSubmitMethod.hpp>
-#include <com/sun/star/sdb/CommandType.hpp>
-#include <com/sun/star/form/NavigationBarMode.hpp>
-#include <com/sun/star/form/TabulatorCycle.hpp>
-#include <com/sun/star/form/FormButtonType.hpp>
-#include <com/sun/star/form/ListSourceType.hpp>
-#include <com/sun/star/awt/TextAlign.hpp>
-#include <com/sun/star/awt/FontEmphasisMark.hpp>
-#include <com/sun/star/awt/FontRelief.hpp>
-#include <vcl/wintypes.hxx> // for check states
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- using namespace ::com::sun::star::form;
- using namespace ::com::sun::star::sdb;
- using namespace ::com::sun::star::awt;
- using namespace ::binfilter::xmloff::token;
-
- const SvXMLEnumMapEntry* OEnumMapper::s_pEnumMap[OEnumMapper::KNOWN_ENUM_PROPERTIES] =
- {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
- };
-
- //---------------------------------------------------------------------
- const SvXMLEnumMapEntry* OEnumMapper::getEnumMap(EnumProperties _eProperty)
- {
- OSL_ENSURE(_eProperty < KNOWN_ENUM_PROPERTIES, "OEnumMapper::getEnumMap: invalid index (this will crash)!");
-
- const SvXMLEnumMapEntry*& rReturn = s_pEnumMap[_eProperty];
- if (!rReturn)
- {
- // the map for this property is not initialized yet
- switch (_eProperty)
- {
- // FormSubmitEncoding
- case epSubmitEncoding:
- {
- static SvXMLEnumMapEntry aSubmitEncodingMap[] =
- {
- { XML_APPLICATION_X_WWW_FORM_URLENCODED, FormSubmitEncoding_URL },
- { XML_MULTIPART_FORMDATA, FormSubmitEncoding_MULTIPART },
- { XML_APPLICATION_TEXT, FormSubmitEncoding_TEXT },
- { XML_TOKEN_INVALID, 0 }
- };
- rReturn = aSubmitEncodingMap;
- }
- break;
- // FormSubmitMethod
- case epSubmitMethod:
- {
- static SvXMLEnumMapEntry aSubmitMethodMap[] =
- {
- { XML_GET, FormSubmitMethod_GET },
- { XML_POST, FormSubmitMethod_POST },
- { XML_TOKEN_INVALID, 0 }
- };
- rReturn = aSubmitMethodMap;
- }
- break;
- // CommandType
- case epCommandType:
- {
- static SvXMLEnumMapEntry aCommandTypeMap[] =
- {
- { XML_TABLE, CommandType::TABLE },
- { XML_QUERY, CommandType::QUERY },
- { XML_COMMAND, CommandType::COMMAND },
- { XML_TOKEN_INVALID, 0 }
- };
- rReturn = aCommandTypeMap;
- }
- break;
- // NavigationBarMode
- case epNavigationType:
- {
- static SvXMLEnumMapEntry aNavigationTypeMap[] =
- {
- { XML_NONE, NavigationBarMode_NONE },
- { XML_CURRENT, NavigationBarMode_CURRENT },
- { XML_PARENT, NavigationBarMode_PARENT },
- { XML_TOKEN_INVALID, 0 }
- };
- rReturn = aNavigationTypeMap;
- };
- break;
- // TabulatorCycle
- case epTabCyle:
- {
- static SvXMLEnumMapEntry aTabulytorCycleMap[] =
- {
- { XML_RECORDS, TabulatorCycle_RECORDS },
- { XML_CURRENT, TabulatorCycle_CURRENT },
- { XML_PAGE, TabulatorCycle_PAGE },
- { XML_TOKEN_INVALID, 0 }
- };
- rReturn = aTabulytorCycleMap;
- };
- break;
- // FormButtonType
- case epButtonType:
- {
- static SvXMLEnumMapEntry aFormButtonTypeMap[] =
- {
- { XML_PUSH, FormButtonType_PUSH },
- { XML_SUBMIT, FormButtonType_SUBMIT },
- { XML_RESET, FormButtonType_RESET },
- { XML_URL, FormButtonType_URL },
- { XML_TOKEN_INVALID, 0 }
- };
- rReturn = aFormButtonTypeMap;
- };
- break;
- // ListSourceType
- case epListSourceType:
- {
- static SvXMLEnumMapEntry aListSourceTypeMap[] =
- {
- { XML_VALUE_LIST, ListSourceType_VALUELIST },
- { XML_TABLE, ListSourceType_TABLE },
- { XML_QUERY, ListSourceType_QUERY },
- { XML_SQL, ListSourceType_SQL },
- { XML_SQL_PASS_THROUGH, ListSourceType_SQLPASSTHROUGH },
- { XML_TABLE_FIELDS, ListSourceType_TABLEFIELDS },
- { XML_TOKEN_INVALID, 0 }
- };
- rReturn = aListSourceTypeMap;
- };
- break;
- // check state of a checkbox
- case epCheckState:
- {
- static SvXMLEnumMapEntry aCheckStateMap[] =
- {
- { XML_UNCHECKED, STATE_NOCHECK },
- { XML_CHECKED, STATE_CHECK },
- { XML_UNKNOWN, STATE_DONTKNOW },
- { XML_TOKEN_INVALID, 0 }
- };
- rReturn = aCheckStateMap;
- };
- break;
- case epTextAlign:
- {
- static SvXMLEnumMapEntry aTextAlignMap[] =
- {
- { XML_START, TextAlign::LEFT },
- { XML_CENTER, TextAlign::CENTER },
- { XML_END, TextAlign::RIGHT },
- { XML_JUSTIFY, -1 },
- { XML_JUSTIFIED, -1 },
- { XML_TOKEN_INVALID, 0 }
- };
- rReturn = aTextAlignMap;
- };
- break;
- case epBorderWidth:
- {
- static SvXMLEnumMapEntry aBorderTypeMap[] =
- {
- { XML_NONE, 0 },
- { XML_HIDDEN, 0 },
- { XML_SOLID, 2 },
- { XML_DOUBLE, 2 },
- { XML_DOTTED, 2 },
- { XML_DASHED, 2 },
- { XML_GROOVE, 1 },
- { XML_RIDGE, 1 },
- { XML_INSET, 1 },
- { XML_OUTSET, 1 },
- { XML_TOKEN_INVALID, 0 }
- };
- rReturn = aBorderTypeMap;
- };
- break;
-
- case epFontEmphasis:
- {
- static SvXMLEnumMapEntry aFontEmphasisMap[] =
- {
- { XML_NONE, FontEmphasisMark::NONE },
- { XML_DOT, FontEmphasisMark::DOT },
- { XML_CIRCLE, FontEmphasisMark::CIRCLE },
- { XML_DISC, FontEmphasisMark::DISC },
- { XML_ACCENT, FontEmphasisMark::ACCENT },
- { XML_TOKEN_INVALID, 0 }
- };
- rReturn = aFontEmphasisMap;
- }
- break;
-
- case epFontRelief:
- {
- static SvXMLEnumMapEntry aFontReliefMap[] =
- {
- { XML_NONE, FontRelief::NONE },
- { XML_ENGRAVED, FontRelief::ENGRAVED },
- { XML_EMBOSSED, FontRelief::EMBOSSED },
- { XML_TOKEN_INVALID, 0 }
- };
- rReturn = aFontReliefMap;
- }
- break;
-
- case epListLinkageType:
- {
- static SvXMLEnumMapEntry aListLinkageMap[] =
- {
- { XML_SELECTION, 0 },
- { XML_SELECTION_INDEXES, 1 },
- { XML_TOKEN_INVALID, 0 }
- };
- rReturn = aListLinkageMap;
- }
- break;
- }
- }
-
- return rReturn;
- }
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_formevents.cxx b/binfilter/bf_xmloff/source/forms/xmloff_formevents.cxx
deleted file mode 100644
index 14a9854ae484..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_formevents.cxx
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "xmlevent.hxx"
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- //=====================================================================
- //= event translation table
- //=====================================================================
- static const XMLEventNameTranslation aEventTranslations[] =
- {
- { "XApproveActionListener::approveAction", "on-approveaction" },
- { "XActionListener::actionPerformed", "on-performaction" },
- { "XChangeListener::changed", "on-change" },
- { "XTextListener::textChanged", "on-textchange" },
- { "XItemListener::itemStateChanged", "on-itemstatechange" },
- { "XFocusListener::focusGained", "on-focus" },
- { "XFocusListener::focusLost", "on-blur" },
- { "XKeyListener::keyPressed", "on-keydown" },
- { "XKeyListener::keyReleased", "on-keyup" },
- { "XMouseListener::mouseEntered", "on-mouseover" },
- { "XMouseMotionListener::mouseDragged", "on-mousedrag" },
- { "XMouseMotionListener::mouseMoved", "on-mousemove" },
- { "XMouseListener::mousePressed", "on-mousedown" },
- { "XMouseListener::mouseReleased", "on-mouseup" },
- { "XMouseListener::mouseExited", "on-mouseout" },
- { "XResetListener::approveReset", "on-approvereset" },
- { "XResetListener::resetted", "on-reset" },
- { "XSubmitListener::approveSubmit", "on-submit" },
- { "XUpdateListener::approveUpdate", "on-approveupdate" },
- { "XUpdateListener::updated", "on-update" },
- { "XLoadListener::loaded", "on-load" },
- { "XLoadListener::reloading", "on-startreload" },
- { "XLoadListener::reloaded", "on-reload" },
- { "XLoadListener::unloading", "on-startunload" },
- { "XLoadListener::unloaded", "on-unload" },
- { "XConfirmDeleteListener::confirmDelete", "on-confirmdelete" },
- { "XRowSetApproveListener::approveRowChange", "on-approverowchange" },
- { "XRowSetListener::rowChanged", "on-rowchange" },
- { "XRowSetApproveListener::approveCursorMove", "on-approvecursormove" },
- { "XRowSetListener::cursorMoved", "on-cursormove" },
- { "XDatabaseParameterListener::approveParameter","on-supplyparameter" },
- { "XSQLErrorListener::errorOccured", "on-error" },
- { 0, 0 }
- };
-
- const XMLEventNameTranslation* g_pFormsEventTranslation = aEventTranslations;
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_formlayerexport.cxx b/binfilter/bf_xmloff/source/forms/xmloff_formlayerexport.cxx
deleted file mode 100644
index 12102b41cccb..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_formlayerexport.cxx
+++ /dev/null
@@ -1,146 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <stdio.h>
-
-#include "xmlexp.hxx"
-#include "layerexport.hxx"
-#include <osl/diagnose.h>
-#include "officeforms.hxx"
-namespace binfilter {
-
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::awt;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::container;
- using namespace ::com::sun::star::drawing;
- using namespace ::com::sun::star::frame;
-
- //=====================================================================
- //= OFormLayerXMLExport
- //=====================================================================
-
- //---------------------------------------------------------------------
- OFormLayerXMLExport::OFormLayerXMLExport(SvXMLExport& _rContext)
- :m_rContext(_rContext)
- ,m_pImpl(new OFormLayerXMLExport_Impl(_rContext))
- {
- }
-
- //---------------------------------------------------------------------
- OFormLayerXMLExport::~OFormLayerXMLExport()
- {
- delete m_pImpl;
- m_pImpl = NULL;
- }
-
- //---------------------------------------------------------------------
- sal_Bool OFormLayerXMLExport::seekPage(const Reference< XDrawPage >& _rxDrawPage)
- {
- return m_pImpl->seekPage(_rxDrawPage);
- }
-
- //---------------------------------------------------------------------
- ::rtl::OUString OFormLayerXMLExport::getControlId(const Reference< XPropertySet >& _rxControl)
- {
- return m_pImpl->getControlId(_rxControl);
- }
-
- //---------------------------------------------------------------------
- ::rtl::OUString OFormLayerXMLExport::getControlNumberStyle( const Reference< XPropertySet >& _rxControl )
- {
- return m_pImpl->getControlNumberStyle(_rxControl);
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport::examineForms(const Reference< XDrawPage >& _rxDrawPage)
- {
- try
- {
- m_pImpl->examineForms(_rxDrawPage);
- }
- catch(Exception&)
- {
- OSL_ENSURE(sal_False, "OFormLayerXMLExport::examine: could not examine the draw page!");
- }
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport::exportForms(const Reference< XDrawPage >& _rxDrawPage)
- {
- m_pImpl->exportForms(_rxDrawPage);
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport::exportAutoControlNumberStyles()
- {
- m_pImpl->exportAutoControlNumberStyles();
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport::exportAutoStyles()
- {
- m_pImpl->exportAutoStyles();
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport::excludeFromExport( const Reference< XControlModel > _rxControl )
- {
- m_pImpl->excludeFromExport( _rxControl );
- }
-
- //=========================================================================
- //= OOfficeFormsExport
- //=========================================================================
- //-------------------------------------------------------------------------
- OOfficeFormsExport::OOfficeFormsExport( SvXMLExport& _rExp )
- :m_pImpl(NULL)
- {
- m_pImpl = new OFormsRootExport(_rExp);
- }
-
- //-------------------------------------------------------------------------
- OOfficeFormsExport::~OOfficeFormsExport()
- {
- delete m_pImpl;
- }
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_formlayerimport.cxx b/binfilter/bf_xmloff/source/forms/xmloff_formlayerimport.cxx
deleted file mode 100644
index 9673e8fa72ac..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_formlayerimport.cxx
+++ /dev/null
@@ -1,134 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "formlayerimport.hxx"
-#include "layerimport.hxx"
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::container;
- using namespace ::com::sun::star::drawing;
- using namespace ::com::sun::star::xml;
-
- //=====================================================================
- //= OFormLayerXMLExport
- //=====================================================================
-
- //---------------------------------------------------------------------
- OFormLayerXMLImport::OFormLayerXMLImport(SvXMLImport& _rImporter)
- :m_pImpl(NULL)
- {
- m_pImpl = new OFormLayerXMLImport_Impl(_rImporter);
- }
-
- //---------------------------------------------------------------------
- OFormLayerXMLImport::~OFormLayerXMLImport()
- {
- delete m_pImpl;
- }
-
- //---------------------------------------------------------------------
- ::rtl::Reference< SvXMLImportPropertyMapper > OFormLayerXMLImport::getStylePropertyMapper() const
- {
- return m_pImpl->getStylePropertyMapper();
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLImport::setAutoStyleContext(SvXMLStylesContext* _pNewContext)
- {
- m_pImpl->setAutoStyleContext(_pNewContext);
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLImport::startPage(const Reference< XDrawPage >& _rxDrawPage)
- {
- m_pImpl->startPage(_rxDrawPage);
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLImport::endPage()
- {
- m_pImpl->endPage();
- }
-
- //---------------------------------------------------------------------
- Reference< XPropertySet > OFormLayerXMLImport::lookupControl(const ::rtl::OUString& _rId)
- {
- return m_pImpl->lookupControlId(_rId);
- }
-
- //---------------------------------------------------------------------
- SvXMLImportContext* OFormLayerXMLImport::createOfficeFormsContext(
- SvXMLImport& _rImport,
- sal_uInt16 _nPrefix,
- const ::rtl::OUString& _rLocalName)
- {
- return m_pImpl->createOfficeFormsContext(_rImport, _nPrefix, _rLocalName);
- }
-
- //---------------------------------------------------------------------
- SvXMLImportContext* OFormLayerXMLImport::createContext(const sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const Reference< sax::XAttributeList >& _rxAttribs)
- {
- return m_pImpl->createContext(_nPrefix, _rLocalName, _rxAttribs);
- }
-
- //---------------------------------------------------------------------
- XMLPropStyleContext* OFormLayerXMLImport::createControlStyleContext( sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const Reference< sax::XAttributeList >& _rxAttrList, SvXMLStylesContext& _rParentStyles,
- sal_uInt16 _nFamily, sal_Bool _bDefaultStyle )
- {
- return m_pImpl->createControlStyleContext( _nPrefix, _rLocalName, _rxAttrList, _rParentStyles, _nFamily, _bDefaultStyle );
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLImport::applyControlNumberStyle(const Reference< XPropertySet >& _rxControlModel, const ::rtl::OUString& _rControlNumerStyleName)
- {
- m_pImpl->applyControlNumberStyle(_rxControlModel, _rControlNumerStyleName);
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLImport::documentDone( )
- {
- m_pImpl->documentDone( );
- }
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_formstyles.cxx b/binfilter/bf_xmloff/source/forms/xmloff_formstyles.cxx
deleted file mode 100644
index 03070eafad0e..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_formstyles.cxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "formstyles.hxx"
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- using namespace token;
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::xml;
-
- //=====================================================================
- //= OControlStyleContext
- //=====================================================================
- //---------------------------------------------------------------------
- OControlStyleContext::OControlStyleContext( SvXMLImport& _rImport, const sal_uInt16 _Prefix, const ::rtl::OUString& _rLocalName,
- const Reference< sax::XAttributeList >& _rxAttrList, SvXMLStylesContext& _rParentStyles,
- const sal_uInt16 _nFamily, const sal_Bool _bDefaultStyle )
- :XMLPropStyleContext( _rImport, _Prefix, _rLocalName, _rxAttrList, _rParentStyles, _nFamily, _bDefaultStyle )
- {
- }
-
- //---------------------------------------------------------------------
- void OControlStyleContext::SetAttribute( sal_uInt16 _nPrefixKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue )
- {
- if ( _rLocalName == GetXMLToken( XML_DATA_STYLE_NAME ) )
- m_sNumberStyleName = _rValue;
- else
- XMLPropStyleContext::SetAttribute( _nPrefixKey, _rLocalName, _rValue );
- }
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_layerexport.cxx b/binfilter/bf_xmloff/source/forms/xmloff_layerexport.cxx
deleted file mode 100644
index f07e64116219..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_layerexport.cxx
+++ /dev/null
@@ -1,719 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <stdio.h>
-
-#include "layerexport.hxx"
-#include "xmlexp.hxx"
-#include "elementexport.hxx"
-#include "contextid.hxx"
-#include "controlpropertyhdl.hxx"
-#include <comphelper/extract.hxx>
-
-#include "controlpropertymap.hxx"
-#include <com/sun/star/form/XFormsSupplier.hpp>
-#include <com/sun/star/form/FormComponentType.hpp>
-#include <com/sun/star/script/XEventAttacherManager.hpp>
-#include "XMLEventExport.hxx"
-#include "formevents.hxx"
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::awt;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::container;
- using namespace ::com::sun::star::drawing;
- using namespace ::com::sun::star::form;
- using namespace ::com::sun::star::script;
- using namespace ::com::sun::star::util;
-
- //=====================================================================
- //= OFormLayerXMLExport_Impl
- //=====================================================================
- //---------------------------------------------------------------------
- const ::rtl::OUString& OFormLayerXMLExport_Impl::getControlNumberStyleNamePrefix()
- {
- static const ::rtl::OUString s_sControlNumberStyleNamePrefix = ::rtl::OUString::createFromAscii("C");
- return s_sControlNumberStyleNamePrefix;
- }
-
- //---------------------------------------------------------------------
- OFormLayerXMLExport_Impl::OFormLayerXMLExport_Impl(SvXMLExport& _rContext)
- :m_rContext(_rContext)
- ,m_pControlNumberStyles(NULL)
- {
- initializePropertyMaps();
-
- // add our style family to the export context's style pool
- m_xPropertyHandlerFactory = new OControlPropertyHandlerFactory();
- ::rtl::Reference< XMLPropertySetMapper > xStylePropertiesMapper = new XMLPropertySetMapper( getControlStylePropertyMap(), m_xPropertyHandlerFactory.get() );
- m_xExportMapper = new OFormExportPropertyMapper( xStylePropertiesMapper.get() );
-
- // our style family
- m_rContext.GetAutoStylePool()->AddFamily(
- XML_STYLE_FAMILY_CONTROL_ID,
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( XML_STYLE_FAMILY_CONTROL_NAME ) ),
- m_xExportMapper.get(),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( XML_STYLE_FAMILY_CONTROL_PREFIX) )
- );
-
- // add our event translation table
- m_rContext.GetEventExport().AddTranslationTable(g_pFormsEventTranslation);
-
- clear();
- }
-
- //---------------------------------------------------------------------
- sal_Bool OFormLayerXMLExport_Impl::implCheckPage(const Reference< XDrawPage >& _rxDrawPage, Reference< XIndexAccess >& _rxForms)
- {
- Reference< XFormsSupplier > xFormsSupp(_rxDrawPage, UNO_QUERY);
- OSL_ENSURE(xFormsSupp.is(), "OFormLayerXMLExport_Impl::implCheckPage: invalid draw page (no XFormsSupplier)! Doin' nothing!");
- if (!xFormsSupp.is())
- return sal_False;
-
- _rxForms = Reference< XIndexAccess >(xFormsSupp->getForms(), UNO_QUERY);
- Reference< XServiceInfo > xSI(_rxForms, UNO_QUERY); // order is important!
- OSL_ENSURE(xSI.is(), "OFormLayerXMLExport_Impl::implCheckPage: invalid collection (must not be NULL and must have a ServiceInfo)!");
- if (!xSI.is())
- return sal_False;
-
- if (!xSI->supportsService(SERVICE_FORMSCOLLECTION))
- {
- OSL_ENSURE(sal_False, "OFormLayerXMLExport_Impl::implCheckPage: invalid collection (is no com.sun.star.form.Forms)!");
- // nothing to do
- return sal_False;
- }
- return sal_True;
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport_Impl::exportGridColumn(const Reference< XPropertySet >& _rxColumn,
- const Sequence< ScriptEventDescriptor >& _rEvents)
- {
- // do the exporting
- OColumnExport aExportImpl(*this, _rxColumn, _rEvents);
- aExportImpl.doExport();
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport_Impl::exportControl(const Reference< XPropertySet >& _rxControl,
- const Sequence< ScriptEventDescriptor >& _rEvents)
- {
- // the list of the referring controls
- ::rtl::OUString sReferringControls;
- ConstMapPropertySet2StringIterator aReferring = m_aCurrentPageReferring->second.find(_rxControl);
- if (aReferring != m_aCurrentPageReferring->second.end())
- sReferringControls = aReferring->second;
-
- // the control id (should already have been created in examineForms)
- ::rtl::OUString sControlId;
- ConstMapPropertySet2StringIterator aControlId = m_aCurrentPageIds->second.find(_rxControl);
- OSL_ENSURE(aControlId != m_aCurrentPageIds->second.end(), "OFormLayerXMLExport_Impl::exportControl: could not find the control id!");
- if (aControlId != m_aCurrentPageIds->second.end())
- sControlId = aControlId->second;
-
- // do the exporting
- OControlExport aExportImpl(*this, _rxControl, sControlId, sReferringControls, _rEvents);
- aExportImpl.doExport();
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport_Impl::exportForm(const Reference< XPropertySet >& _rxProps,
- const Sequence< ScriptEventDescriptor >& _rEvents)
- {
- OSL_ENSURE(_rxProps.is(), "OFormLayerXMLExport_Impl::exportForm: invalid property set!");
- OFormExport aAttributeHandler(*this, _rxProps, _rEvents);
- aAttributeHandler.doExport();
- }
-
- //---------------------------------------------------------------------
- ::rtl::Reference< SvXMLExportPropertyMapper > OFormLayerXMLExport_Impl::getStylePropertyMapper()
- {
- return m_xExportMapper;
- }
-
- //---------------------------------------------------------------------
- SvXMLExport& OFormLayerXMLExport_Impl::getGlobalContext()
- {
- return m_rContext;
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport_Impl::exportCollectionElements(const Reference< XIndexAccess >& _rxCollection)
- {
- // step through all the elements of the collection
- sal_Int32 nElements = _rxCollection->getCount();
-
- Reference< XEventAttacherManager > xElementEventManager(_rxCollection, UNO_QUERY);
- Sequence< ScriptEventDescriptor > aElementEvents;
-
- Reference< XPropertySet > xCurrentProps;
- Reference< XPropertySetInfo > xPropsInfo;
- Reference< XIndexAccess > xCurrentContainer;
- for (sal_Int32 i=0; i<nElements; ++i)
- {
- try
- {
- // extract the current element
- ::cppu::extractInterface(xCurrentProps, _rxCollection->getByIndex(i));
- OSL_ENSURE(xCurrentProps.is(), "OFormLayerXMLExport_Impl::exportCollectionElements: invalid child element, skipping!");
- if (!xCurrentProps.is())
- continue;
-
- // check if there is a ClassId property on the current element. If so, we assume it to be a control
- xPropsInfo = xCurrentProps->getPropertySetInfo();
- OSL_ENSURE(xPropsInfo.is(), "OFormLayerXMLExport_Impl::exportCollectionElements: no property set info!");
- if (!xPropsInfo.is())
- // without this, a lot of stuff in the export routines may fail
- continue;
-
- // if the element is part of a ignore list, we are not allowed to export it
- if ( m_aIgnoreList.end() != m_aIgnoreList.find( xCurrentProps ) )
- continue;
-
- if (xElementEventManager.is())
- aElementEvents = xElementEventManager->getScriptEvents(i);
-
- if (xPropsInfo->hasPropertyByName(PROPERTY_COLUMNSERVICENAME))
- {
- exportGridColumn(xCurrentProps, aElementEvents);
- }
- else if (xPropsInfo->hasPropertyByName(PROPERTY_CLASSID))
- {
- exportControl(xCurrentProps, aElementEvents);
- }
- else
- {
- exportForm(xCurrentProps, aElementEvents);
- }
- }
- catch(Exception&)
- {
- OSL_ENSURE(sal_False, "OFormLayerXMLExport_Impl::exportCollectionElements: caught an exception ... skipping the current element!");
- continue;
- }
- }
- }
-
- //---------------------------------------------------------------------
- ::rtl::OUString OFormLayerXMLExport_Impl::getObjectStyleName( const Reference< XPropertySet >& _rxObject )
- {
- ::rtl::OUString aObjectStyle;
-
- MapPropertySet2String::const_iterator aObjectStylePos = m_aGridColumnStyles.find( _rxObject );
- if ( m_aGridColumnStyles.end() != aObjectStylePos )
- aObjectStyle = aObjectStylePos->second;
- return aObjectStyle;
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport_Impl::clear()
- {
- m_aControlIds.clear();
- m_aReferringControls.clear();
- m_aCurrentPageIds = m_aControlIds.end();
- m_aCurrentPageReferring = m_aReferringControls.end();
-
- m_aControlNumberFormats.clear();
- m_aGridColumnStyles.clear();
-
- m_aIgnoreList.clear();
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport_Impl::exportAutoControlNumberStyles()
- {
- if ( m_pControlNumberStyles )
- m_pControlNumberStyles->Export( sal_True );
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport_Impl::exportAutoStyles()
- {
- m_rContext.GetAutoStylePool()->exportXML(
- XML_STYLE_FAMILY_CONTROL_ID,
- m_rContext.GetDocHandler(),
- m_rContext.GetMM100UnitConverter(),
- m_rContext.GetNamespaceMap()
- );
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport_Impl::exportForms(const Reference< XDrawPage >& _rxDrawPage)
- {
- // get the forms collection of the page
- Reference< XIndexAccess > xCollectionIndex;
- if (!implCheckPage(_rxDrawPage, xCollectionIndex))
- return;
-
-#if OSL_DEBUG_LEVEL > 0
- sal_Bool bPageIsKnown =
-#endif
- implMoveIterators(_rxDrawPage, sal_False);
- OSL_ENSURE(bPageIsKnown, "OFormLayerXMLExport_Impl::exportForms: exporting a page which has not been examined!");
-
- exportCollectionElements(xCollectionIndex);
- }
-
- //---------------------------------------------------------------------
- sal_Bool OFormLayerXMLExport_Impl::implMoveIterators(const Reference< XDrawPage >& _rxDrawPage, sal_Bool _bClear)
- {
- sal_Bool bKnownPage = sal_False;
-
- // the one for the ids
- m_aCurrentPageIds = m_aControlIds.find(_rxDrawPage);
- if (m_aControlIds.end() == m_aCurrentPageIds)
- {
- m_aControlIds[_rxDrawPage] = MapPropertySet2String();
- m_aCurrentPageIds = m_aControlIds.find(_rxDrawPage);
- }
- else
- {
- bKnownPage = sal_True;
- if (_bClear && m_aCurrentPageIds->second.size())
- m_aCurrentPageIds->second.clear();
- }
-
- // the one for the ids of the referring controls
- m_aCurrentPageReferring = m_aReferringControls.find(_rxDrawPage);
- if (m_aReferringControls.end() == m_aCurrentPageReferring)
- {
- m_aReferringControls[_rxDrawPage] = MapPropertySet2String();
- m_aCurrentPageReferring = m_aReferringControls.find(_rxDrawPage);
- }
- else
- {
- bKnownPage = sal_True;
- if (_bClear && m_aCurrentPageReferring->second.size())
- m_aCurrentPageReferring->second.clear();
- }
- return bKnownPage;
- }
-
- //---------------------------------------------------------------------
- sal_Bool OFormLayerXMLExport_Impl::seekPage(const Reference< XDrawPage >& _rxDrawPage)
- {
- return implMoveIterators(_rxDrawPage, sal_False);
- }
-
- //---------------------------------------------------------------------
- ::rtl::OUString OFormLayerXMLExport_Impl::getControlId(const Reference< XPropertySet >& _rxControl)
- {
- OSL_ENSURE(m_aCurrentPageIds != m_aControlIds.end(), "OFormLayerXMLExport_Impl::getControlId: invalid current page!");
- OSL_ENSURE(m_aCurrentPageIds->second.end() != m_aCurrentPageIds->second.find(_rxControl),
- "OFormLayerXMLExport_Impl::getControlId: can not find the control!");
- return m_aCurrentPageIds->second[_rxControl];
- }
-
- //---------------------------------------------------------------------
- ::rtl::OUString OFormLayerXMLExport_Impl::getImmediateNumberStyle( const Reference< XPropertySet >& _rxObject )
- {
- ::rtl::OUString sNumberStyle;
-
- sal_Int32 nOwnFormatKey = implExamineControlNumberFormat( _rxObject );
- if ( -1 != nOwnFormatKey )
- sNumberStyle = getControlNumberStyleExport()->GetStyleName( nOwnFormatKey );
-
- return sNumberStyle;
- }
-
- //---------------------------------------------------------------------
- ::rtl::OUString OFormLayerXMLExport_Impl::getControlNumberStyle( const Reference< XPropertySet >& _rxControl )
- {
- ::rtl::OUString sNumberStyle;
-
- ConstMapPropertySet2IntIterator aControlFormatPos = m_aControlNumberFormats.find(_rxControl);
- if (m_aControlNumberFormats.end() != aControlFormatPos)
- {
- OSL_ENSURE(m_pControlNumberStyles, "OFormLayerXMLExport_Impl::getControlNumberStyle: have a control which has a format style, but no style exporter!");
- sNumberStyle = getControlNumberStyleExport()->GetStyleName(aControlFormatPos->second);
- }
- // it's allowed to ask for a control which does not have format information.
- // (This is for performance reasons)
-
- return sNumberStyle;
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport_Impl::examineForms(const Reference< XDrawPage >& _rxDrawPage)
- {
- // get the forms collection of the page
- Reference< XIndexAccess > xCollectionIndex;
- if (!implCheckPage(_rxDrawPage, xCollectionIndex))
- return;
-
- // move the iterator which specify the currently handled page
-#if OSL_DEBUG_LEVEL > 0
- sal_Bool bPageIsKnown =
-#endif
- implMoveIterators(_rxDrawPage, sal_True);
- OSL_ENSURE(!bPageIsKnown, "OFormLayerXMLExport_Impl::examineForms: examining a page twice!");
-
- ::std::stack< Reference< XIndexAccess > > aContainerHistory;
- ::std::stack< sal_Int32 > aIndexHistory;
-
- Reference< XPropertySet > xCurrent;
-
- Reference< XIndexAccess > xLoop = xCollectionIndex;
- sal_Int32 nChildPos = 0;
- do
- {
- if (nChildPos < xLoop->getCount())
- {
- ::cppu::extractInterface(xCurrent, xLoop->getByIndex(nChildPos));
- OSL_ENSURE(xCurrent.is(), "OFormLayerXMLExport_Impl::examineForms: invalid child object");
- if (!xCurrent.is())
- continue;
-
- if (!checkExamineControl(xCurrent))
- {
- // step down
- Reference< XIndexAccess > xNextContainer(xCurrent, UNO_QUERY);
- OSL_ENSURE(xNextContainer.is(), "OFormLayerXMLExport_Impl::examineForms: what the heck is this ... no control, no container?");
- aContainerHistory.push(xLoop);
- aIndexHistory.push(nChildPos);
-
- xLoop = xNextContainer;
- nChildPos = -1; // will be incremented below
- }
- ++nChildPos;
- }
- else
- {
- // step up
- while ((nChildPos >= xLoop->getCount()) && aContainerHistory.size())
- {
- xLoop = aContainerHistory.top();
- aContainerHistory.pop();
- nChildPos = aIndexHistory.top();
- aIndexHistory.pop();
-
- ++nChildPos;
- }
- if (nChildPos >= xLoop->getCount())
- // exited the loop above because we have no history anymore (0 == aContainerHistory.size()),
- // and on the current level there are no more children
- // -> leave
- break;
- }
- }
- while (xLoop.is());
- }
-
- //---------------------------------------------------------------------
- sal_Bool OFormLayerXMLExport_Impl::checkExamineControl(const Reference< XPropertySet >& _rxObject)
- {
- static const ::rtl::OUString sControlId(RTL_CONSTASCII_USTRINGPARAM("control"));
-
- Reference< XPropertySetInfo > xCurrentInfo = _rxObject->getPropertySetInfo();
- OSL_ENSURE(xCurrentInfo.is(), "OFormLayerXMLExport_Impl::checkExamineControl: no property set info");
-
- sal_Bool bIsControl = xCurrentInfo->hasPropertyByName( PROPERTY_CLASSID );
- if (bIsControl)
- {
- // ----------------------------------
- // generate a new control id
-
- // find a free id
- ::rtl::OUString sCurrentId = sControlId;
- sCurrentId += ::rtl::OUString::valueOf((sal_Int32)(m_aCurrentPageIds->second.size() + 1));
- #ifdef DBG_UTIL
- // Check if the id is already used. It shouldn't, as we currently have no mechanism for removing entries
- // from the map, so the approach used above (take the map size) should be sufficient. But if somebody
- // changes this (e.g. allows removing entries from the map), this assertion here probably will fail.
- for ( ConstMapPropertySet2StringIterator aCheck = m_aCurrentPageIds->second.begin();
- aCheck != m_aCurrentPageIds->second.end();
- ++aCheck
- )
- OSL_ENSURE(aCheck->second != sCurrentId,
- "OFormLayerXMLExport_Impl::checkExamineControl: auto-generated control ID is already used!");
- #endif
- // add it to the map
- m_aCurrentPageIds->second[_rxObject] = sCurrentId;
-
- // ----------------------------------
- // check if this control has a "LabelControl" property referring another control
- if ( xCurrentInfo->hasPropertyByName( PROPERTY_CONTROLLABEL ) )
- {
- Reference< XPropertySet > xCurrentReference;
- ::cppu::extractInterface( xCurrentReference, _rxObject->getPropertyValue( PROPERTY_CONTROLLABEL ) );
- if (xCurrentReference.is())
- {
- ::rtl::OUString& sReferencedBy = m_aCurrentPageReferring->second[xCurrentReference];
- if (sReferencedBy.getLength())
- // it's not the first _rxObject referring to the xCurrentReference
- // -> separate the id
- sReferencedBy += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- sReferencedBy += sCurrentId;
- }
- }
-
- // ----------------------------------
- // check if the control needs a number format style
- if ( xCurrentInfo->hasPropertyByName( PROPERTY_FORMATKEY ) )
- {
- examineControlNumberFormat(_rxObject);
- }
-
- // ----------------------------------
- // check if it is a grid control - in this case, we need special handling for the columns
- sal_Int16 nControlType = FormComponentType::CONTROL;
- _rxObject->getPropertyValue( PROPERTY_CLASSID ) >>= nControlType;
- if ( FormComponentType::GRIDCONTROL == nControlType )
- {
- collectGridAutoStyles( _rxObject );
- }
- }
-
- return bIsControl;
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport_Impl::collectGridAutoStyles( const Reference< XPropertySet >& _rxControl )
- {
- // loop through all columns of the grid
- try
- {
- Reference< XIndexAccess > xContainer( _rxControl, UNO_QUERY );
- OSL_ENSURE( xContainer.is(), "OFormLayerXMLExport_Impl::collectGridAutoStyles: grid control not being a container?!" );
- if ( xContainer.is() )
- {
- Reference< XPropertySet > xColumnProperties;
- Reference< XPropertySetInfo > xColumnPropertiesMeta;
-
- sal_Int32 nCount = xContainer->getCount();
- for ( sal_Int32 i=0; i<nCount; ++i )
- {
- if ( xContainer->getByIndex( i ) >>= xColumnProperties )
- {
- xColumnPropertiesMeta = xColumnProperties->getPropertySetInfo();
- // get the styles of the column
- ::std::vector< XMLPropertyState > aPropertyStates = m_xExportMapper->Filter( xColumnProperties );
-
- // care for the number format, additionally
- ::rtl::OUString sColumnNumberStyle;
- if ( xColumnPropertiesMeta.is() && xColumnPropertiesMeta->hasPropertyByName( PROPERTY_FORMATKEY ) )
- sColumnNumberStyle = getImmediateNumberStyle( xColumnProperties );
-
- if ( sColumnNumberStyle.getLength() )
- { // the column indeed has a formatting
- sal_Int32 nStyleMapIndex = m_xExportMapper->getPropertySetMapper()->FindEntryIndex( CTF_FORMS_DATA_STYLE );
- // TODO: move this to the ctor
- OSL_ENSURE ( -1 != nStyleMapIndex, "XMLShapeExport::collectShapeAutoStyles: could not obtain the index for our context id!");
-
- XMLPropertyState aNumberStyleState( nStyleMapIndex, makeAny( sColumnNumberStyle ) );
- aPropertyStates.push_back( aNumberStyleState );
- }
-
-#ifdef DBG_UTIL
- ::std::vector< XMLPropertyState >::const_iterator aHaveALook = aPropertyStates.begin();
- for ( ; aHaveALook != aPropertyStates.end(); ++aHaveALook )
- {
- sal_Int32 nDummy = 0;
- }
-#endif
-
- if ( aPropertyStates.size() )
- { // add to the style pool
- ::rtl::OUString sColumnStyleName = m_rContext.GetAutoStylePool()->Add( XML_STYLE_FAMILY_CONTROL_ID, aPropertyStates );
-
- OSL_ENSURE( m_aGridColumnStyles.end() == m_aGridColumnStyles.find( xColumnProperties ),
- "OFormLayerXMLExport_Impl::collectGridAutoStyles: already have a style for this column!" );
-
- m_aGridColumnStyles.insert( MapPropertySet2String::value_type( xColumnProperties, sColumnStyleName ) );
- }
- }
- else
- OSL_ENSURE( sal_False, "OFormLayerXMLExport_Impl::collectGridAutoStyles: invalid grid column encountered!" );
- }
- }
- }
- catch( const Exception& e )
- {
- e; // make compiler happy
- OSL_ENSURE( sal_False, "OFormLayerXMLExport_Impl::collectGridAutoStyles: error examining the grid colums!" );
- }
- }
-
- //---------------------------------------------------------------------
- sal_Int32 OFormLayerXMLExport_Impl::implExamineControlNumberFormat( const Reference< XPropertySet >& _rxObject )
- {
- // get the format key relative to our own formats supplier
- sal_Int32 nOwnFormatKey = ensureTranslateFormat( _rxObject );
-
- if ( -1 != nOwnFormatKey )
- // tell the exporter that we used this format
- getControlNumberStyleExport()->SetUsed( nOwnFormatKey );
-
- return nOwnFormatKey;
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport_Impl::examineControlNumberFormat( const Reference< XPropertySet >& _rxControl )
- {
- sal_Int32 nOwnFormatKey = implExamineControlNumberFormat( _rxControl );
-
- if ( -1 == nOwnFormatKey )
- // nothing to do, the number format of this control is void
- return;
-
- // remember the format key for this control (we'll be asked in getControlNumberStyle for this)
- OSL_ENSURE(m_aControlNumberFormats.end() == m_aControlNumberFormats.find(_rxControl),
- "OFormLayerXMLExport_Impl::examineControlNumberFormat: already handled this control!");
- m_aControlNumberFormats[_rxControl] = nOwnFormatKey;
- }
-
- //---------------------------------------------------------------------
- sal_Int32 OFormLayerXMLExport_Impl::ensureTranslateFormat(const Reference< XPropertySet >& _rxFormattedControl)
- {
- ensureControlNumberStyleExport();
- OSL_ENSURE(m_xControlNumberFormats.is(), "OFormLayerXMLExport_Impl::ensureTranslateFormat: no own formats supplier!");
- // (should have been created in ensureControlNumberStyleExport)
-
- sal_Int32 nOwnFormatKey = -1;
-
- // the format key (relative to the control's supplier)
- sal_Int32 nControlFormatKey = -1;
- Any aControlFormatKey = _rxFormattedControl->getPropertyValue(PROPERTY_FORMATKEY);
- if (aControlFormatKey >>= nControlFormatKey)
- {
- // the control's number format
- Reference< XNumberFormatsSupplier > xControlFormatsSupplier;
- _rxFormattedControl->getPropertyValue(PROPERTY_FORMATSSUPPLIER) >>= xControlFormatsSupplier;
- Reference< XNumberFormats > xControlFormats;
- if (xControlFormatsSupplier.is())
- xControlFormats = xControlFormatsSupplier->getNumberFormats();
- OSL_ENSURE(xControlFormats.is(), "OFormLayerXMLExport_Impl::ensureTranslateFormat: formatted control without supplier!");
-
- // obtain the persistent (does not depend on the formats supplier) representation of the control's format
- Locale aFormatLocale;
- ::rtl::OUString sFormatDescription;
- if (xControlFormats.is())
- {
- Reference< XPropertySet > xControlFormat = xControlFormats->getByKey(nControlFormatKey);
-
- xControlFormat->getPropertyValue(PROPERTY_LOCALE) >>= aFormatLocale;
- xControlFormat->getPropertyValue(PROPERTY_FORMATSTRING) >>= sFormatDescription;
- }
-
- // check if our own formats collection already knows the format
- nOwnFormatKey = m_xControlNumberFormats->queryKey(sFormatDescription, aFormatLocale, sal_False);
- if (-1 == nOwnFormatKey)
- { // no, we don't
- // -> create a new format
- nOwnFormatKey = m_xControlNumberFormats->addNew(sFormatDescription, aFormatLocale);
- }
- OSL_ENSURE(-1 != nOwnFormatKey, "OFormLayerXMLExport_Impl::ensureTranslateFormat: could not translate the controls format key!");
- }
- else
- OSL_ENSURE(!aControlFormatKey.hasValue(), "OFormLayerXMLExport_Impl::ensureTranslateFormat: invalid number format property value!");
-
- return nOwnFormatKey;
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport_Impl::ensureControlNumberStyleExport()
- {
- if (!m_pControlNumberStyles)
- {
- // create our number formats supplier (if necessary)
- Reference< XNumberFormatsSupplier > xFormatsSupplier;
-
- OSL_ENSURE(!m_xControlNumberFormats.is(), "OFormLayerXMLExport_Impl::getControlNumberStyleExport: inconsistence!");
- // the m_xControlNumberFormats and m_pControlNumberStyles should be maintained together
-
- try
- {
- // create it for en-US (does not really matter, as we will specify a locale for every
- // concrete language to use)
- Sequence< Any > aSupplierArgs(1);
- aSupplierArgs[0] <<= Locale ( ::rtl::OUString::createFromAscii("en"),
- ::rtl::OUString::createFromAscii("US"),
- ::rtl::OUString()
- );
- // #110680#
- //Reference< XInterface > xFormatsSupplierUntyped =
- // ::comphelper::getProcessServiceFactory()->createInstanceWithArguments(
- // SERVICE_NUMBERFORMATSSUPPLIER,
- // aSupplierArgs
- // );
- Reference< XInterface > xFormatsSupplierUntyped =
- m_rContext.getServiceFactory()->createInstanceWithArguments(
- SERVICE_NUMBERFORMATSSUPPLIER,
- aSupplierArgs
- );
- OSL_ENSURE(xFormatsSupplierUntyped.is(), "OFormLayerXMLExport_Impl::getControlNumberStyleExport: could not instantiate a number formats supplier!");
-
- xFormatsSupplier = Reference< XNumberFormatsSupplier >(xFormatsSupplierUntyped, UNO_QUERY);
- if (xFormatsSupplier.is())
- m_xControlNumberFormats = xFormatsSupplier->getNumberFormats();
- }
- catch(const Exception&)
- {
- }
-
- OSL_ENSURE(m_xControlNumberFormats.is(), "OFormLayerXMLExport_Impl::getControlNumberStyleExport: could not obtain my default number formats!");
-
- // create the exporter
- m_pControlNumberStyles = new SvXMLNumFmtExport(m_rContext, xFormatsSupplier, getControlNumberStyleNamePrefix());
- }
- }
-
- //---------------------------------------------------------------------
- SvXMLNumFmtExport* OFormLayerXMLExport_Impl::getControlNumberStyleExport()
- {
- ensureControlNumberStyleExport();
- return m_pControlNumberStyles;
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLExport_Impl::excludeFromExport( const Reference< XControlModel > _rxControl )
- {
- Reference< XPropertySet > xProps( _rxControl, UNO_QUERY );
- OSL_ENSURE( xProps.is(), "OFormLayerXMLExport_Impl::excludeFromExport: invalid control model!" );
-#if OSL_DEBUG_LEVEL > 0
- ::std::pair< PropertySetBag::iterator, bool > aPos =
-#endif
- m_aIgnoreList.insert( xProps );
- OSL_ENSURE( aPos.second, "OFormLayerXMLExport_Impl::excludeFromExport: element already exists in the ignore list!" );
- }
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_layerimport.cxx b/binfilter/bf_xmloff/source/forms/xmloff_layerimport.cxx
deleted file mode 100644
index a6ecfed10dd3..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_layerimport.cxx
+++ /dev/null
@@ -1,597 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "layerimport.hxx"
-#include "formenums.hxx"
-#include "elementimport.hxx"
-#include "officeforms.hxx"
-#include "strings.hxx"
-#include "formstyles.hxx"
-#include "xmlimp.hxx"
-#include "XMLEventImportHelper.hxx"
-#include "xmlnumfi.hxx"
-#include <com/sun/star/form/FormSubmitEncoding.hpp>
-#include <com/sun/star/form/FormSubmitMethod.hpp>
-#include <com/sun/star/sdb/CommandType.hpp>
-#include <com/sun/star/form/NavigationBarMode.hpp>
-#include <com/sun/star/form/TabulatorCycle.hpp>
-#include <com/sun/star/form/FormButtonType.hpp>
-#include <com/sun/star/form/ListSourceType.hpp>
-#include <vcl/wintypes.hxx> // for check states
-
-#include <com/sun/star/form/XFormsSupplier.hpp>
-#include "controlpropertyhdl.hxx"
-#include "controlpropertymap.hxx"
-#include "formevents.hxx"
-#ifndef XMLOFF_FORMS_FORMCELLBINDING
-#include "formcellbinding.hxx"
-#endif
-namespace binfilter {
-
-SV_IMPL_REF( SvXMLStylesContext );
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::container;
- using namespace ::com::sun::star::drawing;
- using namespace ::com::sun::star::xml;
- using namespace ::com::sun::star::util;
- using namespace ::com::sun::star::form;
- using namespace ::com::sun::star::sdb;
-
- //=====================================================================
- //= OFormLayerXMLImport_Impl
- //=====================================================================
- //---------------------------------------------------------------------
- OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl(SvXMLImport& _rImporter)
- :m_rImporter(_rImporter)
- ,m_pAutoStyles(NULL)
- {
- // build the attribute2property map
- // string properties which are exported as attributes
- m_aAttributeMetaData.addStringProperty(
- OAttributeMetaData::getCommonControlAttributeName(CCA_NAME), PROPERTY_NAME);
- m_aAttributeMetaData.addStringProperty(
- OAttributeMetaData::getCommonControlAttributeName(CCA_IMAGE_DATA), PROPERTY_IMAGEURL);
- m_aAttributeMetaData.addStringProperty(
- OAttributeMetaData::getCommonControlAttributeName(CCA_LABEL), PROPERTY_LABEL);
- m_aAttributeMetaData.addStringProperty(
- OAttributeMetaData::getCommonControlAttributeName(CCA_TARGET_LOCATION), PROPERTY_TARGETURL);
- m_aAttributeMetaData.addStringProperty(
- OAttributeMetaData::getCommonControlAttributeName(CCA_TITLE), PROPERTY_TITLE);
- m_aAttributeMetaData.addStringProperty(
- OAttributeMetaData::getCommonControlAttributeName(CCA_TARGET_FRAME), PROPERTY_TARGETFRAME, "_blank");
- m_aAttributeMetaData.addStringProperty(
- OAttributeMetaData::getDatabaseAttributeName(DA_DATA_FIELD), PROPERTY_DATAFIELD);
- m_aAttributeMetaData.addStringProperty(
- OAttributeMetaData::getFormAttributeName(faCommand), PROPERTY_COMMAND);
- m_aAttributeMetaData.addStringProperty(
- OAttributeMetaData::getFormAttributeName(faDatasource), PROPERTY_DATASOURCENAME);
- m_aAttributeMetaData.addStringProperty(
- OAttributeMetaData::getFormAttributeName(faFilter), PROPERTY_FILTER);
- m_aAttributeMetaData.addStringProperty(
- OAttributeMetaData::getFormAttributeName(faOrder), PROPERTY_ORDER);
-
- // properties not added because they're already present in another form
- OSL_ENSURE(
- 0 == ::rtl::OUString::createFromAscii(OAttributeMetaData::getCommonControlAttributeName(CCA_TARGET_LOCATION)).compareToAscii(
- OAttributeMetaData::getFormAttributeName(faAction)),
- "OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl: invalid attribute names (1)!");
- // if this fails, we would have to add a translation from faAction->PROPERTY_TARGETURL
- // We did not because we already have one CCA_TARGET_LOCATION->PROPERTY_TARGETURL,
- // and CCA_TARGET_LOCATION and faAction should be represented by the same attribute
-
- OSL_ENSURE(
- 0 == ::rtl::OUString::createFromAscii(OAttributeMetaData::getCommonControlAttributeName(CCA_NAME)).compareToAscii(
- OAttributeMetaData::getFormAttributeName(faName)),
- "OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl: invalid attribute names (2)!");
- // the same for faName, CCA_NAME and PROPERTY_NAME
-
- // boolean properties which are exported as attributes
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getCommonControlAttributeName(CCA_CURRENT_SELECTED), PROPERTY_STATE, sal_False);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getCommonControlAttributeName(CCA_DISABLED), PROPERTY_ENABLED, sal_False, sal_True);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getCommonControlAttributeName(CCA_DROPDOWN), PROPERTY_DROPDOWN, sal_False);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getCommonControlAttributeName(CCA_PRINTABLE), PROPERTY_PRINTABLE, sal_True);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getCommonControlAttributeName(CCA_READONLY), PROPERTY_READONLY, sal_False);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getCommonControlAttributeName(CCA_SELECTED), PROPERTY_DEFAULT_STATE, sal_False);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getCommonControlAttributeName(CCA_TAB_STOP), PROPERTY_TABSTOP, sal_True);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getDatabaseAttributeName(DA_CONVERT_EMPTY), PROPERTY_EMPTY_IS_NULL, sal_False);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getSpecialAttributeName(SCA_VALIDATION), PROPERTY_STRICTFORMAT, sal_False);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getSpecialAttributeName(SCA_MULTI_LINE), PROPERTY_MULTILINE, sal_False);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getSpecialAttributeName(SCA_AUTOMATIC_COMPLETION), PROPERTY_AUTOCOMPLETE, sal_False);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getSpecialAttributeName(SCA_MULTIPLE), PROPERTY_MULTISELECTION, sal_False);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getSpecialAttributeName(SCA_DEFAULT_BUTTON), PROPERTY_DEFAULTBUTTON, sal_False);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getSpecialAttributeName(SCA_IS_TRISTATE), PROPERTY_TRISTATE, sal_False);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getFormAttributeName(faAllowDeletes), PROPERTY_ALLOWDELETES, sal_True);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getFormAttributeName(faAllowInserts), PROPERTY_ALLOWINSERTS, sal_True);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getFormAttributeName(faAllowUpdates), PROPERTY_ALLOWUPDATES, sal_True);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getFormAttributeName(faApplyFilter), PROPERTY_APPLYFILTER, sal_False);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getFormAttributeName(faEscapeProcessing), PROPERTY_ESCAPEPROCESSING, sal_True);
- m_aAttributeMetaData.addBooleanProperty(
- OAttributeMetaData::getFormAttributeName(faIgnoreResult), PROPERTY_IGNORERESULT, sal_False);
-
- // the int16 attributes
- m_aAttributeMetaData.addInt16Property(
- OAttributeMetaData::getCommonControlAttributeName(CCA_MAX_LENGTH), PROPERTY_MAXTEXTLENGTH, 0);
- m_aAttributeMetaData.addInt16Property(
- OAttributeMetaData::getCommonControlAttributeName(CCA_SIZE), PROPERTY_LINECOUNT, 5);
- m_aAttributeMetaData.addInt16Property(
- OAttributeMetaData::getCommonControlAttributeName(CCA_TAB_INDEX), PROPERTY_TABINDEX, 0);
- m_aAttributeMetaData.addInt16Property(
- OAttributeMetaData::getDatabaseAttributeName(DA_BOUND_COLUMN), PROPERTY_BOUNDCOLUMN, 0);
-
- // the enum attributes
- m_aAttributeMetaData.addEnumProperty(
- OAttributeMetaData::getCommonControlAttributeName(CCA_BUTTON_TYPE), PROPERTY_BUTTONTYPE,
- FormButtonType_PUSH, OEnumMapper::getEnumMap(OEnumMapper::epButtonType),
- &::getCppuType( static_cast<FormButtonType*>(NULL) ));
- m_aAttributeMetaData.addEnumProperty(
- OAttributeMetaData::getDatabaseAttributeName(DA_LIST_SOURCE_TYPE), PROPERTY_LISTSOURCETYPE,
- ListSourceType_VALUELIST, OEnumMapper::getEnumMap(OEnumMapper::epListSourceType),
- &::getCppuType( static_cast<ListSourceType*>(NULL) ));
- m_aAttributeMetaData.addEnumProperty(
- OAttributeMetaData::getSpecialAttributeName(SCA_STATE), PROPERTY_DEFAULT_STATE, STATE_NOCHECK,
- OEnumMapper::getEnumMap(OEnumMapper::epCheckState),
- &::getCppuType( static_cast< sal_Int16* >(NULL)));
- m_aAttributeMetaData.addEnumProperty(
- OAttributeMetaData::getSpecialAttributeName(SCA_CURRENT_STATE), PROPERTY_STATE, STATE_NOCHECK,
- OEnumMapper::getEnumMap(OEnumMapper::epCheckState),
- &::getCppuType( static_cast< sal_Int16* >(NULL)));
- m_aAttributeMetaData.addEnumProperty(
- OAttributeMetaData::getFormAttributeName(faEnctype), PROPERTY_SUBMIT_ENCODING,
- FormSubmitEncoding_URL, OEnumMapper::getEnumMap(OEnumMapper::epSubmitEncoding),
- &::getCppuType( static_cast<FormSubmitEncoding*>(NULL) ));
- m_aAttributeMetaData.addEnumProperty(
- OAttributeMetaData::getFormAttributeName(faMethod), PROPERTY_SUBMIT_METHOD,
- FormSubmitMethod_GET, OEnumMapper::getEnumMap(OEnumMapper::epSubmitMethod),
- &::getCppuType( static_cast<FormSubmitMethod*>(NULL) ));
- m_aAttributeMetaData.addEnumProperty(
- OAttributeMetaData::getFormAttributeName(faCommandType), PROPERTY_COMMAND_TYPE,
- CommandType::COMMAND, OEnumMapper::getEnumMap(OEnumMapper::epCommandType));
- m_aAttributeMetaData.addEnumProperty(
- OAttributeMetaData::getFormAttributeName(faNavigationMode), PROPERTY_NAVIGATION,
- NavigationBarMode_NONE, OEnumMapper::getEnumMap(OEnumMapper::epNavigationType),
- &::getCppuType( static_cast<NavigationBarMode*>(NULL) ));
- m_aAttributeMetaData.addEnumProperty(
- OAttributeMetaData::getFormAttributeName(faTabbingCycle), PROPERTY_CYCLE,
- TabulatorCycle_RECORDS, OEnumMapper::getEnumMap(OEnumMapper::epTabCyle),
- &::getCppuType( static_cast<TabulatorCycle*>(NULL) ));
-
- // initialize our style map
- m_xPropertyHandlerFactory = new OControlPropertyHandlerFactory();
- ::rtl::Reference< XMLPropertySetMapper > xStylePropertiesMapper = new XMLPropertySetMapper(getControlStylePropertyMap(), m_xPropertyHandlerFactory.get());
- m_xImportMapper = new SvXMLImportPropertyMapper(xStylePropertiesMapper.get(), _rImporter);
-
- // 'initialize'
- m_aCurrentPageIds = m_aControlIds.end();
- }
-
- //---------------------------------------------------------------------
- OFormLayerXMLImport_Impl::~OFormLayerXMLImport_Impl()
- {
- // outlined to allow forward declaration of OAttribute2Property in the header
-
- if (m_pAutoStyles)
- m_pAutoStyles->ReleaseRef();
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLImport_Impl::setAutoStyleContext(SvXMLStylesContext* _pNewContext)
- {
- OSL_ENSURE(!m_pAutoStyles, "OFormLayerXMLImport_Impl::setAutoStyleContext: not to be called twice!");
- m_pAutoStyles = _pNewContext;
- if (m_pAutoStyles)
- m_pAutoStyles->AddRef();
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLImport_Impl::applyControlNumberStyle(const Reference< XPropertySet >& _rxControlModel, const ::rtl::OUString& _rControlNumerStyleName)
- {
- OSL_ENSURE(_rxControlModel.is() && (0 != _rControlNumerStyleName.getLength()),
- "OFormLayerXMLImport_Impl::applyControlNumberStyle: invalid arguments (this will crash)!");
-
- OSL_ENSURE(m_pAutoStyles, "OFormLayerXMLImport_Impl::applyControlNumberStyle: have no auto style context!");
- if (!m_pAutoStyles)
- {
- m_pAutoStyles = m_rImporter.GetShapeImport()->GetAutoStylesContext();
- if (m_pAutoStyles)
- m_pAutoStyles->AddRef();
- }
-
- if (m_pAutoStyles)
- {
- const SvXMLStyleContext* pStyle = m_pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_DATA_STYLE, _rControlNumerStyleName);
- if (pStyle)
- {
- const SvXMLNumFormatContext* pDataStyle = static_cast<const SvXMLNumFormatContext*>(pStyle);
-
- ::rtl::OUString sFormatDescription;
- Locale aFormatLocale;
- const_cast<SvXMLNumFormatContext*>(pDataStyle)->GetFormat(sFormatDescription, aFormatLocale);
-
- // set this format at the control model
- try
- {
- // the models number format supplier and formats
- Reference< XNumberFormatsSupplier > xFormatsSupplier;
- _rxControlModel->getPropertyValue(PROPERTY_FORMATSSUPPLIER) >>= xFormatsSupplier;
- Reference< XNumberFormats > xFormats;
- if (xFormatsSupplier.is())
- xFormats = xFormatsSupplier->getNumberFormats();
- OSL_ENSURE(xFormats.is(), "OFormLayerXMLImport_Impl::applyControlNumberStyle: could not obtain the controls number formats!");
-
- // obtain a key
- if (xFormats.is())
- {
- sal_Int32 nFormatKey = xFormats->queryKey(sFormatDescription, aFormatLocale, sal_False);
- if (-1 == nFormatKey)
- { // not yet available -> add it
- nFormatKey = xFormats->addNew(sFormatDescription, aFormatLocale);
- }
-
- OSL_ENSURE(-1 != nFormatKey, "OFormLayerXMLImport_Impl::applyControlNumberStyle: could not obtain a format key!");
- // set the format on the control model
- _rxControlModel->setPropertyValue(PROPERTY_FORMATKEY, makeAny(nFormatKey));
- }
- }
- catch(const Exception&)
- {
- OSL_ENSURE(sal_False, "OFormLayerXMLImport_Impl::applyControlNumberStyle: couldn't set the format!");
- }
- }
- else
- OSL_ENSURE(sal_False, "OFormLayerXMLImport_Impl::applyControlNumberStyle: did not find the style with the given name!");
- }
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLImport_Impl::registerCellValueBinding( const Reference< XPropertySet >& _rxControlModel, const ::rtl::OUString& _rCellAddress )
- {
- OSL_ENSURE( _rxControlModel.is() && _rCellAddress.getLength(),
- "OFormLayerXMLImport_Impl::registerCellValueBinding: invalid arguments!" );
- m_aCellValueBindings.push_back( ModelStringPair( _rxControlModel, _rCellAddress ) );
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLImport_Impl::registerCellRangeListSource( const Reference< XPropertySet >& _rxControlModel, const ::rtl::OUString& _rCellRangeAddress )
- {
- OSL_ENSURE( _rxControlModel.is() && _rCellRangeAddress.getLength(),
- "OFormLayerXMLImport_Impl::registerCellRangeListSource: invalid arguments!" );
- m_aCellRangeListSources.push_back( ModelStringPair( _rxControlModel, _rCellRangeAddress ) );
- }
-
- //---------------------------------------------------------------------
- IControlIdMap& OFormLayerXMLImport_Impl::getControlIdMap()
- {
- return *this;
- }
-
- //---------------------------------------------------------------------
- OAttribute2Property& OFormLayerXMLImport_Impl::getAttributeMap()
- {
- return m_aAttributeMetaData;
- }
-
- //---------------------------------------------------------------------
- Reference< XMultiServiceFactory > OFormLayerXMLImport_Impl::getServiceFactory()
- {
- // #110680#
- // return ::comphelper::getProcessServiceFactory();
- return m_rImporter.getServiceFactory();
- }
-
- //---------------------------------------------------------------------
- SvXMLImport& OFormLayerXMLImport_Impl::getGlobalContext()
- {
- return m_rImporter;
- }
-
- //---------------------------------------------------------------------
- const SvXMLStyleContext* OFormLayerXMLImport_Impl::getStyleElement(const ::rtl::OUString& _rStyleName) const
- {
- OSL_ENSURE( m_pAutoStyles, "OFormLayerXMLImport_Impl::getStyleElement: have no auto style context!" );
- // did you use setAutoStyleContext?
-
- const SvXMLStyleContext* pControlStyle =
- m_pAutoStyles ? m_pAutoStyles->FindStyleChildContext( XML_STYLE_FAMILY_CONTROL_ID, _rStyleName ) : NULL;
- OSL_ENSURE( pControlStyle || !m_pAutoStyles,
- ::rtl::OString( "OFormLayerXMLImport_Impl::getStyleElement: did not find the style named \"" )
- += ::rtl::OString( _rStyleName.getStr(), _rStyleName.getLength(), RTL_TEXTENCODING_ASCII_US )
- += ::rtl::OString( "\"!" ) );
- return pControlStyle;
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLImport_Impl::enterEventContext()
- {
- // install our own translation table. We need to disable the other tables because of name conflicts.
- m_rImporter.GetEventImport().PushTranslationTable();
- m_rImporter.GetEventImport().AddTranslationTable(g_pFormsEventTranslation);
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLImport_Impl::leaveEventContext()
- {
- // install the original event tables.
- m_rImporter.GetEventImport().PopTranslationTable();
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLImport_Impl::registerControlId(const Reference< XPropertySet >& _rxControl, const ::rtl::OUString& _rId)
- {
- OSL_ENSURE(m_aCurrentPageIds != m_aControlIds.end(), "OFormLayerXMLImport_Impl::registerControlId: no current page!");
- OSL_ENSURE(_rId.getLength(), "OFormLayerXMLImport_Impl::registerControlId: invalid (empty) control id!");
-
- OSL_ENSURE(m_aCurrentPageIds->second.end() == m_aCurrentPageIds->second.find(_rId), "OFormLayerXMLImport_Impl::registerControlId: control id already used!");
- m_aCurrentPageIds->second[_rId] = _rxControl;
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLImport_Impl::registerControlReferences(const Reference< XPropertySet >& _rxControl, const ::rtl::OUString& _rReferringControls)
- {
- OSL_ENSURE(_rReferringControls.getLength(), "OFormLayerXMLImport_Impl::registerControlReferences: invalid (empty) control id list!");
- OSL_ENSURE(_rxControl.is(), "OFormLayerXMLImport_Impl::registerControlReferences: invalid (NULL) control!");
- m_aControlReferences.push_back( ModelStringPair( _rxControl, _rReferringControls ) );
- }
-
- //---------------------------------------------------------------------
- ::rtl::Reference< SvXMLImportPropertyMapper > OFormLayerXMLImport_Impl::getStylePropertyMapper() const
- {
- return m_xImportMapper;
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLImport_Impl::startPage(const Reference< XDrawPage >& _rxDrawPage)
- {
- m_xForms.clear();
-
- OSL_ENSURE(_rxDrawPage.is(), "OFormLayerXMLImport_Impl::startPage: NULL page!");
- Reference< XFormsSupplier > xFormsSupp(_rxDrawPage, UNO_QUERY);
- OSL_ENSURE(xFormsSupp.is(), "OFormLayerXMLImport_Impl::startPage: invalid draw page (no XFormsSupplier)!");
- if (!xFormsSupp.is())
- return;
-
- m_xForms = Reference< XNameContainer >(xFormsSupp->getForms(), UNO_QUERY);
- OSL_ENSURE(m_xForms.is(), "OFormLayerXMLImport_Impl::startPage: invalid forms collection!");
-
- // add a new entry to our page map
- ::std::pair< MapDrawPage2MapIterator, bool > aPagePosition =
- m_aControlIds.insert(MapDrawPage2Map::value_type(_rxDrawPage, MapString2PropertySet()));
- OSL_ENSURE(aPagePosition.second, "OFormLayerXMLImport_Impl::startPage: already imported this page!");
- m_aCurrentPageIds = aPagePosition.first;
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLImport_Impl::endPage()
- {
- OSL_ENSURE(m_xForms.is(), "OFormLayerXMLImport_Impl::endPage: sure you called startPage before?");
-
- // do some knittings for the controls which are referring to each other
- try
- {
- static const sal_Unicode s_nSeparator = ',';
- ::rtl::OUString sReferring;
- ::rtl::OUString sCurrentReferring;
- ::rtl::OUString sSeparator(&s_nSeparator, 1);
- Reference< XPropertySet > xCurrentReferring;
- sal_Int32 nSeparator, nPrevSep;
- for ( ::std::vector< ModelStringPair >::const_iterator aReferences = m_aControlReferences.begin();
- aReferences != m_aControlReferences.end();
- ++aReferences
- )
- {
- // the list of control ids is comma separated
-
- // in a list of n ids there are only n-1 separators ... have to catch this last id
- // -> normalize the list
- sReferring = aReferences->second;
- sReferring += sSeparator;
-
- nPrevSep = -1;
- while (-1 != (nSeparator = sReferring.indexOf(s_nSeparator, nPrevSep + 1)))
- {
- sCurrentReferring = sReferring.copy(nPrevSep + 1, nSeparator - nPrevSep - 1);
- xCurrentReferring = lookupControlId(sCurrentReferring);
- if (xCurrentReferring.is())
- // if this condition fails, this is an error, but lookupControlId should have asserted this ...
- xCurrentReferring->setPropertyValue( PROPERTY_CONTROLLABEL, makeAny( aReferences->first ) );
-
- nPrevSep = nSeparator;
- }
- }
- }
- catch(Exception&)
- {
- OSL_ENSURE(sal_False, "OFormLayerXMLImport_Impl::endPage: unable to knit the control references (caught an exception)!");
- }
-
- // now that we have all children of the forms collection, attach the events
- Reference< XIndexAccess > xIndexContainer(m_xForms, UNO_QUERY);
- if (xIndexContainer.is())
- ODefaultEventAttacherManager::setEvents(xIndexContainer);
-
- // clear the structures for the control references.
- m_aControlReferences.clear();
-
- // and no we have no current page anymore
- m_aCurrentPageIds = m_aControlIds.end();
- }
-
- //---------------------------------------------------------------------
- Reference< XPropertySet > OFormLayerXMLImport_Impl::lookupControlId(const ::rtl::OUString& _rControlId)
- {
- OSL_ENSURE(m_aCurrentPageIds != m_aControlIds.end(), "OFormLayerXMLImport_Impl::lookupControlId: no current page!");
- Reference< XPropertySet > xReturn;
- if (m_aCurrentPageIds != m_aControlIds.end())
- {
- ConstMapString2PropertySetIterator aPos = m_aCurrentPageIds->second.find(_rControlId);
- if (m_aCurrentPageIds->second.end() != aPos)
- xReturn = aPos->second;
- else
- OSL_ENSURE(sal_False, "OFormLayerXMLImport_Impl::lookupControlId: invalid control id (did not find it)!");
- }
- return xReturn;
- }
-
- //---------------------------------------------------------------------
- SvXMLImportContext* OFormLayerXMLImport_Impl::createOfficeFormsContext(
- SvXMLImport& _rImport,
- sal_uInt16 _nPrefix,
- const ::rtl::OUString& _rLocalName)
- {
- return new OFormsRootImport( _rImport, _nPrefix, _rLocalName );
- }
-
- //---------------------------------------------------------------------
- SvXMLImportContext* OFormLayerXMLImport_Impl::createContext(const sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const Reference< sax::XAttributeList >& _rxAttribs)
- {
- OSL_ENSURE(m_xForms.is(), "OFormLayerXMLImport_Impl::createContext: have no forms collection (did you use startPage?)!");
- OSL_ENSURE(0 == _rLocalName.compareToAscii("form"), "OFormLayerXMLImport_Impl::createContext: don't know the element name (must be \"form\")!");
-
- if (!m_xForms.is() || (0 != _rLocalName.compareToAscii("form")))
- {
- return new SvXMLImportContext(m_rImporter, _nPrefix, _rLocalName);
- }
-
- return new OFormImport(*this, *this, _nPrefix, _rLocalName, m_xForms );
- }
-
- //---------------------------------------------------------------------
- XMLPropStyleContext* OFormLayerXMLImport_Impl::createControlStyleContext( sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const Reference< sax::XAttributeList >& _rxAttrList, SvXMLStylesContext& _rParentStyles,
- sal_uInt16 _nFamily, sal_Bool _bDefaultStyle )
- {
- return new OControlStyleContext( m_rImporter, _nPrefix, _rLocalName, _rxAttrList, _rParentStyles, _nFamily, _bDefaultStyle );
- }
-
- //---------------------------------------------------------------------
- void OFormLayerXMLImport_Impl::documentDone( )
- {
- if ( ( getGlobalContext().getImportFlags() & IMPORT_CONTENT ) == 0 )
- return;
-
- // create (and bind) the spreadsheet cell bindings
- if ( !m_aCellValueBindings.empty()
- && FormCellBindingHelper::isCellBindingAllowed( getGlobalContext().GetModel() )
- )
- {
- for ( ::std::vector< ModelStringPair >::const_iterator aCellBindings = m_aCellValueBindings.begin();
- aCellBindings != m_aCellValueBindings.end();
- ++aCellBindings
- )
- {
- try
- {
- FormCellBindingHelper aHelper( aCellBindings->first, getGlobalContext().GetModel() );
- OSL_ENSURE( aHelper.isCellBindingAllowed(), "OFormLayerXMLImport_Impl::documentDone: can't bind this control model!" );
- if ( aHelper.isCellBindingAllowed() )
- {
- // There are special bindings for listboxes. See
- // OListAndComboImport::doRegisterCellValueBinding for a comment on this HACK.
- ::rtl::OUString sBoundCellAddress( aCellBindings->second );
- sal_Int32 nIndicator = sBoundCellAddress.lastIndexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ":index" ) ) );
-
- bool bUseIndexBinding = false;
- if ( nIndicator != -1 )
- {
- sBoundCellAddress = sBoundCellAddress.copy( 0, nIndicator );
- bUseIndexBinding = true;
- }
-
- aHelper.setBinding( aHelper.createCellBindingFromStringAddress( sBoundCellAddress, bUseIndexBinding ) );
- }
- }
- catch( const Exception& )
- {
- OSL_ENSURE( sal_False, "OFormLayerXMLImport_Impl::documentDone: caught an exception while binding to a cell!" );
- }
- }
- m_aCellValueBindings.clear();
- }
-
- // the same for the spreadsheet cell range list sources
- if ( !m_aCellRangeListSources.empty()
- && FormCellBindingHelper::isListCellRangeAllowed( getGlobalContext().GetModel() )
- )
- {
- for ( ::std::vector< ModelStringPair >::const_iterator aRangeBindings = m_aCellRangeListSources.begin();
- aRangeBindings != m_aCellRangeListSources.end();
- ++aRangeBindings
- )
- {
- try
- {
- FormCellBindingHelper aHelper( aRangeBindings->first, getGlobalContext().GetModel() );
- OSL_ENSURE( aHelper.isListCellRangeAllowed(), "OFormLayerXMLImport_Impl::documentDone: can't bind this control model!" );
- if ( aHelper.isListCellRangeAllowed() )
- {
- aHelper.setListSource( aHelper.createCellListSourceFromStringAddress( aRangeBindings->second ) );
- }
- }
- catch( const Exception& )
- {
- OSL_ENSURE( sal_False, "OFormLayerXMLImport_Impl::documentDone: caught an exception while binding to a cell range!" );
- }
- }
- m_aCellRangeListSources.clear();
- }
- }
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_logging.cxx b/binfilter/bf_xmloff/source/forms/xmloff_logging.cxx
deleted file mode 100644
index 14df3f1919a2..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_logging.cxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "logging.hxx"
-#include <rtl/logfile.hxx>
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
-#ifdef TIMELOG
- //=====================================================================
- //= OStackedLogging
- //=====================================================================
- //---------------------------------------------------------------------
- void OStackedLogging::enterContext( const sal_Char* _pContextName )
- {
- m_aLogger.push( new ::rtl::Logfile( _pContextName ) );
- }
-
- //---------------------------------------------------------------------
- void OStackedLogging::leaveTopContext( )
- {
- delete m_aLogger.top();
- m_aLogger.pop();
- }
-#endif
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_officeforms.cxx b/binfilter/bf_xmloff/source/forms/xmloff_officeforms.cxx
deleted file mode 100644
index 486ee4e5a97e..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_officeforms.cxx
+++ /dev/null
@@ -1,196 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-
-#include "officeforms.hxx"
-#include "xmluconv.hxx"
-#include "xmlnmspe.hxx"
-#include "xmlexp.hxx"
-#include "xmlimp.hxx"
-#include "nmspmap.hxx"
-#include <comphelper/extract.hxx>
-#include "strings.hxx"
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::frame;
- using namespace ::com::sun::star::xml;
- using ::binfilter::xmloff::token::XML_FORMS;
-
- //=========================================================================
- //= OFormsRootImport
- //=========================================================================
- TYPEINIT1(OFormsRootImport, SvXMLImportContext);
- //-------------------------------------------------------------------------
- OFormsRootImport::OFormsRootImport( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLocalName )
- :SvXMLImportContext(rImport, nPrfx, rLocalName)
- {
- }
-
- //-------------------------------------------------------------------------
- OFormsRootImport::~OFormsRootImport()
- {
- }
-
- //-------------------------------------------------------------------------
- SvXMLImportContext* OFormsRootImport::CreateChildContext( USHORT _nPrefix, const ::rtl::OUString& _rLocalName,
- const Reference< sax::XAttributeList>& xAttrList )
- {
- return GetImport().GetFormImport()->createContext( _nPrefix, _rLocalName, xAttrList );
- }
-
- //-------------------------------------------------------------------------
- void OFormsRootImport::implImportBool(const Reference< sax::XAttributeList >& _rxAttributes, OfficeFormsAttributes _eAttribute,
- const Reference< XPropertySet >& _rxProps, const Reference< XPropertySetInfo >& _rxPropInfo,
- const ::rtl::OUString& _rPropName, sal_Bool _bDefault)
- {
- // the complete attribute name to look for
- ::rtl::OUString sCompleteAttributeName = GetImport().GetNamespaceMap().GetQNameByIndex(
- getOfficeFormsAttributeNamespace(_eAttribute),
- ::rtl::OUString::createFromAscii(getOfficeFormsAttributeName(_eAttribute)));
-
- // get and convert the value
- ::rtl::OUString sAttributeValue = _rxAttributes->getValueByName(sCompleteAttributeName);
- sal_Bool bValue = _bDefault;
- GetImport().GetMM100UnitConverter().convertBool(bValue, sAttributeValue);
-
- // set the property
- if (_rxPropInfo->hasPropertyByName(_rPropName))
- _rxProps->setPropertyValue(_rPropName, ::cppu::bool2any(bValue));
- }
-
- //-------------------------------------------------------------------------
- void OFormsRootImport::StartElement( const Reference< sax::XAttributeList >& _rxAttrList )
- {
- ENTER_LOG_CONTEXT( "xmloff::OFormsRootImport - importing the complete tree" );
- SvXMLImportContext::StartElement( _rxAttrList );
-
- try
- {
- Reference< XPropertySet > xDocProperties(GetImport().GetModel(), UNO_QUERY);
- if ( xDocProperties.is() )
- { // an empty model is allowed: when doing a copy'n'paste from e.g. Writer to Calc,
- // this is done via streaming the controls as XML.
- Reference< XPropertySetInfo > xDocPropInfo;
- if (xDocProperties.is())
- xDocPropInfo = xDocProperties->getPropertySetInfo();
-
- implImportBool(_rxAttrList, ofaAutomaticFocus, xDocProperties, xDocPropInfo, PROPERTY_AUTOCONTROLFOCUS, sal_False);
- implImportBool(_rxAttrList, ofaApplyDesignMode, xDocProperties, xDocPropInfo, PROPERTY_APPLYDESIGNMODE, sal_True);
- }
- }
- catch(Exception&)
- {
- OSL_ENSURE(sal_False, "OFormsRootImport::StartElement: caught an exception while setting the document properties!");
- }
- }
-
- //-------------------------------------------------------------------------
- void OFormsRootImport::EndElement()
- {
- SvXMLImportContext::EndElement();
- LEAVE_LOG_CONTEXT( );
- }
-
- //=====================================================================
- //= OFormsRootExport
- //=====================================================================
- //---------------------------------------------------------------------
- OFormsRootExport::OFormsRootExport( SvXMLExport& _rExp )
- :m_pImplElement(NULL)
- {
- addModelAttributes(_rExp);
-
- m_pImplElement = new SvXMLElementExport(_rExp, XML_NAMESPACE_OFFICE, XML_FORMS, sal_True, sal_True);
- }
-
- //---------------------------------------------------------------------
- OFormsRootExport::~OFormsRootExport( )
- {
- delete m_pImplElement;
- }
-
- //-------------------------------------------------------------------------
- void OFormsRootExport::implExportBool(SvXMLExport& _rExp, OfficeFormsAttributes _eAttribute,
- const Reference< XPropertySet >& _rxProps, const Reference< XPropertySetInfo >& _rxPropInfo,
- const ::rtl::OUString& _rPropName, sal_Bool _bDefault)
- {
- // retrieve the property value
- sal_Bool bValue = _bDefault;
- if (_rxPropInfo->hasPropertyByName(_rPropName))
- bValue = ::cppu::any2bool(_rxProps->getPropertyValue(_rPropName));
-
- // convert into a string
- ::rtl::OUStringBuffer aValue;
- _rExp.GetMM100UnitConverter().convertBool(aValue, bValue);
-
- // add the attribute
- _rExp.AddAttribute(
- getOfficeFormsAttributeNamespace(_eAttribute),
- getOfficeFormsAttributeName(_eAttribute),
- aValue.makeStringAndClear());
- }
-
- //-------------------------------------------------------------------------
- void OFormsRootExport::addModelAttributes(SvXMLExport& _rExp) SAL_THROW(())
- {
- try
- {
- Reference< XPropertySet > xDocProperties(_rExp.GetModel(), UNO_QUERY);
- if ( xDocProperties.is() )
- { // an empty model is allowed: when doing a copy'n'paste from e.g. Writer to Calc,
- // this is done via streaming the controls as XML.
- Reference< XPropertySetInfo > xDocPropInfo;
- if (xDocProperties.is())
- xDocPropInfo = xDocProperties->getPropertySetInfo();
-
- implExportBool(_rExp, ofaAutomaticFocus, xDocProperties, xDocPropInfo, PROPERTY_AUTOCONTROLFOCUS, sal_False);
- implExportBool(_rExp, ofaApplyDesignMode, xDocProperties, xDocPropInfo, PROPERTY_APPLYDESIGNMODE, sal_True);
- }
- }
- catch(Exception&)
- {
- OSL_ENSURE(sal_False, "OFormsRootExport::addModelAttributes: caught an exception while retrieving the document properties!");
- }
- }
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_propertyexport.cxx b/binfilter/bf_xmloff/source/forms/xmloff_propertyexport.cxx
deleted file mode 100644
index 7de4a0ca36e3..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_propertyexport.cxx
+++ /dev/null
@@ -1,739 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <stdio.h>
-
-#include <xmlexp.hxx>
-#include "propertyexport.hxx"
-#include "xmlexp.hxx"
-#include "xmlnmspe.hxx"
-#include "xmluconv.hxx"
-#include <osl/diagnose.h>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/beans/XPropertyState.hpp>
-#include <osl/diagnose.h>
-#include <comphelper/extract.hxx>
-#include <comphelper/types.hxx>
-
-#include <unotools/datetime.hxx>
-#include <tools/datetime.hxx>
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::beans;
-
- // NO using namespace ...util !!!
- // need a tools Date/Time/DateTime below, which would conflict with the uno types then
-
- using namespace ::comphelper;
-
- //=====================================================================
- //= iterating through sequences
- //=====================================================================
- class IIterator
- {
- public:
- virtual sal_Bool hasMoreElements() const = 0;
- virtual Any nextElement() = 0;
-
- virtual ~IIterator() { }
- };
-
- /** a helper class for iterating through a sequence
- */
- template <class TYPE>
- class OSequenceIterator : public IIterator
- {
- const TYPE* m_pElements;
- sal_Int32 m_nLen;
- const TYPE* m_pCurrent;
-
- public:
- /** contrcuct a sequence iterator from a sequence
- */
- OSequenceIterator(const Sequence< TYPE >& _rSeq);
- /** contrcuct a sequence iterator from a Any containing a sequence
- */
- OSequenceIterator(const Any& _rSequenceAny);
-
- virtual sal_Bool hasMoreElements() const;
- virtual Any nextElement();
-
- protected:
- void construct(const Sequence< TYPE >& _rSeq);
- };
-
- //---------------------------------------------------------------------
- template <class TYPE>
- OSequenceIterator<TYPE>::OSequenceIterator(const Sequence< TYPE >& _rSeq)
- :m_pElements(NULL)
- ,m_nLen(0)
- ,m_pCurrent(NULL)
- {
- construct(_rSeq);
- }
-
- //---------------------------------------------------------------------
- template <class TYPE>
- OSequenceIterator<TYPE>::OSequenceIterator(const ::com::sun::star::uno::Any& _rSequenceAny)
- :m_pElements(NULL)
- ,m_nLen(0)
- ,m_pCurrent(NULL)
- {
- ::com::sun::star::uno::Sequence< TYPE > aContainer;
- #ifdef DBG_UTIL
- sal_Bool bSuccess =
- #endif
- _rSequenceAny >>= aContainer;
- #ifdef DBG_UTIL
- OSL_ENSURE(bSuccess, "OSequenceIterator::OSequenceIterator: invalid Any!");
- #endif
- construct(aContainer);
- }
-
- //---------------------------------------------------------------------
- template <class TYPE>
- void OSequenceIterator<TYPE>::construct(const ::com::sun::star::uno::Sequence< TYPE >& _rSeq)
- {
- m_pElements = _rSeq.getConstArray();
- m_nLen = _rSeq.getLength();
- m_pCurrent = m_pElements;
- }
-
- //---------------------------------------------------------------------
- template <class TYPE>
- sal_Bool OSequenceIterator<TYPE>::hasMoreElements() const
- {
- return m_pCurrent - m_pElements < m_nLen;
- }
-
- //---------------------------------------------------------------------
- template <class TYPE>
- ::com::sun::star::uno::Any OSequenceIterator<TYPE>::nextElement()
- {
- return ::com::sun::star::uno::makeAny(*m_pCurrent++);
- }
-
- //=====================================================================
- //= OPropertyExport
- //=====================================================================
- //---------------------------------------------------------------------
- OPropertyExport::OPropertyExport(IFormsExportContext& _rContext, const Reference< XPropertySet >& _rxProps)
- :m_rContext(_rContext)
- ,m_xProps(_rxProps)
- {
- // caching
- ::rtl::OUStringBuffer aBuffer;
- m_rContext.getGlobalContext().GetMM100UnitConverter().convertBool(aBuffer, sal_True);
- m_sValueTrue = aBuffer.makeStringAndClear();
- m_rContext.getGlobalContext().GetMM100UnitConverter().convertBool(aBuffer, sal_False);
- m_sValueFalse = aBuffer.makeStringAndClear();
-
- m_xPropertyInfo = m_xProps->getPropertySetInfo();
- OSL_ENSURE(m_xPropertyInfo.is(), "OPropertyExport::OPropertyExport: need an XPropertySetInfo!");
-
- // collect the properties which need to be exported
- examinePersistence();
- }
-
- //---------------------------------------------------------------------
- void OPropertyExport::exportRemainingProperties()
- {
- // the properties tag (will be created if we have at least one no-default property)
- SvXMLElementExport* pPropertiesTag = NULL;
-
- try
- {
- Reference< XPropertyState > xPropertyState(m_xProps, UNO_QUERY);
-
- Any aValue;
- ::rtl::OUString sValue;
- ::rtl::OUString sTypeDescription;
-
- // loop through all the properties which are yet to be exported
- for ( ConstStringSetIterator aProperty = m_aRemainingProps.begin();
- aProperty != m_aRemainingProps.end();
- ++aProperty
- )
- {
- DBG_CHECK_PROPERTY_NO_TYPE(*aProperty);
-
- #ifdef DBG_UTIL
- const ::rtl::OUString sPropertyName = *aProperty;
- #endif
- // if the property state is DEFAULT, it does not need to be written
- if (xPropertyState.is() && (PropertyState_DEFAULT_VALUE == xPropertyState->getPropertyState(*aProperty)))
- continue;
-
- // now that we have the first sub-tag we need the form:properties element
- if (!pPropertiesTag)
- pPropertiesTag = new SvXMLElementExport(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, "properties", sal_True, sal_True);
-
- // add the name attribute
- AddAttribute(XML_NAMESPACE_FORM, "property-name", *aProperty);
-
- // get the value
- aValue = m_xProps->getPropertyValue(*aProperty);
-
- if (sal_False)
- {
- ::rtl::OUString sTemp;
- aValue >>= sTemp;
- aValue <<= makeAny(Sequence< ::rtl::OUString >(&sTemp, 1));
- }
-
- // is it a sequence
- sal_Bool bIsSequence = TypeClass_SEQUENCE == aValue.getValueTypeClass();
- // the type of the property, maybe reduced to the element type of a sequence
- Type aSimpleType;
- if (bIsSequence)
- aSimpleType = getSequenceElementType(aValue.getValueType());
- else
- aSimpleType = aValue.getValueType();
-
- // the type attribute
- // modified by BerryJia for Bug102407
- ::com::sun::star::beans::Property aPropertyStruct;
- aPropertyStruct = m_xPropertyInfo->getPropertyByName(*aProperty);
- AddAttribute(XML_NAMESPACE_FORM, "property-type", implGetPropertyXMLType(aPropertyStruct.Type));
-
- if (bIsSequence)
- // we have a special attribute indicating that the property is a list
- AddAttribute(XML_NAMESPACE_FORM, "property-is-list", m_sValueTrue);
-
- // start the property tag
- SvXMLElementExport aValueTag(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, "property", sal_True, sal_True);
-
- if (!bIsSequence)
- { // the simple case
- //add by BerryJia for Bug102407
- if(TypeClass_VOID == aValue.getValueType().getTypeClass())
- {
- AddAttribute(XML_NAMESPACE_FORM, "property-is-void", ::rtl::OUString::createFromAscii("true"));
- SvXMLElementExport aValueTag(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, "property-value", sal_True, sal_False);
- }
- else
- {
- sValue = implConvertAny(aValue);
- SvXMLElementExport aValueTag(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, "property-value", sal_True, sal_False);
- // (no whitespace inside the tag)
- m_rContext.getGlobalContext().GetDocHandler()->characters(sValue);
- }
- // done with this property
- continue;
- }
-
- // the not-that-simple case, we need to iterate through the sequence elements
- IIterator* pSequenceIterator = NULL;
- switch (aSimpleType.getTypeClass())
- {
- case TypeClass_STRING:
- pSequenceIterator = new OSequenceIterator< ::rtl::OUString >(aValue);
- break;
- case TypeClass_DOUBLE:
- pSequenceIterator = new OSequenceIterator< double >(aValue);
- break;
- case TypeClass_BOOLEAN:
- pSequenceIterator = new OSequenceIterator< sal_Bool >(aValue);
- break;
- case TypeClass_BYTE:
- pSequenceIterator = new OSequenceIterator< sal_Int8 >(aValue);
- break;
- case TypeClass_SHORT:
- pSequenceIterator = new OSequenceIterator< sal_Int16 >(aValue);
- break;
- case TypeClass_LONG:
- pSequenceIterator = new OSequenceIterator< sal_Int32 >(aValue);
- break;
- case TypeClass_HYPER:
- pSequenceIterator = new OSequenceIterator< sal_Int64 >(aValue);
- break;
- default:
- OSL_ENSURE(sal_False, "OPropertyExport::exportRemainingProperties: unsupported sequence tyoe !");
- break;
- }
- if (pSequenceIterator)
- {
- ::rtl::OUString sCurrent;
- while (pSequenceIterator->hasMoreElements())
- {
- SvXMLElementExport aValueTag(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, "property-value", sal_True, sal_False);
- // (no whitespace inside the tag)
- m_rContext.getGlobalContext().GetDocHandler()->characters(implConvertAny(pSequenceIterator->nextElement()));
- }
- }
- delete pSequenceIterator;
- }
- }
- catch(...)
- {
- delete pPropertiesTag;
- throw;
- }
- delete pPropertiesTag;
- }
-
- //---------------------------------------------------------------------
- void OPropertyExport::examinePersistence()
- {
- m_aRemainingProps.clear();
- Sequence< Property > aProperties = m_xPropertyInfo->getProperties();
- const Property* pProperties = aProperties.getConstArray();
- for (sal_Int32 i=0; i<aProperties.getLength(); ++i, ++pProperties)
- {
- static sal_Int32 nExcludeIndicator = PropertyAttribute::READONLY | PropertyAttribute::TRANSIENT;
- if (pProperties->Attributes & nExcludeIndicator)
- // no readonly props, no transient props
- continue;
- m_aRemainingProps.insert(pProperties->Name);
- }
- }
-
- //---------------------------------------------------------------------
- void OPropertyExport::exportStringPropertyAttribute( const sal_uInt16 _nNamespaceKey, const sal_Char* _pAttributeName,
- const ::rtl::OUString& _rPropertyName )
- {
- DBG_CHECK_PROPERTY( _rPropertyName, ::rtl::OUString );
-
- // no try-catch here, this would be to expensive. The outer scope has to handle exceptions (which should not
- // happen if we're used correctly :)
-
- // this is way simple, as we don't need to convert anything (the property already is a string)
-
- // get the string
- ::rtl::OUString sPropValue;
- m_xProps->getPropertyValue( _rPropertyName ) >>= sPropValue;
-
- // add the attribute
- if ( sPropValue.getLength() )
- AddAttribute( _nNamespaceKey, _pAttributeName, sPropValue );
-
- // the property does not need to be handled anymore
- exportedProperty( _rPropertyName );
- }
-
- //---------------------------------------------------------------------
- void OPropertyExport::exportBooleanPropertyAttribute(const sal_uInt16 _nNamespaceKey, const sal_Char* _pAttributeName,
- const ::rtl::OUString& _rPropertyName, const sal_Int8 _nBooleanAttributeFlags)
- {
- DBG_CHECK_PROPERTY_NO_TYPE( _rPropertyName );
- // no check of the property value type: this method is allowed to be called with any interger properties
- // (e.g. sal_Int32, sal_uInt16 etc)
-
- sal_Bool bDefault = (BOOLATTR_DEFAULT_TRUE == (BOOLATTR_DEFAULT_MASK & _nBooleanAttributeFlags));
- sal_Bool bDefaultVoid = (BOOLATTR_DEFAULT_VOID == (BOOLATTR_DEFAULT_MASK & _nBooleanAttributeFlags));
-
- // get the value
- sal_Bool bCurrentValue = bDefault;
- Any aCurrentValue = m_xProps->getPropertyValue( _rPropertyName );
- if (aCurrentValue.hasValue())
- {
- bCurrentValue = ::cppu::any2bool(aCurrentValue);
- // this will extract a boolean value even if the Any contains a int or short or something like that ...
-
- if (_nBooleanAttributeFlags & BOOLATTR_INVERSE_SEMANTICS)
- bCurrentValue = !bCurrentValue;
-
- // we have a non-void current value
- if (bDefaultVoid || (bDefault != bCurrentValue))
- // and (the default is void, or the non-void default does not equal the current value)
- // -> write the attribute
- AddAttribute(_nNamespaceKey, _pAttributeName, bCurrentValue ? m_sValueTrue : m_sValueFalse);
- }
- else
- // we have a void current value
- if (!bDefaultVoid)
- // and we have a non-void default
- // -> write the attribute
- AddAttribute(_nNamespaceKey, _pAttributeName, bCurrentValue ? m_sValueTrue : m_sValueFalse);
-
- // the property does not need to be handled anymore
- exportedProperty( _rPropertyName );
- }
-
- //---------------------------------------------------------------------
- void OPropertyExport::exportInt16PropertyAttribute(const sal_uInt16 _nNamespaceKey, const sal_Char* _pAttributeName,
- const ::rtl::OUString& _rPropertyName, const sal_Int16 _nDefault)
- {
- DBG_CHECK_PROPERTY( _rPropertyName, sal_Int16 );
-
- // get the value
- sal_Int16 nCurrentValue(_nDefault);
- m_xProps->getPropertyValue( _rPropertyName ) >>= nCurrentValue;
-
- // add the attribute
- if (_nDefault != nCurrentValue)
- {
- // let the formatter of the export context build a string
- ::rtl::OUStringBuffer sBuffer;
- m_rContext.getGlobalContext().GetMM100UnitConverter().convertNumber(sBuffer, (sal_Int32)nCurrentValue);
-
- AddAttribute(_nNamespaceKey, _pAttributeName, sBuffer.makeStringAndClear());
- }
-
- // the property does not need to be handled anymore
- exportedProperty( _rPropertyName );
- }
-
- //---------------------------------------------------------------------
- void OPropertyExport::exportEnumPropertyAttribute(
- const sal_uInt16 _nNamespaceKey, const sal_Char* _pAttributeName,
- const sal_Char* _pPropertyName, const SvXMLEnumMapEntry* _pValueMap,
- const sal_Int32 _nDefault, const sal_Bool _bVoidDefault)
- {
- // get the value
- sal_Int32 nCurrentValue(_nDefault);
- ::rtl::OUString sPropertyName(::rtl::OUString::createFromAscii(_pPropertyName));
- Any aValue = m_xProps->getPropertyValue(sPropertyName);
-
- if (aValue.hasValue())
- { // we have a non-void current value
- ::cppu::enum2int(nCurrentValue, aValue);
-
- // add the attribute
- if ((_nDefault != nCurrentValue) || _bVoidDefault)
- { // the default does not equal the value, or the default is void and the value isn't
-
- // let the formatter of the export context build a string
- ::rtl::OUStringBuffer sBuffer;
- m_rContext.getGlobalContext().GetMM100UnitConverter().convertEnum(sBuffer, (sal_uInt16)nCurrentValue, _pValueMap);
-
- AddAttribute(_nNamespaceKey, _pAttributeName, sBuffer.makeStringAndClear());
- }
- }
- else
- {
- if (!_bVoidDefault)
- AddAttributeASCII(_nNamespaceKey, _pAttributeName, "");
- }
-
- // the property does not need to be handled anymore
- exportedProperty(sPropertyName);
- }
-
- //---------------------------------------------------------------------
- void OPropertyExport::exportTargetFrameAttribute()
- {
- DBG_CHECK_PROPERTY( PROPERTY_TARGETFRAME, ::rtl::OUString );
-
- ::rtl::OUString sTargetFrame = comphelper::getString(m_xProps->getPropertyValue(PROPERTY_TARGETFRAME));
- if (0 != sTargetFrame.compareToAscii("_blank"))
- { // an empty string and "_blank" have the same meaning and don't have to be written
- AddAttribute(getCommonControlAttributeNamespace(CCA_TARGET_FRAME), getCommonControlAttributeName(CCA_TARGET_FRAME), sTargetFrame);
- }
-
- exportedProperty(PROPERTY_TARGETFRAME);
- }
-
- //---------------------------------------------------------------------
- void OPropertyExport::exportRelativeTargetLocation(const ConstAsciiString& _sPropertyName,sal_Int32 _nProperty)
- {
- DBG_CHECK_PROPERTY( _sPropertyName, ::rtl::OUString );
-
- ::rtl::OUString sTargetLocation = comphelper::getString(m_xProps->getPropertyValue(_sPropertyName));
- sTargetLocation = m_rContext.getGlobalContext().GetRelativeReference(sTargetLocation);
- AddAttribute(getCommonControlAttributeNamespace(_nProperty), getCommonControlAttributeName(_nProperty), sTargetLocation);
-
- exportedProperty(_sPropertyName);
- }
- //---------------------------------------------------------------------
- void OPropertyExport::flagStyleProperties()
- {
- // flag all the properties which are part of the style as "handled"
- UniReference< XMLPropertySetMapper > xStylePropertiesSupplier = m_rContext.getStylePropertyMapper()->getPropertySetMapper();
- for (sal_Int32 i=0; i<xStylePropertiesSupplier->GetEntryCount(); ++i)
- exportedProperty(xStylePropertiesSupplier->GetEntryAPIName(i));
-
- // the font properties are exported as single properties, but there is a FontDescriptor property which
- // collects them all-in-one, this has been exported implicitly
- exportedProperty(PROPERTY_FONT);
-
- // for the DateFormat and TimeFormat, there exist wrapper properties which has been exported as
- // style, too
- exportedProperty(PROPERTY_DATEFORMAT);
- exportedProperty(PROPERTY_TIMEFORMAT);
- }
-
- //---------------------------------------------------------------------
- void OPropertyExport::exportGenericPropertyAttribute(
- const sal_uInt16 _nAttributeNamespaceKey, const sal_Char* _pAttributeName, const sal_Char* _pPropertyName)
- {
- DBG_CHECK_PROPERTY_ASCII_NO_TYPE( _pPropertyName );
-
- ::rtl::OUString sPropertyName = ::rtl::OUString::createFromAscii(_pPropertyName);
- exportedProperty(sPropertyName);
-
- Any aCurrentValue = m_xProps->getPropertyValue(sPropertyName);
- if (!aCurrentValue.hasValue())
- // nothing to do without a concrete value
- return;
-
- ::rtl::OUString sValue = implConvertAny(aCurrentValue);
- if (!sValue.getLength() && (TypeClass_STRING == aCurrentValue.getValueTypeClass()))
- {
- // check whether or not the property is allowed to be VOID
- Property aProperty = m_xPropertyInfo->getPropertyByName(sPropertyName);
- if ((aProperty.Attributes & PropertyAttribute::MAYBEVOID) == 0)
- // the string is empty, and the property is not allowed to be void
- // -> don't need to write the attibute, 'cause missing it is unambiguous
- return;
- }
-
- // finally add the attribuite to the context
- AddAttribute(_nAttributeNamespaceKey, _pAttributeName, sValue);
- }
-
- //---------------------------------------------------------------------
- void OPropertyExport::exportStringSequenceAttribute(const sal_uInt16 _nAttributeNamespaceKey, const sal_Char* _pAttributeName,
- const ::rtl::OUString& _rPropertyName,
- const sal_Unicode _aQuoteCharacter, const sal_Unicode _aListSeparator)
- {
- DBG_CHECK_PROPERTY( _rPropertyName, Sequence< ::rtl::OUString > );
- OSL_ENSURE(_aListSeparator != 0, "OPropertyExport::exportStringSequenceAttribute: invalid separator character!");
-
- Sequence< ::rtl::OUString > aItems;
- m_xProps->getPropertyValue( _rPropertyName ) >>= aItems;
-
- ::rtl::OUString sFinalList;
-
- // unfortunately the OUString can't append single sal_Unicode characters ...
- const ::rtl::OUString sQuote(&_aQuoteCharacter, 1);
- const ::rtl::OUString sSeparator(&_aListSeparator, 1);
- const sal_Bool bQuote = 0 != sQuote.getLength();
-
- // concatenate the string items
- const ::rtl::OUString* pItems = aItems.getConstArray();
- const ::rtl::OUString* pEnd = pItems + aItems.getLength();
- const ::rtl::OUString* pLastElement = pEnd - 1;
- for ( ;
- pItems != pEnd;
- ++pItems
- )
- {
- OSL_ENSURE(!_aQuoteCharacter || (-1 == pItems->indexOf(_aQuoteCharacter)),
- "OPropertyExport::exportStringSequenceAttribute: there is an item which contains the quote character!");
- OSL_ENSURE(_aQuoteCharacter || (-1 == pItems->indexOf(_aListSeparator)),
- "OPropertyExport::exportStringSequenceAttribute: no quote character, but there is an item containing the separator character!");
-
- if (bQuote)
- sFinalList += sQuote;
- sFinalList += *pItems;
- if (bQuote)
- sFinalList += sQuote;
-
- if (pItems != pLastElement)
- sFinalList += sSeparator;
- }
-
- if (sFinalList.getLength())
- AddAttribute(_nAttributeNamespaceKey, _pAttributeName, sFinalList);
-
- exportedProperty( _rPropertyName );
- }
-
- //---------------------------------------------------------------------
- ::rtl::OUString OPropertyExport::implConvertAny(const Any& _rValue)
- {
- ::rtl::OUStringBuffer aBuffer;
- switch (_rValue.getValueTypeClass())
- {
- case TypeClass_STRING:
- { // extract the string
- ::rtl::OUString sCurrentValue;
- _rValue >>= sCurrentValue;
- aBuffer.append(sCurrentValue);
- }
- break;
- case TypeClass_DOUBLE:
- // let the unit converter format is as string
- m_rContext.getGlobalContext().GetMM100UnitConverter().convertDouble(aBuffer, getDouble(_rValue));
- break;
- case TypeClass_BOOLEAN:
- aBuffer = getBOOL(_rValue) ? m_sValueTrue : m_sValueFalse;
- break;
- case TypeClass_BYTE:
- case TypeClass_SHORT:
- case TypeClass_LONG:
- // let the unit converter format is as string
- m_rContext.getGlobalContext().GetMM100UnitConverter().convertNumber(aBuffer, getINT32(_rValue));
- break;
- case TypeClass_HYPER:
- // TODO
- OSL_ENSURE(sal_False, "OPropertyExport::implConvertAny: missing implementation for sal_Int64!");
- break;
- case TypeClass_ENUM:
- {
- // convert it into an int32
- sal_Int32 nValue;
- ::cppu::enum2int(nValue, _rValue);
- m_rContext.getGlobalContext().GetMM100UnitConverter().convertNumber(aBuffer, getINT32(_rValue));
- }
- break;
- default:
- { // hmmm .... what else do we know?
- double fValue = 0;
- ::com::sun::star::util::Date aDate;
- ::com::sun::star::util::Time aTime;
- ::com::sun::star::util::DateTime aDateTime;
- if (_rValue >>= aDate)
- {
- Date aToolsDate;
- ::utl::typeConvert(aDate, aToolsDate);
- fValue = aToolsDate.GetDate();
- }
- else if (_rValue >>= aTime)
- {
- fValue = ((aTime.Hours * 60 + aTime.Minutes) * 60 + aTime.Seconds) * 100 + aTime.HundredthSeconds;
- fValue = fValue / 8640000.0;
- }
- else if (_rValue >>= aDateTime)
- {
- DateTime aToolsDateTime;
- ::utl::typeConvert(aDateTime, aToolsDateTime);
- // the time part (the digits behind the comma)
- fValue = ((aDateTime.Hours * 60 + aDateTime.Minutes) * 60 + aDateTime.Seconds) * 100 + aDateTime.HundredthSeconds;
- fValue = fValue / 8640000.0;
- // plus the data part (the digits in front of the comma)
- fValue += aToolsDateTime.GetDate();
- }
- else
- {
- // if any other types are added here, please remember to adjust implGetPropertyXMLType accordingly
-
- // no more options ...
- OSL_ENSURE(sal_False, "OPropertyExport::implConvertAny: unsupported value type!");
- break;
- }
- // let the unit converter format is as string
- m_rContext.getGlobalContext().GetMM100UnitConverter().convertDouble(aBuffer, fValue);
- }
- break;
- }
-
- return aBuffer.makeStringAndClear();
- }
-
-
- //---------------------------------------------------------------------
- ::rtl::OUString OPropertyExport::implGetPropertyXMLType(const ::com::sun::star::uno::Type& _rType)
- {
- // possible types we can write (either because we recognize them directly or because we convert _rValue
- // into one of these types)
- static const ::rtl::OUString s_sTypeBoolean (RTL_CONSTASCII_USTRINGPARAM("boolean"));
- static const ::rtl::OUString s_sTypeShort (RTL_CONSTASCII_USTRINGPARAM("short"));
- static const ::rtl::OUString s_sTypeInteger (RTL_CONSTASCII_USTRINGPARAM("int"));
- static const ::rtl::OUString s_sTypeLong (RTL_CONSTASCII_USTRINGPARAM("long"));
- static const ::rtl::OUString s_sTypeDouble (RTL_CONSTASCII_USTRINGPARAM("double"));
- static const ::rtl::OUString s_sTypeString (RTL_CONSTASCII_USTRINGPARAM("string"));
-
- // handle the type description
- switch (_rType.getTypeClass())
- {
- case TypeClass_STRING:
- return s_sTypeString;
- case TypeClass_DOUBLE:
- return s_sTypeDouble;
- case TypeClass_BOOLEAN:
- return s_sTypeBoolean;
- case TypeClass_BYTE:
- case TypeClass_SHORT:
- return s_sTypeShort;
- case TypeClass_LONG:
- return s_sTypeInteger;
- case TypeClass_HYPER:
- return s_sTypeLong;
- case TypeClass_ENUM:
- return s_sTypeInteger;
-
- default:
- return s_sTypeDouble;
- }
- }
-
-#ifdef DBG_UTIL
- //---------------------------------------------------------------------
- void OPropertyExport::AddAttribute(sal_uInt16 _nPrefix, const sal_Char* _pName, const ::rtl::OUString& _rValue)
- {
- OSL_ENSURE(0 == m_rContext.getGlobalContext().GetXAttrList()->getValueByName(::rtl::OUString::createFromAscii(_pName)).getLength(),
- "OPropertyExport::AddAttribute: already have such an attribute");
-
- m_rContext.getGlobalContext().AddAttribute(_nPrefix, _pName, _rValue);
- }
-
- //---------------------------------------------------------------------
- void OPropertyExport::AddAttributeASCII(sal_uInt16 _nPrefix, const sal_Char* _pName, const sal_Char *pValue)
- {
- OSL_ENSURE(0 == m_rContext.getGlobalContext().GetXAttrList()->getValueByName(::rtl::OUString::createFromAscii(_pName)).getLength(),
- "OPropertyExport::AddAttributeASCII: already have such an attribute");
-
- m_rContext.getGlobalContext().AddAttributeASCII(_nPrefix, _pName, pValue);
- }
-
- //---------------------------------------------------------------------
- void OPropertyExport::dbg_implCheckProperty(const ::rtl::OUString& _rPropertyName, const Type* _pType)
- {
- try
- {
- // the property must exist
- if (!m_xPropertyInfo->hasPropertyByName(_rPropertyName))
- {
- OSL_ENSURE(sal_False,
- ::rtl::OString("OPropertyExport::dbg_implCheckProperty: no property with the name ") +=
- ::rtl::OString(_rPropertyName.getStr(), _rPropertyName.getLength(), RTL_TEXTENCODING_ASCII_US) +=
- ::rtl::OString("!"));
- return;
- }
-
- if (_pType)
- {
- // and it must have the correct type
- Property aPropertyDescription = m_xPropertyInfo->getPropertyByName(_rPropertyName);
- OSL_ENSURE(aPropertyDescription.Type.equals(*_pType), "OPropertyExport::dbg_implCheckProperty: invalid property type!");
- }
- }
- catch(Exception&)
- {
- OSL_ENSURE(sal_False, "OPropertyExport::dbg_implCheckProperty: caught an exception, could not check the property!");
- }
- }
-#endif // DBG_UTIL - dbg_implCheckProperty
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_propertyimport.cxx b/binfilter/bf_xmloff/source/forms/xmloff_propertyimport.cxx
deleted file mode 100644
index c71738eec691..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_propertyimport.cxx
+++ /dev/null
@@ -1,503 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "propertyimport.hxx"
-#include "xmlimp.hxx"
-#include "xmluconv.hxx"
-#include "nmspmap.hxx"
-#include <osl/diagnose.h>
-#include <comphelper/extract.hxx>
-#include "callbacks.hxx"
-#include <tools/datetime.hxx>
-#include <unotools/datetime.hxx>
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::xml;
-
- // NO using namespace ...util !!!
- // need a tools Date/Time/DateTime below, which would conflict with the uno types then
-
-#define TYPE_DATE 1
-#define TYPE_TIME 2
-#define TYPE_DATETIME 3
-
- //=====================================================================
- //= OPropertyImport
- //=====================================================================
- //---------------------------------------------------------------------
- OPropertyImport::OPropertyImport(IFormsImportContext& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName)
- :SvXMLImportContext(_rImport.getGlobalContext(), _nPrefix, _rName)
- ,m_rContext(_rImport)
- ,m_bTrackAttributes(sal_False)
- {
- }
-
- //---------------------------------------------------------------------
- SvXMLImportContext* OPropertyImport::CreateChildContext(sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const Reference< sax::XAttributeList >& _rxAttrList)
- {
- if (0 == _rLocalName.compareToAscii("properties"))
- {
- return new OPropertyElementsContext(m_rContext.getGlobalContext(), _nPrefix, _rLocalName, this);
- }
- else
- {
- OSL_ENSURE(sal_False,
- ::rtl::OString("OPropertyImport::CreateChildContext: unknown sub element (only \"properties\" is recognized, but it is ")
- += ::rtl::OString(_rLocalName.getStr(), _rLocalName.getLength(), RTL_TEXTENCODING_ASCII_US)
- += ::rtl::OString(")!"));
- return SvXMLImportContext::CreateChildContext(_nPrefix, _rLocalName, _rxAttrList);
- }
- }
-
- //---------------------------------------------------------------------
- void OPropertyImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList)
- {
- OSL_ENSURE(_rxAttrList.is(), "OPropertyImport::StartElement: invalid attribute list!");
- sal_Int32 nAttributeCount = _rxAttrList->getLength();
-
- // assume the 'worst' case: all attributes describe properties. This should save our property array
- // some reallocs
- m_aValues.reserve(nAttributeCount);
-
- sal_uInt16 nNamespace;
- ::rtl::OUString sLocalName;
- for (sal_Int16 i=0; i<nAttributeCount; ++i)
- {
- nNamespace = m_rContext.getGlobalContext().GetNamespaceMap().GetKeyByAttrName(_rxAttrList->getNameByIndex(i), &sLocalName);
- handleAttribute(nNamespace, sLocalName, _rxAttrList->getValueByIndex(i));
-
- if (m_bTrackAttributes)
- m_aEncounteredAttributes.insert(sLocalName);
- }
-
- // TODO: create PropertyValues for all the attributes which were not present, because they were implied
- }
-
- //---------------------------------------------------------------------
- sal_Bool OPropertyImport::encounteredAttribute(const ::rtl::OUString& _rAttributeName) const
- {
- OSL_ENSURE(m_bTrackAttributes, "OPropertyImport::encounteredAttribute: attribute tracking not enabled!");
- return m_aEncounteredAttributes.end() != m_aEncounteredAttributes.find(_rAttributeName);
- }
-
- //---------------------------------------------------------------------
- void OPropertyImport::Characters(const ::rtl::OUString& _rChars)
- {
- // ignore them (should be whitespaces only)
- OSL_ENSURE(0 == _rChars.trim().getLength(), "OPropertyImport::Characters: non-whitespace characters!");
- }
-
- //---------------------------------------------------------------------
- void OPropertyImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
- {
- const OAttribute2Property::AttributeAssignment* pProperty = m_rContext.getAttributeMap().getAttributeTranslation(_rLocalName);
- if (pProperty)
- {
- // create and store a new PropertyValue
- PropertyValue aNewValue;
- aNewValue.Name = pProperty->sPropertyName;
-
- // convert the value string into the target type
- aNewValue.Value = convertString(m_rContext.getGlobalContext(), pProperty->aPropertyType, _rValue, pProperty->pEnumMap, pProperty->bInverseSemantics);
- implPushBackPropertyValue( aNewValue );
- }
- else
- OSL_ENSURE( sal_False, "OPropertyImport::handleAttribute: can't handle attributes which do not describe properties!" );
- }
-
- //---------------------------------------------------------------------
- Any OPropertyImport::convertString(SvXMLImport& _rImporter, const ::com::sun::star::uno::Type& _rExpectedType, const ::rtl::OUString& _rReadCharacters, const SvXMLEnumMapEntry* _pEnumMap, const sal_Bool _bInvertBoolean)
- {
- Any aReturn;
- sal_Bool bEnumAsInt = sal_False;
- switch (_rExpectedType.getTypeClass())
- {
- case TypeClass_BOOLEAN: // sal_Bool
- {
- sal_Bool bValue;
- #if OSL_DEBUG_LEVEL > 0
- sal_Bool bSuccess =
- #endif
- _rImporter.GetMM100UnitConverter().convertBool(bValue, _rReadCharacters);
- OSL_ENSURE(bSuccess,
- ::rtl::OString("OPropertyImport::convertString: could not convert \"")
- += ::rtl::OString(_rReadCharacters.getStr(), _rReadCharacters.getLength(), RTL_TEXTENCODING_ASCII_US)
- += ::rtl::OString("\" into a boolean!"));
- aReturn = ::cppu::bool2any(_bInvertBoolean ? !bValue : bValue);
- }
- break;
- case TypeClass_SHORT: // sal_Int16
- case TypeClass_LONG: // sal_Int32
- if (!_pEnumMap)
- { // it's a real int32/16 property
- sal_Int32 nValue(0);
- #if OSL_DEBUG_LEVEL > 0
- sal_Bool bSuccess =
- #endif
- _rImporter.GetMM100UnitConverter().convertNumber(nValue, _rReadCharacters);
- OSL_ENSURE(bSuccess,
- ::rtl::OString("OPropertyImport::convertString: could not convert \"")
- += ::rtl::OString(_rReadCharacters.getStr(), _rReadCharacters.getLength(), RTL_TEXTENCODING_ASCII_US)
- += ::rtl::OString("\" into an integer!"));
- if (TypeClass_SHORT == _rExpectedType.getTypeClass())
- aReturn <<= (sal_Int16)nValue;
- else
- aReturn <<= (sal_Int32)nValue;
- break;
- }
- bEnumAsInt = sal_True;
- // NO BREAK! handle it as enum
- case TypeClass_ENUM:
- {
- sal_uInt16 nEnumValue;
- #if OSL_DEBUG_LEVEL > 0
- sal_Bool bSuccess =
- #endif
- _rImporter.GetMM100UnitConverter().convertEnum(nEnumValue, _rReadCharacters, _pEnumMap);
- OSL_ENSURE(bSuccess, "OPropertyImport::convertString: could not convert to an enum value!");
- if (bEnumAsInt)
- if (TypeClass_SHORT == _rExpectedType.getTypeClass())
- aReturn <<= (sal_Int16)nEnumValue;
- else
- aReturn <<= (sal_Int32)nEnumValue;
- else
- aReturn = ::cppu::int2enum((sal_Int32)nEnumValue, _rExpectedType);
- }
- break;
- case TypeClass_HYPER:
- {
- OSL_ENSURE(sal_False, "OPropertyImport::convertString: 64-bit integers not implemented yet!");
- }
- break;
- case TypeClass_DOUBLE:
- {
- double nValue;
- #if OSL_DEBUG_LEVEL > 0
- sal_Bool bSuccess =
- #endif
- _rImporter.GetMM100UnitConverter().convertDouble(nValue, _rReadCharacters);
- OSL_ENSURE(bSuccess,
- ::rtl::OString("OPropertyImport::convertString: could not convert \"")
- += ::rtl::OString(_rReadCharacters.getStr(), _rReadCharacters.getLength(), RTL_TEXTENCODING_ASCII_US)
- += ::rtl::OString("\" into a double!"));
- aReturn <<= (double)nValue;
- }
- break;
- case TypeClass_STRING:
- aReturn <<= _rReadCharacters;
- break;
- case TypeClass_STRUCT:
- {
- // recognized structs:
- static ::com::sun::star::uno::Type s_aDateType = ::getCppuType(static_cast< ::com::sun::star::util::Date* >(NULL));
- static ::com::sun::star::uno::Type s_aTimeType = ::getCppuType(static_cast< ::com::sun::star::util::Time* >(NULL));
- static ::com::sun::star::uno::Type s_aDateTimeType = ::getCppuType(static_cast< ::com::sun::star::util::DateTime* >(NULL));
- sal_Int32 nType = 0;
- if ( (_rExpectedType.equals(s_aDateType) && (nType = TYPE_DATE))
- || (_rExpectedType.equals(s_aTimeType) && (nType = TYPE_TIME))
- || (_rExpectedType.equals(s_aDateTimeType) && (nType = TYPE_DATETIME))
- )
- {
- // first extract the double
- double nValue = 0;
- #if OSL_DEBUG_LEVEL > 0
- sal_Bool bSuccess =
- #endif
- _rImporter.GetMM100UnitConverter().convertDouble(nValue, _rReadCharacters);
- OSL_ENSURE(bSuccess,
- ::rtl::OString("OPropertyImport::convertString: could not convert \"")
- += ::rtl::OString(_rReadCharacters.getStr(), _rReadCharacters.getLength(), RTL_TEXTENCODING_ASCII_US)
- += ::rtl::OString("\" into a double!"));
-
- // then convert it into the target type
- switch (nType)
- {
- case TYPE_DATE:
- {
- OSL_ENSURE(((sal_uInt32)nValue) - nValue == 0,
- "OPropertyImport::convertString: a Date value with a fractional part?");
- aReturn <<= implGetDate(nValue);
- }
- break;
- case TYPE_TIME:
- {
- OSL_ENSURE(((sal_uInt32)nValue) == 0,
- "OPropertyImport::convertString: a Time value with more than a fractional part?");
- aReturn <<= implGetTime(nValue);
- }
- break;
- case TYPE_DATETIME:
- {
- ::com::sun::star::util::Time aTime = implGetTime(nValue);
- ::com::sun::star::util::Date aDate = implGetDate(nValue);
-
- ::com::sun::star::util::DateTime aDateTime;
- aDateTime.HundredthSeconds = aTime.HundredthSeconds;
- aDateTime.Seconds = aTime.Seconds;
- aDateTime.Minutes = aTime.Minutes;
- aDateTime.Hours = aTime.Hours;
- aDateTime.Day = aDate.Day;
- aDateTime.Month = aDate.Month;
- aDateTime.Year = aDate.Year;
- aReturn <<= aDateTime;
- }
- break;
- }
- }
- else
- OSL_ENSURE(sal_False, "OPropertyImport::convertString: unsupported property type!");
- }
- break;
- default:
- OSL_ENSURE(sal_False, "OPropertyImport::convertString: invalid type class!");
- }
-
- return aReturn;
- }
-
- //---------------------------------------------------------------------
- ::com::sun::star::util::Time OPropertyImport::implGetTime(double _nValue)
- {
- ::com::sun::star::util::Time aTime;
- sal_Int32 nIntValue = sal_Int32(_nValue * 8640000);
- nIntValue *= 8640000;
- aTime.HundredthSeconds = nIntValue % 100;
- nIntValue /= 100;
- aTime.Seconds = nIntValue % 60;
- nIntValue /= 60;
- aTime.Minutes = nIntValue % 60;
- nIntValue /= 60;
- OSL_ENSURE(nIntValue < 24, "OPropertyImport::implGetTime: more than a day?");
- aTime.Hours = (sal_uInt16)nIntValue;
-
- return aTime;
- }
-
- //---------------------------------------------------------------------
- ::com::sun::star::util::Date OPropertyImport::implGetDate(double _nValue)
- {
- Date aToolsDate((sal_uInt32)_nValue);
- ::com::sun::star::util::Date aDate;
- ::utl::typeConvert(aToolsDate, aDate);
- return aDate;
- }
-
- //=====================================================================
- //= OPropertyElementsContext
- //=====================================================================
- //---------------------------------------------------------------------
- OPropertyElementsContext::OPropertyElementsContext(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const OPropertyImportRef& _rPropertyImporter)
- :SvXMLImportContext(_rImport, _nPrefix, _rName)
- ,m_xPropertyImporter(_rPropertyImporter)
- {
- }
-
- //---------------------------------------------------------------------
- SvXMLImportContext* OPropertyElementsContext::CreateChildContext(sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const Reference< sax::XAttributeList >& _rxAttrList)
- {
- static const ::rtl::OUString s_sSinglePropertyElementName = ::rtl::OUString::createFromAscii("property");
- if (_rLocalName == s_sSinglePropertyElementName)
- {
- return new OSinglePropertyContext(GetImport(), _nPrefix, _rLocalName, m_xPropertyImporter);
- }
- else
- {
- OSL_ENSURE(sal_False,
- ::rtl::OString("OPropertyElementsContext::CreateChildContext: unknown child element (\"")
- += ::rtl::OString(_rLocalName.getStr(), _rLocalName.getLength(), RTL_TEXTENCODING_ASCII_US)
- += ::rtl::OString("\")!"));
- return new SvXMLImportContext(GetImport(), _nPrefix, _rLocalName);
- }
- }
-
-#if OSL_DEBUG_LEVEL > 0
- //---------------------------------------------------------------------
- void OPropertyElementsContext::StartElement(const Reference< sax::XAttributeList >& _rxAttrList)
- {
- OSL_ENSURE(0 == _rxAttrList->getLength(), "OPropertyElementsContext::StartElement: the form:properties element should not have attributes!");
- SvXMLImportContext::StartElement(_rxAttrList);
- }
-
- //---------------------------------------------------------------------
- void OPropertyElementsContext::Characters(const ::rtl::OUString& _rChars)
- {
- OSL_ENSURE(0 == _rChars.trim(), "OPropertyElementsContext::Characters: non-whitespace characters detected!");
- SvXMLImportContext::Characters(_rChars);
- }
-
-#endif
-
- //=====================================================================
- //= OSinglePropertyContext
- //=====================================================================
- //---------------------------------------------------------------------
- OSinglePropertyContext::OSinglePropertyContext(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName,
- const OPropertyImportRef& _rPropertyImporter)
- :SvXMLImportContext(_rImport, _nPrefix, _rName)
- ,m_xPropertyImporter(_rPropertyImporter)
- {
- }
-
- //---------------------------------------------------------------------
- SvXMLImportContext* OSinglePropertyContext::CreateChildContext(sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
- const Reference< sax::XAttributeList >& _rxAttrList)
- {
- static const ::rtl::OUString s_sPropertyValueElementName = ::rtl::OUString::createFromAscii("property-value");
- if (_rLocalName == s_sPropertyValueElementName)
- {
- OSL_ENSURE(!m_xValueReader.Is(), "OSinglePropertyContext::CreateChildContext: already had a value element!");
- m_xValueReader = new OAccumulateCharacters(GetImport(), _nPrefix, _rLocalName);
- return &m_xValueReader;
- }
- else
- {
- OSL_ENSURE(sal_False,
- ::rtl::OString("OSinglePropertyContext::CreateChildContext: unknown child element (\"")
- += ::rtl::OString(_rLocalName.getStr(), _rLocalName.getLength(), RTL_TEXTENCODING_ASCII_US)
- += ::rtl::OString("\")!"));
- return new SvXMLImportContext(GetImport(), _nPrefix, _rLocalName);
- }
- }
-
- //---------------------------------------------------------------------
- void OSinglePropertyContext::StartElement(const Reference< sax::XAttributeList >& _rxAttrList)
- {
- ::rtl::OUString sNameAttribute = GetImport().GetNamespaceMap().GetQNameByIndex(
- GetPrefix(), ::rtl::OUString::createFromAscii("property-name"));
- ::rtl::OUString sTypeAttribute = GetImport().GetNamespaceMap().GetQNameByIndex(
- GetPrefix(), ::rtl::OUString::createFromAscii("property-type"));
-
- // the name of the property
- m_aPropValue.Name = _rxAttrList->getValueByName(sNameAttribute);
- OSL_ENSURE(m_aPropValue.Name.getLength(), "OSinglePropertyContext::StartElement: invalid property name!");
-
- // the type of the property
- ::rtl::OUString sType = _rxAttrList->getValueByName(sTypeAttribute);
-
- // needs to be translated into a ::com::sun::star::uno::Type
- DECLARE_STL_USTRINGACCESS_MAP( ::com::sun::star::uno::Type, MapString2Type );
- static MapString2Type s_aTypeNameMap;
- if (!s_aTypeNameMap.size())
- {
- s_aTypeNameMap[::rtl::OUString::createFromAscii("boolean")] = ::getBooleanCppuType();
- s_aTypeNameMap[::rtl::OUString::createFromAscii("short")] = ::getCppuType( static_cast< sal_Int16* >(NULL) );
- s_aTypeNameMap[::rtl::OUString::createFromAscii("int")] = ::getCppuType( static_cast< sal_Int32* >(NULL) );
- s_aTypeNameMap[::rtl::OUString::createFromAscii("long")] = ::getCppuType( static_cast< sal_Int64* >(NULL) );
- s_aTypeNameMap[::rtl::OUString::createFromAscii("double")] = ::getCppuType( static_cast< double* >(NULL) );
- s_aTypeNameMap[::rtl::OUString::createFromAscii("string")] = ::getCppuType( static_cast< ::rtl::OUString* >(NULL) );
- }
-
- const ConstMapString2TypeIterator aTypePos = s_aTypeNameMap.find(sType);
- OSL_ENSURE(s_aTypeNameMap.end() != aTypePos, "OSinglePropertyContext::StartElement: invalid property name!");
- if (s_aTypeNameMap.end() != aTypePos)
- m_aPropType = aTypePos->second;
- }
-
-#if OSL_DEBUG_LEVEL > 0
- //---------------------------------------------------------------------
- void OSinglePropertyContext::Characters(const ::rtl::OUString& _rChars)
- {
- OSL_ENSURE(0 == _rChars.trim(), "OSinglePropertyContext::Characters: non-whitespace characters detected!");
- SvXMLImportContext::Characters(_rChars);
- }
-#endif
-
- //---------------------------------------------------------------------
- void OSinglePropertyContext::EndElement()
- {
- OSL_ENSURE(m_xValueReader.Is(), "OSinglePropertyContext::EndElement: did not encounter a value tag!");
- if (m_xValueReader.Is())
- {
- //modified by BerryJia for Bug102407
- if (m_xValueReader->isVoid())
- m_aPropValue.Value = Any();
- else
- {
- ::rtl::OUString sCharacters = m_xValueReader->getCharacters();
- // convert these characters into the property value target type
- m_aPropValue.Value = OPropertyImport::convertString(GetImport(), m_aPropType, sCharacters);
- }
- }
-
- // now that we finally have our property value, add it to our parent object
- m_xPropertyImporter->implPushBackPropertyValue(m_aPropValue);
- }
-
- //=====================================================================
- //= OAccumulateCharacters
- //=====================================================================
- //---------------------------------------------------------------------
- OAccumulateCharacters::OAccumulateCharacters(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName)
- :SvXMLImportContext(_rImport, _nPrefix, _rName)
- //added by BerryJia for Bug102407
- ,m_bPropertyIsVoid(sal_False)
- {
- }
-
- //---------------------------------------------------------------------
- void OAccumulateCharacters::StartElement(const Reference< sax::XAttributeList >& _rxAttrList)
- {
- ::rtl::OUString sIsVoidAttributeName = GetImport().GetNamespaceMap().GetQNameByIndex(
- GetPrefix(), ::rtl::OUString::createFromAscii("property-is-void"));
- ::rtl::OUString sIsVoidAttributeValue = _rxAttrList->getValueByName(sIsVoidAttributeName);
-
- if (sIsVoidAttributeValue.getLength())
- {
- //modified by BerryJia for Bug102407
- m_bPropertyIsVoid = sal_False;
- GetImport().GetMM100UnitConverter().convertBool(m_bPropertyIsVoid, sIsVoidAttributeValue);
- }
- }
- //---------------------------------------------------------------------
- void OAccumulateCharacters::Characters(const ::rtl::OUString& _rChars)
- {
- m_sCharacters += _rChars;
- }
- //---------------------------------------------------------------------
- //added by BerryJia for Bug102407
- sal_Bool OAccumulateCharacters::isVoid()
- {
- return m_bPropertyIsVoid;
- }
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_strings.cxx b/binfilter/bf_xmloff/source/forms/xmloff_strings.cxx
deleted file mode 100644
index 09bcd7184e33..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_strings.cxx
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FORMS_STRINGS_HXX_
-#define XMLFORM_IMPLEMENT_STRINGS
-#include "strings.hxx"
-#undef XMLFORM_IMPLEMENT_STRINGS
-#endif
-namespace binfilter {
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/forms/xmloff_valueproperties.cxx b/binfilter/bf_xmloff/source/forms/xmloff_valueproperties.cxx
deleted file mode 100644
index 8e0734d66cdf..000000000000
--- a/binfilter/bf_xmloff/source/forms/xmloff_valueproperties.cxx
+++ /dev/null
@@ -1,178 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "valueproperties.hxx"
-#include "strings.hxx"
-#include <com/sun/star/form/FormComponentType.hpp>
-namespace binfilter {
-
-//.........................................................................
-namespace xmloff
-{
-//.........................................................................
-
- using namespace ::com::sun::star::form;
-
- //=====================================================================
- //= OValuePropertiesMetaData
- //=====================================================================
- //---------------------------------------------------------------------
- void OValuePropertiesMetaData::getValuePropertyNames(
- OControlElement::ElementType _eType, sal_Int16 _nFormComponentType,
- sal_Char const * & _rpCurrentValuePropertyName, sal_Char const * & _rpValuePropertyName)
- {
- // reset the pointers in case we can't determine the property names
- _rpCurrentValuePropertyName = _rpValuePropertyName = NULL;
- switch (_nFormComponentType)
- {
- case FormComponentType::TEXTFIELD:
- if (OControlElement::FORMATTED_TEXT == _eType)
- {
- _rpCurrentValuePropertyName = PROPERTY_EFFECTIVE_VALUE;
- _rpValuePropertyName = PROPERTY_EFFECTIVE_DEFAULT;
- }
- else
- {
- if (OControlElement::PASSWORD != _eType)
- // no CurrentValue" for passwords
- _rpCurrentValuePropertyName = PROPERTY_TEXT;
- _rpValuePropertyName = PROPERTY_DEFAULT_TEXT;
- }
- break;
- case FormComponentType::DATEFIELD:
- _rpCurrentValuePropertyName = PROPERTY_DATE;
- _rpValuePropertyName = PROPERTY_DEFAULT_DATE;
- break;
- case FormComponentType::TIMEFIELD:
- _rpCurrentValuePropertyName = PROPERTY_TIME;
- _rpValuePropertyName = PROPERTY_DEFAULT_TIME;
- break;
- case FormComponentType::NUMERICFIELD:
- case FormComponentType::CURRENCYFIELD:
- _rpCurrentValuePropertyName = PROPERTY_VALUE;
- _rpValuePropertyName = PROPERTY_DEFAULT_VALUE;
- break;
- case FormComponentType::PATTERNFIELD:
- case FormComponentType::FILECONTROL:
- case FormComponentType::COMBOBOX:
- _rpValuePropertyName = PROPERTY_DEFAULT_TEXT;
- // NO BREAK!!
- case FormComponentType::COMMANDBUTTON:
- _rpCurrentValuePropertyName = PROPERTY_TEXT;
- break;
- case FormComponentType::CHECKBOX:
- case FormComponentType::RADIOBUTTON:
- _rpValuePropertyName = PROPERTY_REFVALUE;
- break;
- case FormComponentType::HIDDENCONTROL:
- _rpValuePropertyName = PROPERTY_HIDDEN_VALUE;
- break;
- }
- }
-
-
- //---------------------------------------------------------------------
- void OValuePropertiesMetaData::getValueLimitPropertyNames(sal_Int16 _nFormComponentType,
- sal_Char const * & _rpMinValuePropertyName, sal_Char const * & _rpMaxValuePropertyName)
- {
- _rpMinValuePropertyName = _rpMinValuePropertyName = NULL;
- switch (_nFormComponentType)
- {
- case FormComponentType::DATEFIELD:
- _rpMinValuePropertyName = PROPERTY_DATE_MIN;
- _rpMaxValuePropertyName = PROPERTY_DATE_MAX;
- break;
- case FormComponentType::TIMEFIELD:
- _rpMinValuePropertyName = PROPERTY_TIME_MIN;
- _rpMaxValuePropertyName = PROPERTY_TIME_MAX;
- break;
- case FormComponentType::NUMERICFIELD:
- case FormComponentType::CURRENCYFIELD:
- _rpMinValuePropertyName = PROPERTY_VALUE_MIN;
- _rpMaxValuePropertyName = PROPERTY_VALUE_MAX;
- break;
- case FormComponentType::PATTERNFIELD:
- // no min/max value for the pattern field
- break;
- case FormComponentType::TEXTFIELD:
- _rpMinValuePropertyName = PROPERTY_EFFECTIVE_MIN;
- _rpMaxValuePropertyName = PROPERTY_EFFECTIVE_MAX;
- break;
- }
- }
-
- //---------------------------------------------------------------------
- void OValuePropertiesMetaData::getRuntimeValuePropertyNames(
- OControlElement::ElementType _eType, sal_Int16 _nFormComponentType,
- sal_Char const * & _rpValuePropertyName, sal_Char const * & _rpDefaultValuePropertyName )
- {
- // reset the pointers in case we can't determine the property names
- _rpValuePropertyName = _rpDefaultValuePropertyName = NULL;
- switch (_nFormComponentType)
- {
- case FormComponentType::TEXTFIELD:
- if (OControlElement::FORMATTED_TEXT == _eType)
- {
- _rpValuePropertyName = PROPERTY_EFFECTIVE_VALUE;
- _rpDefaultValuePropertyName = PROPERTY_EFFECTIVE_DEFAULT;
- }
- else
- {
- _rpValuePropertyName = PROPERTY_TEXT;
- _rpDefaultValuePropertyName = PROPERTY_DEFAULT_TEXT;
- }
- break;
-
- case FormComponentType::DATEFIELD:
- case FormComponentType::TIMEFIELD:
- case FormComponentType::NUMERICFIELD:
- case FormComponentType::CURRENCYFIELD:
- case FormComponentType::PATTERNFIELD:
- case FormComponentType::FILECONTROL:
- case FormComponentType::COMBOBOX:
- // For these types, the runtime properties are the same as the ones which in the XML
- // stream are named "value properties"
- getValuePropertyNames( _eType, _nFormComponentType, _rpValuePropertyName, _rpDefaultValuePropertyName );
- break;
-
- case FormComponentType::CHECKBOX:
- case FormComponentType::RADIOBUTTON:
- _rpValuePropertyName = PROPERTY_STATE;
- _rpDefaultValuePropertyName = PROPERTY_DEFAULT_STATE;
- break;
- }
- }
-
-//.........................................................................
-} // namespace xmloff
-//.........................................................................
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/meta/makefile.mk b/binfilter/bf_xmloff/source/meta/makefile.mk
deleted file mode 100644
index 9ffd9c40d747..000000000000
--- a/binfilter/bf_xmloff/source/meta/makefile.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
-
-PRJ=..$/..$/..
-
-PRJNAME=binfilter
-TARGET=xmloff_meta
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-INC+= -I$(PRJ)$/inc$/bf_xmloff
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/xmloff_xmlmetae.obj \
- $(SLO)$/xmloff_xmlmetai.obj \
- $(SLO)$/xmloff_MetaExportComponent.obj \
- $(SLO)$/xmloff_MetaImportComponent.obj
-
-# --- Tagets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/binfilter/bf_xmloff/source/meta/xmloff_MetaExportComponent.cxx b/binfilter/bf_xmloff/source/meta/xmloff_MetaExportComponent.cxx
deleted file mode 100644
index 5d6ccac976a1..000000000000
--- a/binfilter/bf_xmloff/source/meta/xmloff_MetaExportComponent.cxx
+++ /dev/null
@@ -1,113 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "MetaExportComponent.hxx"
-
-#include "xmlnmspe.hxx"
-
-#include "nmspmap.hxx"
-
-#include "xmlmetae.hxx"
-
-namespace binfilter {
-
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-// #110680#
-XMLMetaExportComponent::XMLMetaExportComponent(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory)
-: SvXMLExport( xServiceFactory, MAP_INCH, XML_META )
-{
-}
-
-XMLMetaExportComponent::~XMLMetaExportComponent()
-{
-}
-
-sal_uInt32 XMLMetaExportComponent::exportDoc( enum XMLTokenEnum eClass )
-{
- GetDocHandler()->startDocument();
- {
- GetAttrList().AddAttribute(
- GetNamespaceMap().GetAttrNameByKey( XML_NAMESPACE_DC ),
- GetNamespaceMap().GetNameByKey( XML_NAMESPACE_DC ) );
- GetAttrList().AddAttribute(
- GetNamespaceMap().GetAttrNameByKey( XML_NAMESPACE_META ),
- GetNamespaceMap().GetNameByKey( XML_NAMESPACE_META ) );
- GetAttrList().AddAttribute(
- GetNamespaceMap().GetAttrNameByKey( XML_NAMESPACE_OFFICE ),
- GetNamespaceMap().GetNameByKey( XML_NAMESPACE_OFFICE ) );
-
- SvXMLElementExport aDocElem( *this, XML_NAMESPACE_OFFICE, XML_DOCUMENT_META,
- sal_True, sal_True );
- {
-
- SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_META,
- sal_True, sal_True );
- SfxXMLMetaExport aMeta( *this, GetModel() );
- aMeta.Export();
- }
- }
- GetDocHandler()->endDocument();
- return 0;
-}
-
-// methods without content:
-void XMLMetaExportComponent::_ExportAutoStyles() {}
-void XMLMetaExportComponent::_ExportMasterStyles() {}
-void XMLMetaExportComponent::_ExportContent() {}
-
-
-uno::Sequence< ::rtl::OUString > SAL_CALL XMLMetaExportComponent_getSupportedServiceNames()
- throw()
-{
- const ::rtl::OUString aServiceName(
- RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.XMLMetaExporter" ) );
- const uno::Sequence< ::rtl::OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-rtl::OUString SAL_CALL XMLMetaExportComponent_getImplementationName() throw()
-{
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XMLMetaExportComponent" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL XMLMetaExportComponent_createInstance(
- const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
- throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new XMLMetaExportComponent;
- return (cppu::OWeakObject*)new XMLMetaExportComponent(rSMgr);
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/meta/xmloff_MetaImportComponent.cxx b/binfilter/bf_xmloff/source/meta/xmloff_MetaImportComponent.cxx
deleted file mode 100644
index bdec3fea81ac..000000000000
--- a/binfilter/bf_xmloff/source/meta/xmloff_MetaImportComponent.cxx
+++ /dev/null
@@ -1,161 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "MetaImportComponent.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "xmlmetai.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-class SvXMLMetaDocumentContext : public SvXMLImportContext
-{
-private:
- ::com::sun::star::uno::Reference<
- ::com::sun::star::document::XDocumentInfo> xDocInfo;
-
-public:
- SvXMLMetaDocumentContext(SvXMLImport& rImport, USHORT nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::document::XDocumentInfo>& rDocInfo);
- virtual ~SvXMLMetaDocumentContext();
-
- virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
- virtual void EndElement();
-};
-
-SvXMLMetaDocumentContext::SvXMLMetaDocumentContext(SvXMLImport& rImport,
- USHORT nPrfx, const ::rtl::OUString& rLName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList,
- const uno::Reference<document::XDocumentInfo>& rDocInfo) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- xDocInfo(rDocInfo)
-{
- // here are no attributes
-}
-
-SvXMLMetaDocumentContext::~SvXMLMetaDocumentContext()
-{
-}
-
-SvXMLImportContext *SvXMLMetaDocumentContext::CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
-{
- if ( (XML_NAMESPACE_OFFICE == nPrefix) &&
- IsXMLToken(rLocalName, XML_META) )
- {
- return new SfxXMLMetaContext(GetImport(), nPrefix, rLocalName, xDocInfo);
- }
- else
- {
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
-}
-
-void SvXMLMetaDocumentContext::EndElement()
-{
-}
-
-//===========================================================================
-
-// #110680#
-XMLMetaImportComponent::XMLMetaImportComponent(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory) throw()
-: SvXMLImport(xServiceFactory)
-{
-}
-
-XMLMetaImportComponent::~XMLMetaImportComponent() throw()
-{
-}
-
-
-SvXMLImportContext* XMLMetaImportComponent::CreateContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList > & xAttrList )
-{
- if ( (XML_NAMESPACE_OFFICE == nPrefix) &&
- IsXMLToken(rLocalName, XML_DOCUMENT_META) )
- {
- return new SvXMLMetaDocumentContext(*this, nPrefix, rLocalName, xAttrList, xDocInfo);
- }
- else
- {
- return SvXMLImport::CreateContext(nPrefix, rLocalName, xAttrList);
- }
-}
-
-void SAL_CALL XMLMetaImportComponent::setTargetDocument( const uno::Reference< lang::XComponent >& xDoc )
- throw(lang::IllegalArgumentException, uno::RuntimeException)
-{
- xDocInfo = uno::Reference< document::XDocumentInfo >::query( xDoc );
- if( !xDocInfo.is() )
- throw lang::IllegalArgumentException();
-}
-
-uno::Sequence< ::rtl::OUString > SAL_CALL
- XMLMetaImportComponent_getSupportedServiceNames()
- throw()
-{
- const ::rtl::OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.document.XMLMetaImporter" ) );
- const uno::Sequence< ::rtl::OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-rtl::OUString SAL_CALL XMLMetaImportComponent_getImplementationName() throw()
-{
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XMLMetaImportComponent" ) );
-}
-
-uno::Reference< uno::XInterface > SAL_CALL XMLMetaImportComponent_createInstance(
- const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
- throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new XMLMetaImportComponent;
- return (cppu::OWeakObject*)new XMLMetaImportComponent(rSMgr);
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/meta/xmloff_xmlmetae.cxx b/binfilter/bf_xmloff/source/meta/xmloff_xmlmetae.cxx
deleted file mode 100644
index cb06e633177a..000000000000
--- a/binfilter/bf_xmloff/source/meta/xmloff_xmlmetae.cxx
+++ /dev/null
@@ -1,496 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/inetdef.hxx>
-#include <tools/urlobj.hxx>
-#include <unotools/configmgr.hxx>
-
-#include "xmlmetae.hxx"
-
-
-#include <tools/time.hxx>
-
-#include <unotools/bootstrap.hxx>
-
-#include "xmlnmspe.hxx"
-
-#include "xmlexp.hxx"
-
-#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
-#include "bf_so3/staticbaseurl.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-//-------------------------------------------------------------------------
-
-#define PROP_TITLE "Title"
-#define PROP_DESCRIPTION "Description"
-#define PROP_THEME "Theme"
-#define PROP_KEYWORDS "Keywords"
-#define PROP_AUTHOR "Author"
-#define PROP_CREATIONDATE "CreationDate"
-#define PROP_MODIFIEDBY "ModifiedBy"
-#define PROP_MODIFYDATE "ModifyDate"
-#define PROP_PRINTEDBY "PrintedBy"
-#define PROP_PRINTDATE "PrintDate"
-#define PROP_TEMPLATEURL "TemplateFileName"
-#define PROP_TEMPLATENAME "Template"
-#define PROP_TEMPLATEDATE "TemplateDate"
-#define PROP_RELOADENABLED "AutoloadEnabled"
-#define PROP_RELOADURL "AutoloadURL"
-#define PROP_RELOADSECS "AutoloadSecs"
-#define PROP_DEFAULTTARGET "DefaultTarget"
-#define PROP_EDITINGCYCLES "EditingCycles"
-#define PROP_EDITINGDURATION "EditingDuration"
-
-#define PROP_CHARLOCALE "CharLocale"
-
-
-//-------------------------------------------------------------------------
-
-void lcl_AddTwoDigits( ::rtl::OUStringBuffer& rStr, sal_Int32 nVal )
-{
- if ( nVal < 10 )
- rStr.append( sal_Unicode('0') );
- rStr.append( nVal );
-}
-
-// static
-rtl::OUString SfxXMLMetaExport::GetISODateTimeString( const util::DateTime& rDateTime )
-{
- // return ISO date string "YYYY-MM-DDThh:mm:ss"
-
- ::rtl::OUStringBuffer sTmp;
- sTmp.append( (sal_Int32) rDateTime.Year );
- sTmp.append( sal_Unicode('-') );
- lcl_AddTwoDigits( sTmp, rDateTime.Month );
- sTmp.append( sal_Unicode('-') );
- lcl_AddTwoDigits( sTmp, rDateTime.Day );
- sTmp.append( sal_Unicode('T') );
- lcl_AddTwoDigits( sTmp, rDateTime.Hours );
- sTmp.append( sal_Unicode(':') );
- lcl_AddTwoDigits( sTmp, rDateTime.Minutes );
- sTmp.append( sal_Unicode(':') );
- lcl_AddTwoDigits( sTmp, rDateTime.Seconds );
-
- return sTmp.makeStringAndClear();
-}
-
-// static
-rtl::OUString SfxXMLMetaExport::GetISODurationString( const Time& rTime )
-{
- // return ISO time period string
-
- ::rtl::OUStringBuffer sTmp;
- sTmp.append( sal_Unicode('P') ); // "period"
-
- sal_uInt16 nHours = rTime.GetHour();
- sal_Bool bHasHours = ( nHours > 0 );
- if ( nHours >= 24 )
- {
- // add days
-
- sal_uInt16 nDays = nHours / 24;
- sTmp.append( (sal_Int32) nDays );
- sTmp.append( sal_Unicode('D') ); // "days"
-
- nHours -= nDays * 24;
- }
- sTmp.append( sal_Unicode('T') ); // "time"
-
- if ( bHasHours )
- {
- sTmp.append( (sal_Int32) nHours );
- sTmp.append( sal_Unicode('H') ); // "hours"
- }
- sal_uInt16 nMinutes = rTime.GetMin();
- if ( bHasHours || nMinutes > 0 )
- {
- sTmp.append( (sal_Int32) nMinutes );
- sTmp.append( sal_Unicode('M') ); // "minutes"
- }
- sal_uInt16 nSeconds = rTime.GetSec();
- sTmp.append( (sal_Int32) nSeconds );
- sTmp.append( sal_Unicode('S') ); // "seconds"
-
- return sTmp.makeStringAndClear();
-}
-
-//-------------------------------------------------------------------------
-
-SfxXMLMetaExport::SfxXMLMetaExport(
- SvXMLExport& rExp,
- const uno::Reference<frame::XModel>& rDocModel ) :
- rExport( rExp )
-{
- uno::Reference<document::XDocumentInfoSupplier> xSupp( rDocModel, uno::UNO_QUERY );
- if ( xSupp.is() )
- {
- xDocInfo = xSupp->getDocumentInfo();
- xInfoProp = uno::Reference<beans::XPropertySet>( xDocInfo, uno::UNO_QUERY );
- }
-
- uno::Reference<beans::XPropertySet> xDocProp( rDocModel, uno::UNO_QUERY );
- if ( xDocProp.is() )
- {
- // get document language from document properties
- // (not available for all document types)
-
- try
- {
- uno::Any aLocAny = xDocProp->getPropertyValue(
- ::rtl::OUString::createFromAscii( PROP_CHARLOCALE ) );
- aLocAny >>= aLocale;
- }
- catch (beans::UnknownPropertyException&)
- {
- // no error
- }
- }
-
- // for Image etc. there is no XModel and no document info
-// DBG_ASSERT( xInfoProp.is(), "no document info properties" );
-}
-
-SfxXMLMetaExport::~SfxXMLMetaExport()
-{
-}
-
-void SfxXMLMetaExport::SimpleStringElement( const ::rtl::OUString& rPropertyName,
- sal_uInt16 nNamespace,
- enum XMLTokenEnum eElementName )
-{
- uno::Any aAny = xInfoProp->getPropertyValue( rPropertyName );
- ::rtl::OUString sValue;
- if ( aAny >>= sValue )
- {
- if ( sValue.getLength() )
- {
- SvXMLElementExport aElem( rExport, nNamespace, eElementName,
- sal_True, sal_False );
- rExport.Characters( sValue );
-
- }
- }
-}
-
-void SfxXMLMetaExport::SimpleDateTimeElement(
- const ::rtl::OUString& rPropertyName, sal_uInt16 nNamespace,
- enum XMLTokenEnum eElementName )
-{
- uno::Any aAny = xInfoProp->getPropertyValue( rPropertyName );
- util::DateTime aDateTime;
- if ( aAny >>= aDateTime )
- {
- ::rtl::OUString sValue = GetISODateTimeString( aDateTime );
-
- SvXMLElementExport aElem( rExport, nNamespace, eElementName,
- sal_True, sal_False );
- rExport.Characters( sValue );
- }
-}
-
-rtl::OUString lcl_GetProductName()
-{
- // get the correct product name from the configuration
-
- ::rtl::OUStringBuffer aName;
- utl::ConfigManager& rMgr = utl::ConfigManager::GetConfigManager();
- ::rtl::OUString aValue;
- uno::Any aAny = rMgr.GetDirectConfigProperty(utl::ConfigManager::PRODUCTNAME);
- if ( (aAny >>= aValue) && aValue.getLength() )
- aName.append( aValue ).append( (sal_Unicode)' ' );
-
- aAny = rMgr.GetDirectConfigProperty(utl::ConfigManager::PRODUCTVERSION);
- if ( (aAny >>= aValue) && aValue.getLength() )
- aName.append( aValue ).append( (sal_Unicode)' ' );
-
- aAny = rMgr.GetDirectConfigProperty(utl::ConfigManager::PRODUCTEXTENSION);
- if ( (aAny >>= aValue) && aValue.getLength() )
- aName.append( aValue ).append( (sal_Unicode)' ' );
- aName.append( (sal_Unicode)'(' );
- aName.appendAscii( TOOLS_INETDEF_OS );
- aName.append( (sal_Unicode)')' );
-
- return aName.makeStringAndClear();
-}
-
-void SfxXMLMetaExport::Export()
-{
- if ( !xInfoProp.is() ) return;
-
- ::rtl::OUString sElem, sSubElem, sAttrName, sValue;
- uno::Any aPropVal;
-
- // generator (exported only)
- sValue = lcl_GetProductName();
- {
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_META, XML_GENERATOR,
- sal_True, sal_True );
- rExport.Characters( sValue );
- }
-
- // build-id as comment
- if (rExport.GetExtDocHandler().is())
- {
- ::rtl::OUString aDefault;
- sValue = utl::Bootstrap::getBuildIdData( aDefault );
- if ( sValue.getLength() )
- rExport.GetExtDocHandler()->comment( sValue );
- }
-
- // document title
- SimpleStringElement( ::rtl::OUString::createFromAscii(PROP_TITLE),
- XML_NAMESPACE_DC, XML_TITLE );
-
- // description
- SimpleStringElement( ::rtl::OUString::createFromAscii(PROP_DESCRIPTION),
- XML_NAMESPACE_DC, XML_DESCRIPTION );
-
- // subject
- SimpleStringElement( ::rtl::OUString::createFromAscii(PROP_THEME),
- XML_NAMESPACE_DC, XML_SUBJECT );
-
- // created...
- SimpleStringElement( ::rtl::OUString::createFromAscii(PROP_AUTHOR),
- XML_NAMESPACE_META, XML_INITIAL_CREATOR );
- SimpleDateTimeElement( ::rtl::OUString::createFromAscii(PROP_CREATIONDATE),
- XML_NAMESPACE_META, XML_CREATION_DATE );
-
- // modified...
- SimpleStringElement( ::rtl::OUString::createFromAscii(PROP_MODIFIEDBY),
- XML_NAMESPACE_DC, XML_CREATOR );
- SimpleDateTimeElement( ::rtl::OUString::createFromAscii(PROP_MODIFYDATE),
- XML_NAMESPACE_DC, XML_DATE );
-
- // printed...
- SimpleStringElement( ::rtl::OUString::createFromAscii(PROP_PRINTEDBY),
- XML_NAMESPACE_META, XML_PRINTED_BY );
- SimpleDateTimeElement( ::rtl::OUString::createFromAscii(PROP_PRINTDATE),
- XML_NAMESPACE_META, XML_PRINT_DATE );
-
- // keywords
- // service DocumentInfo contains keywords in a single string, comma separated.
- aPropVal = xInfoProp->getPropertyValue(
- ::rtl::OUString::createFromAscii(PROP_KEYWORDS) );
- ::rtl::OUString sKeywords;
- aPropVal >>= sKeywords;
- if ( sKeywords.getLength() )
- {
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_META, XML_KEYWORDS,
- sal_True, sal_True );
- sal_Int32 nTokenIndex = 0;
- do
- {
- ::rtl::OUString sKeyword = sKeywords.getToken( 0, ',', nTokenIndex ).trim();
-
- SvXMLElementExport aKeywElem( rExport,
- XML_NAMESPACE_META, XML_KEYWORD,
- sal_True, sal_False );
- rExport.Characters( sKeyword );
- }
- while ( nTokenIndex >= 0 );
- }
-
- // document language
-#if 0
- if ( eLanguage != LANGUAGE_SYSTEM )
- {
- sValue = ConvertLanguageToIsoString( eLanguage, '-' );
- if ( sValue.getLength() )
- {
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_DC, XML_LANGUAGE,
- sal_True, sal_False );
- aElem->Characters( sValue );
- }
- }
-#endif
- if ( aLocale.Language.getLength() )
- {
- sValue = aLocale.Language;
- if ( aLocale.Country.getLength() )
- {
- sValue += ::rtl::OUString::valueOf((sal_Unicode)'-');
- sValue += aLocale.Country;
- }
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_DC, XML_LANGUAGE,
- sal_True, sal_False );
- rExport.Characters( sValue );
- }
-
- // editing cycles
- aPropVal = xInfoProp->getPropertyValue(
- ::rtl::OUString::createFromAscii(PROP_EDITINGCYCLES) );
- sal_Int32 nCycles;
- if ( aPropVal >>= nCycles )
- {
- sValue = ::rtl::OUString::valueOf( nCycles );
-
- SvXMLElementExport aElem( rExport,
- XML_NAMESPACE_META, XML_EDITING_CYCLES,
- sal_True, sal_False );
- rExport.Characters( sValue );
- }
-
- // editing duration
- // property is a int32 with the Time::GetTime value
- aPropVal = xInfoProp->getPropertyValue(
- ::rtl::OUString::createFromAscii(PROP_EDITINGDURATION) );
- sal_Int32 nDurVal;
- if ( aPropVal >>= nDurVal )
- {
- Time aDurTime( nDurVal );
- sValue = GetISODurationString( aDurTime );
-
- SvXMLElementExport aElem( rExport,
- XML_NAMESPACE_META, XML_EDITING_DURATION,
- sal_True, sal_False );
- rExport.Characters( sValue );
- }
-
- // default target
- aPropVal = xInfoProp->getPropertyValue(
- ::rtl::OUString::createFromAscii(PROP_DEFAULTTARGET) );
- ::rtl::OUString sDefTarget;
- aPropVal >>= sDefTarget;
- if ( sDefTarget.getLength() )
- {
- rExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_TARGET_FRAME_NAME,
- sDefTarget );
-
- //! define strings for xlink:show values
- XMLTokenEnum eShow =
- sDefTarget.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("_blank"))
- ? XML_NEW : XML_REPLACE;
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, eShow );
-
- SvXMLElementExport aElem( rExport,
- XML_NAMESPACE_META,XML_HYPERLINK_BEHAVIOUR,
- sal_True, sal_False );
- }
-
- // auto-reload
- aPropVal = xInfoProp->getPropertyValue(
- ::rtl::OUString::createFromAscii(PROP_RELOADENABLED) );
- BOOL bAutoReload = FALSE;
- if ( aPropVal.getValueTypeClass() == uno::TypeClass_BOOLEAN )
- bAutoReload = *(sal_Bool*)aPropVal.getValue();
- if ( bAutoReload )
- {
- aPropVal = xInfoProp->getPropertyValue(
- ::rtl::OUString::createFromAscii(PROP_RELOADURL) );
- ::rtl::OUString sReloadURL;
- aPropVal >>= sReloadURL;
- if ( sReloadURL.getLength() )
- {
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF,
- ::binfilter::StaticBaseUrl::AbsToRel( sReloadURL) );
- }
-
- aPropVal = xInfoProp->getPropertyValue(
- ::rtl::OUString::createFromAscii(PROP_RELOADSECS) );
- sal_Int32 nSecs;
- if ( aPropVal >>= nSecs )
- {
- Time aTime;
- aTime.MakeTimeFromMS( nSecs * 1000 );
- ::rtl::OUString sReloadTime = GetISODurationString( aTime );
-
- rExport.AddAttribute( XML_NAMESPACE_META, XML_DELAY, sReloadTime );
- }
-
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_META, XML_AUTO_RELOAD,
- sal_True, sal_False );
- }
-
- // template
- aPropVal = xInfoProp->getPropertyValue(
- ::rtl::OUString::createFromAscii(PROP_TEMPLATEURL) );
- ::rtl::OUString sTplPath;
- aPropVal >>= sTplPath;
- if ( sTplPath.getLength() )
- {
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONREQUEST );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ROLE, XML_TEMPLATE );
-
- // template URL
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF,
- ::binfilter::StaticBaseUrl::AbsToRel(sTplPath) );
-
- // template name
- aPropVal = xInfoProp->getPropertyValue(
- ::rtl::OUString::createFromAscii(PROP_TEMPLATENAME) );
- ::rtl::OUString sTplName;
- aPropVal >>= sTplName;
- if ( sTplName.getLength() )
- {
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TITLE, sTplName );
- }
-
- // template date
- aPropVal = xInfoProp->getPropertyValue(
- ::rtl::OUString::createFromAscii(PROP_TEMPLATEDATE) );
- util::DateTime aDateTime;
- if ( aPropVal >>= aDateTime )
- {
- ::rtl::OUString sTplDate = GetISODateTimeString( aDateTime );
-
- rExport.AddAttribute( XML_NAMESPACE_META, XML_DATE, sTplDate );
- }
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_META, XML_TEMPLATE,
- sal_True, sal_False );
- }
-
- // user defined fields
- sal_Int16 nUFCount = xDocInfo->getUserFieldCount();
- if ( nUFCount )
- {
- for (sal_Int16 nUF=0; nUF<nUFCount; nUF++)
- {
- ::rtl::OUString aUFName = xDocInfo->getUserFieldName( nUF );
- ::rtl::OUString aUFValue = xDocInfo->getUserFieldValue( nUF );
-
- rExport.AddAttribute( XML_NAMESPACE_META, XML_NAME, aUFName );
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_META,
- XML_USER_DEFINED, sal_True, sal_False );
- rExport.Characters( aUFValue );
- }
- }
-}
-
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/meta/xmloff_xmlmetai.cxx b/binfilter/bf_xmloff/source/meta/xmloff_xmlmetai.cxx
deleted file mode 100644
index 0cb8236a28ae..000000000000
--- a/binfilter/bf_xmloff/source/meta/xmloff_xmlmetai.cxx
+++ /dev/null
@@ -1,800 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-#include <tools/time.hxx>
-#include <tools/string.hxx>
-
-#include <com/sun/star/util/DateTime.hpp>
-#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
-
-#include "xmlmetai.hxx"
-#include "xmlnmspe.hxx"
-#include "xmlimp.hxx"
-#include "nmspmap.hxx"
-
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-//-------------------------------------------------------------------------
-
-#define PROP_TITLE "Title"
-#define PROP_DESCRIPTION "Description"
-#define PROP_THEME "Theme"
-#define PROP_KEYWORDS "Keywords"
-#define PROP_AUTHOR "Author"
-#define PROP_CREATIONDATE "CreationDate"
-#define PROP_MODIFIEDBY "ModifiedBy"
-#define PROP_MODIFYDATE "ModifyDate"
-#define PROP_PRINTEDBY "PrintedBy"
-#define PROP_PRINTDATE "PrintDate"
-#define PROP_TEMPLATEURL "TemplateFileName"
-#define PROP_TEMPLATENAME "Template"
-#define PROP_TEMPLATEDATE "TemplateDate"
-#define PROP_RELOADENABLED "AutoloadEnabled"
-#define PROP_RELOADURL "AutoloadURL"
-#define PROP_RELOADSECS "AutoloadSecs"
-#define PROP_DEFAULTTARGET "DefaultTarget"
-#define PROP_EDITINGCYCLES "EditingCycles"
-#define PROP_EDITINGDURATION "EditingDuration"
-
-#define PROP_CHARLOCALE "CharLocale"
-
-
-//-------------------------------------------------------------------------
-
-class SfxXMLMetaElementContext : public SvXMLImportContext
-{
-private:
- SfxXMLMetaContext& rParent;
- sal_uInt16 nElementType;
- ::rtl::OUString sContent;
- ::rtl::OUString sFieldName; // for <meta:user-defined>
-
-public:
- SfxXMLMetaElementContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const uno::Reference<
- xml::sax::XAttributeList>& xAttrList,
- SfxXMLMetaContext& rParentContext,
- sal_uInt16 nType );
-
- virtual ~SfxXMLMetaElementContext();
-
- virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
- const ::rtl::OUString& rLName,
- const uno::Reference<
- xml::sax::XAttributeList>& xAttrList );
- virtual void EndElement();
- virtual void Characters( const ::rtl::OUString& rChars );
-
- static BOOL ParseISODateTimeString( const ::rtl::OUString& rString,
- util::DateTime& rDateTime );
- static BOOL ParseISODurationString( const ::rtl::OUString& rString,
- Time& rTime );
-};
-
-//-------------------------------------------------------------------------
-
-enum SfxXMLMetaElemTokens
-{
- XML_TOK_META_TITLE,
- XML_TOK_META_DESCRIPTION,
- XML_TOK_META_SUBJECT,
- XML_TOK_META_KEYWORDS,
- XML_TOK_META_KEYWORD,
- XML_TOK_META_INITIALCREATOR,
- XML_TOK_META_CREATIONDATE,
- XML_TOK_META_CREATOR,
- XML_TOK_META_DATE,
- XML_TOK_META_PRINTEDBY,
- XML_TOK_META_PRINTDATE,
- XML_TOK_META_TEMPLATE,
- XML_TOK_META_AUTORELOAD,
- XML_TOK_META_HYPERLINKBEHAVIOUR,
- XML_TOK_META_LANGUAGE,
- XML_TOK_META_EDITINGCYCLES,
- XML_TOK_META_EDITINGDURATION,
- XML_TOK_META_USERDEFINED,
- XML_TOK_META_DOCUMENT_STATISTIC,
- XML_TOK_META_ELEM_END = XML_TOK_UNKNOWN
-};
-
-// XML_TOK_META_KEYWORD is not in map,
-// handled in SfxXMLMetaElementContext::CreateChildContext
-
-static __FAR_DATA SvXMLTokenMapEntry aMetaElemTokenMap[] =
-{
- { XML_NAMESPACE_DC, XML_TITLE, XML_TOK_META_TITLE },
- { XML_NAMESPACE_DC, XML_DESCRIPTION, XML_TOK_META_DESCRIPTION },
- { XML_NAMESPACE_DC, XML_SUBJECT, XML_TOK_META_SUBJECT },
- { XML_NAMESPACE_META, XML_KEYWORDS, XML_TOK_META_KEYWORDS },
- { XML_NAMESPACE_META, XML_INITIAL_CREATOR, XML_TOK_META_INITIALCREATOR },
- { XML_NAMESPACE_META, XML_CREATION_DATE, XML_TOK_META_CREATIONDATE },
- { XML_NAMESPACE_DC, XML_CREATOR, XML_TOK_META_CREATOR },
- { XML_NAMESPACE_DC, XML_DATE, XML_TOK_META_DATE },
- { XML_NAMESPACE_META, XML_PRINTED_BY, XML_TOK_META_PRINTEDBY },
- { XML_NAMESPACE_META, XML_PRINT_DATE, XML_TOK_META_PRINTDATE },
- { XML_NAMESPACE_META, XML_TEMPLATE, XML_TOK_META_TEMPLATE },
- { XML_NAMESPACE_META, XML_AUTO_RELOAD, XML_TOK_META_AUTORELOAD },
- { XML_NAMESPACE_META, XML_HYPERLINK_BEHAVIOUR,XML_TOK_META_HYPERLINKBEHAVIOUR },
- { XML_NAMESPACE_DC, XML_LANGUAGE, XML_TOK_META_LANGUAGE },
- { XML_NAMESPACE_META, XML_EDITING_CYCLES, XML_TOK_META_EDITINGCYCLES },
- { XML_NAMESPACE_META, XML_EDITING_DURATION, XML_TOK_META_EDITINGDURATION },
- { XML_NAMESPACE_META, XML_USER_DEFINED, XML_TOK_META_USERDEFINED },
- { XML_NAMESPACE_META, XML_DOCUMENT_STATISTIC,XML_TOK_META_DOCUMENT_STATISTIC },
- XML_TOKEN_MAP_END
-};
-
-enum SfxXMLMetaTemplateTokens
-{
- XML_TOK_META_TEMPLATE_HREF,
- XML_TOK_META_TEMPLATE_TITLE,
- XML_TOK_META_TEMPLATE_DATE,
- XML_TOK_META_TEMPLATE_END = XML_TOK_UNKNOWN
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aMetaTemplateTokenMap[] =
-{
- { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_META_TEMPLATE_HREF },
- { XML_NAMESPACE_XLINK, XML_TITLE, XML_TOK_META_TEMPLATE_TITLE },
- { XML_NAMESPACE_META, XML_DATE, XML_TOK_META_TEMPLATE_DATE },
- XML_TOKEN_MAP_END
-};
-
-enum SfxXMLMetaReloadTokens
-{
- XML_TOK_META_RELOAD_HREF,
- XML_TOK_META_RELOAD_DELAY,
- XML_TOK_META_RELOAD_END = XML_TOK_UNKNOWN
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aMetaReloadTokenMap[] =
-{
- { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_META_RELOAD_HREF },
- { XML_NAMESPACE_META, XML_DELAY, XML_TOK_META_RELOAD_DELAY },
- XML_TOKEN_MAP_END
-};
-
-//-------------------------------------------------------------------------
-
-sal_Bool lcl_GetNumber( const ::rtl::OUString& rString, sal_Int32& rValue,
- sal_Int32 nMax )
-{
- sal_Int32 nTemp = 0;
-
- ::rtl::OUString aTrimmed = rString.trim();
- sal_Int32 nLen = aTrimmed.getLength();
- sal_Int32 nPos = 0;
- sal_Unicode c;
- while( nPos < nLen && sal_Unicode('0') <= (c = aTrimmed[nPos]) &&
- sal_Unicode('9') >= c )
- {
- nTemp *= 10;
- nTemp += (c - sal_Unicode('0'));
- if ( nTemp > nMax )
- return sal_False;
-
- nPos++;
- }
-
-// if ( *pStr )
-// return FALSE; // invalid characters
-
- rValue = nTemp;
- return sal_True;
-}
-
-// static
-sal_Bool SfxXMLMetaElementContext::ParseISODateTimeString(
- const ::rtl::OUString& rString,
- util::DateTime& rDateTime )
-{
- sal_Bool bSuccess = sal_True;
-
- ::rtl::OUString aDateStr, aTimeStr;
- sal_Int32 nPos = rString.indexOf( (sal_Unicode) 'T' );
- if ( nPos >= 0 )
- {
- aDateStr = rString.copy( 0, nPos );
- aTimeStr = rString.copy( nPos + 1 );
- }
- else
- aDateStr = rString; // no separator: only date part
-
- sal_Int32 nYear = 0;
- sal_Int32 nMonth = 1;
- sal_Int32 nDay = 1;
- sal_Int32 nHour = 0;
- sal_Int32 nMin = 0;
- sal_Int32 nSec = 0;
-
- const sal_Unicode* pStr = aDateStr.getStr();
- sal_Int32 nDateTokens = 1;
- while ( *pStr )
- {
- if ( *pStr == '-' )
- nDateTokens++;
- pStr++;
- }
- if ( nDateTokens > 3 || aDateStr.getLength() == 0 )
- bSuccess = sal_False;
- else
- {
- sal_Int32 n = 0;
- if ( !lcl_GetNumber( aDateStr.getToken( 0, '-', n ), nYear, 9999 ) )
- bSuccess = sal_False;
- if ( nDateTokens >= 2 )
- if ( !lcl_GetNumber( aDateStr.getToken( 0, '-', n ), nMonth, 12 ) )
- bSuccess = sal_False;
- if ( nDateTokens >= 3 )
- if ( !lcl_GetNumber( aDateStr.getToken( 0, '-', n ), nDay, 31 ) )
- bSuccess = sal_False;
- }
-
- if ( aTimeStr.getLength() > 0 ) // time is optional
- {
- pStr = aTimeStr.getStr();
- sal_Int32 nTimeTokens = 1;
- while ( *pStr )
- {
- if ( *pStr == ':' )
- nTimeTokens++;
- pStr++;
- }
- if ( nTimeTokens > 3 )
- bSuccess = sal_False;
- else
- {
- sal_Int32 n = 0;
- if ( !lcl_GetNumber( aTimeStr.getToken( 0, ':', n ), nHour, 23 ) )
- bSuccess = sal_False;
- if ( nTimeTokens >= 2 )
- if ( !lcl_GetNumber( aTimeStr.getToken( 0, ':', n ), nMin, 59 ) )
- bSuccess = sal_False;
- if ( nTimeTokens >= 3 )
- if ( !lcl_GetNumber( aTimeStr.getToken( 0, ':', n ), nSec, 59 ) )
- bSuccess = sal_False;
- }
- }
-
- if (bSuccess)
- rDateTime = util::DateTime( 0, nSec, nMin, nHour, nDay, nMonth, nYear );
- return bSuccess;
-}
-
-// static
-sal_Bool SfxXMLMetaElementContext::ParseISODurationString(
- const ::rtl::OUString& rString, Time& rTime )
-{
- ::rtl::OUString aTrimmed = rString.trim().toAsciiUpperCase();
- const sal_Unicode* pStr = aTrimmed.getStr();
-
- if ( *(pStr++) != sal_Unicode('P') ) // duration must start with "P"
- return sal_False;
-
- sal_Bool bSuccess = TRUE;
- sal_Bool bDone = sal_False;
- sal_Bool bTimePart = sal_False;
- sal_Int32 nDays = 0;
- sal_Int32 nHours = 0;
- sal_Int32 nMins = 0;
- sal_Int32 nSecs = 0;
- sal_Int32 nTemp = 0;
-
- while ( bSuccess && !bDone )
- {
- sal_Unicode c = *(pStr++);
- if ( !c ) // end
- bDone = sal_True;
- else if ( sal_Unicode('0') <= c && sal_Unicode('9') >= c )
- {
- if ( nTemp >= SAL_MAX_INT32 / 10 )
- bSuccess = sal_False;
- else
- {
- nTemp *= 10;
- nTemp += (c - sal_Unicode('0'));
- }
- }
- else if ( bTimePart )
- {
- if ( c == sal_Unicode('H') )
- {
- nHours = nTemp;
- nTemp = 0;
- }
- else if ( c == sal_Unicode('M') )
- {
- nMins = nTemp;
- nTemp = 0;
- }
- else if ( c == sal_Unicode('S') )
- {
- nSecs = nTemp;
- nTemp = 0;
- }
- else
- bSuccess = sal_False; // invalid characted
- }
- else
- {
- if ( c == sal_Unicode('T') ) // "T" starts time part
- bTimePart = TRUE;
- else if ( c == sal_Unicode('D') )
- {
- nDays = nTemp;
- nTemp = 0;
- }
- else if ( c == sal_Unicode('Y') || c == sal_Unicode('M') )
- {
- //! how many days is a year or month?
-
- DBG_ERROR("years or months in duration: not implemented");
- bSuccess = sal_False;
- }
- else
- bSuccess = sal_False; // invalid characted
- }
- }
-
- if ( bSuccess )
- {
- if ( nDays )
- nHours += nDays * 24; // add the days to the hours part
- rTime = Time( nHours, nMins, nSecs );
- }
- return bSuccess;
-}
-
-//-------------------------------------------------------------------------
-
-SfxXMLMetaElementContext::SfxXMLMetaElementContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList,
- SfxXMLMetaContext& rParentContext, sal_uInt16 nType ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rParent( rParentContext ),
- nElementType( nType )
-{
- rParent.AddRef();
- uno::Any aPropAny;
-
- if ( nElementType == XML_TOK_META_TEMPLATE )
- {
- // <meta:template>: everything is in the attributes
-
- uno::Reference<beans::XPropertySet> xInfoProp = rParent.GetInfoProp();
- if ( xInfoProp.is() )
- {
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName(
- sAttrName, &aLocalName );
- ::rtl::OUString sValue = xAttrList->getValueByIndex( i );
-
- SvXMLTokenMap aTokenMap( aMetaTemplateTokenMap );
- switch( aTokenMap.Get( nPrefix, aLocalName ) )
- {
- case XML_TOK_META_TEMPLATE_HREF:
- aPropAny <<= GetImport().GetAbsoluteReference(sValue);
- xInfoProp->setPropertyValue(
- ::rtl::OUString::createFromAscii(PROP_TEMPLATEURL),
- aPropAny );
- break;
- case XML_TOK_META_TEMPLATE_TITLE:
- aPropAny <<= sValue;
- xInfoProp->setPropertyValue(
- ::rtl::OUString::createFromAscii(PROP_TEMPLATENAME),
- aPropAny );
- break;
- case XML_TOK_META_TEMPLATE_DATE:
- {
- util::DateTime aDateTime;
- if ( ParseISODateTimeString( sValue, aDateTime ) )
- {
- aPropAny <<= aDateTime;
- xInfoProp->setPropertyValue(
- ::rtl::OUString::createFromAscii(
- PROP_TEMPLATEDATE), aPropAny );
- }
- }
- break;
- }
- }
- }
- }
- else if ( nElementType == XML_TOK_META_AUTORELOAD )
- {
- // <meta:auto-reload>: everything is in the attributes
-
- uno::Reference<beans::XPropertySet> xInfoProp = rParent.GetInfoProp();
- if ( xInfoProp.is() )
- {
- // AutoloadEnabled is implicit
- sal_Bool bReload = sal_True;
- aPropAny.setValue( &bReload, getBooleanCppuType() );
- xInfoProp->setPropertyValue(
- ::rtl::OUString::createFromAscii(PROP_RELOADENABLED),
- aPropAny );
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName(
- sAttrName, &aLocalName );
- ::rtl::OUString sValue = xAttrList->getValueByIndex( i );
-
- SvXMLTokenMap aTokenMap( aMetaReloadTokenMap );
- uno::Any aAny;
- switch( aTokenMap.Get( nPrefix, aLocalName ) )
- {
- case XML_TOK_META_RELOAD_HREF:
- aPropAny <<= GetImport().GetAbsoluteReference(sValue);
- xInfoProp->setPropertyValue(
- ::rtl::OUString::createFromAscii(PROP_RELOADURL),
- aPropAny );
- break;
- case XML_TOK_META_RELOAD_DELAY:
- {
- Time aTime;
- if ( ParseISODurationString( sValue, aTime ) )
- {
- sal_Int32 nSecs = aTime.GetMSFromTime() / 1000;
- aPropAny <<= nSecs;
- xInfoProp->setPropertyValue(
- ::rtl::OUString::createFromAscii(
- PROP_RELOADSECS), aPropAny );
- }
- }
- break;
- }
- }
- }
- }
- else if ( nElementType == XML_TOK_META_HYPERLINKBEHAVIOUR )
- {
- // <meta:hyperlink-behaviour>: everything is in the attributes
-
- uno::Reference<beans::XPropertySet> xInfoProp = rParent.GetInfoProp();
- if ( xInfoProp.is() )
- {
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName(
- sAttrName, &aLocalName );
- if ( nPrefix == XML_NAMESPACE_OFFICE &&
- IsXMLToken(aLocalName, XML_TARGET_FRAME_NAME) )
- {
- ::rtl::OUString sValue = xAttrList->getValueByIndex( i );
- aPropAny <<= sValue;
- xInfoProp->setPropertyValue(
- ::rtl::OUString::createFromAscii(PROP_DEFAULTTARGET),
- aPropAny );
- }
- }
- }
- }
- else if ( nElementType == XML_TOK_META_USERDEFINED )
- {
- // <meta:user-defined>: get field name from attributes
-
- INT16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( INT16 i=0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName(
- sAttrName, &aLocalName );
- if ( nPrefix == XML_NAMESPACE_META &&
- IsXMLToken(aLocalName, XML_NAME) )
- {
- sFieldName = xAttrList->getValueByIndex( i );
- }
- }
- }
- else if ( nElementType == XML_TOK_META_DOCUMENT_STATISTIC )
- GetImport().SetStatisticAttributes(xAttrList);
-}
-
-SfxXMLMetaElementContext::~SfxXMLMetaElementContext()
-{
- rParent.ReleaseRef();
-}
-
-SvXMLImportContext* SfxXMLMetaElementContext::CreateChildContext( sal_uInt16 nPrefix,
- const ::rtl::OUString& rLName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
-
- if ( nElementType == XML_TOK_META_KEYWORDS &&
- nPrefix == XML_NAMESPACE_META &&
- IsXMLToken(rLName, XML_KEYWORD) )
- {
- // <office:keyword> inside of <office:keywords>
- pContext = new SfxXMLMetaElementContext( GetImport(), nPrefix, rLName,
- xAttrList, rParent, XML_TOK_META_KEYWORD );
- }
-
- if ( !pContext )
- {
- // default context to ignore unknown elements
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
- }
- return pContext;
-}
-
-void SfxXMLMetaElementContext::EndElement()
-{
- uno::Reference<beans::XPropertySet> xInfoProp = rParent.GetInfoProp();
- if ( !xInfoProp.is() )
- return;
-
- uno::Any aPropAny;
- util::DateTime aDateTime;
- Time aTime;
- sal_Int32 nValue;
- switch ( nElementType )
- {
- // simple strings
- case XML_TOK_META_TITLE:
- aPropAny <<= sContent;
- xInfoProp->setPropertyValue( ::rtl::OUString::createFromAscii(PROP_TITLE), aPropAny );
- break;
- case XML_TOK_META_DESCRIPTION:
- aPropAny <<= sContent;
- xInfoProp->setPropertyValue( ::rtl::OUString::createFromAscii(PROP_DESCRIPTION), aPropAny );
- break;
- case XML_TOK_META_SUBJECT:
- aPropAny <<= sContent;
- xInfoProp->setPropertyValue( ::rtl::OUString::createFromAscii(PROP_THEME), aPropAny );
- break;
- case XML_TOK_META_INITIALCREATOR:
- aPropAny <<= sContent;
- xInfoProp->setPropertyValue( ::rtl::OUString::createFromAscii(PROP_AUTHOR), aPropAny );
- break;
- case XML_TOK_META_CREATOR:
- aPropAny <<= sContent;
- xInfoProp->setPropertyValue( ::rtl::OUString::createFromAscii(PROP_MODIFIEDBY), aPropAny );
- break;
- case XML_TOK_META_PRINTEDBY:
- aPropAny <<= sContent;
- xInfoProp->setPropertyValue( ::rtl::OUString::createFromAscii(PROP_PRINTEDBY), aPropAny );
- break;
- // date/time
- case XML_TOK_META_CREATIONDATE:
- if ( ParseISODateTimeString( sContent, aDateTime ) )
- {
- aPropAny <<= aDateTime;
- xInfoProp->setPropertyValue( ::rtl::OUString::createFromAscii(PROP_CREATIONDATE), aPropAny );
- }
- break;
- case XML_TOK_META_DATE:
- if ( ParseISODateTimeString( sContent, aDateTime ) )
- {
- aPropAny <<= aDateTime;
- xInfoProp->setPropertyValue( ::rtl::OUString::createFromAscii(PROP_MODIFYDATE), aPropAny );
- }
- break;
- case XML_TOK_META_PRINTDATE:
- if ( ParseISODateTimeString( sContent, aDateTime ) )
- {
- aPropAny <<= aDateTime;
- xInfoProp->setPropertyValue( ::rtl::OUString::createFromAscii(PROP_PRINTDATE), aPropAny );
- }
- break;
- // others
- case XML_TOK_META_LANGUAGE:
- {
- uno::Reference<beans::XPropertySet> xDocProp = rParent.GetDocProp();
- if ( xDocProp.is() )
- {
- // set document language in document properties
- // (not available for all document types)
-
- lang::Locale aLocale;
- String aString( sContent );
- xub_StrLen nSepPos = aString.Search( (sal_Unicode)'-' );
- if ( nSepPos != STRING_NOTFOUND )
- {
- aLocale.Language = aString.Copy( 0, nSepPos );
- aLocale.Country = aString.Copy( nSepPos+1 );
- }
- else
- aLocale.Language = aString;
-
- aPropAny <<= aLocale;
- try
- {
- xDocProp->setPropertyValue(
- ::rtl::OUString::createFromAscii( PROP_CHARLOCALE ),
- aPropAny );
- }
- catch (beans::UnknownPropertyException&)
- {
- // no error
- }
- }
- }
- break;
- case XML_TOK_META_EDITINGCYCLES:
- if ( lcl_GetNumber( sContent, nValue, USHRT_MAX ) )
- {
- aPropAny <<= (sal_Int16) nValue;
- xInfoProp->setPropertyValue( ::rtl::OUString::createFromAscii(PROP_EDITINGCYCLES), aPropAny );
- }
- break;
- case XML_TOK_META_EDITINGDURATION:
- // property is a int32 with the Time::GetTime value
- if ( ParseISODurationString( sContent, aTime ) )
- {
- aPropAny <<= (sal_Int32) aTime.GetTime();
- xInfoProp->setPropertyValue( ::rtl::OUString::createFromAscii(PROP_EDITINGDURATION), aPropAny );
- }
- break;
- case XML_TOK_META_KEYWORDS:
- // nothing to do, keywords are handled in XML_TOK_META_KEYWORD
- break;
- case XML_TOK_META_TEMPLATE:
- case XML_TOK_META_AUTORELOAD:
- case XML_TOK_META_HYPERLINKBEHAVIOUR:
- // nothing to do, everything is handled in attributes
- break;
- case XML_TOK_META_KEYWORD:
- rParent.AddKeyword( sContent );
- break;
- case XML_TOK_META_USERDEFINED:
- rParent.AddUserField( sFieldName, sContent );
- break;
- case XML_TOK_META_DOCUMENT_STATISTIC:
- break;
- default:
- DBG_ERROR("wrong element");
- }
-}
-
-void SfxXMLMetaElementContext::Characters( const ::rtl::OUString& rChars )
-{
- sContent += rChars;
-}
-
-//-------------------------------------------------------------------------
-//
-// context for <office:meta> element
-//
-
-SfxXMLMetaContext::SfxXMLMetaContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const uno::Reference<frame::XModel>& rDocModel ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- xDocProp( rDocModel, uno::UNO_QUERY ),
- pTokenMap( NULL ),
- nUserKeys( 0 )
-{
- uno::Reference<document::XDocumentInfoSupplier> xSupp( rDocModel, uno::UNO_QUERY );
- if ( xSupp.is() )
- {
- xDocInfo = xSupp->getDocumentInfo();
- xInfoProp = uno::Reference<beans::XPropertySet>( xDocInfo, uno::UNO_QUERY );
- }
-#ifndef SVX_LIGHT
- // this service is not available for player
- DBG_ASSERT( xInfoProp.is(), "no document info properties" );
-#endif
-}
-
-SfxXMLMetaContext::SfxXMLMetaContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const uno::Reference<document::XDocumentInfo>& rDocInfo ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- xDocInfo( rDocInfo ),
- xInfoProp( rDocInfo, uno::UNO_QUERY ),
- pTokenMap ( NULL ),
- nUserKeys ( 0 )
-{
-#ifndef SVX_LIGHT
- // this service is not available for player
- DBG_ASSERT( xInfoProp.is(), "no document info properties" );
-#endif
-}
-
-SfxXMLMetaContext::~SfxXMLMetaContext()
-{
- delete pTokenMap;
-}
-
-SvXMLImportContext* SfxXMLMetaContext::CreateChildContext( sal_uInt16 nPrefix,
- const ::rtl::OUString& rLName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
-
- if (!pTokenMap)
- pTokenMap = new SvXMLTokenMap( aMetaElemTokenMap );
-
- sal_uInt16 nToken = pTokenMap->Get( nPrefix, rLName );
- if ( nToken != XML_TOK_UNKNOWN )
- pContext = new SfxXMLMetaElementContext( GetImport(),
- nPrefix, rLName, xAttrList, *this, nToken );
-
- if ( !pContext )
- {
- // default context to ignore unknown elements
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
- }
- return pContext;
-}
-
-void SfxXMLMetaContext::EndElement()
-{
- if ( sKeywords.getLength() && xInfoProp.is() )
- {
- uno::Any aAny;
- aAny <<= ::rtl::OUString(sKeywords);
- xInfoProp->setPropertyValue( ::rtl::OUString::createFromAscii(PROP_KEYWORDS), aAny );
- }
-}
-
-void SfxXMLMetaContext::AddKeyword( const ::rtl::OUString& rKW )
-{
- if ( sKeywords.getLength() )
- {
- // comma separated
- sKeywords.append(sal_Unicode(','));
- sKeywords.append(sal_Unicode(' '));
- }
- sKeywords.append( rKW );
-}
-
-void SfxXMLMetaContext::AddUserField( const ::rtl::OUString& rName, const ::rtl::OUString& rContent )
-{
- if ( xDocInfo.is() && nUserKeys < xDocInfo->getUserFieldCount() )
- {
- // keep default name if none is there
- if ( rName.getLength() )
- xDocInfo->setUserFieldName( nUserKeys, rName );
- xDocInfo->setUserFieldValue( nUserKeys, rContent );
- ++nUserKeys;
- }
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/script/makefile.mk b/binfilter/bf_xmloff/source/script/makefile.mk
deleted file mode 100644
index df548fa53d28..000000000000
--- a/binfilter/bf_xmloff/source/script/makefile.mk
+++ /dev/null
@@ -1,57 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
-
-PRJ=..$/..$/..
-
-PRJNAME=binfilter
-TARGET=xmloff_script
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-INC+= -I$(PRJ)$/inc$/bf_xmloff
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/xmloff_XMLEventExport.obj \
- $(SLO)$/xmloff_XMLEventImportHelper.obj \
- $(SLO)$/xmloff_XMLEventsImportContext.obj \
- $(SLO)$/xmloff_XMLScriptContextFactory.obj \
- $(SLO)$/xmloff_XMLScriptExportHandler.obj \
- $(SLO)$/xmloff_XMLStarBasicContextFactory.obj \
- $(SLO)$/xmloff_XMLStarBasicExportHandler.obj \
- $(SLO)$/xmloff_xmlscripti.obj \
- $(SLO)$/xmloff_xmlbasici.obj
-
-# --- Tagets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/binfilter/bf_xmloff/source/script/xmlbasici.hxx b/binfilter/bf_xmloff/source/script/xmlbasici.hxx
deleted file mode 100644
index 2ab44c1f0fef..000000000000
--- a/binfilter/bf_xmloff/source/script/xmlbasici.hxx
+++ /dev/null
@@ -1,100 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLBASICI_HXX
-#define _XMLOFF_XMLBASICI_HXX
-
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-
-#include "xmlictxt.hxx"
-
-//.........................................................................
-namespace binfilter
-{
-//.........................................................................
-
- // =============================================================================
- // class XMLBasicImportContext
- // =============================================================================
-
- class XMLBasicImportContext : public SvXMLImportContext
- {
- private:
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel;
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xHandler;
-
- public:
- XMLBasicImportContext( SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel );
-
- virtual ~XMLBasicImportContext();
-
- virtual SvXMLImportContext* CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& rxAttrList );
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& rxAttrList );
-
- virtual void EndElement();
-
- virtual void Characters( const ::rtl::OUString& rChars );
- };
-
-
- // =============================================================================
- // class XMLBasicImportChildContext
- // =============================================================================
-
- class XMLBasicImportChildContext : public SvXMLImportContext
- {
- private:
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xHandler;
-
- public:
- XMLBasicImportChildContext( SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler >& rxHandler );
-
- virtual ~XMLBasicImportChildContext();
-
- virtual SvXMLImportContext* CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
- virtual void EndElement();
-
- virtual void Characters( const ::rtl::OUString& rChars );
- };
-
-//.........................................................................
-} // namespace binfilter
-//.........................................................................
-
-#endif // _XMLOFF_XMLBASICI_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/script/xmloff_XMLEventExport.cxx b/binfilter/bf_xmloff/source/script/xmloff_XMLEventExport.cxx
deleted file mode 100644
index 80ed4c209fee..000000000000
--- a/binfilter/bf_xmloff/source/script/xmloff_XMLEventExport.cxx
+++ /dev/null
@@ -1,310 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLEventExport.hxx"
-
-
-#include <com/sun/star/document/XEventsSupplier.hpp>
-
-
-#include <tools/debug.hxx>
-
-#include "xmlexp.hxx"
-
-
-#include "xmlnmspe.hxx"
-
-namespace binfilter {
-
-
-using namespace ::com::sun::star::uno;
-
-using ::std::map;
-using ::rtl::OUString;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::document::XEventsSupplier;
-using ::com::sun::star::container::XNameReplace;
-using ::com::sun::star::container::XNameAccess;
-using ::binfilter::xmloff::token::GetXMLToken;
-using ::binfilter::xmloff::token::XML_EVENTS;
-
-
-XMLEventExport::XMLEventExport(SvXMLExport& rExp,
- const XMLEventNameTranslation* pTranslationTable) :
- rExport(rExp),
- sEventType(RTL_CONSTASCII_USTRINGPARAM("EventType"))
-{
- AddTranslationTable(pTranslationTable);
-}
-
-XMLEventExport::~XMLEventExport()
-{
- // delete all handlers
- HandlerMap::iterator aEnd = aHandlerMap.end();
- for( HandlerMap::iterator aIter =
- aHandlerMap.begin();
- aIter != aEnd;
- aIter++ )
- {
- delete aIter->second;
- }
- aHandlerMap.clear();
-}
-
-void XMLEventExport::AddHandler( const OUString& rName,
- XMLEventExportHandler* pHandler )
-{
- DBG_ASSERT(pHandler != NULL, "Need EventExportHandler");
- if (pHandler != NULL)
- {
- aHandlerMap[rName] = pHandler;
- }
-}
-
-void XMLEventExport::AddTranslationTable(
- const XMLEventNameTranslation* pTransTable )
-{
- if (NULL != pTransTable)
- {
- // put translation table into map
- for(const XMLEventNameTranslation* pTrans = pTransTable;
- pTrans->sAPIName != NULL;
- pTrans++)
- {
- aNameTranslationMap[OUString::createFromAscii(pTrans->sAPIName)] =
- OUString::createFromAscii(pTrans->sXMLName);
- }
- }
- // else? ignore!
-}
-
-void XMLEventExport::Export( Reference<XEventsSupplier> & rSupplier,
- sal_Bool bWhitespace)
-{
- if (rSupplier.is())
- {
- Reference<XNameAccess> xAccess(rSupplier->getEvents(), UNO_QUERY);
- Export(xAccess, bWhitespace);
- }
- // else: no supplier, no export -> ignore!
-}
-
-void XMLEventExport::Export( Reference<XNameReplace> & rReplace,
- sal_Bool bWhitespace)
-{
- Reference<XNameAccess> xAccess(rReplace, UNO_QUERY);
- Export(xAccess, bWhitespace);
-}
-
-void XMLEventExport::Export( Reference<XNameAccess> & rAccess,
- sal_Bool bWhitespace)
-{
- // early out if we don't actually get any events
- if (!rAccess.is())
- {
- return;
- }
-
- // have we already processed an element?
- sal_Bool bStarted = sal_False;
-
- // iterate over all event types
- Sequence<OUString> aNames = rAccess->getElementNames();
- sal_Int32 nCount = aNames.getLength();
- for(sal_Int32 i = 0; i < nCount; i++)
- {
- // translate name
- NameMap::iterator aIter = aNameTranslationMap.find(aNames[i]);
- if (aIter != aNameTranslationMap.end())
- {
- OUString& rXmlName = aIter->second;
-
- // get PropertyValues for this event
- Any aAny = rAccess->getByName( aNames[i] );
- Sequence<PropertyValue> aValues;
- aAny >>= aValues;
-
- // now export the current event
- ExportEvent( aValues, rXmlName, bWhitespace, bStarted );
- }
- else
- {
- // don't proceed further
- DBG_ERROR("Unknown event name.");
- }
- }
-
- // close <script:events> element (if it was opened before)
- if (bStarted)
- {
- EndElement(bWhitespace);
- }
-}
-
-/// export a singular event and wirte <office:events> container
-void XMLEventExport::ExportSingleEvent(
- Sequence<PropertyValue>& rEventValues,
- const OUString& rEventName,
- sal_Bool bUseWhitespace )
-{
- // translate the name
- NameMap::iterator aIter = aNameTranslationMap.find(rEventName);
- if (aIter != aNameTranslationMap.end())
- {
- OUString& rXmlName = aIter->second;
-
- // export the event ...
- sal_Bool bStarted = sal_False;
- ExportEvent( rEventValues, rXmlName, bUseWhitespace, bStarted );
-
- // ... and close the container element (if necessary)
- if (bStarted)
- {
- EndElement(bUseWhitespace);
- }
- }
- else
- {
- // unknown name!
- DBG_ERROR("unknown event name");
- }
-}
-
-
-/// export a single event
-void XMLEventExport::ExportEvent(
- Sequence<PropertyValue>& rEventValues,
- const OUString& rXmlName,
- sal_Bool bUseWhitespace,
- sal_Bool& rExported )
-{
- // search for EventType value and then delegate to EventHandler
- sal_Int32 nValues = rEventValues.getLength();
- const PropertyValue* pValues = rEventValues.getConstArray();
-
- for(sal_Int32 nVal = 0; nVal < nValues; nVal++)
- {
- if (sEventType.equals(pValues[nVal].Name))
- {
- // found! Now find handler and delegate
- OUString sType;
- pValues[nVal].Value >>= sType;
-
- if (aHandlerMap.count(sType))
- {
- if (! rExported)
- {
- // OK, we have't yet exported the enclosing
- // element. So we do that now.
- rExported = sal_True;
- StartElement(bUseWhitespace);
- }
-
- // delegate to proper ExportEventHandler
- aHandlerMap[sType]->Export(rExport, rXmlName,
- rEventValues, bUseWhitespace);
- }
- else
- {
- if (! sType.equalsAsciiL("None", sizeof("None")-1))
- {
- DBG_ERROR("unknown event type returned by API");
- // unknown type -> error (ignore)
- }
- // else: we ignore None fields
- }
-
- // early out: we don't need to look for another type
- break;
- }
- // else: we only care for EventType -> ignore
- }
-}
-
-
-void XMLEventExport::StartElement(sal_Bool bWhitespace)
-{
- if (bWhitespace)
- {
- rExport.IgnorableWhitespace();
- }
- rExport.StartElement( XML_NAMESPACE_OFFICE, XML_EVENTS, bWhitespace);
-}
-
-void XMLEventExport::EndElement(sal_Bool bWhitespace)
-{
- rExport.EndElement(XML_NAMESPACE_OFFICE, XML_EVENTS, bWhitespace);
- if (bWhitespace)
- {
- rExport.IgnorableWhitespace();
- }
-}
-
-
-// implement aStandardEventTable (defined in xmlevent.hxx)
-const XMLEventNameTranslation aStandardEventTable[] =
-{
- { "OnSelect", "on-select" },
- { "OnInsertStart", "on-insert-start" },
- { "OnInsertDone", "on-insert-done" },
- { "OnMailMerge", "on-mail-merge" },
- { "OnAlphaCharInput", "on-alpha-char-input" },
- { "OnNonAlphaCharInput", "on-non-alpha-char-input" },
- { "OnResize", "on-resize" },
- { "OnMove", "on-move" },
- { "OnPageCountChange", "page-count-change" },
- { "OnMouseOver", "on-mouse-over" },
- { "OnClick", "on-click" },
- { "OnMouseOut", "on-mouse-out" },
- { "OnLoadError", "on-load-error" },
- { "OnLoadCancel", "on-load-cancel" },
- { "OnLoadDone", "on-load-done" },
- { "OnLoad", "on-load" },
- { "OnUnload", "on-unload" },
- { "OnStartApp", "on-start-app" },
- { "OnCloseApp", "on-close-app" },
- { "OnNew", "on-new" },
- { "OnSave", "on-save" },
- { "OnSaveAs", "on-save-as" },
- { "OnFocus", "on-focus" },
- { "OnUnfocus", "on-unfocus" },
- { "OnPrint", "on-print" },
- { "OnError", "on-error" },
- { "OnLoadFinished", "on-load-finished" },
- { "OnSaveFinished", "on-save-finished" },
- { "OnModifyChanged", "on-modify-changed" },
- { "OnPrepareUnload", "on-prepare-unload" },
- { "OnNewMail", "on-new-mail" },
- { "OnToggleFullscreen", "on-toggle-fullscreen" },
- { "OnSaveDone", "on-save-done" },
- { "OnSaveAsDone", "on-save-as-done" },
- { NULL, NULL }
-};
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/script/xmloff_XMLEventImportHelper.cxx b/binfilter/bf_xmloff/source/script/xmloff_XMLEventImportHelper.cxx
deleted file mode 100644
index 9b598c0b0516..000000000000
--- a/binfilter/bf_xmloff/source/script/xmloff_XMLEventImportHelper.cxx
+++ /dev/null
@@ -1,170 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLEventImportHelper.hxx"
-
-#include <tools/debug.hxx>
-
-#include "xmlimp.hxx"
-
-
-
-#include "xmlerror.hxx"
-namespace binfilter {
-
-using ::rtl::OUString;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-
-XMLEventImportHelper::XMLEventImportHelper() :
- aFactoryMap(),
- pEventNameMap(new NameMap()),
- aEventNameMapList()
-{
-}
-
-
-XMLEventImportHelper::~XMLEventImportHelper()
-{
- // delete factories
- FactoryMap::iterator aEnd = aFactoryMap.end();
- for(FactoryMap::iterator aIter = aFactoryMap.begin();
- aIter != aEnd;
- aIter++ )
- {
- delete aIter->second;
- }
- aFactoryMap.clear();
-
- // delete name map
- delete pEventNameMap;
-}
-
-void XMLEventImportHelper::RegisterFactory(
- const OUString& rLanguage,
- XMLEventContextFactory* pFactory )
-{
- DBG_ASSERT(pFactory != NULL, "I need a factory.");
- if (NULL != pFactory)
- {
- aFactoryMap[rLanguage] = pFactory;
- }
-}
-
-void XMLEventImportHelper::AddTranslationTable(
- const XMLEventNameTranslation* pTransTable )
-{
- if (NULL != pTransTable)
- {
- // put translation table into map
- for(const XMLEventNameTranslation* pTrans = pTransTable;
- pTrans->sAPIName != NULL;
- pTrans++)
- {
- OUString rName(OUString::createFromAscii(pTrans->sXMLName));
-
- // check for conflicting entries
- DBG_ASSERT(pEventNameMap->find(rName) == pEventNameMap->end(),
- "conflicting event translations");
-
- // assign new translation
- (*pEventNameMap)[rName] =
- OUString::createFromAscii(pTrans->sAPIName);
- }
- }
- // else? ignore!
-}
-
-void XMLEventImportHelper::PushTranslationTable()
-{
- // save old map and install new one
- aEventNameMapList.push_back(pEventNameMap);
- pEventNameMap = new NameMap();
-}
-
-void XMLEventImportHelper::PopTranslationTable()
-{
- DBG_ASSERT(aEventNameMapList.size() > 0,
- "no translation tables left to pop");
- if (aEventNameMapList.size() > 0)
- {
- // delete current and install old map
- delete pEventNameMap;
- pEventNameMap = aEventNameMapList.back();
- aEventNameMapList.pop_back();
- }
-}
-
-
-SvXMLImportContext* XMLEventImportHelper::CreateContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList,
- XMLEventsImportContext* rEvents,
- const OUString& rXmlEventName,
- const OUString& rLanguage)
-{
- SvXMLImportContext* pContext = NULL;
-
- // translate event name form xml to api
- NameMap::iterator aNameIter = pEventNameMap->find(rXmlEventName);
- if (aNameIter != pEventNameMap->end())
- {
- // check for factory
- FactoryMap::iterator aFactoryIterator = aFactoryMap.find(rLanguage);
- if (aFactoryIterator != aFactoryMap.end())
- {
- // delegate to factory
- pContext = aFactoryIterator->second->CreateContext(
- rImport, nPrefix, rLocalName, xAttrList,
- rEvents, aNameIter->second, rLanguage);
- }
- }
-
- // default context (if no context was created above)
- if( NULL == pContext )
- {
- pContext = new SvXMLImportContext(rImport, nPrefix, rLocalName);
-
- Sequence<OUString> aMsgParams(2);
-
- aMsgParams[0] = rXmlEventName;
- aMsgParams[1] = rLanguage;
-
- rImport.SetError(XMLERROR_FLAG_ERROR | XMLERROR_ILLEGAL_EVENT,
- aMsgParams);
-
- }
-
- return pContext;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/script/xmloff_XMLEventsImportContext.cxx b/binfilter/bf_xmloff/source/script/xmloff_XMLEventsImportContext.cxx
deleted file mode 100644
index f795ca77b151..000000000000
--- a/binfilter/bf_xmloff/source/script/xmloff_XMLEventsImportContext.cxx
+++ /dev/null
@@ -1,240 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLEventsImportContext.hxx"
-
-#include "XMLEventImportHelper.hxx"
-
-#include <com/sun/star/document/XEventsSupplier.hpp>
-
-
-#include "xmlimp.hxx"
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "xmlerror.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star::uno;
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::container::XNameReplace;
-using ::com::sun::star::document::XEventsSupplier;
-using ::com::sun::star::lang::IllegalArgumentException;
-
-TYPEINIT1(XMLEventsImportContext, SvXMLImportContext);
-
-
-XMLEventsImportContext::XMLEventsImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName) :
- SvXMLImportContext(rImport, nPrfx, rLocalName)
-{
-}
-
-
-XMLEventsImportContext::XMLEventsImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const Reference<XEventsSupplier> & xEventsSupplier) :
- SvXMLImportContext(rImport, nPrfx, rLocalName),
- xEvents(xEventsSupplier->getEvents())
-{
-}
-
-
-XMLEventsImportContext::~XMLEventsImportContext()
-{
-// // if, for whatever reason, the object gets destroyed prematurely,
-// // we need to delete the collected events
-// EventsVector::iterator aEnd = aCollectEvents.end();
-// for(EventsVector::iterator aIter = aCollectEvents.begin();
-// aIter != aEnd;
-// aIter++)
-// {
-// EventNameValuesPair* pPair = &(*aIter);
-// delete pPair;
-// }
-// aCollectEvents.clear();
-}
-
-
-void XMLEventsImportContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- // nothing to be done
-}
-
-void XMLEventsImportContext::EndElement()
-{
- // nothing to be done
-}
-
-SvXMLImportContext* XMLEventsImportContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- // a) search for script:language and script:event-name attribute
- // b) delegate to factory. The factory will:
- // 1) translate XML event name into API event name
- // 2) get proper event context factory from import
- // 3) instantiate context
-
- // a) search for script:language and script:event-name attribute
- OUString sLanguage;
- OUString sEventName;
- sal_Int16 nCount = xAttrList->getLength();
- for (sal_Int16 nAttr = 0; nAttr < nCount; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr), &sLocalName );
-
- if (XML_NAMESPACE_SCRIPT == nPrefix)
- {
- if (IsXMLToken(sLocalName, XML_EVENT_NAME))
- {
- sEventName = xAttrList->getValueByIndex(nAttr);
- }
- else if (IsXMLToken(sLocalName, XML_LANGUAGE))
- {
- sLanguage = xAttrList->getValueByIndex(nAttr);
- }
- // else: ignore -> let child context handle this
- }
- // else: ignore -> let child context handle this
- }
-
- // b) delegate to factory
- return GetImport().GetEventImport().CreateContext(
- GetImport(), nPrefix, rLocalName, xAttrList,
- this, sEventName, sLanguage);
-}
-
-void XMLEventsImportContext::SetEvents(
- const Reference<XEventsSupplier> & xEventsSupplier)
-{
- if (xEventsSupplier.is())
- {
- SetEvents(xEventsSupplier->getEvents());
- }
-}
-
-void XMLEventsImportContext::SetEvents(
- const Reference<XNameReplace> & xNameRepl)
-{
- if (xNameRepl.is())
- {
- xEvents = xNameRepl;
-
- // now iterate over vector and a) insert b) delete all elements
- EventsVector::iterator aEnd = aCollectEvents.end();
- for(EventsVector::iterator aIter = aCollectEvents.begin();
- aIter != aEnd;
- aIter++)
- {
- AddEventValues(aIter->first, aIter->second);
-// EventNameValuesPair* pPair = &(*aIter);
-// delete pPair;
- }
- aCollectEvents.clear();
- }
-}
-
-sal_Bool XMLEventsImportContext::GetEventSequence(
- const OUString& rName,
- Sequence<PropertyValue> & rSequence )
-{
- // search through the vector
- // (This shouldn't take a lot of time, since this method should only get
- // called if only one (or few) events are being expected)
-
- // iterate over vector until end or rName is found;
- EventsVector::iterator aIter = aCollectEvents.begin();
- while( (aIter != aCollectEvents.end()) && (aIter->first != rName) )
- {
- aIter++;
- }
-
- // if we're not at the end, set the sequence
- sal_Bool bRet = (aIter != aCollectEvents.end());
- if (bRet)
- rSequence = aIter->second;
-
- return bRet;
-}
-
-void XMLEventsImportContext::AddEventValues(
- const OUString& rEventName,
- const Sequence<PropertyValue> & rValues )
-{
- // if we already have the events, set them; else just collect
- if (xEvents.is())
- {
- // set event (if name is known)
- if (xEvents->hasByName(rEventName))
- {
- Any aAny;
- aAny <<= rValues;
-
- try
- {
- xEvents->replaceByName(rEventName, aAny);
- } catch ( const IllegalArgumentException & rException )
- {
- Sequence<OUString> aMsgParams(1);
-
- aMsgParams[0] = rEventName;
-
- GetImport().SetError(XMLERROR_FLAG_ERROR |
- XMLERROR_ILLEGAL_EVENT,
- aMsgParams, rException.Message, 0);
- }
- }
- }
- else
- {
-// EventNameValuesPair* aPair = new EventNameValuesPair(rEventName,
-// rValues);
-// aCollectEvents.push_back(*aPair);
- EventNameValuesPair aPair(rEventName, rValues);
- aCollectEvents.push_back(aPair);
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/script/xmloff_XMLScriptContextFactory.cxx b/binfilter/bf_xmloff/source/script/xmloff_XMLScriptContextFactory.cxx
deleted file mode 100644
index 332897d4ed0b..000000000000
--- a/binfilter/bf_xmloff/source/script/xmloff_XMLScriptContextFactory.cxx
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLScriptContextFactory.hxx"
-
-#include "XMLEventsImportContext.hxx"
-
-
-#include "xmlimp.hxx"
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-namespace binfilter {
-
-
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Any;
-
-XMLScriptContextFactory::XMLScriptContextFactory() :
- sEventType(RTL_CONSTASCII_USTRINGPARAM("EventType")),
- sURL(RTL_CONSTASCII_USTRINGPARAM("Script")),
- sScript(RTL_CONSTASCII_USTRINGPARAM("Script"))
-{
-}
-
-XMLScriptContextFactory::~XMLScriptContextFactory()
-{
-}
-
-SvXMLImportContext * XMLScriptContextFactory::CreateContext
-(SvXMLImport & rImport,
- sal_uInt16 nPrefix,
- const OUString & rLocalName,
- const Reference<XAttributeList> & xAttrList,
- XMLEventsImportContext * rEvents,
- const OUString & rApiEventName,
- const OUString & rLanguage)
-{
- OUString sURLVal;
-
- sal_Int16 nCount = xAttrList->getLength();
- for (sal_Int16 nAttr = 0; nAttr < nCount; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().
- GetKeyByAttrName(xAttrList->getNameByIndex(nAttr), &sLocalName);
-
- if (XML_NAMESPACE_XLINK == nPrefix)
- {
- if (IsXMLToken(sLocalName, XML_HREF))
- sURLVal = xAttrList->getValueByIndex(nAttr);
- // else: ignore
- }
- // else ignore
- }
-
- Sequence<PropertyValue> aValues(2);
-
- // EventType
- aValues[0].Name = sEventType;
- aValues[0].Value <<= sScript;
-
- // URL
- aValues[1].Name = sURL;
- aValues[1].Value <<= sURLVal;
-
- // add values for event now
- rEvents->AddEventValues(rApiEventName, aValues);
-
- // return dummy context
- return new SvXMLImportContext(rImport, nPrefix, rLocalName);
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/script/xmloff_XMLScriptExportHandler.cxx b/binfilter/bf_xmloff/source/script/xmloff_XMLScriptExportHandler.cxx
deleted file mode 100644
index f0ca4eb78e29..000000000000
--- a/binfilter/bf_xmloff/source/script/xmloff_XMLScriptExportHandler.cxx
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLScriptExportHandler.hxx"
-
-
-
-#include "xmlexp.hxx"
-
-
-#include "xmlnmspe.hxx"
-namespace binfilter {
-
-
-using namespace ::com::sun::star::uno;
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::PropertyValue;
-
-
-XMLScriptExportHandler::XMLScriptExportHandler() :
- sURL(RTL_CONSTASCII_USTRINGPARAM("Script"))
-{
-}
-
-XMLScriptExportHandler::~XMLScriptExportHandler()
-{
-}
-
-void XMLScriptExportHandler::Export(
- SvXMLExport& rExport,
- const OUString& rEventName,
- Sequence<PropertyValue> & rValues,
- sal_Bool bUseWhitespace)
-{
- rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_LANGUAGE, XML_SCRIPT);
- rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, rEventName);
-
- sal_Int32 nCount = rValues.getLength();
- for(sal_Int32 i = 0; i < nCount; i++)
- {
- if (sURL.equals(rValues[i].Name))
- {
- OUString sTmp;
- rValues[i].Value >>= sTmp;
- rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, sTmp);
- }
- // else: disregard
- }
-
- SvXMLElementExport aEventElemt(rExport, XML_NAMESPACE_SCRIPT, XML_EVENT,
- bUseWhitespace, sal_False);
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/script/xmloff_XMLStarBasicContextFactory.cxx b/binfilter/bf_xmloff/source/script/xmloff_XMLStarBasicContextFactory.cxx
deleted file mode 100644
index e5f5e28eab63..000000000000
--- a/binfilter/bf_xmloff/source/script/xmloff_XMLStarBasicContextFactory.cxx
+++ /dev/null
@@ -1,128 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLStarBasicContextFactory.hxx"
-
-#include "XMLEventsImportContext.hxx"
-
-
-#include "xmlimp.hxx"
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-namespace binfilter {
-
-
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Any;
-
-
-XMLStarBasicContextFactory::XMLStarBasicContextFactory() :
- sEventType(RTL_CONSTASCII_USTRINGPARAM("EventType")),
- sLibrary(RTL_CONSTASCII_USTRINGPARAM("Library")),
- sMacroName(RTL_CONSTASCII_USTRINGPARAM("MacroName")),
- sStarBasic(RTL_CONSTASCII_USTRINGPARAM("StarBasic"))
-{
-}
-
-XMLStarBasicContextFactory::~XMLStarBasicContextFactory()
-{
-}
-
-SvXMLImportContext* XMLStarBasicContextFactory::CreateContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList,
- XMLEventsImportContext* rEvents,
- const OUString& rApiEventName,
- const OUString& rLanguage)
-{
- OUString sLibraryVal;
- OUString sMacroNameVal;
-
- sal_Int16 nCount = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nCount; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr), &sLocalName );
-
- if (XML_NAMESPACE_SCRIPT == nPrefix)
- {
- if (IsXMLToken(sLocalName, XML_LIBRARY))
- {
- sLibraryVal = xAttrList->getValueByIndex(nAttr);
- }
- if (IsXMLToken(sLocalName, XML_LOCATION))
- {
- sLibraryVal = xAttrList->getValueByIndex(nAttr);
- if ( IsXMLToken( sLibraryVal, XML_APPLICATION ) )
- sLibraryVal =
- OUString(RTL_CONSTASCII_USTRINGPARAM("StarOffice"));
- }
- else if (IsXMLToken(sLocalName, XML_MACRO_NAME))
- {
- sMacroNameVal = xAttrList->getValueByIndex(nAttr);
- }
- // else: ingore
- }
- // else: ignore
- }
-
- Sequence<PropertyValue> aValues(3);
-
- // EventType
- aValues[0].Name = sEventType;
- aValues[0].Value <<= sStarBasic;
-
- // library name
- aValues[1].Name = sLibrary;
- aValues[1].Value <<= sLibraryVal;
-
- // macro name
- aValues[2].Name = sMacroName;
- aValues[2].Value <<= sMacroNameVal;
-
- // add values for event now
- rEvents->AddEventValues(rApiEventName, aValues);
-
- // return dummy context
- return new SvXMLImportContext(rImport, nPrefix, rLocalName);
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/script/xmloff_XMLStarBasicExportHandler.cxx b/binfilter/bf_xmloff/source/script/xmloff_XMLStarBasicExportHandler.cxx
deleted file mode 100644
index 1e98b02d8178..000000000000
--- a/binfilter/bf_xmloff/source/script/xmloff_XMLStarBasicExportHandler.cxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLStarBasicExportHandler.hxx"
-
-
-
-#include "xmlexp.hxx"
-
-
-#include "xmlnmspe.hxx"
-namespace binfilter {
-
-
-using namespace ::com::sun::star::uno;
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::PropertyValue;
-
-
-XMLStarBasicExportHandler::XMLStarBasicExportHandler() :
- sStarBasic(RTL_CONSTASCII_USTRINGPARAM("StarBasic")),
- sStarOffice(RTL_CONSTASCII_USTRINGPARAM("StarOffice")),
- sApplication(RTL_CONSTASCII_USTRINGPARAM("application")),
- sLibrary(RTL_CONSTASCII_USTRINGPARAM("Library")),
- sMacroName(RTL_CONSTASCII_USTRINGPARAM("MacroName"))
-{
-}
-
-XMLStarBasicExportHandler::~XMLStarBasicExportHandler()
-{
-}
-
-void XMLStarBasicExportHandler::Export(
- SvXMLExport& rExport,
- const OUString& rEventName,
- Sequence<PropertyValue> & rValues,
- sal_Bool bUseWhitespace)
-{
- rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_LANGUAGE, sStarBasic);
- rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, rEventName);
-
- sal_Int32 nCount = rValues.getLength();
- for(sal_Int32 i = 0; i < nCount; i++)
- {
- if (sLibrary.equals(rValues[i].Name))
- {
- OUString sTmp;
- rValues[i].Value >>= sTmp;
- rExport.AddAttribute(
- XML_NAMESPACE_SCRIPT, XML_LOCATION,
- (sTmp.equalsIgnoreAsciiCase(sApplication) || sTmp.equalsIgnoreAsciiCase(sStarOffice) ) ? XML_APPLICATION
- : XML_DOCUMENT );
- }
- else if (sMacroName.equals(rValues[i].Name))
- {
- OUString sTmp;
- rValues[i].Value >>= sTmp;
- rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_MACRO_NAME, sTmp);
- }
- // else: disregard
- }
-
- SvXMLElementExport aEventElemt(rExport, XML_NAMESPACE_SCRIPT, XML_EVENT,
- bUseWhitespace, sal_False);
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/script/xmloff_xmlbasici.cxx b/binfilter/bf_xmloff/source/script/xmloff_xmlbasici.cxx
deleted file mode 100644
index 336c922c3833..000000000000
--- a/binfilter/bf_xmloff/source/script/xmloff_xmlbasici.cxx
+++ /dev/null
@@ -1,208 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "xmlbasici.hxx"
-
-#include "attrlist.hxx"
-#include "nmspmap.hxx"
-#include "xmlimp.hxx"
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-
-
-//.........................................................................
-namespace binfilter
-{
-//.........................................................................
-
- // =============================================================================
- // XMLBasicImportContext
- // =============================================================================
-
- XMLBasicImportContext::XMLBasicImportContext( SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName,
- const Reference< frame::XModel >& rxModel )
- :SvXMLImportContext( rImport, nPrfx, rLName )
- ,m_xModel( rxModel )
- {
- Reference< lang::XMultiServiceFactory > xMSF = GetImport().getServiceFactory();
- if ( xMSF.is() )
- {
- m_xHandler.set( xMSF->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.XMLBasicImporter" ) ) ),
- UNO_QUERY );
- }
-
- if ( m_xHandler.is() )
- {
- Reference< document::XImporter > xImporter( m_xHandler, UNO_QUERY );
- if ( xImporter.is() )
- {
- Reference< lang::XComponent > xComp( m_xModel, UNO_QUERY );
- xImporter->setTargetDocument( xComp );
- }
- }
- }
-
- // -----------------------------------------------------------------------------
-
- XMLBasicImportContext::~XMLBasicImportContext()
- {
- }
-
- // -----------------------------------------------------------------------------
-
- SvXMLImportContext* XMLBasicImportContext::CreateChildContext(
- USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const Reference< xml::sax::XAttributeList >& rxAttrList )
- {
- SvXMLImportContext* pContext = 0;
-
- if ( m_xHandler.is() )
- pContext = new XMLBasicImportChildContext( GetImport(), nPrefix, rLocalName, m_xHandler );
-
- if ( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
- return pContext;
- }
-
- // -----------------------------------------------------------------------------
-
- void XMLBasicImportContext::StartElement(
- const Reference< xml::sax::XAttributeList >& rxAttrList )
- {
- if ( m_xHandler.is() )
- {
- m_xHandler->startDocument();
-
- // copy namespace declarations
- SvXMLAttributeList* pAttrList = new SvXMLAttributeList( rxAttrList );
- Reference< xml::sax::XAttributeList > xAttrList( pAttrList );
- const SvXMLNamespaceMap& rNamespaceMap = GetImport().GetNamespaceMap();
- sal_uInt16 nPos = rNamespaceMap.GetFirstKey();
- while ( nPos != USHRT_MAX )
- {
- ::rtl::OUString aAttrName( rNamespaceMap.GetAttrNameByKey( nPos ) );
- if ( xAttrList->getValueByName( aAttrName ).getLength() == 0 )
- pAttrList->AddAttribute( aAttrName, rNamespaceMap.GetNameByKey( nPos ) );
- nPos = rNamespaceMap.GetNextKey( nPos );
- }
-
- m_xHandler->startElement(
- GetImport().GetNamespaceMap().GetQNameByKey( GetPrefix(), GetLocalName() ),
- xAttrList );
- }
- }
-
- // -----------------------------------------------------------------------------
-
- void XMLBasicImportContext::EndElement()
- {
- if ( m_xHandler.is() )
- {
- m_xHandler->endElement(
- GetImport().GetNamespaceMap().GetQNameByKey( GetPrefix(), GetLocalName() ) );
- m_xHandler->endDocument();
- }
- }
-
- // -----------------------------------------------------------------------------
-
- void XMLBasicImportContext::Characters( const ::rtl::OUString& rChars )
- {
- if ( m_xHandler.is() )
- m_xHandler->characters( rChars );
- }
-
-
- // =============================================================================
- // XMLBasicImportChildContext
- // =============================================================================
-
- XMLBasicImportChildContext::XMLBasicImportChildContext( SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName,
- const Reference< xml::sax::XDocumentHandler >& rxHandler )
- :SvXMLImportContext( rImport, nPrfx, rLName )
- ,m_xHandler( rxHandler )
- {
- }
-
- // -----------------------------------------------------------------------------
-
- XMLBasicImportChildContext::~XMLBasicImportChildContext()
- {
- }
-
- // -----------------------------------------------------------------------------
-
- SvXMLImportContext* XMLBasicImportChildContext::CreateChildContext(
- USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const Reference< xml::sax::XAttributeList >& xAttrList )
- {
- return new XMLBasicImportChildContext( GetImport(), nPrefix, rLocalName, m_xHandler );
- }
-
- // -----------------------------------------------------------------------------
-
- void XMLBasicImportChildContext::StartElement(
- const Reference< xml::sax::XAttributeList >& xAttrList )
- {
- if ( m_xHandler.is() )
- {
- m_xHandler->startElement(
- GetImport().GetNamespaceMap().GetQNameByKey( GetPrefix(), GetLocalName() ),
- xAttrList );
- }
- }
-
- // -----------------------------------------------------------------------------
-
- void XMLBasicImportChildContext::EndElement()
- {
- if ( m_xHandler.is() )
- {
- m_xHandler->endElement(
- GetImport().GetNamespaceMap().GetQNameByKey( GetPrefix(), GetLocalName() ) );
- }
- }
-
- // -----------------------------------------------------------------------------
-
- void XMLBasicImportChildContext::Characters( const ::rtl::OUString& rChars )
- {
- if ( m_xHandler.is() )
- m_xHandler->characters( rChars );
- }
-
- // -----------------------------------------------------------------------------
-
-//.........................................................................
-} // namespace binfilter
-//.........................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/script/xmloff_xmlscripti.cxx b/binfilter/bf_xmloff/source/script/xmloff_xmlscripti.cxx
deleted file mode 100644
index 1a797dfecef2..000000000000
--- a/binfilter/bf_xmloff/source/script/xmloff_xmlscripti.cxx
+++ /dev/null
@@ -1,344 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include "xmlscripti.hxx"
-#include "xmlnmspe.hxx"
-#include "xmlimp.hxx"
-#include "nmspmap.hxx"
-#include "XMLEventsImportContext.hxx"
-#include "xmlbasici.hxx"
-
-#include <com/sun/star/script/XStarBasicAccess.hpp>
-#include <com/sun/star/document/XEventsSupplier.hpp>
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::script;
-using namespace ::com::sun::star::document;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-
-//-------------------------------------------------------------------------
-
-class XMLScriptElementContext;
-
-class XMLScriptModuleContext : public SvXMLImportContext
-{
-private:
- XMLScriptElementContext& mrParent;
- OUString msSource;
- Reference<XStarBasicAccess> mxBasicAccess;
-
- OUString msLibName;
- OUString msModuleName;
- OUString msLanguage;
-
-public:
- XMLScriptModuleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName, const OUString& aLibName,
- const Reference<XAttributeList>& xAttrList,
- XMLScriptElementContext& rParentContext,
- Reference<XStarBasicAccess> xBasicAccess );
-
- virtual ~XMLScriptModuleContext();
-
- virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
- const OUString& rLName,
- const Reference<XAttributeList>& xAttrList );
- virtual void EndElement();
- virtual void Characters( const ::rtl::OUString& rChars );
-};
-
-//-------------------------------------------------------------------------
-
-class XMLScriptElementContext : public SvXMLImportContext
-{
-private:
- XMLScriptContext& mrParent;
- OUString msLName;
- OUString msContent;
- Reference<XStarBasicAccess> mxBasicAccess;
-
- OUString msLibName;
-
-public:
- XMLScriptElementContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference<XAttributeList>& xAttrList,
- XMLScriptContext& rParentContext,
- Reference<XStarBasicAccess> xBasicAccess );
- virtual ~XMLScriptElementContext();
-
- virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
- const OUString& rLName,
- const Reference<XAttributeList>& xAttrList );
- virtual void EndElement();
- virtual void Characters( const ::rtl::OUString& rChars );
-};
-
-
-//-------------------------------------------------------------------------
-
-XMLScriptElementContext::~XMLScriptElementContext()
-{
- mrParent.ReleaseRef();
-}
-
-
-SvXMLImportContext* XMLScriptElementContext::CreateChildContext( sal_uInt16 nPrefix,
- const OUString& rLName,
- const Reference<XAttributeList>& xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
-
- if ( XML_NAMESPACE_SCRIPT == nPrefix)
- {
- if( IsXMLToken( msLName, XML_LIBRARY_EMBEDDED ) )
- {
- if( IsXMLToken( rLName, XML_MODULE ) )
- {
- pContext = new XMLScriptModuleContext( GetImport(), nPrefix,
- rLName, msLibName, xAttrList, *this, mxBasicAccess );
- }
- //else if( IsXMLToken( rLName, XML_DIALOG ) )
- //{
- //pContext = new XMLScriptDialogContext( GetImport(),
- //nPrefix, rLName, xAttrList, *this, mxBasicAccess );
- //}
- }
- }
- // else: unknown namespace: ignore
-
- if ( !pContext )
- {
- // default context to ignore unknown elements
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
- }
- return pContext;
-}
-
-void XMLScriptElementContext::EndElement()
-{
-}
-
-void XMLScriptElementContext::Characters( const ::rtl::OUString& rChars )
-{
- msContent += rChars;
-}
-
-//-------------------------------------------------------------------------
-
-XMLScriptModuleContext::XMLScriptModuleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName, const OUString& aLibName,
- const Reference<XAttributeList>& xAttrList,
- XMLScriptElementContext& rParentContext,
- Reference<XStarBasicAccess> xBasicAccess )
- : SvXMLImportContext( rImport, nPrfx, rLName )
- , msLibName( aLibName )
- , mrParent( rParentContext )
- , mxBasicAccess( xBasicAccess )
-{
- mrParent.AddRef();
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i = 0 ; i < nAttrCount ; i++ )
- {
- OUString sFullAttrName = xAttrList->getNameByIndex( i );
- OUString sAttrName;
- sal_Int16 nAttrPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( sFullAttrName,
- &sAttrName );
-
- if( (XML_NAMESPACE_SCRIPT == nAttrPrefix) &&
- IsXMLToken( sAttrName, XML_NAME ) )
- {
- msModuleName = xAttrList->getValueByIndex( i );
- }
- else if( (XML_NAMESPACE_SCRIPT == nAttrPrefix) &&
- IsXMLToken( sAttrName, XML_LANGUAGE ) )
- {
- msLanguage = xAttrList->getValueByIndex( i );
- }
- }
-}
-
-XMLScriptModuleContext::~XMLScriptModuleContext()
-{
- mrParent.ReleaseRef();
-}
-
-SvXMLImportContext* XMLScriptModuleContext::CreateChildContext( sal_uInt16 nPrefix,
- const OUString& rLName,
- const Reference<XAttributeList>& xAttrList )
-{
- SvXMLImportContext* pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
- return pContext;
-}
-
-void XMLScriptModuleContext::EndElement()
-{
- mxBasicAccess->addModule( msLibName, msModuleName, msLanguage, msSource );
-}
-
-void XMLScriptModuleContext::Characters( const ::rtl::OUString& rChars )
-{
- msSource += rChars;
-}
-
-// =============================================================================
-// XMLScriptChildContext: context for <office:script-data> element
-// =============================================================================
-
-class XMLScriptChildContext : public SvXMLImportContext
-{
-private:
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel;
- ::rtl::OUString m_aLanguage;
-
-public:
- XMLScriptChildContext( SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& rxModel,
- const ::rtl::OUString& rLanguage );
- virtual ~XMLScriptChildContext();
-
- virtual SvXMLImportContext* CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
- virtual void EndElement();
-};
-
-// -----------------------------------------------------------------------------
-
-XMLScriptChildContext::XMLScriptChildContext( SvXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName,
- const Reference< frame::XModel >& rxModel, const ::rtl::OUString& rLanguage )
- :SvXMLImportContext( rImport, nPrfx, rLName )
- ,m_xModel( rxModel )
- ,m_aLanguage( rLanguage )
-{
-}
-
-// -----------------------------------------------------------------------------
-
-XMLScriptChildContext::~XMLScriptChildContext()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-SvXMLImportContext* XMLScriptChildContext::CreateChildContext(
- USHORT nPrefix, const ::rtl::OUString& rLocalName,
- const Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
-
- ::rtl::OUString aBasic( RTL_CONSTASCII_USTRINGPARAM( "Basic" ) );
-
- if ( m_aLanguage == aBasic && nPrefix == XML_NAMESPACE_SCRIPT && IsXMLToken( rLocalName, XML_LIBRARIES ) )
- pContext = new XMLBasicImportContext( GetImport(), nPrefix, rLocalName, m_xModel );
-
- if ( !pContext )
- pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList );
-
- return pContext;
-}
-
-// -----------------------------------------------------------------------------
-
-void XMLScriptChildContext::EndElement()
-{
-}
-
-// =============================================================================
-// XMLScriptContext: context for <office:script> element
-// =============================================================================
-
-XMLScriptContext::XMLScriptContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName,
- const Reference<XModel>& rDocModel )
- :SvXMLImportContext( rImport, nPrfx, rLName )
- ,m_xModel( rDocModel )
-{
-}
-
-// -----------------------------------------------------------------------------
-
-XMLScriptContext::~XMLScriptContext()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-SvXMLImportContext* XMLScriptContext::CreateChildContext(
- sal_uInt16 nPrefix, const OUString& rLName,
- const Reference<XAttributeList>& xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
-
- if ( nPrefix == XML_NAMESPACE_OFFICE )
- {
- if ( IsXMLToken( rLName, XML_EVENTS ) )
- {
- Reference< XEventsSupplier > xSupplier( GetImport().GetModel(), UNO_QUERY );
- pContext = new XMLEventsImportContext( GetImport(), nPrefix, rLName, xSupplier );
- }
- else if ( IsXMLToken( rLName, XML_SCRIPT_DATA ) )
- {
- ::rtl::OUString aAttrName( GetImport().GetNamespaceMap().GetPrefixByKey( XML_NAMESPACE_SCRIPT ) );
- aAttrName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ":language" ) );
- if ( xAttrList.is() )
- {
- ::rtl::OUString aLanguage = xAttrList->getValueByName( aAttrName );
- pContext = new XMLScriptChildContext( GetImport(), nPrefix, rLName, m_xModel, aLanguage );
- }
- }
- }
-
- if ( !pContext )
- pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLName, xAttrList);
-
- return pContext;
-}
-
-// -----------------------------------------------------------------------------
-
-void XMLScriptContext::EndElement()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/DrawAspectHdl.hxx b/binfilter/bf_xmloff/source/style/DrawAspectHdl.hxx
deleted file mode 100644
index 13d7fc5ab158..000000000000
--- a/binfilter/bf_xmloff/source/style/DrawAspectHdl.hxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_DRAWASPECTHDL_HXX
-#define _XMLOFF_DRAWASPECTHDL_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class DrawAspectHdl : public XMLPropertyHandler
-{
-public:
- virtual ~DrawAspectHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_DRAWASPECTHDL_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/FillStyleContext.hxx b/binfilter/bf_xmloff/source/style/FillStyleContext.hxx
deleted file mode 100644
index 4b219d11e608..000000000000
--- a/binfilter/bf_xmloff/source/style/FillStyleContext.hxx
+++ /dev/null
@@ -1,174 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_FILLSTYLECONTEXTS_HXX_
-#define _XMLOFF_FILLSTYLECONTEXTS_HXX_
-
-#include <com/sun/star/io/XOutputStream.hpp>
-
-#include <xmlstyle.hxx>
-
-#include "rtl/ustring.hxx"
-namespace binfilter {
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:gardient context
-
-class XMLGradientStyleContext: public SvXMLStyleContext
-{
-private:
- ::com::sun::star::uno::Any maAny;
- ::rtl::OUString maStrName;
-
-public:
- TYPEINFO();
-
- XMLGradientStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual ~XMLGradientStyleContext();
-
- virtual void EndElement();
-
- virtual BOOL IsTransient() const;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:hatch context
-
-class XMLHatchStyleContext: public SvXMLStyleContext
-{
-private:
- ::com::sun::star::uno::Any maAny;
- ::rtl::OUString maStrName;
-
-public:
- TYPEINFO();
-
- XMLHatchStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual ~XMLHatchStyleContext();
-
- virtual void EndElement();
-
- virtual BOOL IsTransient() const;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:fill-image context
-
-class XMLBitmapStyleContext: public SvXMLStyleContext
-{
-private:
- ::com::sun::star::uno::Any maAny;
- ::rtl::OUString maStrName;
- ::com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > mxBase64Stream;
-
-public:
- TYPEINFO();
-
- XMLBitmapStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual ~XMLBitmapStyleContext();
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
-
- virtual void EndElement();
-
- virtual BOOL IsTransient() const;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:transparency context
-
-class XMLTransGradientStyleContext: public SvXMLStyleContext
-{
-private:
- ::com::sun::star::uno::Any maAny;
- ::rtl::OUString maStrName;
-
-public:
- TYPEINFO();
-
- XMLTransGradientStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual ~XMLTransGradientStyleContext();
-
- virtual void EndElement();
-
- virtual BOOL IsTransient() const;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:marker context
-
-class XMLMarkerStyleContext: public SvXMLStyleContext
-{
-private:
- ::com::sun::star::uno::Any maAny;
- ::rtl::OUString maStrName;
-
-public:
- TYPEINFO();
-
- XMLMarkerStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual ~XMLMarkerStyleContext();
-
- virtual void EndElement();
-
- virtual BOOL IsTransient() const;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// draw:marker context
-
-class XMLDashStyleContext: public SvXMLStyleContext
-{
-private:
- ::com::sun::star::uno::Any maAny;
- ::rtl::OUString maStrName;
-
-public:
- TYPEINFO();
-
- XMLDashStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual ~XMLDashStyleContext();
-
- virtual void EndElement();
-
- virtual BOOL IsTransient() const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_FILLSTYLECONTEXTS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/PageHeaderFooterContext.hxx b/binfilter/bf_xmloff/source/style/PageHeaderFooterContext.hxx
deleted file mode 100644
index 955542588a71..000000000000
--- a/binfilter/bf_xmloff/source/style/PageHeaderFooterContext.hxx
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _XMLOFF_PAGEHEADERFOOTERCONTEXT_HXX
-#define _XMLOFF_PAGEHEADERFOOTERCONTEXT_HXX
-
-#include "xmlimp.hxx"
-namespace binfilter {
-
-class PageHeaderFooterContext : public SvXMLImportContext
-{
- ::std::vector< XMLPropertyState > & rProperties;
- sal_Int32 nStartIndex;
- sal_Int32 nEndIndex;
- sal_Bool bHeader;
- const UniReference < SvXMLImportPropertyMapper > rMap;
-
-public:
-
- PageHeaderFooterContext( SvXMLImport& rImport, USHORT nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::std::vector< XMLPropertyState > & rProperties,
- const UniReference < SvXMLImportPropertyMapper > &rMap,
- sal_Int32 nStartIndex, sal_Int32 nEndIndex,
- const sal_Bool bHeader);
-
- virtual ~PageHeaderFooterContext();
-
- virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
-
- virtual void EndElement();
-};
-
-}//end of namespace binfilter
-#endif
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/PageMasterExportPropMapper.hxx b/binfilter/bf_xmloff/source/style/PageMasterExportPropMapper.hxx
deleted file mode 100644
index c58a1a315f48..000000000000
--- a/binfilter/bf_xmloff/source/style/PageMasterExportPropMapper.hxx
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PAGEMASTEREXPORTPROPMAPPER_HXX
-#define _XMLOFF_PAGEMASTEREXPORTPROPMAPPER_HXX
-
-#include "xmlexppr.hxx"
-#include "XMLBackgroundImageExport.hxx"
-#include "XMLTextColumnsExport.hxx"
-#include "XMLFootnoteSeparatorExport.hxx"
-namespace binfilter {
-
-//______________________________________________________________________________
-
-class XMLPageMasterExportPropMapper : public SvXMLExportPropertyMapper
-{
-protected:
- XMLBackgroundImageExport aBackgroundImageExport;
- XMLTextColumnsExport aTextColumnsExport;
- XMLFootnoteSeparatorExport aFootnoteSeparatorExport;
-
- virtual void ContextFilter(
- ::std::vector< XMLPropertyState >& rProperties,
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rPropSet
- ) const;
-
-public:
- XMLPageMasterExportPropMapper(
- const UniReference< XMLPropertySetMapper >& rMapper,
- SvXMLExport& rExport
- );
- virtual ~XMLPageMasterExportPropMapper();
-
- virtual void handleElementItem(
- SvXMLExport& rExport,
- const XMLPropertyState& rProperty,
- sal_uInt16 nFlags,
- const ::std::vector< XMLPropertyState >* pProperties = 0,
- sal_uInt32 nIdx = 0
- ) const;
- virtual void handleSpecialItem(
- SvXMLAttributeList& rAttrList,
- const XMLPropertyState& rProperty,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap,
- const ::std::vector< XMLPropertyState >* pProperties = 0,
- sal_uInt32 nIdx = 0
- ) const;
-
- inline XMLBackgroundImageExport& GetBackgroundImageExport()
- { return aBackgroundImageExport; }
-
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/PageMasterImportPropMapper.hxx b/binfilter/bf_xmloff/source/style/PageMasterImportPropMapper.hxx
deleted file mode 100644
index 18e9f0ceb4d8..000000000000
--- a/binfilter/bf_xmloff/source/style/PageMasterImportPropMapper.hxx
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PAGEMASTERIMPORTPROPMAPPER_HXX
-#define _XMLOFF_PAGEMASTERIMPORTPROPMAPPER_HXX
-
-#include "xmlimppr.hxx"
-namespace binfilter {
-
-class SvXMLImport;
-
-class PageMasterImportPropertyMapper : public SvXMLImportPropertyMapper
-{
- SvXMLImport& rImport;
-
-protected:
-
-public:
-
- PageMasterImportPropertyMapper(
- const UniReference< XMLPropertySetMapper >& rMapper,
- SvXMLImport& rImp);
- virtual ~PageMasterImportPropertyMapper();
-
- /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_IMPORT flag set */
- virtual sal_Bool handleSpecialItem(
- XMLPropertyState& rProperty,
- ::std::vector< XMLPropertyState >& rProperties,
- const ::rtl::OUString& rValue,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap ) const;
-
- /** This method is called when all attributes have been processed. It may be used to remove items that are incomplete */
- virtual void finished(
- ::std::vector< XMLPropertyState >& rProperties,
- sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const;
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/PageMasterPropHdl.hxx b/binfilter/bf_xmloff/source/style/PageMasterPropHdl.hxx
deleted file mode 100644
index bbd062833373..000000000000
--- a/binfilter/bf_xmloff/source/style/PageMasterPropHdl.hxx
+++ /dev/null
@@ -1,186 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PAGEMASTERPROPHDL_HXX_
-#define _XMLOFF_PAGEMASTERPROPHDL_HXX_
-
-#include "xmlprhdl.hxx"
-
-#include "rtl/ustring.hxx"
-
-#include "xmltoken.hxx"
-namespace binfilter {
-
-
-//______________________________________________________________________________
-// property handler for style:page-usage (style::PageStyleLayout)
-
-class XMLPMPropHdl_PageStyleLayout : public XMLPropertyHandler
-{
-public:
- virtual ~XMLPMPropHdl_PageStyleLayout();
- virtual sal_Bool equals(
- const ::com::sun::star::uno::Any& rAny1,
- const ::com::sun::star::uno::Any& rAny2
- ) const;
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter
- ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter
- ) const;
-};
-
-
-//______________________________________________________________________________
-// property handler for style:num-format (style::NumberingType)
-
-class XMLPMPropHdl_NumFormat : public XMLPropertyHandler
-{
-public:
- virtual ~XMLPMPropHdl_NumFormat();
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter
- ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter
- ) const;
-};
-
-
-//______________________________________________________________________________
-// property handler for style:num-letter-sync (style::NumberingType)
-
-class XMLPMPropHdl_NumLetterSync : public XMLPropertyHandler
-{
-public:
- virtual ~XMLPMPropHdl_NumLetterSync();
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter
- ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter
- ) const;
-};
-
-
-//______________________________________________________________________________
-// property handler for style:paper-tray-number
-
-class XMLPMPropHdl_PaperTrayNumber : public XMLPropertyHandler
-{
-public:
- virtual ~XMLPMPropHdl_PaperTrayNumber();
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter
- ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter
- ) const;
-};
-
-
-//______________________________________________________________________________
-// property handler for style:print
-
-class XMLPMPropHdl_Print : public XMLPropertyHandler
-{
-protected:
- ::rtl::OUString sAttrValue;
-
-public:
- XMLPMPropHdl_Print( enum ::binfilter::xmloff::token::XMLTokenEnum eValue );
- virtual ~XMLPMPropHdl_Print();
-
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter
- ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter
- ) const;
-};
-
-//______________________________________________________________________________
-// property handler for style:table-centering
-
-class XMLPMPropHdl_CenterHorizontal : public XMLPropertyHandler
-{
-public:
- virtual ~XMLPMPropHdl_CenterHorizontal();
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter
- ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter
- ) const;
-};
-
-class XMLPMPropHdl_CenterVertical : public XMLPropertyHandler
-{
-public:
- virtual ~XMLPMPropHdl_CenterVertical();
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter
- ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter
- ) const;
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/PageMasterPropHdlFactory.hxx b/binfilter/bf_xmloff/source/style/PageMasterPropHdlFactory.hxx
deleted file mode 100644
index 436a32801cfb..000000000000
--- a/binfilter/bf_xmloff/source/style/PageMasterPropHdlFactory.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PAGEMASTERPROPHDLFACTORY_HXX
-#define _XMLOFF_PAGEMASTERPROPHDLFACTORY_HXX
-
-#include "prhdlfac.hxx"
-namespace binfilter {
-
-
-//______________________________________________________________________________
-
-class XMLPageMasterPropHdlFactory : public XMLPropertyHandlerFactory
-{
-public:
- XMLPageMasterPropHdlFactory();
- virtual ~XMLPageMasterPropHdlFactory();
-
- virtual const XMLPropertyHandler*
- GetPropertyHandler( sal_Int32 nType ) const;
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/PageMasterPropMapper.hxx b/binfilter/bf_xmloff/source/style/PageMasterPropMapper.hxx
deleted file mode 100644
index 71745a667283..000000000000
--- a/binfilter/bf_xmloff/source/style/PageMasterPropMapper.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PAGEMASTERPROPMAPPER_HXX_
-#define _XMLOFF_PAGEMASTERPROPMAPPER_HXX_
-
-#include "xmlprmap.hxx"
-namespace binfilter {
-
-
-//______________________________________________________________________________
-
-class XMLPageMasterPropSetMapper : public XMLPropertySetMapper
-{
-public:
- XMLPageMasterPropSetMapper();
- XMLPageMasterPropSetMapper(
- const XMLPropertyMapEntry* pEntries,
- const UniReference< XMLPropertyHandlerFactory >& rFactory );
- virtual ~XMLPageMasterPropSetMapper();
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/PagePropertySetContext.hxx b/binfilter/bf_xmloff/source/style/PagePropertySetContext.hxx
deleted file mode 100644
index f79ede483a50..000000000000
--- a/binfilter/bf_xmloff/source/style/PagePropertySetContext.hxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PAGEPROPERTYSETCONTEXT_HXX
-#define _XMLOFF_PAGEPROPERTYSETCONTEXT_HXX
-
-#include "xmlprcon.hxx"
-namespace binfilter {
-
-enum PageContextType
-{
- Page,
- Header,
- Footer
-};
-
-class PagePropertySetContext : public SvXMLPropertySetContext
-{
- PageContextType aType;
-
-public:
- PagePropertySetContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
- ::std::vector< XMLPropertyState > &rProps,
- const UniReference < SvXMLImportPropertyMapper > &rMap,
- sal_Int32 nStartIndex, sal_Int32 nEndIndex,
- const PageContextType aType );
-
- virtual ~PagePropertySetContext();
-
- virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
- ::std::vector< XMLPropertyState > &rProperties,
- const XMLPropertyState& rProp);
-};
-
-
-}//end of namespace binfilter
-#endif // _XMLOFF_XMLTEXTPROPERTYSETCONTEXT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/XMLFootnoteSeparatorExport.hxx b/binfilter/bf_xmloff/source/style/XMLFootnoteSeparatorExport.hxx
deleted file mode 100644
index 8a8a091a139a..000000000000
--- a/binfilter/bf_xmloff/source/style/XMLFootnoteSeparatorExport.hxx
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLFOOTNOTESEPARATOREXPORT_HXX
-#define _XMLOFF_XMLFOOTNOTESEPARATOREXPORT_HXX
-
-#include <sal/types.h>
-
-
-#include <vector>
-namespace binfilter {
-class SvXMLExport;
-class XMLPropertySetMapper;
-struct XMLPropertyState;
-template<class X> class UniReference;
-
-/**
- * export footnote separator element in page styles
- */
-class XMLFootnoteSeparatorExport
-{
- SvXMLExport& rExport;
-
-public:
-
- XMLFootnoteSeparatorExport(SvXMLExport& rExp);
-
- ~XMLFootnoteSeparatorExport();
-
- void exportXML(
- const ::std::vector<XMLPropertyState> * pProperties,
- sal_uInt32 nIdx,
- /// used only for debugging
- const UniReference<XMLPropertySetMapper> & rMapper);
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/XMLFootnoteSeparatorImport.hxx b/binfilter/bf_xmloff/source/style/XMLFootnoteSeparatorImport.hxx
deleted file mode 100644
index fd964c66c5dd..000000000000
--- a/binfilter/bf_xmloff/source/style/XMLFootnoteSeparatorImport.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLFOOTNOTESEPARATORIMPORT_HXX
-#define _XMLOFF_XMLFOOTNOTESEPARATORIMPORT_HXX
-
-
-
-#include "xmlictxt.hxx"
-
-#include "uniref.hxx"
-
-#include <vector>
-namespace rtl { class OUString; }
-namespace com { namespace sun { namespace star {
- namespace uno { template<class X> class Reference; }
- namespace xml { namespace sax { class XAttributeList; } }
-} } }
-namespace binfilter {
-
-
-class SvXMLImport;
-struct XMLPropertyState;
-class XMLPropertySetMapper;
-
-
-
-/**
- * Import the footnote-separator element in page styles.
- */
-class XMLFootnoteSeparatorImport : public SvXMLImportContext
-{
- ::std::vector<XMLPropertyState> & rProperties;
- UniReference<XMLPropertySetMapper> rMapper;
- sal_Int32 nPropIndex;
-
-public:
-
- TYPEINFO();
-
- XMLFootnoteSeparatorImport(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- ::std::vector<XMLPropertyState> & rProperties,
- const UniReference<XMLPropertySetMapper> & rMapperRef,
- sal_Int32 nIndex);
-
- ~XMLFootnoteSeparatorImport();
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/adjushdl.hxx b/binfilter/bf_xmloff/source/style/adjushdl.hxx
deleted file mode 100644
index f9deb75161a1..000000000000
--- a/binfilter/bf_xmloff/source/style/adjushdl.hxx
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_ADJUSTTYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_ADJUSTTYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLParaAdjustPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLParaAdjustPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLLastLineAdjustPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLLastLineAdjustPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_ADJUSTTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/backhdl.hxx b/binfilter/bf_xmloff/source/style/backhdl.hxx
deleted file mode 100644
index d4d2ba73e6b0..000000000000
--- a/binfilter/bf_xmloff/source/style/backhdl.hxx
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_BRUSHTYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_BRUSHTYPES_HXX
-
-#include <xmlprhdl.hxx>
-
-#include <com/sun/star/style/GraphicLocation.hpp>
-
-#include <com/sun/star/style/GraphicLocation.hpp>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLBackGraphicPositionPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLBackGraphicPositionPropHdl();
-
- /// TabStops will be imported/exported as XML-Elements. So the Import/Export-work must be done at another place.
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-
-private:
- void MergeXMLHoriPos( ::com::sun::star::style::GraphicLocation& ePos, ::com::sun::star::style::GraphicLocation eHori ) const;
- void MergeXMLVertPos( ::com::sun::star::style::GraphicLocation& ePos, ::com::sun::star::style::GraphicLocation eVert ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_BRUSHTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/bordrhdl.hxx b/binfilter/bf_xmloff/source/style/bordrhdl.hxx
deleted file mode 100644
index 8f0b9bb13f27..000000000000
--- a/binfilter/bf_xmloff/source/style/bordrhdl.hxx
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_BORDERTYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_BORDERTYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLBorderWidthHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLBorderWidthHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-class XMLBorderHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLBorderHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_CHARLOCALETYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/breakhdl.hxx b/binfilter/bf_xmloff/source/style/breakhdl.hxx
deleted file mode 100644
index 676379c3bb87..000000000000
--- a/binfilter/bf_xmloff/source/style/breakhdl.hxx
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_BREAKTYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_BREAKTYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLFmtBreakBeforePropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLFmtBreakBeforePropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLFmtBreakAfterPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLFmtBreakAfterPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_BREAKTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/cdouthdl.hxx b/binfilter/bf_xmloff/source/style/cdouthdl.hxx
deleted file mode 100644
index b5584e550012..000000000000
--- a/binfilter/bf_xmloff/source/style/cdouthdl.hxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_CROSSEDOUTTYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_CROSSEDOUTTYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLCrossedOutPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLCrossedOutPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_CROSSEDOUTTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/chrhghdl.hxx b/binfilter/bf_xmloff/source/style/chrhghdl.hxx
deleted file mode 100644
index 951c326ad567..000000000000
--- a/binfilter/bf_xmloff/source/style/chrhghdl.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_CHARHEIGHTTYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_CHARHEIGHTTYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLCharHeightHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLCharHeightHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-class XMLCharHeightPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLCharHeightPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-class XMLCharHeightDiffHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLCharHeightDiffHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_CHARHEIGHTTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/chrlohdl.hxx b/binfilter/bf_xmloff/source/style/chrlohdl.hxx
deleted file mode 100644
index 3c905e6a496b..000000000000
--- a/binfilter/bf_xmloff/source/style/chrlohdl.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_CHARLOCALETYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_CHARLOCALETYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLCharLanguageHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLCharLanguageHdl();
-
- virtual sal_Bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-class XMLCharCountryHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLCharCountryHdl();
-
- virtual sal_Bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_CHARLOCALETYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/csmaphdl.hxx b/binfilter/bf_xmloff/source/style/csmaphdl.hxx
deleted file mode 100644
index 74d1f95adf21..000000000000
--- a/binfilter/bf_xmloff/source/style/csmaphdl.hxx
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_CASEMAPTYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_CASEMAPTYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLCaseMapPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLCaseMapPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-class XMLCaseMapVariantHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLCaseMapVariantHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_CASEMAPTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/durationhdl.hxx b/binfilter/bf_xmloff/source/style/durationhdl.hxx
deleted file mode 100644
index 7468edccc84d..000000000000
--- a/binfilter/bf_xmloff/source/style/durationhdl.hxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_DURATIONS_HXX
-#define _XMLOFF_PROPERTYHANDLER_DURATIONS_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for a sal_int16 duration in ms:
-*/
-class XMLDurationMS16PropHdl_Impl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLDurationMS16PropHdl_Impl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_FMTSPLITTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/escphdl.hxx b/binfilter/bf_xmloff/source/style/escphdl.hxx
deleted file mode 100644
index 7d33d7553eeb..000000000000
--- a/binfilter/bf_xmloff/source/style/escphdl.hxx
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_ESCAPETYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_ESCAPETYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLEscapementPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLEscapementPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-class XMLEscapementHeightPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLEscapementHeightPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_ESCAPETYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/fonthdl.hxx b/binfilter/bf_xmloff/source/style/fonthdl.hxx
deleted file mode 100644
index fb255ea79ec5..000000000000
--- a/binfilter/bf_xmloff/source/style/fonthdl.hxx
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_FONTYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_FONTTYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLFontFamilyNamePropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLFontFamilyNamePropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLFontFamilyPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLFontFamilyPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLFontEncodingPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLFontEncodingPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLFontPitchPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLFontPitchPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_FONTTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/impastpl.hxx b/binfilter/bf_xmloff/source/style/impastpl.hxx
deleted file mode 100644
index c06a22163d29..000000000000
--- a/binfilter/bf_xmloff/source/style/impastpl.hxx
+++ /dev/null
@@ -1,217 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLASTPL_IMPL_HXX
-#define _XMLOFF_XMLASTPL_IMPL_HXX
-
-#include <sal/types.h>
-#include <tools/list.hxx>
-#include <bf_svtools/cntnrsrt.hxx>
-#include <rtl/ustring.hxx>
-#include <vector>
-#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/xml/sax/XAttributeList.hpp>
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-
-#include <maptype.hxx>
-#include <xmlexppr.hxx>
-namespace binfilter {
-
-class SvXMLAutoStylePoolP;
-class SvXMLAutoStylePoolParentsP_Impl;
-class SvXMLAutoStylePoolNamesP_Impl;
-class SvXMLAttributeList;
-class SvXMLExportPropertyMapper;
-class SvXMLExport;
-
-#define MAX_CACHE_SIZE 65536
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Implementationclass for stylefamily-information
-//
-
-typedef ::rtl::OUString *OUStringPtr;
-DECLARE_LIST( SvXMLAutoStylePoolCache_Impl, OUStringPtr )
-
-class XMLFamilyData_Impl
-{
-public:
- SvXMLAutoStylePoolCache_Impl *pCache;
- sal_uInt32 mnFamily;
- ::rtl::OUString maStrFamilyName;
- UniReference < SvXMLExportPropertyMapper > mxMapper;
-
- SvXMLAutoStylePoolParentsP_Impl* mpParentList;
- SvXMLAutoStylePoolNamesP_Impl* mpNameList;
- sal_uInt32 mnCount;
- sal_uInt32 mnName;
- ::rtl::OUString maStrPrefix;
- sal_Bool bAsFamily;
-
-public:
- XMLFamilyData_Impl( sal_Int32 nFamily, const ::rtl::OUString& rStrName,
- const UniReference < SvXMLExportPropertyMapper > & rMapper,
- const ::rtl::OUString& rStrPrefix, sal_Bool bAsFamily = sal_True );
-
- XMLFamilyData_Impl( sal_Int32 nFamily ) :
- mnFamily( nFamily ), mpParentList( NULL ),
- mpNameList( NULL ), mnCount( 0 ), mnName( 0 ),
- pCache( 0 )
- {}
- ~XMLFamilyData_Impl();
-
- friend int XMLFamilyDataSort_Impl( const XMLFamilyData_Impl& r1, const XMLFamilyData_Impl& r2 );
-
- void ClearEntries();
-};
-
-DECLARE_CONTAINER_SORT( XMLFamilyDataList_Impl, XMLFamilyData_Impl )
-
-///////////////////////////////////////////////////////////////////////////////
-//
-//
-//
-
-DECLARE_CONTAINER_SORT_DEL( SvXMLAutoStylePoolNamesP_Impl,
- ::rtl::OUString )
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Properties of a pool
-//
-
-class SvXMLAutoStylePoolPropertiesP_Impl
-{
- ::rtl::OUString msName;
- ::std::vector< XMLPropertyState > maProperties;
- sal_uInt32 mnPos;
-
-public:
-
- SvXMLAutoStylePoolPropertiesP_Impl( XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties );
-
- ~SvXMLAutoStylePoolPropertiesP_Impl()
- {
- }
-
- const ::rtl::OUString& GetName() const { return msName; }
- const ::std::vector< XMLPropertyState >& GetProperties() const { return maProperties; }
- sal_uInt32 GetPos() const { return mnPos; }
-};
-
-typedef SvXMLAutoStylePoolPropertiesP_Impl *SvXMLAutoStylePoolPropertiesPPtr;
-DECLARE_LIST( SvXMLAutoStylePoolPropertiesPList_Impl, SvXMLAutoStylePoolPropertiesPPtr )
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Parents of AutoStylePool's
-//
-
-class SvXMLAutoStylePoolParentP_Impl
-{
- ::rtl::OUString msParent;
- SvXMLAutoStylePoolPropertiesPList_Impl maPropertiesList;
-
-public:
-
- SvXMLAutoStylePoolParentP_Impl( const ::rtl::OUString & rParent ) :
- msParent( rParent )
- {
- }
-
- ~SvXMLAutoStylePoolParentP_Impl();
-
- sal_Bool Add( XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties, ::rtl::OUString& rName );
-
- ::rtl::OUString Find( const XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties ) const;
-
- const ::rtl::OUString& GetParent() const { return msParent; }
-
- const SvXMLAutoStylePoolPropertiesPList_Impl& GetPropertiesList() const
- {
- return maPropertiesList;
- }
-};
-
-DECLARE_CONTAINER_SORT_DEL( SvXMLAutoStylePoolParentsP_Impl,
- SvXMLAutoStylePoolParentP_Impl )
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Implementationclass of SvXMLAutoStylePool
-//
-
-class SvXMLAutoStylePoolP_Impl
-{
- SvXMLExport& rExport;
-
- XMLFamilyDataList_Impl maFamilyList;
-
-public:
-
- SvXMLAutoStylePoolP_Impl( SvXMLExport& rExport );
- ~SvXMLAutoStylePoolP_Impl();
-
- SvXMLExport& GetExport() const { return rExport; }
-
- void AddFamily( sal_Int32 nFamily, const ::rtl::OUString& rStrName,
- const UniReference < SvXMLExportPropertyMapper > & rMapper,
- const ::rtl::OUString& rStrPrefix, sal_Bool bAsFamily = sal_True );
- void RegisterName( sal_Int32 nFamily, const ::rtl::OUString& rName );
-
-// ::rtl::OUString Add( sal_Int32 nFamily, const ::rtl::OUString& rParent,
-// const ::std::vector< XMLPropertyState >& rProperties,
-// sal_Bool bCache = sal_False );
- sal_Bool Add( ::rtl::OUString& rName, sal_Int32 nFamily,
- const ::rtl::OUString& rParent,
- const ::std::vector< XMLPropertyState >& rProperties,
- sal_Bool bCache = sal_False );
-
- ::rtl::OUString Find( sal_Int32 nFamily, const ::rtl::OUString& rParent,
- const ::std::vector< XMLPropertyState >& rProperties ) const;
-
- void exportXML( sal_Int32 nFamily,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap,
- const SvXMLAutoStylePoolP *pAntiImpl) const;
-
- void ClearEntries();
-};
-
-struct SvXMLAutoStylePoolPExport_Impl
-{
- const ::rtl::OUString *mpParent;
- const SvXMLAutoStylePoolPropertiesP_Impl *mpProperties;
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/kernihdl.hxx b/binfilter/bf_xmloff/source/style/kernihdl.hxx
deleted file mode 100644
index b4d47a343b64..000000000000
--- a/binfilter/bf_xmloff/source/style/kernihdl.hxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_KERNINGTYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_KERNINGTYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLKerningPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLKerningPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_KERNINGTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/lspachdl.hxx b/binfilter/bf_xmloff/source/style/lspachdl.hxx
deleted file mode 100644
index 1c9e1961179d..000000000000
--- a/binfilter/bf_xmloff/source/style/lspachdl.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_LINESPACETYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_LINESPACETYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLLineHeightHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLLineHeightHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-class XMLLineHeightAtLeastHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLLineHeightAtLeastHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-class XMLLineSpacingHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLLineSpacingHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_CHARHEIGHTTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/makefile.mk b/binfilter/bf_xmloff/source/style/makefile.mk
deleted file mode 100644
index 1e9cbc59b7c6..000000000000
--- a/binfilter/bf_xmloff/source/style/makefile.mk
+++ /dev/null
@@ -1,132 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
-
-PRJ=..$/..$/..
-
-PRJNAME=binfilter
-TARGET=xmloff_style
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-CDEFS += -DCONV_STAR_FONTS
-INC+= -I$(PRJ)$/inc$/bf_xmloff
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/xmloff_XMLPercentOrMeasurePropertyHandler.obj \
- $(SLO)$/xmloff_XMLIsPercentagePropertyHandler.obj \
- $(SLO)$/xmloff_XMLRectangleMembersHandler.obj \
- $(SLO)$/xmloff_adjushdl.obj \
- $(SLO)$/xmloff_backhdl.obj \
- $(SLO)$/xmloff_bordrhdl.obj \
- $(SLO)$/xmloff_breakhdl.obj \
- $(SLO)$/xmloff_cdouthdl.obj \
- $(SLO)$/xmloff_chrhghdl.obj \
- $(SLO)$/xmloff_chrlohdl.obj \
- $(SLO)$/xmloff_csmaphdl.obj \
- $(SLO)$/xmloff_escphdl.obj \
- $(SLO)$/xmloff_fonthdl.obj \
- $(SLO)$/xmloff_impastp1.obj \
- $(SLO)$/xmloff_impastp2.obj \
- $(SLO)$/xmloff_impastp3.obj \
- $(SLO)$/xmloff_impastp4.obj \
- $(SLO)$/xmloff_kernihdl.obj \
- $(SLO)$/xmloff_lspachdl.obj \
- $(SLO)$/xmloff_numehelp.obj \
- $(SLO)$/xmloff_opaquhdl.obj \
- $(SLO)$/xmloff_postuhdl.obj \
- $(SLO)$/xmloff_prhdlfac.obj \
- $(SLO)$/xmloff_prstylei.obj \
- $(SLO)$/xmloff_shadwhdl.obj \
- $(SLO)$/xmloff_shdwdhdl.obj \
- $(SLO)$/xmloff_styleexp.obj \
- $(SLO)$/xmloff_splithdl.obj \
- $(SLO)$/xmloff_tabsthdl.obj \
- $(SLO)$/xmloff_undlihdl.obj \
- $(SLO)$/xmloff_uniref.obj \
- $(SLO)$/xmloff_weighhdl.obj \
- $(SLO)$/xmloff_xmlaustp.obj \
- $(SLO)$/xmloff_xmlbahdl.obj \
- $(SLO)$/xmloff_xmlexppr.obj \
- $(SLO)$/xmloff_xmlimppr.obj \
- $(SLO)$/xmloff_xmlnume.obj \
- $(SLO)$/xmloff_xmlnumfe.obj \
- $(SLO)$/xmloff_xmlnumfi.obj \
- $(SLO)$/xmloff_xmlnumi.obj \
- $(SLO)$/xmloff_xmlprcon.obj \
- $(SLO)$/xmloff_xmlprhdl.obj \
- $(SLO)$/xmloff_xmlprmap.obj \
- $(SLO)$/xmloff_xmlstyle.obj \
- $(SLO)$/xmloff_xmltabe.obj \
- $(SLO)$/xmloff_xmltabi.obj \
- $(SLO)$/xmloff_DashStyle.obj \
- $(SLO)$/xmloff_EnumPropertyHdl.obj \
- $(SLO)$/xmloff_FillStyleContext.obj \
- $(SLO)$/xmloff_GradientStyle.obj \
- $(SLO)$/xmloff_HatchStyle.obj \
- $(SLO)$/xmloff_ImageStyle.obj \
- $(SLO)$/xmloff_MarkerStyle.obj \
- $(SLO)$/xmloff_MultiPropertySetHelper.obj \
- $(SLO)$/xmloff_SinglePropertySetInfoCache.obj \
- $(SLO)$/xmloff_NamedBoolPropertyHdl.obj \
- $(SLO)$/xmloff_TransGradientStyle.obj \
- $(SLO)$/xmloff_XMLBackgroundImageContext.obj \
- $(SLO)$/xmloff_XMLBackgroundImageExport.obj \
- $(SLO)$/xmloff_XMLClipPropertyHandler.obj \
- $(SLO)$/xmloff_XMLConstantsPropertyHandler.obj \
- $(SLO)$/xmloff_AttributeContainerHandler.obj \
- $(SLO)$/xmloff_XMLElementPropertyContext.obj \
- $(SLO)$/xmloff_XMLFootnoteSeparatorExport.obj \
- $(SLO)$/xmloff_XMLFootnoteSeparatorImport.obj \
- $(SLO)$/xmloff_XMLFontAutoStylePool.obj \
- $(SLO)$/xmloff_XMLFontStylesContext.obj \
- $(SLO)$/xmloff_XMLPageExport.obj \
- $(SLO)$/xmloff_PageMasterPropHdl.obj \
- $(SLO)$/xmloff_PageMasterPropHdlFactory.obj \
- $(SLO)$/xmloff_PageMasterStyleMap.obj \
- $(SLO)$/xmloff_PageMasterPropMapper.obj \
- $(SLO)$/xmloff_PageMasterExportPropMapper.obj \
- $(SLO)$/xmloff_PageMasterImportPropMapper.obj \
- $(SLO)$/xmloff_PageMasterImportContext.obj \
- $(SLO)$/xmloff_PagePropertySetContext.obj \
- $(SLO)$/xmloff_PageHeaderFooterContext.obj \
- $(SLO)$/xmloff_XMLBitmapRepeatOffsetPropertyHandler.obj \
- $(SLO)$/xmloff_XMLFillBitmapSizePropertyHandler.obj \
- $(SLO)$/xmloff_XMLBitmapLogicalSizePropertyHandler.obj \
- $(SLO)$/xmloff_durationhdl.obj \
- $(SLO)$/xmloff_VisAreaContext.obj \
- $(SLO)$/xmloff_DrawAspectHdl.obj
-
-# --- Tagets -------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/binfilter/bf_xmloff/source/style/opaquhdl.hxx b/binfilter/bf_xmloff/source/style/opaquhdl.hxx
deleted file mode 100644
index 436c8a6da5a8..000000000000
--- a/binfilter/bf_xmloff/source/style/opaquhdl.hxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_OPAQUETYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_OPAQUETYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLOpaquePropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLOpaquePropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_OPAQUETYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/postuhdl.hxx b/binfilter/bf_xmloff/source/style/postuhdl.hxx
deleted file mode 100644
index 70c2dadccce2..000000000000
--- a/binfilter/bf_xmloff/source/style/postuhdl.hxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_POSTURETYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_POSTURETYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLPosturePropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLPosturePropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_POSTURETYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/shadwhdl.hxx b/binfilter/bf_xmloff/source/style/shadwhdl.hxx
deleted file mode 100644
index 62e70095b598..000000000000
--- a/binfilter/bf_xmloff/source/style/shadwhdl.hxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_SHADOWTYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_SHADOWTYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLShadowPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLShadowPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_BASICTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/shdwdhdl.hxx b/binfilter/bf_xmloff/source/style/shdwdhdl.hxx
deleted file mode 100644
index ea40f1b13706..000000000000
--- a/binfilter/bf_xmloff/source/style/shdwdhdl.hxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_SHADOWEDTYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_SHADOWEDTYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLShadowedPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLShadowedPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_SHADOWEDTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/splithdl.hxx b/binfilter/bf_xmloff/source/style/splithdl.hxx
deleted file mode 100644
index 8b256e8ab39a..000000000000
--- a/binfilter/bf_xmloff/source/style/splithdl.hxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_FMTSPLITTYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_FMTSPLITTYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLFmtSplitPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLFmtSplitPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_FMTSPLITTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/tabsthdl.hxx b/binfilter/bf_xmloff/source/style/tabsthdl.hxx
deleted file mode 100644
index eacadc15dbcd..000000000000
--- a/binfilter/bf_xmloff/source/style/tabsthdl.hxx
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_TABSTOPTYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_TABSTOPTYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLTabStopPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLTabStopPropHdl();
-
- virtual sal_Bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
-
- /// TabStops will be imported/exported as XML-Elements. So the Import/Export-work must be done at another place.
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_TABSTOPTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/undlihdl.hxx b/binfilter/bf_xmloff/source/style/undlihdl.hxx
deleted file mode 100644
index 6da5fd2e687b..000000000000
--- a/binfilter/bf_xmloff/source/style/undlihdl.hxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_UNDERLINETYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_UNDERLINETYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLUnderlinePropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLUnderlinePropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_UNDERLINETYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/weighhdl.hxx b/binfilter/bf_xmloff/source/style/weighhdl.hxx
deleted file mode 100644
index 5a62b3a4ba87..000000000000
--- a/binfilter/bf_xmloff/source/style/weighhdl.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_FONTWEIGHTTYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_FONTWEIGHTTYPES_HXX
-
-#include <xmlprhdl.hxx>
-namespace binfilter {
-
-/**
- PropertyHandler for the XML-data-type:
-*/
-class XMLFontWeightPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLFontWeightPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_FONTWEIGHTTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmlbahdl.hxx b/binfilter/bf_xmloff/source/style/xmlbahdl.hxx
deleted file mode 100644
index eb095ac39795..000000000000
--- a/binfilter/bf_xmloff/source/style/xmlbahdl.hxx
+++ /dev/null
@@ -1,249 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_PROPERTYHANDLER_BASICTYPES_HXX
-#define _XMLOFF_PROPERTYHANDLER_BASICTYPES_HXX
-
-#include <xmlprhdl.hxx>
-
-#include <rtl/ustrbuf.hxx>
-
-#include "xmltoken.hxx"
-namespace binfilter {
-
-
-/**
- PropertyHandler for the XML-data-type: XML_TYPE_NUMBER
-*/
-class XMLNumberPropHdl : public XMLPropertyHandler
-{
- sal_Int8 nBytes;
-
-public:
- XMLNumberPropHdl( sal_Int8 nB=4 ) : nBytes( nB ) {}
- virtual ~XMLNumberPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type: XML_TYPE_NUMBER_NONE
-*/
-class XMLNumberNonePropHdl : public XMLPropertyHandler
-{
- ::rtl::OUString sZeroStr;
- sal_Int8 nBytes;
-public:
- XMLNumberNonePropHdl( sal_Int8 nB = 4 );
- XMLNumberNonePropHdl( enum ::binfilter::xmloff::token::XMLTokenEnum eZeroString, sal_Int8 nB = 4 );
- virtual ~XMLNumberNonePropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type: XML_TYPE_MEASURE
-*/
-class XMLMeasurePropHdl : public XMLPropertyHandler
-{
- sal_Int8 nBytes;
-public:
- XMLMeasurePropHdl( sal_Int8 nB=4 ) : nBytes( nB ) {}
- virtual ~XMLMeasurePropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type: XML_TYPE_PERCENT
-*/
-class XMLPercentPropHdl : public XMLPropertyHandler
-{
- sal_Int8 nBytes;
-public:
- XMLPercentPropHdl( sal_Int8 nB=4 ) : nBytes( nB ) {}
- virtual ~XMLPercentPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type: XML_TYPE_PERCENT
-*/
-class XMLMeasurePxPropHdl : public XMLPropertyHandler
-{
- sal_Int8 nBytes;
-public:
- XMLMeasurePxPropHdl( sal_Int8 nB=4 ) : nBytes( nB ) {}
- virtual ~XMLMeasurePxPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type: XML_TYPE_BOOL
-*/
-class XMLBoolPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLBoolPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type: XML_TYPE_COLOR
-*/
-class XMLColorPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLColorPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type: XML_TYPE_STRING
-*/
-class XMLStringPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLStringPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type: XML_TYPE_DOUBLE
-*/
-class XMLDoublePropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLDoublePropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type: XML_TYPE_NBOOL
-*/
-class XMLNBoolPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLNBoolPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type: XML_TYPE_COLORTRANSPARENT
-*/
-class XMLColorTransparentPropHdl : public XMLPropertyHandler
-{
- const ::rtl::OUString sTransparent;
-
-public:
- XMLColorTransparentPropHdl( enum ::binfilter::xmloff::token::XMLTokenEnum eTransparent = xmloff::token::XML_TOKEN_INVALID );
- virtual ~XMLColorTransparentPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type: XML_TYPE_ISTRANSPARENT
-*/
-class XMLIsTransparentPropHdl : public XMLPropertyHandler
-{
- const ::rtl::OUString sTransparent;
- sal_Bool bTransPropValue;
-
-public:
- XMLIsTransparentPropHdl( enum ::binfilter::xmloff::token::XMLTokenEnum eTransparent = xmloff::token::XML_TOKEN_INVALID,
- sal_Bool bTransPropValue = sal_True );
- virtual ~XMLIsTransparentPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type: XML_TYPE_COLORAUTO
-*/
-class XMLColorAutoPropHdl : public XMLPropertyHandler
-{
-public:
- XMLColorAutoPropHdl();
- virtual ~XMLColorAutoPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-/**
- PropertyHandler for the XML-data-type: XML_TYPE_COLORISAUTO
-*/
-class XMLIsAutoColorPropHdl : public XMLPropertyHandler
-{
-public:
- XMLIsAutoColorPropHdl();
- virtual ~XMLIsAutoColorPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-
-/**
- PropertyHandler for properties that cannot make use of importXML
- and exportXML methods, but can make use of the default comparison
-*/
-class XMLCompareOnlyPropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLCompareOnlyPropHdl();
-
- virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-
-}//end of namespace binfilter
-#endif // _XMLOFF_PROPERTYHANDLER_BASICTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_AttributeContainerHandler.cxx b/binfilter/bf_xmloff/source/style/xmloff_AttributeContainerHandler.cxx
deleted file mode 100644
index 316dc97f2a04..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_AttributeContainerHandler.cxx
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/xml/AttributeData.hpp>
-
-
-
-
-#include "AttributeContainerHandler.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::container;
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLAttributeContainerHandler
-//
-
-XMLAttributeContainerHandler::~XMLAttributeContainerHandler()
-{
- // nothing to do
-}
-
-sal_Bool XMLAttributeContainerHandler::equals(
- const Any& r1,
- const Any& r2 ) const
-{
- Reference< XNameContainer > xContainer1;
- Reference< XNameContainer > xContainer2;
-
- if( ( r1 >>= xContainer1 ) && ( r2 >>= xContainer2 ) )
- {
- uno::Sequence< OUString > aAttribNames1( xContainer1->getElementNames() );
- uno::Sequence< OUString > aAttribNames2( xContainer2->getElementNames() );
- const sal_Int32 nCount = aAttribNames1.getLength();
-
- if( aAttribNames2.getLength() == nCount )
- {
- const OUString* pAttribName = aAttribNames1.getConstArray();
-
- xml::AttributeData aData1;
- xml::AttributeData aData2;
-
- for( sal_Int32 i=0; i < nCount; i++, pAttribName++ )
- {
- if( !xContainer2->hasByName( *pAttribName ) )
- return sal_False;
-
- xContainer1->getByName( *pAttribName ) >>= aData1;
- xContainer2->getByName( *pAttribName ) >>= aData2;
-
- if( ( aData1.Namespace != aData2.Namespace ) ||
- ( aData1.Type != aData2.Type ) ||
- ( aData1.Value != aData2.Value ) )
- return sal_False;
- }
-
- return sal_True;
- }
- }
-
- return sal_False;
-}
-
-sal_Bool XMLAttributeContainerHandler::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- return sal_True;
-}
-
-sal_Bool XMLAttributeContainerHandler::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- return sal_True;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_DashStyle.cxx b/binfilter/bf_xmloff/source/style/xmloff_DashStyle.cxx
deleted file mode 100644
index 519d702d20cf..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_DashStyle.cxx
+++ /dev/null
@@ -1,320 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <com/sun/star/drawing/LineDash.hpp>
-
-#include "DashStyle.hxx"
-
-
-#include "nmspmap.hxx"
-
-#include "xmluconv.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "xmlexp.hxx"
-
-#include "xmlimp.hxx"
-
-
-#include "rtl/ustring.hxx"
-
-#include <tools/debug.hxx>
-
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::rtl;
-using namespace ::binfilter::xmloff::token;
-
-enum SvXMLTokenMapAttrs
-{
- XML_TOK_DASH_NAME,
- XML_TOK_DASH_STYLE,
- XML_TOK_DASH_DOTS1,
- XML_TOK_DASH_DOTS1LEN,
- XML_TOK_DASH_DOTS2,
- XML_TOK_DASH_DOTS2LEN,
- XML_TOK_DASH_DISTANCE,
- XML_TOK_DASH_END=XML_TOK_UNKNOWN
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aDashStyleAttrTokenMap[] =
-{
- { XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_DASH_NAME },
- { XML_NAMESPACE_DRAW, XML_STYLE, XML_TOK_DASH_STYLE },
- { XML_NAMESPACE_DRAW, XML_DOTS1, XML_TOK_DASH_DOTS1 },
- { XML_NAMESPACE_DRAW, XML_DOTS1_LENGTH, XML_TOK_DASH_DOTS1LEN },
- { XML_NAMESPACE_DRAW, XML_DOTS2, XML_TOK_DASH_DOTS2 },
- { XML_NAMESPACE_DRAW, XML_DOTS2_LENGTH, XML_TOK_DASH_DOTS2LEN },
- { XML_NAMESPACE_DRAW, XML_DISTANCE, XML_TOK_DASH_DISTANCE },
- XML_TOKEN_MAP_END
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_DashStyle_Enum[] =
-{
- { XML_RECT, drawing::DashStyle_RECT },
- { XML_ROUND, drawing::DashStyle_ROUND },
- { XML_RECT, drawing::DashStyle_RECTRELATIVE },
- { XML_ROUND, drawing::DashStyle_ROUNDRELATIVE },
- { XML_TOKEN_INVALID, 0 }
-};
-
-//-------------------------------------------------------------
-// Import
-//-------------------------------------------------------------
-
-XMLDashStyleImport::XMLDashStyleImport( SvXMLImport& rImp )
- : rImport(rImp)
-{
-}
-
-XMLDashStyleImport::~XMLDashStyleImport()
-{
-}
-
-sal_Bool XMLDashStyleImport::importXML(
- const uno::Reference< xml::sax::XAttributeList >& xAttrList,
- uno::Any& rValue,
- OUString& rStrName )
-{
- drawing::LineDash aLineDash;
- aLineDash.Style = drawing::DashStyle_RECT;
- aLineDash.Dots = 0;
- aLineDash.DotLen = 0;
- aLineDash.Dashes = 0;
- aLineDash.DashLen = 0;
- aLineDash.Distance = 20;
-
- sal_Bool bIsRel = sal_False;
-
- SvXMLNamespaceMap& rNamespaceMap = rImport.GetNamespaceMap();
- SvXMLUnitConverter& rUnitConverter = rImport.GetMM100UnitConverter();
-
- SvXMLTokenMap aTokenMap( aDashStyleAttrTokenMap );
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rFullAttrName = xAttrList->getNameByIndex( i );
- OUString aStrAttrName;
- sal_uInt16 nPrefix = rNamespaceMap.GetKeyByAttrName( rFullAttrName, &aStrAttrName );
- const OUString& rStrValue = xAttrList->getValueByIndex( i );
-
- switch( aTokenMap.Get( nPrefix, aStrAttrName ) )
- {
- case XML_TOK_DASH_NAME:
- {
- rStrName = rStrValue;
- }
- break;
- case XML_TOK_DASH_STYLE:
- {
- sal_uInt16 eValue;
- if( rUnitConverter.convertEnum( eValue, rStrValue, pXML_DashStyle_Enum ) )
- {
- aLineDash.Style = (drawing::DashStyle) eValue;
- }
- }
- break;
- case XML_TOK_DASH_DOTS1:
- aLineDash.Dots = (sal_Int16)rStrValue.toInt32();
- break;
-
- case XML_TOK_DASH_DOTS1LEN:
- {
- if( rStrValue.indexOf( sal_Unicode('%') ) != -1 ) // its a percentage
- {
- bIsRel = sal_True;
- rUnitConverter.convertPercent( aLineDash.DotLen, rStrValue );
- }
- else
- {
- rUnitConverter.convertMeasure( aLineDash.DotLen, rStrValue );
- }
- }
- break;
-
- case XML_TOK_DASH_DOTS2:
- aLineDash.Dashes = (sal_Int16)rStrValue.toInt32();
- break;
-
- case XML_TOK_DASH_DOTS2LEN:
- {
- if( rStrValue.indexOf( sal_Unicode('%') ) != -1 ) // its a percentage
- {
- bIsRel = sal_True;
- rUnitConverter.convertPercent( aLineDash.DashLen, rStrValue );
- }
- else
- {
- rUnitConverter.convertMeasure( aLineDash.DashLen, rStrValue );
- }
- }
- break;
-
- case XML_TOK_DASH_DISTANCE:
- {
- if( rStrValue.indexOf( sal_Unicode('%') ) != -1 ) // its a percentage
- {
- bIsRel = sal_True;
- rUnitConverter.convertPercent( aLineDash.Distance, rStrValue );
- }
- else
- {
- rUnitConverter.convertMeasure( aLineDash.Distance, rStrValue );
- }
- }
- break;
- default:
- DBG_WARNING( "Unknown token at import gradient style" );
- }
- }
-
- if( bIsRel )
- aLineDash.Style = aLineDash.Style == drawing::DashStyle_RECT ? drawing::DashStyle_RECTRELATIVE : drawing::DashStyle_ROUNDRELATIVE;
-
- rValue <<= aLineDash;
-
- return sal_True;
-}
-
-
-//-------------------------------------------------------------
-// Export
-//-------------------------------------------------------------
-
-#ifndef SVX_LIGHT
-
-XMLDashStyleExport::XMLDashStyleExport( SvXMLExport& rExp )
- : rExport(rExp)
-{
-}
-
-XMLDashStyleExport::~XMLDashStyleExport()
-{
-}
-
-sal_Bool XMLDashStyleExport::exportXML(
- const OUString& rStrName,
- const uno::Any& rValue )
-{
- sal_Bool bRet = sal_False;
-
- SvXMLUnitConverter rUnitConverter = rExport.GetMM100UnitConverter();
-
- drawing::LineDash aLineDash;
-
- if( rStrName.getLength() )
- {
- if( rValue >>= aLineDash )
- {
- sal_Bool bIsRel = aLineDash.Style == drawing::DashStyle_RECTRELATIVE || aLineDash.Style == drawing::DashStyle_ROUNDRELATIVE;
-
- OUString aStrValue;
- OUStringBuffer aOut;
-
- // Name
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, rStrName );
-
- // Style
- rUnitConverter.convertEnum( aOut, aLineDash.Style, pXML_DashStyle_Enum );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue );
-
-
- // dots
- if( aLineDash.Dots )
- {
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DOTS1, OUString::valueOf( (sal_Int32)aLineDash.Dots ) );
-
- if( aLineDash.DotLen )
- {
- // dashes length
- if( bIsRel )
- {
- rUnitConverter.convertPercent( aOut, aLineDash.DotLen );
- }
- else
- {
- rUnitConverter.convertMeasure( aOut, aLineDash.DotLen );
- }
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DOTS1_LENGTH, aStrValue );
- }
- }
-
- // dashes
- if( aLineDash.Dashes )
- {
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DOTS2, OUString::valueOf( (sal_Int32)aLineDash.Dashes ) );
-
- if( aLineDash.DashLen )
- {
- // dashes length
- if( bIsRel )
- {
- rUnitConverter.convertPercent( aOut, aLineDash.DashLen );
- }
- else
- {
- rUnitConverter.convertMeasure( aOut, aLineDash.DashLen );
- }
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DOTS2_LENGTH, aStrValue );
- }
- }
-
- // distance
- if( bIsRel )
- {
- rUnitConverter.convertPercent( aOut, aLineDash.Distance );
- }
- else
- {
- rUnitConverter.convertMeasure( aOut, aLineDash.Distance );
- }
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISTANCE, aStrValue );
-
-
- // do Write
- SvXMLElementExport rElem( rExport,
- XML_NAMESPACE_DRAW, XML_STROKE_DASH,
- sal_True, sal_False );
- }
- }
- return bRet;
-}
-
-#endif // #ifndef SVX_LIGHT
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_DrawAspectHdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_DrawAspectHdl.cxx
deleted file mode 100644
index 12ac779a175b..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_DrawAspectHdl.cxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <rtl/ustrbuf.hxx>
-
-#include "xmluconv.hxx"
-
-
-#include "DrawAspectHdl.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLMeasurePropHdl
-//
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_DrawAspect_Enum[] =
-{
- { XML_CONTENT, 1 },
- { XML_THUMBNAIL, 2 },
- { XML_ICON, 4 },
- { XML_PRINT, 8 },
- { XML_TOKEN_INVALID, 0 }
-};
-
-DrawAspectHdl::~DrawAspectHdl()
-{
- // nothing to do
-}
-
-sal_Bool DrawAspectHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Int32 nAspect = 0;
-
- SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
- OUString aToken;
- while( aTokenEnum.getNextToken( aToken ) )
- {
- sal_uInt16 nVal;
- if( rUnitConverter.convertEnum( nVal, aToken, pXML_DrawAspect_Enum ) )
- {
- nAspect = nAspect | (sal_Int32)nVal;
- }
- }
-
- rValue <<= nAspect;
-
- return nAspect != 0;
-}
-
-sal_Bool DrawAspectHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- OUStringBuffer aOut;
-
- sal_Int32 nAspect;
- if( rValue >>= nAspect )
- {
- if( (nAspect & 1) != 0 )
- aOut.append( GetXMLToken(XML_CONTENT) );
-
- if( (nAspect & 2) != 0 )
- {
- if( aOut.getLength() )
- aOut.append( sal_Unicode(' ') );
- aOut.append( GetXMLToken(XML_THUMBNAIL) );
- }
-
- if( (nAspect & 4) != 0 )
- {
- if( aOut.getLength() )
- aOut.append( sal_Unicode(' ') );
- aOut.append( GetXMLToken(XML_ICON) );
- }
-
- if( (nAspect & 8) != 0 )
- {
- if( aOut.getLength() )
- aOut.append( sal_Unicode(' ') );
- aOut.append( GetXMLToken(XML_PRINT) );
- }
-
- rStrExpValue = aOut.makeStringAndClear();
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_EnumPropertyHdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_EnumPropertyHdl.cxx
deleted file mode 100644
index dd2f2a7b2d6b..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_EnumPropertyHdl.cxx
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include <EnumPropertyHdl.hxx>
-
-#include "xmluconv.hxx"
-
-#include <comphelper/extract.hxx>
-
-#include "rtl/ustring.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-/*
-
-#include <tools/solar.h>
-
-#ifndef _INC_LIMITS
-#include <limits.h>
-#endif
-
-
-*/
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLEnumPropertyHdl
-//
-
-XMLEnumPropertyHdl::~XMLEnumPropertyHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLEnumPropertyHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- USHORT nValue = 0;
-
- if( SvXMLUnitConverter::convertEnum( nValue, rStrImpValue, mpEnumMap ) )
- {
- switch( mrType.getTypeClass() )
- {
- case TypeClass_ENUM:
- rValue = ::cppu::int2enum( nValue, mrType );
- break;
- case TypeClass_LONG:
- rValue <<= (sal_Int32) nValue;
- break;
- case TypeClass_SHORT:
- rValue <<= (sal_Int16) nValue;
- break;
- case TypeClass_BYTE:
- rValue <<= (sal_Int8) nValue;
- break;
- default:
- DBG_ERROR( "Wrong type for enum property handler!" );
- return sal_False;
- }
- return sal_True;
- }
-
- return sal_False;
-}
-
-sal_Bool XMLEnumPropertyHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Int32 nValue;
- if(!(rValue >>= nValue ))
- if(!::cppu::enum2int(nValue, rValue) )
- return sal_False;
-
- OUStringBuffer aOut;
-
- if(!SvXMLUnitConverter::convertEnum( aOut, nValue, mpEnumMap ))
- return sal_False;
-
- rStrExpValue = aOut.makeStringAndClear();
- return sal_True;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_FillStyleContext.cxx b/binfilter/bf_xmloff/source/style/xmloff_FillStyleContext.cxx
deleted file mode 100644
index 58459d991a94..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_FillStyleContext.cxx
+++ /dev/null
@@ -1,366 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "FillStyleContext.hxx"
-
-#include "xmlimp.hxx"
-
-#include "GradientStyle.hxx"
-#include "HatchStyle.hxx"
-#include "ImageStyle.hxx"
-#include "TransGradientStyle.hxx"
-#include "MarkerStyle.hxx"
-#include "DashStyle.hxx"
-
-
-
-#include "xmlnmspe.hxx"
-
-#include "XMLBase64ImportContext.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::rtl;
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( XMLGradientStyleContext, SvXMLStyleContext );
-
-XMLGradientStyleContext::XMLGradientStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList)
-: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList)
-{
- // set Family
-// SetFamily( XML_STYLE_FAMILY_FILLSTYLE_GRADIENT_ID );
-
- // start import
- XMLGradientStyleImport aGradientStyle( GetImport() );
- aGradientStyle.importXML( xAttrList, maAny, maStrName );
-}
-
-XMLGradientStyleContext::~XMLGradientStyleContext()
-{
-}
-
-void XMLGradientStyleContext::EndElement()
-{
- uno::Reference< container::XNameContainer > xGradient( GetImport().GetGradientHelper() );
-
- try
- {
- if(xGradient.is())
- {
- if( xGradient->hasByName( maStrName ) )
- {
- xGradient->replaceByName( maStrName, maAny );
- }
- else
- {
- xGradient->insertByName( maStrName, maAny );
- }
- }
- }
- catch( container::ElementExistException& )
- {}
-}
-
-BOOL XMLGradientStyleContext::IsTransient() const
-{
- return sal_True;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( XMLHatchStyleContext, SvXMLStyleContext );
-
-XMLHatchStyleContext::XMLHatchStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList)
-: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList)
-{
- // start import
- XMLHatchStyleImport aHatchStyle( GetImport() );
- aHatchStyle.importXML( xAttrList, maAny, maStrName );
-}
-
-XMLHatchStyleContext::~XMLHatchStyleContext()
-{
-}
-
-void XMLHatchStyleContext::EndElement()
-{
- uno::Reference< container::XNameContainer > xHatch( GetImport().GetHatchHelper() );
-
- try
- {
- if(xHatch.is())
- {
- if( xHatch->hasByName( maStrName ) )
- {
- xHatch->replaceByName( maStrName, maAny );
- }
- else
- {
- xHatch->insertByName( maStrName, maAny );
- }
- }
- }
- catch( container::ElementExistException& )
- {}
-}
-
-BOOL XMLHatchStyleContext::IsTransient() const
-{
- return sal_True;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( XMLBitmapStyleContext, SvXMLStyleContext );
-
-XMLBitmapStyleContext::XMLBitmapStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList)
-: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList)
-{
- // start import
- XMLImageStyle aBitmapStyle;
- aBitmapStyle.importXML( xAttrList, maAny, maStrName, rImport );
-}
-
-XMLBitmapStyleContext::~XMLBitmapStyleContext()
-{
-}
-
-SvXMLImportContext* XMLBitmapStyleContext::CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = NULL;
- if( (XML_NAMESPACE_OFFICE == nPrefix) && xmloff::token::IsXMLToken( rLocalName, xmloff::token::XML_BINARY_DATA ) )
- {
- OUString sURL;
- maAny >>= sURL;
- if( !sURL.getLength() && !mxBase64Stream.is() )
- {
- mxBase64Stream = GetImport().GetStreamForGraphicObjectURLFromBase64();
- if( mxBase64Stream.is() )
- pContext = new XMLBase64ImportContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- mxBase64Stream );
- }
- }
- if( !pContext )
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
-
- return pContext;
-}
-
-void XMLBitmapStyleContext::EndElement()
-{
- OUString sURL;
- maAny >>= sURL;
-
- if( !sURL.getLength() && mxBase64Stream.is() )
- {
- sURL = GetImport().ResolveGraphicObjectURLFromBase64( mxBase64Stream );
- mxBase64Stream = 0;
- maAny <<= sURL;
- }
-
- uno::Reference< container::XNameContainer > xBitmap( GetImport().GetBitmapHelper() );
-
- try
- {
- if(xBitmap.is())
- {
- if( xBitmap->hasByName( maStrName ) )
- {
- xBitmap->replaceByName( maStrName, maAny );
- }
- else
- {
- xBitmap->insertByName( maStrName, maAny );
- }
- }
- }
- catch( container::ElementExistException& )
- {}
-}
-
-BOOL XMLBitmapStyleContext::IsTransient() const
-{
- return sal_True;
-}
-
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( XMLTransGradientStyleContext, SvXMLStyleContext );
-
-XMLTransGradientStyleContext::XMLTransGradientStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList)
-: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList)
-{
- // start import
- XMLTransGradientStyleImport aTransGradientStyle( GetImport() );
- aTransGradientStyle.importXML( xAttrList, maAny, maStrName );
-}
-
-XMLTransGradientStyleContext::~XMLTransGradientStyleContext()
-{
-}
-
-void XMLTransGradientStyleContext::EndElement()
-{
- uno::Reference< container::XNameContainer > xTransGradient( GetImport().GetTransGradientHelper() );
-
- try
- {
- if(xTransGradient.is())
- {
- if( xTransGradient->hasByName( maStrName ) )
- {
- xTransGradient->replaceByName( maStrName, maAny );
- }
- else
- {
- xTransGradient->insertByName( maStrName, maAny );
- }
- }
- }
- catch( container::ElementExistException& )
- {}
-}
-
-BOOL XMLTransGradientStyleContext::IsTransient() const
-{
- return sal_True;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( XMLMarkerStyleContext, SvXMLStyleContext );
-
-XMLMarkerStyleContext::XMLMarkerStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList)
-: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList)
-{
- // start import
- XMLMarkerStyleImport aMarkerStyle( GetImport() );
- aMarkerStyle.importXML( xAttrList, maAny, maStrName );
-}
-
-XMLMarkerStyleContext::~XMLMarkerStyleContext()
-{
-}
-
-void XMLMarkerStyleContext::EndElement()
-{
- uno::Reference< container::XNameContainer > xMarker( GetImport().GetMarkerHelper() );
-
- try
- {
- if(xMarker.is())
- {
- if( xMarker->hasByName( maStrName ) )
- {
- xMarker->replaceByName( maStrName, maAny );
- }
- else
- {
- xMarker->insertByName( maStrName, maAny );
- }
- }
- }
- catch( container::ElementExistException& )
- {}
-}
-
-BOOL XMLMarkerStyleContext::IsTransient() const
-{
- return sal_True;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( XMLDashStyleContext, SvXMLStyleContext );
-
-XMLDashStyleContext::XMLDashStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList)
-: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList)
-{
- // start import
- XMLDashStyleImport aDashStyle( GetImport() );
- aDashStyle.importXML( xAttrList, maAny, maStrName );
-}
-
-XMLDashStyleContext::~XMLDashStyleContext()
-{
-}
-
-void XMLDashStyleContext::EndElement()
-{
- uno::Reference< container::XNameContainer > xDashes( GetImport().GetDashHelper() );
-
- try
- {
- if(xDashes.is())
- {
- if( xDashes->hasByName( maStrName ) )
- {
- xDashes->replaceByName( maStrName, maAny );
- }
- else
- {
- xDashes->insertByName( maStrName, maAny );
- }
- }
- }
- catch( container::ElementExistException& )
- {}
-}
-
-BOOL XMLDashStyleContext::IsTransient() const
-{
- return sal_True;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_GradientStyle.cxx b/binfilter/bf_xmloff/source/style/xmloff_GradientStyle.cxx
deleted file mode 100644
index 70d256890207..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_GradientStyle.cxx
+++ /dev/null
@@ -1,329 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "GradientStyle.hxx"
-
-#include <com/sun/star/awt/Gradient.hpp>
-
-
-#include "nmspmap.hxx"
-
-#include "xmluconv.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-
-#include "rtl/ustring.hxx"
-
-#include <tools/debug.hxx>
-
-
-#include "xmlexp.hxx"
-
-#include "xmlimp.hxx"
-namespace binfilter {
-
-
-
-using namespace ::com::sun::star;
-using namespace ::rtl;
-using namespace ::binfilter::xmloff::token;
-
-enum SvXMLTokenMapAttrs
-{
- XML_TOK_GRADIENT_NAME,
- XML_TOK_GRADIENT_STYLE,
- XML_TOK_GRADIENT_CX,
- XML_TOK_GRADIENT_CY,
- XML_TOK_GRADIENT_STARTCOLOR,
- XML_TOK_GRADIENT_ENDCOLOR,
- XML_TOK_GRADIENT_STARTINT,
- XML_TOK_GRADIENT_ENDINT,
- XML_TOK_GRADIENT_ANGLE,
- XML_TOK_GRADIENT_BORDER,
- XML_TOK_TABSTOP_END=XML_TOK_UNKNOWN
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aGradientAttrTokenMap[] =
-{
- { XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_GRADIENT_NAME },
- { XML_NAMESPACE_DRAW, XML_STYLE, XML_TOK_GRADIENT_STYLE },
- { XML_NAMESPACE_DRAW, XML_CX, XML_TOK_GRADIENT_CX },
- { XML_NAMESPACE_DRAW, XML_CY, XML_TOK_GRADIENT_CY },
- { XML_NAMESPACE_DRAW, XML_START_COLOR, XML_TOK_GRADIENT_STARTCOLOR },
- { XML_NAMESPACE_DRAW, XML_END_COLOR, XML_TOK_GRADIENT_ENDCOLOR },
- { XML_NAMESPACE_DRAW, XML_START_INTENSITY, XML_TOK_GRADIENT_STARTINT },
- { XML_NAMESPACE_DRAW, XML_END_INTENSITY, XML_TOK_GRADIENT_ENDINT },
- { XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, XML_TOK_GRADIENT_ANGLE },
- { XML_NAMESPACE_DRAW, XML_GRADIENT_BORDER, XML_TOK_GRADIENT_BORDER },
- XML_TOKEN_MAP_END
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_GradientStyle_Enum[] =
-{
- { XML_GRADIENTSTYLE_LINEAR, awt::GradientStyle_LINEAR },
- { XML_GRADIENTSTYLE_AXIAL, awt::GradientStyle_AXIAL },
- { XML_GRADIENTSTYLE_RADIAL, awt::GradientStyle_RADIAL },
- { XML_GRADIENTSTYLE_ELLIPSOID, awt::GradientStyle_ELLIPTICAL },
- { XML_GRADIENTSTYLE_SQUARE, awt::GradientStyle_SQUARE },
- { XML_GRADIENTSTYLE_RECTANGULAR, awt::GradientStyle_RECT },
- { XML_TOKEN_INVALID, 0 }
-};
-
-//-------------------------------------------------------------
-// Import
-//-------------------------------------------------------------
-XMLGradientStyleImport::XMLGradientStyleImport(
- SvXMLImport& rImp )
- : rImport(rImp)
-{
-}
-
-XMLGradientStyleImport::~XMLGradientStyleImport()
-{
-}
-
-sal_Bool XMLGradientStyleImport::importXML(
- const uno::Reference< xml::sax::XAttributeList >& xAttrList,
- uno::Any& rValue,
- OUString& rStrName )
-{
- sal_Bool bRet = sal_False;
- sal_Bool bHasName = sal_False;
- sal_Bool bHasStyle = sal_False;
- sal_Bool bHasStartColor = sal_False;
- sal_Bool bHasEndColor = sal_False;
-
- awt::Gradient aGradient;
- aGradient.XOffset = 0;
- aGradient.YOffset = 0;
- aGradient.StartIntensity = 100;
- aGradient.EndIntensity = 100;
- aGradient.Angle = 0;
- aGradient.Border = 0;
-
- SvXMLTokenMap aTokenMap( aGradientAttrTokenMap );
- SvXMLNamespaceMap& rNamespaceMap = rImport.GetNamespaceMap();
- SvXMLUnitConverter& rUnitConverter = rImport.GetMM100UnitConverter();
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rFullAttrName = xAttrList->getNameByIndex( i );
- OUString aStrAttrName;
- sal_uInt16 nPrefix = rNamespaceMap.GetKeyByAttrName( rFullAttrName, &aStrAttrName );
- const OUString& rStrValue = xAttrList->getValueByIndex( i );
-
- sal_Int32 nTmpValue;
-
- switch( aTokenMap.Get( nPrefix, aStrAttrName ) )
- {
- case XML_TOK_GRADIENT_NAME:
- {
- rStrName = rStrValue;
- bHasName = sal_True;
- }
- break;
- case XML_TOK_GRADIENT_STYLE:
- {
- sal_uInt16 eValue;
- if( rUnitConverter.convertEnum( eValue, rStrValue, pXML_GradientStyle_Enum ) )
- {
- aGradient.Style = (awt::GradientStyle) eValue;
- bHasStyle = sal_True;
- }
- }
- break;
- case XML_TOK_GRADIENT_CX:
- rUnitConverter.convertPercent( nTmpValue, rStrValue );
- aGradient.XOffset = nTmpValue;
- break;
- case XML_TOK_GRADIENT_CY:
- rUnitConverter.convertPercent( nTmpValue, rStrValue );
- aGradient.YOffset = nTmpValue;
- break;
- case XML_TOK_GRADIENT_STARTCOLOR:
- {
- Color aColor;
- if( bHasStartColor = rUnitConverter.convertColor( aColor, rStrValue ) )
- aGradient.StartColor = (sal_Int32)( aColor.GetColor() );
- }
- break;
- case XML_TOK_GRADIENT_ENDCOLOR:
- {
- Color aColor;
- if( bHasStartColor = rUnitConverter.convertColor( aColor, rStrValue ) )
- aGradient.EndColor = (sal_Int32)( aColor.GetColor() );
- }
- break;
- case XML_TOK_GRADIENT_STARTINT:
- rUnitConverter.convertPercent( nTmpValue, rStrValue );
- aGradient.StartIntensity = nTmpValue;
- break;
- case XML_TOK_GRADIENT_ENDINT:
- rUnitConverter.convertPercent( nTmpValue, rStrValue );
- aGradient.EndIntensity = nTmpValue;
- break;
- case XML_TOK_GRADIENT_ANGLE:
- {
- sal_Int32 nValue;
- rUnitConverter.convertNumber( nValue, rStrValue, 0, 360 );
- aGradient.Angle = sal_Int16( nValue );
- }
- break;
- case XML_TOK_GRADIENT_BORDER:
- rUnitConverter.convertPercent( nTmpValue, rStrValue );
- aGradient.Border = nTmpValue;
- break;
-
- default:
- DBG_WARNING( "Unknown token at import gradient style" )
- ;
- }
- }
-
- rValue <<= aGradient;
-
- bRet = bHasName && bHasStyle && bHasStartColor && bHasEndColor;
-
- return bRet;
-}
-
-
-//-------------------------------------------------------------
-// Export
-//-------------------------------------------------------------
-
-#ifndef SVX_LIGHT
-
-XMLGradientStyleExport::XMLGradientStyleExport(
- SvXMLExport& rExp )
- : rExport(rExp)
-{
-}
-
-XMLGradientStyleExport::~XMLGradientStyleExport()
-{
-}
-
-sal_Bool XMLGradientStyleExport::exportXML(
- const OUString& rStrName,
- const uno::Any& rValue )
-{
- sal_Bool bRet = sal_False;
- awt::Gradient aGradient;
-
- if( rStrName.getLength() )
- {
- if( rValue >>= aGradient )
- {
- OUString aStrValue;
- OUStringBuffer aOut;
-
- SvXMLUnitConverter& rUnitConverter =
- rExport.GetMM100UnitConverter();
-
- // Style
- if( !rUnitConverter.convertEnum( aOut, aGradient.Style, pXML_GradientStyle_Enum ) )
- {
- bRet = sal_False;
- }
- else
- {
- // Name
- OUString aStrName( rStrName );
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, aStrName );
-
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue );
-
- // Center x/y
- if( aGradient.Style != awt::GradientStyle_LINEAR &&
- aGradient.Style != awt::GradientStyle_AXIAL )
- {
- rUnitConverter.convertPercent( aOut, aGradient.XOffset );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CX, aStrValue );
-
- rUnitConverter.convertPercent( aOut, aGradient.YOffset );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CY, aStrValue );
- }
-
- Color aColor;
-
- // Color start
- aColor.SetColor( aGradient.StartColor );
- rUnitConverter.convertColor( aOut, aColor );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START_COLOR, aStrValue );
-
- // Color end
- aColor.SetColor( aGradient.EndColor );
- rUnitConverter.convertColor( aOut, aColor );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END_COLOR, aStrValue );
-
- // Intensity start
- rUnitConverter.convertPercent( aOut, aGradient.StartIntensity );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START_INTENSITY, aStrValue );
-
- // Intensity end
- rUnitConverter.convertPercent( aOut, aGradient.EndIntensity );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END_INTENSITY, aStrValue );
-
- // Angle
- if( aGradient.Style != awt::GradientStyle_RADIAL )
- {
- rUnitConverter.convertNumber( aOut, sal_Int32( aGradient.Angle ) );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, aStrValue );
- }
-
- // Border
- rUnitConverter.convertPercent( aOut, aGradient.Border );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_BORDER, aStrValue );
-
- // Do Write
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_DRAW, XML_GRADIENT,
- sal_True, sal_False );
- }
- }
- }
-
- return bRet;
-}
-
-#endif // #ifndef SVX_LIGHT
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_HatchStyle.cxx b/binfilter/bf_xmloff/source/style/xmloff_HatchStyle.cxx
deleted file mode 100644
index 81ac712da2db..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_HatchStyle.cxx
+++ /dev/null
@@ -1,247 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "HatchStyle.hxx"
-
-#include <com/sun/star/drawing/Hatch.hpp>
-
-#include "nmspmap.hxx"
-
-#include "xmluconv.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "xmlexp.hxx"
-
-#include "xmlimp.hxx"
-
-
-#include "rtl/ustring.hxx"
-
-#include <tools/debug.hxx>
-
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::rtl;
-using namespace ::binfilter::xmloff::token;
-
-enum SvXMLTokenMapAttrs
-{
- XML_TOK_HATCH_NAME,
- XML_TOK_HATCH_STYLE,
- XML_TOK_HATCH_COLOR,
- XML_TOK_HATCH_DISTANCE,
- XML_TOK_HATCH_ROTATION,
- XML_TOK_TABSTOP_END=XML_TOK_UNKNOWN
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aHatchAttrTokenMap[] =
-{
- { XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_HATCH_NAME },
- { XML_NAMESPACE_DRAW, XML_STYLE, XML_TOK_HATCH_STYLE },
- { XML_NAMESPACE_DRAW, XML_COLOR, XML_TOK_HATCH_COLOR },
- { XML_NAMESPACE_DRAW, XML_HATCH_DISTANCE, XML_TOK_HATCH_DISTANCE },
- { XML_NAMESPACE_DRAW, XML_ROTATION, XML_TOK_HATCH_ROTATION },
- XML_TOKEN_MAP_END
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_HatchStyle_Enum[] =
-{
- { XML_HATCHSTYLE_SINGLE, drawing::HatchStyle_SINGLE },
- { XML_HATCHSTYLE_DOUBLE, drawing::HatchStyle_DOUBLE },
- { XML_HATCHSTYLE_TRIPLE, drawing::HatchStyle_TRIPLE },
- { XML_TOKEN_INVALID, 0 }
-};
-
-
-//-------------------------------------------------------------
-// Import
-//-------------------------------------------------------------
-
-XMLHatchStyleImport::XMLHatchStyleImport( SvXMLImport& rImp )
- : rImport(rImp)
-{
-}
-
-XMLHatchStyleImport::~XMLHatchStyleImport()
-{
-}
-
-sal_Bool XMLHatchStyleImport::importXML(
- const uno::Reference< xml::sax::XAttributeList >& xAttrList,
- uno::Any& rValue,
- OUString& rStrName )
-{
- sal_Bool bRet = sal_False;
-
- sal_Bool bHasName = sal_False;
- sal_Bool bHasStyle = sal_False;
- sal_Bool bHasColor = sal_False;
- sal_Bool bHasDist = sal_False;
-
- drawing::Hatch aHatch;
- aHatch.Style = drawing::HatchStyle_SINGLE;
- aHatch.Color = 0;
- aHatch.Distance = 0;
- aHatch.Angle = 0;
-
- SvXMLTokenMap aTokenMap( aHatchAttrTokenMap );
- SvXMLNamespaceMap rNamespaceMap = rImport.GetNamespaceMap();
- SvXMLUnitConverter& rUnitConverter = rImport.GetMM100UnitConverter();
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rFullAttrName = xAttrList->getNameByIndex( i );
- OUString aStrAttrName;
- sal_uInt16 nPrefix = rNamespaceMap.GetKeyByAttrName( rFullAttrName, &aStrAttrName );
- const OUString& rStrValue = xAttrList->getValueByIndex( i );
-
- switch( aTokenMap.Get( nPrefix, aStrAttrName ) )
- {
- case XML_TOK_HATCH_NAME:
- {
- rStrName = rStrValue;
- bHasName = sal_True;
- }
- break;
- case XML_TOK_HATCH_STYLE:
- {
- sal_uInt16 eValue;
- if( bHasStyle = rUnitConverter.convertEnum( eValue, rStrValue, pXML_HatchStyle_Enum ) )
- aHatch.Style = (drawing::HatchStyle) eValue;
- }
- break;
- case XML_TOK_HATCH_COLOR:
- {
- Color aColor;
- if( bHasColor = rUnitConverter.convertColor( aColor, rStrValue ) )
- aHatch.Color = (sal_Int32)( aColor.GetColor() );
- }
- break;
- case XML_TOK_HATCH_DISTANCE:
- bHasDist = rUnitConverter.convertMeasure( (sal_Int32&)aHatch.Distance, rStrValue );
- break;
- case XML_TOK_HATCH_ROTATION:
- {
- sal_Int32 nValue;
- rUnitConverter.convertNumber( nValue, rStrValue, 0, 360 );
- aHatch.Angle = sal_Int16( nValue );
- }
- break;
-
- default:
- DBG_WARNING( "Unknown token at import hatch style" )
- ;
- }
- }
-
- rValue <<= aHatch;
-
- bRet = bHasName && bHasStyle && bHasColor && bHasDist;
-
- return bRet;
-}
-
-
-//-------------------------------------------------------------
-// Export
-//-------------------------------------------------------------
-
-#ifndef SVX_LIGHT
-
-XMLHatchStyleExport::XMLHatchStyleExport( SvXMLExport& rExp )
- : rExport(rExp)
-{
-}
-
-XMLHatchStyleExport::~XMLHatchStyleExport()
-{
-}
-
-sal_Bool XMLHatchStyleExport::exportXML(
- const OUString& rStrName,
- const uno::Any& rValue )
-{
- sal_Bool bRet = sal_False;
- drawing::Hatch aHatch;
-
- if( rStrName.getLength() )
- {
- if( rValue >>= aHatch )
- {
- OUString aStrValue;
- OUStringBuffer aOut;
-
- SvXMLUnitConverter& rUnitConverter =
- rExport.GetMM100UnitConverter();
-
- // Style
- if( !rUnitConverter.convertEnum( aOut, aHatch.Style, pXML_HatchStyle_Enum ) )
- {
- bRet = sal_False;
- }
- else
- {
- // Name
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, rStrName );
-
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue );
-
- // Color
- rUnitConverter.convertColor( aOut, Color( aHatch.Color ) );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_COLOR, aStrValue );
-
- // Distance
- rUnitConverter.convertMeasure( aOut, aHatch.Distance );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_HATCH_DISTANCE, aStrValue );
-
- // Angle
- rUnitConverter.convertNumber( aOut, sal_Int32( aHatch.Angle ) );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_ROTATION, aStrValue );
-
- // Do Write
- SvXMLElementExport rElem( rExport, XML_NAMESPACE_DRAW, XML_HATCH,
- sal_True, sal_False );
- }
- }
- }
-
- return bRet;
-}
-
-#endif // #ifndef SVX_LIGHT
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_ImageStyle.cxx b/binfilter/bf_xmloff/source/style/xmloff_ImageStyle.cxx
deleted file mode 100644
index 575cdf4d13d6..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_ImageStyle.cxx
+++ /dev/null
@@ -1,207 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "ImageStyle.hxx"
-
-
-
-#include "nmspmap.hxx"
-
-
-#include"xmlnmspe.hxx"
-
-
-#include "xmlexp.hxx"
-
-#include "xmlimp.hxx"
-
-
-#include "rtl/ustring.hxx"
-
-#include <tools/debug.hxx>
-
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::rtl;
-using namespace ::binfilter::xmloff::token;
-
-enum SvXMLTokenMapAttrs
-{
- XML_TOK_IMAGE_NAME,
- XML_TOK_IMAGE_URL,
- XML_TOK_IMAGE_TYPE,
- XML_TOK_IMAGE_SHOW,
- XML_TOK_IMAGE_ACTUATE,
- /* XML_TOK_IMAGE_SIZEW,
- XML_TOK_IMAGE_SIZEH,*/
- XML_TOK_TABSTOP_END=XML_TOK_UNKNOWN
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aHatchAttrTokenMap[] =
-{
- { XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_IMAGE_NAME },
- { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_IMAGE_URL },
- { XML_NAMESPACE_XLINK, XML_TYPE, XML_TOK_IMAGE_TYPE },
- { XML_NAMESPACE_XLINK, XML_SHOW, XML_TOK_IMAGE_SHOW },
- { XML_NAMESPACE_XLINK, XML_ACTUATE, XML_TOK_IMAGE_ACTUATE },
- /*{ XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_IMAGE_URL },
- { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_IMAGE_URL },*/
- XML_TOKEN_MAP_END
-};
-
-XMLImageStyle::XMLImageStyle()
-{
-}
-
-XMLImageStyle::~XMLImageStyle()
-{
-}
-
-#ifndef SVX_LIGHT
-
-sal_Bool XMLImageStyle::exportXML( const OUString& rStrName, const ::com::sun::star::uno::Any& rValue, SvXMLExport& rExport )
-{
- return ImpExportXML( rStrName, rValue, rExport );
-}
-
-sal_Bool XMLImageStyle::ImpExportXML( const OUString& rStrName, const uno::Any& rValue, SvXMLExport& rExport )
-{
- sal_Bool bRet = sal_False;
-
- OUString sImageURL;
-
- if( rStrName.getLength() )
- {
- if( rValue >>= sImageURL )
- {
- OUString aStrValue;
- OUStringBuffer aOut;
-
- // Name
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, rStrName );
-
- // uri
- const OUString aStr( rExport.AddEmbeddedGraphicObject( sImageURL ) );
- if( aStr.getLength() )
- {
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aStr );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED );
- rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD );
- }
-/*
- // size
- awt::Size aSize = xBitmap->getSize();
-
- rUnitConverter.convertNumber( aOut, aSize.Width );
- aStrValue = aOut.makeStringAndClear();
- AddAttribute( XML_NAMESPACE_SVG, XML_WIDTH, aStrValue );
-
- rUnitConverter.convertNumber( aOut, aSize.Height );
- aStrValue = aOut.makeStringAndClear();
- AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT, aStrValue );
-*/
- // Do Write
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_DRAW, XML_FILL_IMAGE, sal_True, sal_True );
-
- if( sImageURL.getLength() )
- {
- // optional office:binary-data
- rExport.AddEmbeddedGraphicObjectAsBase64( sImageURL );
- }
- }
- }
-
- return bRet;
-}
-
-#endif // #ifndef SVX_LIGHT
-
-sal_Bool XMLImageStyle::importXML( const uno::Reference< xml::sax::XAttributeList >& xAttrList, uno::Any& rValue, OUString& rStrName, SvXMLImport& rImport )
-{
- return ImpImportXML( xAttrList, rValue, rStrName, rImport );
-}
-
-sal_Bool XMLImageStyle::ImpImportXML( const uno::Reference< xml::sax::XAttributeList >& xAttrList,
- uno::Any& rValue, OUString& rStrName,
- SvXMLImport& rImport )
-{
- sal_Bool bRet = sal_False;
- sal_Bool bHasHRef = sal_False;
- sal_Bool bHasName = sal_False;
- OUString aStrURL;
-
- SvXMLTokenMap aTokenMap( aHatchAttrTokenMap );
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rFullAttrName = xAttrList->getNameByIndex( i );
- OUString aStrAttrName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName( rFullAttrName, &aStrAttrName );
- const OUString& rStrValue = xAttrList->getValueByIndex( i );
-
- switch( aTokenMap.Get( nPrefix, aStrAttrName ) )
- {
- case XML_TOK_IMAGE_NAME:
- {
- rStrName = rStrValue;
- bHasName = sal_True;
- }
- break;
- case XML_TOK_IMAGE_URL:
- {
- aStrURL = rImport.ResolveGraphicObjectURL( rStrValue, sal_False );
- bHasHRef = sal_True;
- }
- break;
- case XML_TOK_IMAGE_TYPE:
- // ignore
- break;
- case XML_TOK_IMAGE_SHOW:
- // ignore
- break;
- case XML_TOK_IMAGE_ACTUATE:
- // ignore
- break;
- default:
- DBG_WARNING( "Unknown token at import fill bitmap style" )
- ;
- }
- }
-
- rValue <<= aStrURL;
-
- bRet = bHasName && bHasHRef;
-
- return bRet;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_MarkerStyle.cxx b/binfilter/bf_xmloff/source/style/xmloff_MarkerStyle.cxx
deleted file mode 100644
index bfc0c87ea715..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_MarkerStyle.cxx
+++ /dev/null
@@ -1,275 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "MarkerStyle.hxx"
-
-#include "xexptran.hxx"
-
-
-#include "nmspmap.hxx"
-
-
-#include "xmlnmspe.hxx"
-
-
-#include "xmlexp.hxx"
-
-#include "xmlimp.hxx"
-
-
-#include "rtl/ustring.hxx"
-
-#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::rtl;
-using namespace ::binfilter::xmloff::token;
-
-
-//-------------------------------------------------------------
-// Import
-//-------------------------------------------------------------
-
-XMLMarkerStyleImport::XMLMarkerStyleImport( SvXMLImport& rImp )
- : rImport( rImp )
-{
-}
-
-XMLMarkerStyleImport::~XMLMarkerStyleImport()
-{
-}
-
-sal_Bool XMLMarkerStyleImport::importXML(
- const uno::Reference< xml::sax::XAttributeList >& xAttrList,
- uno::Any& rValue,
- OUString& rStrName )
-{
- sal_Bool bRet = sal_False;
- sal_Bool bHasViewBox = sal_False;
- sal_Bool bHasPathData = sal_False;
-
- SdXMLImExViewBox* pViewBox = NULL;
-
- SvXMLNamespaceMap& rNamespaceMap = rImport.GetNamespaceMap();
- SvXMLUnitConverter& rUnitConverter = rImport.GetMM100UnitConverter();
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- OUString aStrFullAttrName = xAttrList->getNameByIndex( i );
- OUString aStrAttrName;
- rNamespaceMap.GetKeyByAttrName( aStrFullAttrName, &aStrAttrName );
- OUString aStrValue = xAttrList->getValueByIndex( i );
-
- if( IsXMLToken( aStrAttrName, XML_NAME ) )
- {
- rStrName = aStrValue;
- }
- else if( IsXMLToken( aStrAttrName, XML_VIEWBOX ) )
- {
- pViewBox = new SdXMLImExViewBox( aStrValue, rUnitConverter );
- bHasViewBox = sal_True;
-
- }
- else if( bHasViewBox && IsXMLToken( aStrAttrName, XML_D ) )
- {
- SdXMLImExSvgDElement aPoints(aStrValue, *pViewBox, awt::Point( 0, 0 ),
- awt::Size( pViewBox->GetWidth(), pViewBox->GetHeight() ),
- rUnitConverter );
-
- if(aPoints.IsCurve())
- {
- drawing::PolyPolygonBezierCoords aSourcePolyPolygon(
- aPoints.GetPointSequenceSequence(),
- aPoints.GetFlagSequenceSequence());
- rValue <<= aSourcePolyPolygon;
- }
- else
- {
- drawing::PolyPolygonBezierCoords aSourcePolyPolygon;
- aSourcePolyPolygon.Coordinates = aPoints.GetPointSequenceSequence();
- aSourcePolyPolygon.Flags.realloc(aSourcePolyPolygon.Coordinates.getLength());
-
- // Zeiger auf innere sequences holen
- const drawing::PointSequence* pInnerSequence = aSourcePolyPolygon.Coordinates.getConstArray();
- drawing::FlagSequence* pInnerSequenceFlags = aSourcePolyPolygon.Flags.getArray();
-
- for(sal_Int32 a(0); a < aSourcePolyPolygon.Coordinates.getLength(); a++)
- {
- pInnerSequenceFlags->realloc(pInnerSequence->getLength());
- drawing::PolygonFlags* pPolyFlags = pInnerSequenceFlags->getArray();
-
- for(sal_Int32 b(0); b < pInnerSequence->getLength(); b++)
- *pPolyFlags++ = drawing::PolygonFlags_NORMAL;
-
- // next run
- pInnerSequence++;
- pInnerSequenceFlags++;
- }
-
- rValue <<= aSourcePolyPolygon;
- }
-
- bHasPathData = sal_True;
- }
- }
-
- if( pViewBox )
- delete pViewBox;
-
- bRet = bHasViewBox && bHasPathData;
-
- return bRet;
-}
-
-
-//-------------------------------------------------------------
-// Export
-//-------------------------------------------------------------
-
-#ifndef SVX_LIGHT
-
-XMLMarkerStyleExport::XMLMarkerStyleExport( SvXMLExport& rExp )
- : rExport( rExp )
-{
-}
-
-XMLMarkerStyleExport::~XMLMarkerStyleExport()
-{
-}
-
-sal_Bool XMLMarkerStyleExport::exportXML(
- const OUString& rStrName,
- const uno::Any& rValue )
-{
- sal_Bool bRet(sal_False);
-
- if(rStrName.getLength())
- {
- drawing::PolyPolygonBezierCoords aBezier;
-
- if(rValue >>= aBezier)
- {
- OUString aStrValue;
- OUStringBuffer aOut;
-
- SvXMLUnitConverter& rUnitConverter =
- rExport.GetMM100UnitConverter();
-
- /////////////////
- // Name
- OUString aStrName( rStrName );
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, aStrName );
-
- /////////////////
- // Viewbox (viewBox="0 0 1500 1000")
- sal_Int32 nMinX(0x7fffffff);
- sal_Int32 nMaxX(0x80000000);
- sal_Int32 nMinY(0x7fffffff);
- sal_Int32 nMaxY(0x80000000);
- sal_Int32 nOuterCnt(aBezier.Coordinates.getLength());
- drawing::PointSequence* pOuterSequence = aBezier.Coordinates.getArray();
- sal_Int32 a, b;
- sal_Bool bClosed(sal_False);
-
- for(a = 0L; a < nOuterCnt; a++)
- {
- drawing::PointSequence* pSequence = pOuterSequence++;
- const awt::Point *pPoints = pSequence->getConstArray();
- sal_Int32 nPointCount(pSequence->getLength());
-
- if(nPointCount)
- {
- const awt::Point aStart = pPoints[0];
- const awt::Point aEnd = pPoints[nPointCount - 1];
-
- if(aStart.X == aEnd.X && aStart.Y == aEnd.Y)
- {
- bClosed = sal_True;
- }
- }
-
- for(b = 0L; b < nPointCount; b++)
- {
- const awt::Point aPoint = pPoints[b];
-
- if( aPoint.X < nMinX )
- nMinX = aPoint.X;
-
- if( aPoint.X > nMaxX )
- nMaxX = aPoint.X;
-
- if( aPoint.Y < nMinY )
- nMinY = aPoint.Y;
-
- if( aPoint.Y > nMaxY )
- nMaxY = aPoint.Y;
- }
- }
-
- sal_Int32 nDifX(nMaxX - nMinX);
- sal_Int32 nDifY(nMaxY - nMinY);
-
- SdXMLImExViewBox aViewBox( 0, 0, nDifX, nDifY );
- rExport.AddAttribute( XML_NAMESPACE_SVG, XML_VIEWBOX, aViewBox.GetExportString( rUnitConverter ) );
-
- /////////////////
- // Pathdata
- pOuterSequence = aBezier.Coordinates.getArray();
- drawing::FlagSequence* pOuterFlags = aBezier.Flags.getArray();
- SdXMLImExSvgDElement aSvgDElement(aViewBox);
-
- for(a = 0L; a < nOuterCnt; a++)
- {
- drawing::PointSequence* pSequence = pOuterSequence++;
- drawing::FlagSequence* pFlags = pOuterFlags++;
-
- aSvgDElement.AddPolygon(pSequence, pFlags,
- awt::Point( 0, 0 ),
- awt::Size( aViewBox.GetWidth(), aViewBox.GetHeight() ),
- rUnitConverter, bClosed);
- }
-
- // write point array
- rExport.AddAttribute(XML_NAMESPACE_SVG, XML_D, aSvgDElement.GetExportString());
-
- /////////////////
- // Do Write
- SvXMLElementExport rElem( rExport, XML_NAMESPACE_DRAW, XML_MARKER,
- sal_True, sal_False );
- }
- }
-
- return bRet;
-}
-
-#endif // #ifndef SVX_LIGHT
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_MultiPropertySetHelper.cxx b/binfilter/bf_xmloff/source/style/xmloff_MultiPropertySetHelper.cxx
deleted file mode 100644
index b295d84c26f7..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_MultiPropertySetHelper.cxx
+++ /dev/null
@@ -1,200 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "MultiPropertySetHelper.hxx"
-
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-
-#include <com/sun/star/beans/XMultiPropertySet.hpp>
-
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-#include <comphelper/stl_types.hxx>
-
-// STL includes
-#include <algorithm>
-namespace binfilter {
-
-
-using ::com::sun::star::beans::XMultiPropertySet;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::beans::XPropertySetInfo;
-using ::com::sun::star::lang::XServiceInfo;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::comphelper::UStringLess;
-using ::rtl::OUString;
-using ::std::sort;
-
-
-MultiPropertySetHelper::MultiPropertySetHelper(
- const sal_Char** pNames ) :
- pPropertyNames( NULL ),
- nLength( 0 ),
- aPropertySequence(),
- pSequenceIndex( NULL ),
- aValues(),
- pValues( NULL )
-{
- // first count the elements
- for( const sal_Char** pPtr = pNames; *pPtr != NULL; pPtr++ )
- nLength++;
-
- // allocate array and create strings
- pPropertyNames = new OUString[nLength];
- for( sal_Int16 i = 0; i < nLength; i++ )
- pPropertyNames[i] = OUString::createFromAscii( pNames[i] );
-}
-
-MultiPropertySetHelper::~MultiPropertySetHelper()
-{
- pValues = NULL; // memory 'owned' by aValues
-
- delete[] pSequenceIndex;
- delete[] pPropertyNames;
-}
-
-
-
-void MultiPropertySetHelper::hasProperties(
- const Reference<XPropertySetInfo> & rInfo )
-{
- DBG_ASSERT( rInfo.is(), "I'd really like an XPropertySetInfo here." );
-
- // allocate sequence index
- if ( NULL == pSequenceIndex )
- pSequenceIndex = new sal_Int16[nLength] ;
-
- // construct pSequenceIndex
- sal_Int16 nNumberOfProperties = 0;
- sal_Int16 i;
-
- for( i = 0; i < nLength; i++ )
- {
- // ask for property
- sal_Bool bHasProperty =
- rInfo->hasPropertyByName( pPropertyNames[i] );
-
- // set index and increment (if appropriate)
- pSequenceIndex[i]= bHasProperty ? nNumberOfProperties : -1;
- if ( bHasProperty )
- nNumberOfProperties++;
- }
-
- // construct property sequence from index array
- if ( aPropertySequence.getLength() != nNumberOfProperties )
- aPropertySequence.realloc( nNumberOfProperties );
- OUString* pPropertySequence = aPropertySequence.getArray();
- for( i = 0; i < nLength; i ++ )
- {
- sal_Int16 nIndex = pSequenceIndex[i];
- if ( nIndex != -1 )
- pPropertySequence[nIndex] = pPropertyNames[i];
- }
-}
-
-sal_Bool MultiPropertySetHelper::checkedProperties()
-{
- return (NULL != pSequenceIndex);
-}
-
-
-
-void MultiPropertySetHelper::getValues(
- const Reference<XMultiPropertySet> & rMultiPropertySet )
-{
- DBG_ASSERT( rMultiPropertySet.is(), "We need an XMultiPropertySet." );
-
- aValues = rMultiPropertySet->getPropertyValues( aPropertySequence );
- pValues = aValues.getConstArray();
-}
-
-void MultiPropertySetHelper::getValues(
- const Reference<XPropertySet> & rPropertySet )
-{
- DBG_ASSERT( rPropertySet.is(), "We need an XPropertySet." );
-
- // re-alloc aValues (if necessary) and fill with values from XPropertySet
- sal_Int16 nSupportedPropertiesCount =
- (sal_Int16)aPropertySequence.getLength();
- if ( aValues.getLength() != nSupportedPropertiesCount )
- aValues.realloc( nSupportedPropertiesCount );
- Any* pMutableArray = aValues.getArray();
- for( sal_Int16 i = 0; i < nSupportedPropertiesCount; i++ )
- {
- pMutableArray[i] = rPropertySet->getPropertyValue(
- pPropertyNames[ pSequenceIndex[ i ] ] );
- }
-
- // re-establish pValues pointer
- pValues = aValues.getConstArray();
-}
-
-
-const Any& MultiPropertySetHelper::getValue( sal_Int16 nIndex,
- const Reference< XPropertySet> & rPropSet,
- sal_Bool bTryMulti )
-{
- if( !pValues )
- {
- if( bTryMulti )
- {
- Reference < XMultiPropertySet > xMultiPropSet( rPropSet,
- UNO_QUERY );
- if( xMultiPropSet.is() )
- getValues( xMultiPropSet );
- else
- getValues( rPropSet );
- }
- else
- {
- getValues( rPropSet );
- }
- }
-
- return getValue( nIndex );
-}
-
-const Any& MultiPropertySetHelper::getValue( sal_Int16 nIndex,
- const Reference< XMultiPropertySet> & rMultiPropSet )
-{
- if( !pValues )
- getValues( rMultiPropSet );
-
- return getValue( nIndex );
-}
-
-// inline methods defined in header:
-// inline Any& MultiPropertySetHelper::getValue( sal_Int16 nIndex )
-// inline sal_Bool MultiPropertySetHelper::hasProperty( sal_Int16 nValueNo )
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_NamedBoolPropertyHdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_NamedBoolPropertyHdl.cxx
deleted file mode 100644
index efc140531673..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_NamedBoolPropertyHdl.cxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <NamedBoolPropertyHdl.hxx>
-
-
-#include <comphelper/extract.hxx>
-
-#include "rtl/ustring.hxx"
-
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLNamedBoolPropertyHdl
-//
-
-XMLNamedBoolPropertyHdl::~XMLNamedBoolPropertyHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLNamedBoolPropertyHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- if( rStrImpValue == maTrueStr )
- {
- rValue = ::cppu::bool2any( sal_True );
- return sal_True;
- }
-
- if( rStrImpValue == maFalseStr )
- {
- rValue = ::cppu::bool2any( sal_False );
- return sal_True;
- }
-
- return sal_False;
-}
-
-sal_Bool XMLNamedBoolPropertyHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- if( ::cppu::any2bool( rValue ) )
- {
- rStrExpValue = maTrueStr;
- }
- else
- {
- rStrExpValue = maFalseStr;
- }
-
- return sal_True;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_PageHeaderFooterContext.cxx b/binfilter/bf_xmloff/source/style/xmloff_PageHeaderFooterContext.cxx
deleted file mode 100644
index 3ed3e49da70a..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_PageHeaderFooterContext.cxx
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-// INCLUDE ---------------------------------------------------------------
-
-#include "PageHeaderFooterContext.hxx"
-#include "xmlnmspe.hxx"
-#include "PagePropertySetContext.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_PROPERTIES;
-
-//------------------------------------------------------------------
-
-PageHeaderFooterContext::PageHeaderFooterContext( SvXMLImport& rImport,
- USHORT nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
- ::std::vector< XMLPropertyState > & rTempProperties,
- const UniReference < SvXMLImportPropertyMapper > &rTempMap,
- sal_Int32 nStart, sal_Int32 nEnd,
- const sal_Bool bTempHeader ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rProperties(rTempProperties),
- rMap(rTempMap),
- nStartIndex(nStart),
- nEndIndex(nEnd)
-{
- bHeader = bTempHeader;
-}
-
-PageHeaderFooterContext::~PageHeaderFooterContext()
-{
-}
-
-SvXMLImportContext *PageHeaderFooterContext::CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext *pContext = 0;
-
- if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken( rLName, XML_PROPERTIES ) )
- {
- PageContextType aType = Header;
- if (!bHeader)
- aType = Footer;
- pContext = new PagePropertySetContext( GetImport(), nPrefix,
- rLName, xAttrList,
- rProperties,
- rMap, nStartIndex, nEndIndex, aType);
- }
-
-
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
-
- return pContext;
-}
-
-void PageHeaderFooterContext::EndElement()
-{
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_PageMasterExportPropMapper.cxx b/binfilter/bf_xmloff/source/style/xmloff_PageMasterExportPropMapper.cxx
deleted file mode 100644
index a5f4dd2e52cf..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_PageMasterExportPropMapper.cxx
+++ /dev/null
@@ -1,416 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "PageMasterExportPropMapper.hxx"
-
-#include <comphelper/types.hxx>
-
-#include <com/sun/star/table/BorderLine.hpp>
-#include "PageMasterStyleMap.hxx"
-
-#include <tools/debug.hxx>
-#include <comphelper/extract.hxx>
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::comphelper;
-using namespace ::binfilter::xmloff::token;
-
-
-//______________________________________________________________________________
-
-inline sal_Bool lcl_HasSameLineWidth( const table::BorderLine& rLine1, const table::BorderLine& rLine2 )
-{
- return (rLine1.InnerLineWidth == rLine2.InnerLineWidth) &&
- (rLine1.OuterLineWidth == rLine2.OuterLineWidth) &&
- (rLine1.LineDistance == rLine2.LineDistance);
-}
-
-inline sal_Bool operator==( const table::BorderLine& rLine1, const table::BorderLine& rLine2 )
-{
- return (rLine1.Color == rLine2.Color) &&
- 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 );
-}
-
-void lcl_AddState(::std::vector< XMLPropertyState >& rPropState, sal_Int32 nIndex, const ::rtl::OUString& rProperty, uno::Reference< beans::XPropertySet >& xProps)
-{
- if(::cppu::any2bool(xProps->getPropertyValue(rProperty)))
- rPropState.push_back(XMLPropertyState (nIndex, ::cppu::bool2any(sal_True)));
-}
-
-//______________________________________________________________________________
-// helper struct to handle equal XMLPropertyState's for page, header and footer
-
-struct XMLPropertyStateBuffer
-{
- XMLPropertyState* pPMBorderAll;
- XMLPropertyState* pPMBorderTop;
- XMLPropertyState* pPMBorderBottom;
- XMLPropertyState* pPMBorderLeft;
- XMLPropertyState* pPMBorderRight;
-
- XMLPropertyState* pPMBorderWidthAll;
- XMLPropertyState* pPMBorderWidthTop;
- XMLPropertyState* pPMBorderWidthBottom;
- XMLPropertyState* pPMBorderWidthLeft;
- XMLPropertyState* pPMBorderWidthRight;
-
- XMLPropertyState* pPMPaddingAll;
- XMLPropertyState* pPMPaddingTop;
- XMLPropertyState* pPMPaddingBottom;
- XMLPropertyState* pPMPaddingLeft;
- XMLPropertyState* pPMPaddingRight;
-
- XMLPropertyStateBuffer();
- void ContextFilter( ::std::vector< XMLPropertyState >& rPropState );
-};
-
-XMLPropertyStateBuffer::XMLPropertyStateBuffer() :
- pPMBorderAll( NULL ),
- pPMBorderTop( NULL ),
- pPMBorderBottom( NULL ),
- pPMBorderLeft( NULL ),
- pPMBorderRight( NULL ),
-
- pPMBorderWidthAll( NULL ),
- pPMBorderWidthTop( NULL ),
- pPMBorderWidthBottom( NULL ),
- pPMBorderWidthLeft( NULL ),
- pPMBorderWidthRight( NULL ),
-
- pPMPaddingAll( NULL ),
- pPMPaddingTop( NULL ),
- pPMPaddingBottom( NULL ),
- pPMPaddingLeft( NULL ),
- pPMPaddingRight( NULL )
-{
-}
-
-void XMLPropertyStateBuffer::ContextFilter( ::std::vector< XMLPropertyState >& rPropState )
-{
- if( pPMBorderAll )
- {
- if( pPMBorderTop && pPMBorderBottom && pPMBorderLeft && pPMBorderRight )
- {
- table::BorderLine aLineTop, aLineBottom, aLineLeft, aLineRight;
-
- pPMBorderTop->maValue >>= aLineTop;
- pPMBorderBottom->maValue >>= aLineBottom;
- pPMBorderLeft->maValue >>= aLineLeft;
- pPMBorderRight->maValue >>= aLineRight;
-
- if( (aLineTop == aLineBottom) && (aLineBottom == aLineLeft) && (aLineLeft == aLineRight) )
- {
- lcl_RemoveState( pPMBorderTop );
- lcl_RemoveState( pPMBorderBottom );
- lcl_RemoveState( pPMBorderLeft );
- lcl_RemoveState( pPMBorderRight );
- }
- else
- lcl_RemoveState( pPMBorderAll );
- }
- else
- lcl_RemoveState( pPMBorderAll );
- }
-
- if( pPMBorderWidthAll )
- {
- if( pPMBorderWidthTop && pPMBorderWidthBottom && pPMBorderWidthLeft && pPMBorderWidthRight )
- {
- table::BorderLine aLineTop, aLineBottom, aLineLeft, aLineRight;
-
- pPMBorderWidthTop->maValue >>= aLineTop;
- pPMBorderWidthBottom->maValue >>= aLineBottom;
- pPMBorderWidthLeft->maValue >>= aLineLeft;
- pPMBorderWidthRight->maValue >>= aLineRight;
-
- if( lcl_HasSameLineWidth( aLineTop, aLineBottom ) &&
- lcl_HasSameLineWidth( aLineBottom, aLineLeft ) &&
- lcl_HasSameLineWidth( aLineLeft, aLineRight ) )
- {
- lcl_RemoveState( pPMBorderWidthTop );
- lcl_RemoveState( pPMBorderWidthBottom );
- lcl_RemoveState( pPMBorderWidthLeft );
- lcl_RemoveState( pPMBorderWidthRight );
- }
- else
- lcl_RemoveState( pPMBorderWidthAll );
- }
- else
- lcl_RemoveState( pPMBorderWidthAll );
- }
-
- if( pPMPaddingAll )
- {
- if( pPMPaddingTop && pPMPaddingBottom && pPMPaddingLeft && pPMPaddingRight )
- {
- sal_Int32 nTop, nBottom, nLeft, nRight;
-
- pPMPaddingTop->maValue >>= nTop;
- pPMPaddingBottom->maValue >>= nBottom;
- pPMPaddingLeft->maValue >>= nLeft;
- pPMPaddingRight->maValue >>= nRight;
-
- if( (nTop == nBottom) && (nBottom == nLeft) && (nLeft == nRight) )
- {
- lcl_RemoveState( pPMPaddingTop );
- lcl_RemoveState( pPMPaddingBottom );
- lcl_RemoveState( pPMPaddingLeft );
- lcl_RemoveState( pPMPaddingRight );
- }
- else
- lcl_RemoveState( pPMPaddingAll );
- }
- else
- lcl_RemoveState( pPMPaddingAll );
- }
-}
-
-//______________________________________________________________________________
-
-XMLPageMasterExportPropMapper::XMLPageMasterExportPropMapper(
- const UniReference< XMLPropertySetMapper >& rMapper,
- SvXMLExport& rExport ) :
- SvXMLExportPropertyMapper( rMapper ),
- aBackgroundImageExport( rExport ),
- aTextColumnsExport( rExport ),
- aFootnoteSeparatorExport( rExport )
-{
-}
-
-XMLPageMasterExportPropMapper::~XMLPageMasterExportPropMapper()
-{
-}
-
-void XMLPageMasterExportPropMapper::handleElementItem(
- SvXMLExport& rExport,
- const XMLPropertyState& rProperty,
- sal_uInt16 nFlags,
- const ::std::vector< XMLPropertyState >* pProperties,
- sal_uInt32 nIdx ) const
-{
- XMLPageMasterExportPropMapper* pThis = (XMLPageMasterExportPropMapper*) this;
-
- sal_uInt32 nContextId = getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex );
- switch( nContextId )
- {
- case CTF_PM_GRAPHICURL:
- case CTF_PM_HEADERGRAPHICURL:
- case CTF_PM_FOOTERGRAPHICURL:
- {
- DBG_ASSERT( pProperties && (nIdx >= 2), "property vector missing" );
- sal_Int32 nPos;
- sal_Int32 nFilter;
- switch( nContextId )
- {
- case CTF_PM_GRAPHICURL:
- nPos = CTF_PM_GRAPHICPOSITION;
- nFilter = CTF_PM_GRAPHICFILTER;
- break;
- case CTF_PM_HEADERGRAPHICURL:
- nPos = CTF_PM_HEADERGRAPHICPOSITION;
- nFilter = CTF_PM_HEADERGRAPHICFILTER;
- break;
- case CTF_PM_FOOTERGRAPHICURL:
- nPos = CTF_PM_FOOTERGRAPHICPOSITION;
- nFilter = CTF_PM_FOOTERGRAPHICFILTER;
- break;
- }
- const Any* pPos = NULL;
- const Any* pFilter = NULL;
- if( pProperties && (nIdx >= 2) )
- {
- const XMLPropertyState& rPos = (*pProperties)[nIdx - 2];
- DBG_ASSERT( getPropertySetMapper()->GetEntryContextId( rPos.mnIndex ) == nPos,
- "invalid property map: pos expected" );
- if( getPropertySetMapper()->GetEntryContextId( rPos.mnIndex ) == nPos )
- pPos = &rPos.maValue;
-
- const XMLPropertyState& rFilter = (*pProperties)[nIdx - 1];
- DBG_ASSERT( getPropertySetMapper()->GetEntryContextId( rFilter.mnIndex ) == nFilter,
- "invalid property map: filter expected" );
- if( getPropertySetMapper()->GetEntryContextId( rFilter.mnIndex ) == nFilter )
- pFilter = &rFilter.maValue;
- }
- sal_uInt32 nPropIndex = rProperty.mnIndex;
- pThis->aBackgroundImageExport.exportXML( rProperty.maValue, pPos, pFilter, NULL,
- getPropertySetMapper()->GetEntryNameSpace( nPropIndex ),
- getPropertySetMapper()->GetEntryXMLName( nPropIndex ) );
- }
- break;
- case CTF_PM_TEXTCOLUMNS:
- pThis->aTextColumnsExport.exportXML( rProperty.maValue );
- break;
- case CTF_PM_FTN_LINE_WEIGTH:
- pThis->aFootnoteSeparatorExport.exportXML( pProperties, nIdx,
- getPropertySetMapper());
- break;
- }
-}
-
-void XMLPageMasterExportPropMapper::handleSpecialItem(
- SvXMLAttributeList& rAttrList,
- const XMLPropertyState& rProperty,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap,
- const ::std::vector< XMLPropertyState >* pProperties,
- sal_uInt32 nIdx) const
-{
-}
-
-void XMLPageMasterExportPropMapper::ContextFilter(
- ::std::vector< XMLPropertyState >& rPropState,
- Reference< XPropertySet > rPropSet ) const
-{
- XMLPropertyStateBuffer aPageBuffer;
- XMLPropertyStateBuffer aHeaderBuffer;
- XMLPropertyStateBuffer aFooterBuffer;
-
- XMLPropertyState* pPMHeaderHeight = NULL;
- XMLPropertyState* pPMHeaderMinHeight = NULL;
- XMLPropertyState* pPMHeaderDynamic = NULL;
-
- XMLPropertyState* pPMFooterHeight = NULL;
- XMLPropertyState* pPMFooterMinHeight = NULL;
- XMLPropertyState* pPMFooterDynamic = NULL;
-
- XMLPropertyState* pPMScaleTo = NULL;
- XMLPropertyState* pPMScaleToPages = NULL;
-
- XMLPropertyState* pPrint = NULL;
-
- UniReference < XMLPropertySetMapper > aPropMapper(getPropertySetMapper());
-
- for( ::std::vector< XMLPropertyState >::iterator pProp = rPropState.begin(); pProp != rPropState.end(); pProp++ )
- {
- sal_Int16 nContextId = aPropMapper->GetEntryContextId( pProp->mnIndex );
- sal_Int16 nFlag = nContextId & CTF_PM_FLAGMASK;
- sal_Int16 nSimpleId = nContextId & (~CTF_PM_FLAGMASK | XML_PM_CTF_START);
- sal_Int16 nPrintId = nContextId & CTF_PM_PRINTMASK;
-
- XMLPropertyStateBuffer* pBuffer;
- switch( nFlag )
- {
- case CTF_PM_HEADERFLAG: pBuffer = &aHeaderBuffer; break;
- case CTF_PM_FOOTERFLAG: pBuffer = &aFooterBuffer; break;
- default: pBuffer = &aPageBuffer; break;
- }
-
- switch( nSimpleId )
- {
- case CTF_PM_BORDERALL: pBuffer->pPMBorderAll = &(*pProp); break;
- case CTF_PM_BORDERTOP: pBuffer->pPMBorderTop = &(*pProp); break;
- case CTF_PM_BORDERBOTTOM: pBuffer->pPMBorderBottom = &(*pProp); break;
- case CTF_PM_BORDERLEFT: pBuffer->pPMBorderLeft = &(*pProp); break;
- case CTF_PM_BORDERRIGHT: pBuffer->pPMBorderRight = &(*pProp); break;
- case CTF_PM_BORDERWIDTHALL: pBuffer->pPMBorderWidthAll = &(*pProp); break;
- case CTF_PM_BORDERWIDTHTOP: pBuffer->pPMBorderWidthTop = &(*pProp); break;
- case CTF_PM_BORDERWIDTHBOTTOM: pBuffer->pPMBorderWidthBottom = &(*pProp); break;
- case CTF_PM_BORDERWIDTHLEFT: pBuffer->pPMBorderWidthLeft = &(*pProp); break;
- case CTF_PM_BORDERWIDTHRIGHT: pBuffer->pPMBorderWidthRight = &(*pProp); break;
- case CTF_PM_PADDINGALL: pBuffer->pPMPaddingAll = &(*pProp); break;
- case CTF_PM_PADDINGTOP: pBuffer->pPMPaddingTop = &(*pProp); break;
- case CTF_PM_PADDINGBOTTOM: pBuffer->pPMPaddingBottom = &(*pProp); break;
- case CTF_PM_PADDINGLEFT: pBuffer->pPMPaddingLeft = &(*pProp); break;
- case CTF_PM_PADDINGRIGHT: pBuffer->pPMPaddingRight = &(*pProp); break;
- }
-
- switch( nContextId )
- {
- case CTF_PM_HEADERHEIGHT: pPMHeaderHeight = &(*pProp); break;
- case CTF_PM_HEADERMINHEIGHT: pPMHeaderMinHeight = &(*pProp); break;
- case CTF_PM_HEADERDYNAMIC: pPMHeaderDynamic = &(*pProp); break;
- 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;
- }
- if (nPrintId == CTF_PM_PRINTMASK)
- {
- pPrint = &(*pProp);
- lcl_RemoveState(pPrint);
- }
- }
-
- aPageBuffer.ContextFilter( rPropState );
- aHeaderBuffer.ContextFilter( rPropState );
- aFooterBuffer.ContextFilter( rPropState );
-
- if( pPMHeaderHeight && (!pPMHeaderDynamic || (pPMHeaderDynamic && getBOOL( pPMHeaderDynamic->maValue ))) )
- lcl_RemoveState( pPMHeaderHeight );
- if( pPMHeaderMinHeight && pPMHeaderDynamic && !getBOOL( pPMHeaderDynamic->maValue ) )
- lcl_RemoveState( pPMHeaderMinHeight );
- if( pPMHeaderDynamic )
- lcl_RemoveState( pPMHeaderDynamic );
-
- if( pPMFooterHeight && (!pPMFooterDynamic || (pPMFooterDynamic && getBOOL( pPMFooterDynamic->maValue ))) )
- lcl_RemoveState( pPMFooterHeight );
- if( pPMFooterMinHeight && pPMFooterDynamic && !getBOOL( pPMFooterDynamic->maValue ) )
- lcl_RemoveState( pPMFooterMinHeight );
- if( pPMFooterDynamic )
- lcl_RemoveState( pPMFooterDynamic );
-
- if( pPMScaleTo )
- lcl_RemoveStateIfZero16( pPMScaleTo );
- if( pPMScaleToPages )
- lcl_RemoveStateIfZero16( pPMScaleToPages );
-
- if (pPrint)
- {
- lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_ANNOTATIONS), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintAnnotations")), rPropSet);
- lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_CHARTS), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintCharts")), rPropSet);
- lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_DRAWING), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintDrawing")), rPropSet);
- lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_FORMULAS), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintFormulas")), rPropSet);
- lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_GRID), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintGrid")), rPropSet);
- lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_HEADERS), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintHeaders")), rPropSet);
- lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_OBJECTS), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintObjects")), rPropSet);
- lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_ZEROVALUES), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintZeroValues")), rPropSet);
- }
-
- SvXMLExportPropertyMapper::ContextFilter(rPropState,rPropSet);
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_PageMasterImportContext.cxx b/binfilter/bf_xmloff/source/style/xmloff_PageMasterImportContext.cxx
deleted file mode 100644
index c35dfe5d35f8..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_PageMasterImportContext.cxx
+++ /dev/null
@@ -1,178 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include "PageMasterImportContext.hxx"
-
-#include "xmlnmspe.hxx"
-#include "PageMasterPropHdl.hxx"
-#include "PagePropertySetContext.hxx"
-#include "PageHeaderFooterContext.hxx"
-#include "PageMasterStyleMap.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-void PageStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
- const ::rtl::OUString& rLocalName,
- const ::rtl::OUString& rValue )
-{
- // TODO: use a map here
- if( XML_NAMESPACE_STYLE == nPrefixKey && IsXMLToken( rLocalName, XML_PAGE_USAGE ) )
- {
- sPageUsage = rValue;
- }
- else
- {
- XMLPropStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue );
- }
-}
-
-TYPEINIT1( PageStyleContext, XMLPropStyleContext );
-
-PageStyleContext::PageStyleContext( SvXMLImport& rImport,
- sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList,
- SvXMLStylesContext& rStyles) :
- XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, XML_STYLE_FAMILY_PAGE_MASTER ),
- sPageUsage()
-{
-}
-
-PageStyleContext::~PageStyleContext()
-{
-}
-
-SvXMLImportContext *PageStyleContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = NULL;
-
- if( XML_NAMESPACE_STYLE == nPrefix &&
- ((IsXMLToken(rLocalName, XML_HEADER_STYLE )) ||
- (IsXMLToken(rLocalName, XML_FOOTER_STYLE )) ) )
- {
- sal_Bool bHeader = IsXMLToken(rLocalName, XML_HEADER_STYLE);
- UniReference < SvXMLImportPropertyMapper > xImpPrMap =
- GetStyles()->GetImportPropertyMapper( GetFamily() );
- if( xImpPrMap.is() )
- {
- const UniReference< XMLPropertySetMapper >& rMapper = xImpPrMap->getPropertySetMapper();
- sal_Int32 nFlag;
- if (bHeader)
- nFlag = CTF_PM_HEADERFLAG;
- else
- nFlag = CTF_PM_FOOTERFLAG;
- sal_Int32 nStartIndex (-1);
- sal_Int32 nEndIndex (-1);
- sal_Bool bFirst(sal_False);
- sal_Bool bEnd(sal_False);
- sal_Int32 nIndex = 0;
- while ( nIndex < rMapper->GetEntryCount() && !bEnd)
- {
- if ((rMapper->GetEntryContextId( nIndex ) & CTF_PM_FLAGMASK) == nFlag)
- {
- if (!bFirst)
- {
- bFirst = sal_True;
- nStartIndex = nIndex;
- }
- }
- else if (bFirst)
- {
- bEnd = sal_True;
- nEndIndex = nIndex;
- }
- nIndex++;
- }
- if (!bEnd)
- nEndIndex = nIndex;
- pContext = new PageHeaderFooterContext(GetImport(), nPrefix, rLocalName,
- xAttrList, GetProperties(), xImpPrMap, nStartIndex, nEndIndex, bHeader);
- }
- }
- if( XML_NAMESPACE_STYLE == nPrefix &&
- IsXMLToken(rLocalName, XML_PROPERTIES) )
- {
- UniReference < SvXMLImportPropertyMapper > xImpPrMap =
- GetStyles()->GetImportPropertyMapper( GetFamily() );
- if( xImpPrMap.is() )
- {
- const UniReference< XMLPropertySetMapper >& rMapper = xImpPrMap->getPropertySetMapper();
- sal_Int32 nEndIndex (-1);
- sal_Bool bEnd(sal_False);
- sal_Int32 nIndex = 0;
- sal_Int16 nContextID;
- while ( nIndex < rMapper->GetEntryCount() && !bEnd)
- {
- nContextID = rMapper->GetEntryContextId( nIndex );
- if (nContextID && ((nContextID & CTF_PM_FLAGMASK) != XML_PM_CTF_START))
- {
- nEndIndex = nIndex;
- bEnd = sal_True;
- }
- nIndex++;
- }
- if (!bEnd)
- nEndIndex = nIndex;
- PageContextType aType = Page;
- pContext = new PagePropertySetContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- GetProperties(),
- xImpPrMap, 0, nEndIndex, aType);
- }
- }
-
- if (!pContext)
- pContext = XMLPropStyleContext::CreateChildContext( nPrefix, rLocalName,
- xAttrList );
- return pContext;
-}
-
-void PageStyleContext::FillPropertySet(
- const uno::Reference<beans::XPropertySet > & rPropSet )
-{
- XMLPropStyleContext::FillPropertySet(rPropSet);
- if (sPageUsage.getLength())
- {
- uno::Any aPageUsage;
- XMLPMPropHdl_PageStyleLayout aPageUsageHdl;
- if (aPageUsageHdl.importXML(sPageUsage, aPageUsage, GetImport().GetMM100UnitConverter()))
- rPropSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PageStyleLayout")), aPageUsage);
- }
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_PageMasterImportPropMapper.cxx b/binfilter/bf_xmloff/source/style/xmloff_PageMasterImportPropMapper.cxx
deleted file mode 100644
index b467bffe93ff..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_PageMasterImportPropMapper.cxx
+++ /dev/null
@@ -1,337 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-#include "PageMasterImportPropMapper.hxx"
-#include "PageMasterPropMapper.hxx"
-#include "PageMasterStyleMap.hxx"
-
-#include <com/sun/star/table/BorderLine.hpp>
-#include "xmlimp.hxx"
-namespace binfilter {
-
-#define XML_LINE_LEFT 0
-#define XML_LINE_RIGHT 1
-#define XML_LINE_TOP 2
-#define XML_LINE_BOTTOM 3
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::container;
-
-PageMasterImportPropertyMapper::PageMasterImportPropertyMapper(
- const UniReference< XMLPropertySetMapper >& rMapper,
- SvXMLImport& rImp ) :
- SvXMLImportPropertyMapper( rMapper, rImp ),
- rImport( rImp )
-{
-}
-
-PageMasterImportPropertyMapper::~PageMasterImportPropertyMapper()
-{
-}
-
-sal_Bool PageMasterImportPropertyMapper::handleSpecialItem(
- XMLPropertyState& rProperty,
- ::std::vector< XMLPropertyState >& rProperties,
- const ::rtl::OUString& rValue,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int16 nContextID =
- getPropertySetMapper()->GetEntryContextId(rProperty.mnIndex);
-
- if( CTF_PM_REGISTER_STYLE==nContextID )
- {
- Reference < XNameContainer > xParaStyles =
- rImport.GetTextImport()->GetParaStyles();
- if( xParaStyles.is() && xParaStyles->hasByName( rValue ) )
- {
- rProperty.maValue <<= rValue;
- bRet = sal_True;
- }
- }
- else
- {
- bRet = SvXMLImportPropertyMapper::handleSpecialItem(
- rProperty, rProperties, rValue,
- rUnitConverter, rNamespaceMap );
- }
-
- return bRet;
-}
-
-
-void PageMasterImportPropertyMapper::finished(::std::vector< XMLPropertyState >& rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const
-{
- SvXMLImportPropertyMapper::finished(rProperties, nStartIndex, nEndIndex);
- XMLPropertyState* pAllPaddingProperty = NULL;
- XMLPropertyState* pPadding[4] = { NULL, NULL, NULL, NULL };
- XMLPropertyState* pNewPadding[4] = { NULL, NULL, NULL, NULL };
- XMLPropertyState* pAllBorderProperty = NULL;
- XMLPropertyState* pBorders[4] = { NULL, NULL, NULL, NULL };
- XMLPropertyState* pNewBorders[4] = { NULL, NULL, NULL, NULL };
- XMLPropertyState* pAllBorderWidthProperty = NULL;
- XMLPropertyState* pBorderWidths[4] = { NULL, NULL, NULL, NULL };
- XMLPropertyState* pAllHeaderPaddingProperty = NULL;
- XMLPropertyState* pHeaderPadding[4] = { NULL, NULL, NULL, NULL };
- XMLPropertyState* pHeaderNewPadding[4] = { NULL, NULL, NULL, NULL };
- XMLPropertyState* pAllHeaderBorderProperty = NULL;
- XMLPropertyState* pHeaderBorders[4] = { NULL, NULL, NULL, NULL };
- XMLPropertyState* pHeaderNewBorders[4] = { NULL, NULL, NULL, NULL };
- XMLPropertyState* pAllHeaderBorderWidthProperty = NULL;
- XMLPropertyState* pHeaderBorderWidths[4] = { NULL, NULL, NULL, NULL };
- XMLPropertyState* pAllFooterPaddingProperty = NULL;
- XMLPropertyState* pFooterPadding[4] = { NULL, NULL, NULL, NULL };
- XMLPropertyState* pFooterNewPadding[4] = { NULL, NULL, NULL, NULL };
- XMLPropertyState* pAllFooterBorderProperty = NULL;
- XMLPropertyState* pFooterBorders[4] = { NULL, NULL, NULL, NULL };
- XMLPropertyState* pFooterNewBorders[4] = { NULL, NULL, NULL, NULL };
- XMLPropertyState* pAllFooterBorderWidthProperty = NULL;
- XMLPropertyState* pFooterBorderWidths[4] = { NULL, NULL, NULL, NULL };
- XMLPropertyState* pHeaderHeight = NULL;
- XMLPropertyState* pHeaderMinHeight = NULL;
- XMLPropertyState* pHeaderDynamic = NULL;
- XMLPropertyState* pFooterHeight = NULL;
- XMLPropertyState* pFooterMinHeight = NULL;
- XMLPropertyState* pFooterDynamic = NULL;
- ::std::vector< XMLPropertyState >::iterator property = rProperties.begin();
- for (property; property != rProperties.end(); property++)
- {
- sal_Int16 nContextID = getPropertySetMapper()->GetEntryContextId(property->mnIndex);
- if (property->mnIndex >= nStartIndex && property->mnIndex < nEndIndex)
- {
- switch (nContextID)
- {
- case CTF_PM_PADDINGALL : pAllPaddingProperty = &(*property); break;
- case CTF_PM_PADDINGLEFT : pPadding[XML_LINE_LEFT] = &(*property); break;
- case CTF_PM_PADDINGRIGHT : pPadding[XML_LINE_RIGHT] = &(*property); break;
- case CTF_PM_PADDINGTOP : pPadding[XML_LINE_TOP] = &(*property); break;
- case CTF_PM_PADDINGBOTTOM : pPadding[XML_LINE_BOTTOM] = &(*property); break;
- case CTF_PM_BORDERALL : pAllBorderProperty = &(*property); break;
- case CTF_PM_BORDERLEFT : pBorders[XML_LINE_LEFT] = &(*property); break;
- case CTF_PM_BORDERRIGHT : pBorders[XML_LINE_RIGHT] = &(*property); break;
- case CTF_PM_BORDERTOP : pBorders[XML_LINE_TOP] = &(*property); break;
- case CTF_PM_BORDERBOTTOM : pBorders[XML_LINE_BOTTOM] = &(*property); break;
- case CTF_PM_BORDERWIDTHALL : pAllBorderWidthProperty = &(*property); break;
- case CTF_PM_BORDERWIDTHLEFT : pBorderWidths[XML_LINE_LEFT] = &(*property); break;
- case CTF_PM_BORDERWIDTHRIGHT : pBorderWidths[XML_LINE_RIGHT] = &(*property); break;
- case CTF_PM_BORDERWIDTHTOP : pBorderWidths[XML_LINE_TOP] = &(*property); break;
- case CTF_PM_BORDERWIDTHBOTTOM : pBorderWidths[XML_LINE_BOTTOM] = &(*property); break;
- case CTF_PM_HEADERPADDINGALL : pAllHeaderPaddingProperty = &(*property); break;
- case CTF_PM_HEADERPADDINGLEFT : pHeaderPadding[XML_LINE_LEFT] = &(*property); break;
- case CTF_PM_HEADERPADDINGRIGHT : pHeaderPadding[XML_LINE_RIGHT] = &(*property); break;
- case CTF_PM_HEADERPADDINGTOP : pHeaderPadding[XML_LINE_TOP] = &(*property); break;
- case CTF_PM_HEADERPADDINGBOTTOM : pHeaderPadding[XML_LINE_BOTTOM] = &(*property); break;
- case CTF_PM_HEADERBORDERALL : pAllHeaderBorderProperty = &(*property); break;
- case CTF_PM_HEADERBORDERLEFT : pHeaderBorders[XML_LINE_LEFT] = &(*property); break;
- case CTF_PM_HEADERBORDERRIGHT : pHeaderBorders[XML_LINE_RIGHT] = &(*property); break;
- case CTF_PM_HEADERBORDERTOP : pHeaderBorders[XML_LINE_TOP] = &(*property); break;
- case CTF_PM_HEADERBORDERBOTTOM : pHeaderBorders[XML_LINE_BOTTOM] = &(*property); break;
- case CTF_PM_HEADERBORDERWIDTHALL : pAllHeaderBorderWidthProperty = &(*property); break;
- case CTF_PM_HEADERBORDERWIDTHLEFT : pHeaderBorderWidths[XML_LINE_LEFT] = &(*property); break;
- case CTF_PM_HEADERBORDERWIDTHRIGHT : pHeaderBorderWidths[XML_LINE_RIGHT] = &(*property); break;
- case CTF_PM_HEADERBORDERWIDTHTOP : pHeaderBorderWidths[XML_LINE_TOP] = &(*property); break;
- case CTF_PM_HEADERBORDERWIDTHBOTTOM : pHeaderBorderWidths[XML_LINE_BOTTOM] = &(*property); break;
- case CTF_PM_FOOTERPADDINGALL : pAllFooterPaddingProperty = &(*property); break;
- case CTF_PM_FOOTERPADDINGLEFT : pFooterPadding[XML_LINE_LEFT] = &(*property); break;
- case CTF_PM_FOOTERPADDINGRIGHT : pFooterPadding[XML_LINE_RIGHT] = &(*property); break;
- case CTF_PM_FOOTERPADDINGTOP : pFooterPadding[XML_LINE_TOP] = &(*property); break;
- case CTF_PM_FOOTERPADDINGBOTTOM : pFooterPadding[XML_LINE_BOTTOM] = &(*property); break;
- case CTF_PM_FOOTERBORDERALL : pAllFooterBorderProperty = &(*property); break;
- case CTF_PM_FOOTERBORDERLEFT : pFooterBorders[XML_LINE_LEFT] = &(*property); break;
- case CTF_PM_FOOTERBORDERRIGHT : pFooterBorders[XML_LINE_RIGHT] = &(*property); break;
- case CTF_PM_FOOTERBORDERTOP : pFooterBorders[XML_LINE_TOP] = &(*property); break;
- case CTF_PM_FOOTERBORDERBOTTOM : pFooterBorders[XML_LINE_BOTTOM] = &(*property); break;
- case CTF_PM_FOOTERBORDERWIDTHALL : pAllFooterBorderWidthProperty = &(*property); break;
- case CTF_PM_FOOTERBORDERWIDTHLEFT : pFooterBorderWidths[XML_LINE_LEFT] = &(*property); break;
- case CTF_PM_FOOTERBORDERWIDTHRIGHT : pFooterBorderWidths[XML_LINE_RIGHT] = &(*property); break;
- case CTF_PM_FOOTERBORDERWIDTHTOP : pFooterBorderWidths[XML_LINE_TOP] = &(*property); break;
- case CTF_PM_FOOTERBORDERWIDTHBOTTOM : pFooterBorderWidths[XML_LINE_BOTTOM] = &(*property); break;
- case CTF_PM_HEADERHEIGHT : pHeaderHeight = &(*property); break;
- case CTF_PM_HEADERMINHEIGHT : pHeaderMinHeight = &(*property); break;
- case CTF_PM_FOOTERHEIGHT : pFooterHeight = &(*property); break;
- case CTF_PM_FOOTERMINHEIGHT : pFooterMinHeight = &(*property); break;
- }
- }
- }
-
- sal_uInt16 i;
- for (i = 0; i < 4; i++)
- {
- if (pAllPaddingProperty && !pPadding[i])
- pNewPadding[i] = new XMLPropertyState(pAllPaddingProperty->mnIndex + 1 + i, pAllPaddingProperty->maValue);
- if (pAllBorderProperty && !pBorders[i])
- {
- pNewBorders[i] = new XMLPropertyState(pAllBorderProperty->mnIndex + 1 + i, pAllBorderProperty->maValue);
- pBorders[i] = pNewBorders[i];
- }
- if( !pBorderWidths[i] )
- pBorderWidths[i] = pAllBorderWidthProperty;
- else
- pBorderWidths[i]->mnIndex = -1;
- if( pBorders[i] )
- {
- table::BorderLine aBorderLine;
- pBorders[i]->maValue >>= aBorderLine;
- if( pBorderWidths[i] )
- {
- table::BorderLine aBorderLineWidth;
- pBorderWidths[i]->maValue >>= aBorderLineWidth;
- aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
- aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
- aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
- pBorders[i]->maValue <<= aBorderLine;
- }
- }
- if (pAllHeaderPaddingProperty && !pHeaderPadding[i])
- pHeaderNewPadding[i] = new XMLPropertyState(pAllHeaderPaddingProperty->mnIndex + 1 + i, pAllHeaderPaddingProperty->maValue);
- if (pAllHeaderBorderProperty && !pHeaderBorders[i])
- pHeaderNewBorders[i] = new XMLPropertyState(pAllHeaderBorderProperty->mnIndex + 1 + i, pAllHeaderBorderProperty->maValue);
- if( !pHeaderBorderWidths[i] )
- pHeaderBorderWidths[i] = pAllHeaderBorderWidthProperty;
- else
- pHeaderBorderWidths[i]->mnIndex = -1;
- if( pHeaderBorders[i] )
- {
- table::BorderLine aBorderLine;
- pHeaderBorders[i]->maValue >>= aBorderLine;
- if( pHeaderBorderWidths[i] )
- {
- table::BorderLine aBorderLineWidth;
- pHeaderBorderWidths[i]->maValue >>= aBorderLineWidth;
- aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
- aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
- aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
- pHeaderBorders[i]->maValue <<= aBorderLine;
- }
- }
- if (pAllFooterPaddingProperty && !pFooterPadding[i])
- pFooterNewPadding[i] = new XMLPropertyState(pAllFooterPaddingProperty->mnIndex + 1 + i, pAllFooterPaddingProperty->maValue);
- if (pAllFooterBorderProperty && !pFooterBorders[i])
- pFooterNewBorders[i] = new XMLPropertyState(pAllFooterBorderProperty->mnIndex + 1 + i, pAllFooterBorderProperty->maValue);
- if( !pFooterBorderWidths[i] )
- pFooterBorderWidths[i] = pAllFooterBorderWidthProperty;
- else
- pFooterBorderWidths[i]->mnIndex = -1;
- if( pFooterBorders[i] )
- {
- table::BorderLine aBorderLine;
- pFooterBorders[i]->maValue >>= aBorderLine;
- if( pFooterBorderWidths[i] )
- {
- table::BorderLine aBorderLineWidth;
- pFooterBorderWidths[i]->maValue >>= aBorderLineWidth;
- aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
- aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
- aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
- pFooterBorders[i]->maValue <<= aBorderLine;
- }
- }
- }
-
- if (pHeaderHeight)
- {
- sal_Bool bValue(sal_False);
- uno::Any aAny;
- aAny.setValue( &bValue, ::getBooleanCppuType() );
- pHeaderDynamic = new XMLPropertyState(pHeaderHeight->mnIndex + 2, aAny);
- }
- if (pHeaderMinHeight)
- {
- sal_Bool bValue(sal_True);
- uno::Any aAny;
- aAny.setValue( &bValue, ::getBooleanCppuType() );
- pHeaderDynamic = new XMLPropertyState(pHeaderMinHeight->mnIndex + 1, aAny);
- }
- if (pFooterHeight)
- {
- sal_Bool bValue(sal_False);
- uno::Any aAny;
- aAny.setValue( &bValue, ::getBooleanCppuType() );
- pFooterDynamic = new XMLPropertyState(pFooterHeight->mnIndex + 2, aAny);
- }
- if (pFooterMinHeight)
- {
- sal_Bool bValue(sal_True);
- uno::Any aAny;
- aAny.setValue( &bValue, ::getBooleanCppuType() );
- pFooterDynamic = new XMLPropertyState(pFooterMinHeight->mnIndex + 1, aAny);
- }
- for (i = 0; i < 4; i++)
- {
- if (pNewPadding[i])
- {
- rProperties.push_back(*pNewPadding[i]);
- delete pNewPadding[i];
- }
- if (pNewBorders[i])
- {
- rProperties.push_back(*pNewBorders[i]);
- delete pNewBorders[i];
- }
- if (pHeaderNewPadding[i])
- {
- rProperties.push_back(*pHeaderNewPadding[i]);
- delete pHeaderNewPadding[i];
- }
- if (pHeaderNewBorders[i])
- {
- rProperties.push_back(*pHeaderNewBorders[i]);
- delete pHeaderNewBorders[i];
- }
- if (pFooterNewPadding[i])
- {
- rProperties.push_back(*pFooterNewPadding[i]);
- delete pFooterNewPadding[i];
- }
- if (pFooterNewBorders[i])
- {
- rProperties.push_back(*pFooterNewBorders[i]);
- delete pFooterNewBorders[i];
- }
- }
- if(pHeaderDynamic)
- {
- rProperties.push_back(*pHeaderDynamic);
- delete pHeaderDynamic;
- }
- if(pFooterDynamic)
- {
- rProperties.push_back(*pFooterDynamic);
- delete pFooterDynamic;
- }
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_PageMasterPropHdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_PageMasterPropHdl.cxx
deleted file mode 100644
index ed652a4fb885..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_PageMasterPropHdl.cxx
+++ /dev/null
@@ -1,428 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "PageMasterPropHdl.hxx"
-
-#include "xmluconv.hxx"
-#include "xmlnumi.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-#include <com/sun/star/style/PageStyleLayout.hpp>
-
-#include <comphelper/types.hxx>
-#include <comphelper/extract.hxx>
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::style;
-using namespace ::comphelper;
-using namespace ::binfilter::xmloff::token;
-
-
-//______________________________________________________________________________
-
-#define DEFAULT_PAPERTRAY (sal_Int32(-1))
-
-
-//______________________________________________________________________________
-// property handler for style:page-usage (style::PageStyleLayout)
-
-XMLPMPropHdl_PageStyleLayout::~XMLPMPropHdl_PageStyleLayout()
-{
-}
-
-sal_Bool XMLPMPropHdl_PageStyleLayout::equals( const Any& rAny1, const Any& rAny2 ) const
-{
- style::PageStyleLayout eLayout1, eLayout2;
- return ((rAny1 >>= eLayout1) && (rAny2 >>= eLayout2)) ? (eLayout1 == eLayout2) : sal_False;
-}
-
-sal_Bool XMLPMPropHdl_PageStyleLayout::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_True;
-
- if( IsXMLToken( rStrImpValue, XML_ALL ) )
- rValue <<= PageStyleLayout_ALL;
- else if( IsXMLToken( rStrImpValue, XML_LEFT ) )
- rValue <<= PageStyleLayout_LEFT;
- else if( IsXMLToken( rStrImpValue, XML_RIGHT ) )
- rValue <<= PageStyleLayout_RIGHT;
- else if( IsXMLToken( rStrImpValue, XML_MIRRORED ) )
- rValue <<= PageStyleLayout_MIRRORED;
- else
- bRet = sal_False;
-
- return bRet;
-}
-
-sal_Bool XMLPMPropHdl_PageStyleLayout::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- PageStyleLayout eLayout;
-
- if( rValue >>= eLayout )
- {
- bRet = sal_True;
- switch( eLayout )
- {
- case PageStyleLayout_ALL:
- rStrExpValue = GetXMLToken( XML_ALL );
- break;
- case PageStyleLayout_LEFT:
- rStrExpValue = GetXMLToken( XML_LEFT );
- break;
- case PageStyleLayout_RIGHT:
- rStrExpValue = GetXMLToken( XML_RIGHT );
- break;
- case PageStyleLayout_MIRRORED:
- rStrExpValue = GetXMLToken( XML_MIRRORED );
- break;
- default:
- bRet = sal_False;
- }
- }
-
- return bRet;
-}
-
-
-//______________________________________________________________________________
-// property handler for style:num-format (style::NumberingType)
-
-XMLPMPropHdl_NumFormat::~XMLPMPropHdl_NumFormat()
-{
-}
-
-sal_Bool XMLPMPropHdl_NumFormat::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Int16 nSync;
- sal_Int16 nNumType = NumberingType::NUMBER_NONE;
- rUnitConverter.convertNumFormat( nNumType, rStrImpValue, OUString(),
- sal_True );
-
- if( !(rValue >>= nSync) )
- nSync = NumberingType::NUMBER_NONE;
-
- // if num-letter-sync appears before num-format, the function
- // XMLPMPropHdl_NumLetterSync::importXML() sets the value
- // NumberingType::CHARS_LOWER_LETTER_N
- if( nSync == NumberingType::CHARS_LOWER_LETTER_N )
- {
- switch( nNumType )
- {
- case NumberingType::CHARS_LOWER_LETTER:
- nNumType = NumberingType::CHARS_LOWER_LETTER_N;
- break;
- case NumberingType::CHARS_UPPER_LETTER:
- nNumType = NumberingType::CHARS_UPPER_LETTER_N;
- break;
- }
- }
- rValue <<= nNumType;
-
- return sal_True;
-}
-
-sal_Bool XMLPMPropHdl_NumFormat::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int16 nNumType;
-
- if( rValue >>= nNumType )
- {
- OUStringBuffer aBuffer( 10 );
- rUnitConverter.convertNumFormat( aBuffer, nNumType );
- rStrExpValue = aBuffer.makeStringAndClear();
- bRet = sal_True;
- }
- return bRet;
-}
-
-
-//______________________________________________________________________________
-// property handler for style:num-letter-sync (style::NumberingType)
-
-XMLPMPropHdl_NumLetterSync::~XMLPMPropHdl_NumLetterSync()
-{
-}
-
-sal_Bool XMLPMPropHdl_NumLetterSync::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Int16 nNumType;
- sal_Int16 nSync = NumberingType::NUMBER_NONE;
- rUnitConverter.convertNumFormat( nSync, rStrImpValue,
- GetXMLToken( XML_A ), sal_True );
-
- if( !(rValue >>= nNumType) )
- nNumType = NumberingType::NUMBER_NONE;
-
- if( nSync == NumberingType::CHARS_LOWER_LETTER_N )
- {
- switch( nNumType )
- {
- case NumberingType::CHARS_LOWER_LETTER:
- nNumType = NumberingType::CHARS_LOWER_LETTER_N;
- break;
- case NumberingType::CHARS_UPPER_LETTER:
- nNumType = NumberingType::CHARS_UPPER_LETTER_N;
- break;
- }
- }
- rValue <<= nNumType;
-
- return sal_True;
-}
-
-sal_Bool XMLPMPropHdl_NumLetterSync::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int16 nNumType;
-
- if( rValue >>= nNumType )
- {
- OUStringBuffer aBuffer( 5 );
- rUnitConverter.convertNumLetterSync( aBuffer, nNumType );
- rStrExpValue = aBuffer.makeStringAndClear();
- bRet = rStrExpValue.getLength() > 0;
- }
- return bRet;
-}
-
-
-//______________________________________________________________________________
-// property handler for style:paper-tray-number
-
-XMLPMPropHdl_PaperTrayNumber::~XMLPMPropHdl_PaperTrayNumber()
-{
-}
-
-sal_Bool XMLPMPropHdl_PaperTrayNumber::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- if( IsXMLToken( rStrImpValue, XML_DEFAULT ) )
- {
- rValue <<= DEFAULT_PAPERTRAY;
- bRet = sal_True;
- }
- else
- {
- sal_Int32 nPaperTray;
- if( SvXMLUnitConverter::convertNumber( nPaperTray, rStrImpValue, 0 ) )
- {
- rValue <<= nPaperTray;
- bRet = sal_True;
- }
- }
-
- return bRet;
-}
-
-sal_Bool XMLPMPropHdl_PaperTrayNumber::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int32 nPaperTray;
-
- if( rValue >>= nPaperTray )
- {
- if( nPaperTray == DEFAULT_PAPERTRAY )
- rStrExpValue = GetXMLToken( XML_DEFAULT );
- else
- {
- OUStringBuffer aBuffer;
- SvXMLUnitConverter::convertNumber( aBuffer, nPaperTray );
- rStrExpValue = aBuffer.makeStringAndClear();
- }
- bRet = sal_True;
- }
- return bRet;
-}
-
-
-//______________________________________________________________________________
-// property handler for style:print
-
-XMLPMPropHdl_Print::XMLPMPropHdl_Print( enum XMLTokenEnum eValue ) :
- sAttrValue( GetXMLToken( eValue ) )
-{
-}
-
-XMLPMPropHdl_Print::~XMLPMPropHdl_Print()
-{
-}
-
-sal_Bool XMLPMPropHdl_Print::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Unicode cToken = ' ';
- sal_Int32 nTokenIndex = 0;
- sal_Bool bFound = sal_False;
-
- do
- {
- bFound = (sAttrValue == rStrImpValue.getToken( 0, cToken, nTokenIndex ));
- }
- while ( (nTokenIndex >= 0) && !bFound );
-
- setBOOL( rValue, bFound );
- return sal_True;
-}
-
-sal_Bool XMLPMPropHdl_Print::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- if( getBOOL( rValue ) )
- {
- if( rStrExpValue.getLength() )
- rStrExpValue += OUString( RTL_CONSTASCII_USTRINGPARAM( " " ) );
- rStrExpValue += sAttrValue;
- }
-
- return sal_True;
-}
-
-//______________________________________________________________________________
-// property handler for style:table-centering
-
-XMLPMPropHdl_CenterHorizontal::~XMLPMPropHdl_CenterHorizontal()
-{
-}
-
-sal_Bool XMLPMPropHdl_CenterHorizontal::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- if (rStrImpValue.getLength())
- if (IsXMLToken( rStrImpValue, XML_BOTH) ||
- IsXMLToken( rStrImpValue, XML_HORIZONTAL))
- {
- rValue = ::cppu::bool2any(sal_True);
- bRet = sal_True;
- }
-
-
- return bRet;
-}
-
-sal_Bool XMLPMPropHdl_CenterHorizontal::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- if ( ::cppu::any2bool( rValue ) )
- {
- bRet = sal_True;
- if (rStrExpValue.getLength())
- rStrExpValue = GetXMLToken(XML_BOTH);
- else
- rStrExpValue = GetXMLToken(XML_HORIZONTAL);
- }
-
- return bRet;
-}
-
-XMLPMPropHdl_CenterVertical::~XMLPMPropHdl_CenterVertical()
-{
-}
-
-sal_Bool XMLPMPropHdl_CenterVertical::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- if (rStrImpValue.getLength())
- if (IsXMLToken(rStrImpValue, XML_BOTH) ||
- IsXMLToken(rStrImpValue, XML_VERTICAL) )
- {
- rValue = ::cppu::bool2any(sal_True);
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-sal_Bool XMLPMPropHdl_CenterVertical::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- if ( ::cppu::any2bool( rValue ) )
- {
- bRet = sal_True;
- if (rStrExpValue.getLength())
- rStrExpValue = GetXMLToken(XML_BOTH);
- else
- rStrExpValue = GetXMLToken(XML_VERTICAL);
- }
-
- return bRet;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_PageMasterPropHdlFactory.cxx b/binfilter/bf_xmloff/source/style/xmloff_PageMasterPropHdlFactory.cxx
deleted file mode 100644
index 7306840bfba8..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_PageMasterPropHdlFactory.cxx
+++ /dev/null
@@ -1,148 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "PageMasterPropHdlFactory.hxx"
-
-#include "xmlbahdl.hxx"
-#include "NamedBoolPropertyHdl.hxx"
-#include "XMLTextColumnsPropertyHandler.hxx"
-#include "XMLConstantsPropertyHandler.hxx"
-
-#include "PageMasterPropHdl.hxx"
-#include "PageMasterStyleMap.hxx"
-
-#include <com/sun/star/text/TextGridMode.hpp>
-namespace binfilter {
-
-
-using namespace ::rtl;
-using namespace ::binfilter::xmloff::token;
-using namespace ::com::sun::star;
-
-
-SvXMLEnumMapEntry aXML_TextGridMode_ConstantMap[] =
-{
- { XML_NONE, text::TextGridMode::NONE },
- { XML_LINE, text::TextGridMode::LINES },
- { XML_BOTH, text::TextGridMode::LINES_AND_CHARS },
- { XML_TOKEN_INVALID, 0 }
-};
-
-//______________________________________________________________________________
-
-XMLPageMasterPropHdlFactory::XMLPageMasterPropHdlFactory() :
- XMLPropertyHandlerFactory()
-{
-}
-
-XMLPageMasterPropHdlFactory::~XMLPageMasterPropHdlFactory()
-{
-}
-
-const XMLPropertyHandler* XMLPageMasterPropHdlFactory::GetPropertyHandler( sal_Int32 nType ) const
-{
- nType &= MID_FLAG_MASK;
-
- XMLPropertyHandler* pHdl = (XMLPropertyHandler*) XMLPropertyHandlerFactory::GetPropertyHandler( nType );
- if( !pHdl )
- {
- switch( nType )
- {
- case XML_PM_TYPE_PAGESTYLELAYOUT:
- pHdl = new XMLPMPropHdl_PageStyleLayout();
- break;
- case XML_PM_TYPE_NUMFORMAT:
- pHdl = new XMLPMPropHdl_NumFormat();
- break;
- case XML_PM_TYPE_NUMLETTERSYNC:
- pHdl = new XMLPMPropHdl_NumLetterSync();
- break;
- case XML_PM_TYPE_PAPERTRAYNUMBER:
- pHdl = new XMLPMPropHdl_PaperTrayNumber();
- break;
- case XML_PM_TYPE_PRINTORIENTATION:
- pHdl = new XMLNamedBoolPropertyHdl(
- GetXMLToken( XML_LANDSCAPE ),
- GetXMLToken( XML_PORTRAIT ) );
- break;
- case XML_PM_TYPE_PRINTANNOTATIONS:
- pHdl = new XMLPMPropHdl_Print( XML_ANNOTATIONS );
- break;
- case XML_PM_TYPE_PRINTCHARTS:
- pHdl = new XMLPMPropHdl_Print( XML_CHARTS );
- break;
- case XML_PM_TYPE_PRINTDRAWING:
- pHdl = new XMLPMPropHdl_Print( XML_DRAWINGS );
- break;
- case XML_PM_TYPE_PRINTFORMULAS:
- pHdl = new XMLPMPropHdl_Print( XML_FORMULAS );
- break;
- case XML_PM_TYPE_PRINTGRID:
- pHdl = new XMLPMPropHdl_Print( XML_GRID );
- break;
- case XML_PM_TYPE_PRINTHEADERS:
- pHdl = new XMLPMPropHdl_Print( XML_HEADERS );
- break;
- case XML_PM_TYPE_PRINTOBJECTS:
- pHdl = new XMLPMPropHdl_Print( XML_OBJECTS );
- break;
- case XML_PM_TYPE_PRINTZEROVALUES:
- pHdl = new XMLPMPropHdl_Print( XML_ZERO_VALUES );
- break;
- case XML_PM_TYPE_PRINTPAGEORDER:
- pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_TTB ),
- GetXMLToken( XML_LTR ) );
- break;
- case XML_PM_TYPE_FIRSTPAGENUMBER:
- pHdl = new XMLNumberNonePropHdl( XML_CONTINUE, 2 );
- break;
- case XML_PM_TYPE_CENTER_HORIZONTAL:
- pHdl = new XMLPMPropHdl_CenterHorizontal();
- break;
- case XML_PM_TYPE_CENTER_VERTICAL:
- pHdl = new XMLPMPropHdl_CenterVertical();
- break;
- case XML_TYPE_TEXT_COLUMNS:
- pHdl = new XMLTextColumnsPropertyHandler;
- break;
- case XML_TYPE_LAYOUT_GRID_MODE:
- pHdl = new XMLConstantsPropertyHandler(
- aXML_TextGridMode_ConstantMap, XML_NONE );
- break;
- }
-
- if( pHdl )
- PutHdlCache( nType, pHdl );
- }
- return pHdl;
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_PageMasterPropMapper.cxx b/binfilter/bf_xmloff/source/style/xmloff_PageMasterPropMapper.cxx
deleted file mode 100644
index 8976a549a953..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_PageMasterPropMapper.cxx
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "PageMasterPropMapper.hxx"
-
-
-#include "PageMasterStyleMap.hxx"
-#include "PageMasterPropHdlFactory.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-
-
-//______________________________________________________________________________
-
-XMLPageMasterPropSetMapper::XMLPageMasterPropSetMapper():
- XMLPropertySetMapper( aXMLPageMasterStyleMap, new XMLPageMasterPropHdlFactory())
-{
-}
-
-XMLPageMasterPropSetMapper::XMLPageMasterPropSetMapper(
- const XMLPropertyMapEntry* pEntries,
- const UniReference< XMLPropertyHandlerFactory >& rFactory ) :
- XMLPropertySetMapper( pEntries, rFactory )
-{
-}
-
-XMLPageMasterPropSetMapper::~XMLPageMasterPropSetMapper()
-{
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_PageMasterStyleMap.cxx b/binfilter/bf_xmloff/source/style/xmloff_PageMasterStyleMap.cxx
deleted file mode 100644
index fa86849f9672..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_PageMasterStyleMap.cxx
+++ /dev/null
@@ -1,178 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "PageMasterStyleMap.hxx"
-
-#include "xmlnmspe.hxx"
-namespace binfilter {
-
-using namespace ::binfilter::xmloff::token;
-
-#define MAP(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context }
-//______________________________________________________________________________
-
-const XMLPropertyMapEntry aXMLPageMasterStyleMap[] =
-{
-// page master
- MAP( "PageStyleLayout", XML_NAMESPACE_STYLE, XML_PAGE_USAGE, XML_PM_TYPE_PAGESTYLELAYOUT | MID_FLAG_SPECIAL_ITEM, CTF_PM_PAGEUSAGE ),
- MAP( "Width", XML_NAMESPACE_FO, XML_PAGE_WIDTH, XML_TYPE_MEASURE, 0 ),
- 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_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 ),
- MAP( "LeftMargin", XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_MEASURE, 0 ),
- MAP( "RightMargin", XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TYPE_MEASURE, 0 ),
- MAP( "TopBorder", XML_NAMESPACE_FO, XML_BORDER, XML_TYPE_BORDER, CTF_PM_BORDERALL ),
- MAP( "TopBorder", XML_NAMESPACE_FO, XML_BORDER_TOP, XML_TYPE_BORDER, CTF_PM_BORDERTOP ),
- MAP( "BottomBorder", XML_NAMESPACE_FO, XML_BORDER_BOTTOM, XML_TYPE_BORDER, CTF_PM_BORDERBOTTOM ),
- MAP( "LeftBorder", XML_NAMESPACE_FO, XML_BORDER_LEFT, XML_TYPE_BORDER, CTF_PM_BORDERLEFT ),
- MAP( "RightBorder", XML_NAMESPACE_FO, XML_BORDER_RIGHT, XML_TYPE_BORDER, CTF_PM_BORDERRIGHT ),
- MAP( "TopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH, XML_TYPE_BORDER_WIDTH, CTF_PM_BORDERWIDTHALL ),
- MAP( "TopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_TOP, XML_TYPE_BORDER_WIDTH, CTF_PM_BORDERWIDTHTOP ),
- MAP( "BottomBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_BOTTOM, XML_TYPE_BORDER_WIDTH, CTF_PM_BORDERWIDTHBOTTOM ),
- MAP( "LeftBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_LEFT, XML_TYPE_BORDER_WIDTH, CTF_PM_BORDERWIDTHLEFT ),
- MAP( "RightBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_RIGHT, XML_TYPE_BORDER_WIDTH, CTF_PM_BORDERWIDTHRIGHT ),
- MAP( "TopBorderDistance", XML_NAMESPACE_FO, XML_PADDING, XML_TYPE_MEASURE, CTF_PM_PADDINGALL ),
- MAP( "TopBorderDistance", XML_NAMESPACE_FO, XML_PADDING_TOP, XML_TYPE_MEASURE, CTF_PM_PADDINGTOP ),
- MAP( "BottomBorderDistance", XML_NAMESPACE_FO, XML_PADDING_BOTTOM, XML_TYPE_MEASURE, CTF_PM_PADDINGBOTTOM ),
- MAP( "LeftBorderDistance", XML_NAMESPACE_FO, XML_PADDING_LEFT, XML_TYPE_MEASURE, CTF_PM_PADDINGLEFT ),
- MAP( "RightBorderDistance", XML_NAMESPACE_FO, XML_PADDING_RIGHT, XML_TYPE_MEASURE, CTF_PM_PADDINGRIGHT ),
- MAP( "ShadowFormat", XML_NAMESPACE_STYLE, XML_SHADOW, XML_TYPE_TEXT_SHADOW, 0 ),
- MAP( "BackColor", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT | MID_FLAG_MULTI_PROPERTY, 0 ),
- MAP( "BackTransparent", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT | MID_FLAG_MERGE_ATTRIBUTE, 0 ),
- MAP( "BackGraphicLocation", XML_NAMESPACE_STYLE, XML_POSITION, XML_TYPE_BUILDIN_CMP_ONLY | MID_FLAG_SPECIAL_ITEM, CTF_PM_GRAPHICPOSITION ),
- MAP( "BackGraphicFilter", XML_NAMESPACE_STYLE, XML_FILTER_NAME, XML_TYPE_STRING | MID_FLAG_SPECIAL_ITEM, CTF_PM_GRAPHICFILTER ),
- MAP( "BackGraphicURL", XML_NAMESPACE_STYLE, XML_BACKGROUND_IMAGE, XML_TYPE_STRING | MID_FLAG_ELEMENT_ITEM, CTF_PM_GRAPHICURL ),
- MAP( "PrintAnnotations", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTANNOTATIONS | MID_FLAG_MULTI_PROPERTY, CTF_PM_PRINT_ANNOTATIONS ),
- MAP( "PrintCharts", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTCHARTS | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_CHARTS ),
- MAP( "PrintDrawing", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTDRAWING | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_DRAWING ),
- MAP( "PrintFormulas", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTFORMULAS | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_FORMULAS ),
- MAP( "PrintGrid", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTGRID | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_GRID ),
- MAP( "PrintHeaders", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTHEADERS | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_HEADERS ),
- MAP( "PrintObjects", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTOBJECTS | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_OBJECTS ),
- MAP( "PrintZeroValues", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTZEROVALUES | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_ZEROVALUES ),
- MAP( "PrintDownFirst", XML_NAMESPACE_STYLE, XML_PRINT_PAGE_ORDER, XML_PM_TYPE_PRINTPAGEORDER, 0 ),
- MAP( "FirstPageNumber", XML_NAMESPACE_STYLE, XML_FIRST_PAGE_NUMBER, XML_PM_TYPE_FIRSTPAGENUMBER, 0 ),
- MAP( "PageScale", XML_NAMESPACE_STYLE, XML_SCALE_TO, XML_TYPE_NUMBER16, CTF_PM_SCALETO ),
- MAP( "ScaleToPages", XML_NAMESPACE_STYLE, XML_SCALE_TO_PAGES, XML_TYPE_NUMBER16, CTF_PM_SCALETOPAGES ),
- MAP( "CenterHorizontally", XML_NAMESPACE_STYLE, XML_TABLE_CENTERING, XML_PM_TYPE_CENTER_HORIZONTAL | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, 0 ),
- MAP( "CenterVertically", XML_NAMESPACE_STYLE, XML_TABLE_CENTERING, XML_PM_TYPE_CENTER_VERTICAL | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, 0 ),
- MAP( "TextColumns", XML_NAMESPACE_STYLE, XML_COLUMNS, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_COLUMNS, CTF_PM_TEXTCOLUMNS ),
- MAP( "RegisterModeActive", XML_NAMESPACE_STYLE, XML_REGISTER_TRUE, XML_TYPE_BOOL, 0 ),
- MAP( "RegisterParagraphStyle", XML_NAMESPACE_STYLE, XML_REGISTER_TRUTH_REF_STYLE_NAME, XML_TYPE_STRING| MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_PM_REGISTER_STYLE ),
- MAP( "WritingMode", XML_NAMESPACE_STYLE, XML_WRITING_MODE, XML_TYPE_TEXT_WRITING_MODE, 0 ),
-
- MAP( "GridColor", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_COLOR, XML_TYPE_COLOR, 0 ),
- MAP( "GridLines", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_LINES, XML_TYPE_NUMBER16, 0 ),
- MAP( "GridBaseHeight", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_BASE_HEIGHT, XML_TYPE_MEASURE, 0 ),
- MAP( "GridRubyHeight", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_RUBY_HEIGHT, XML_TYPE_MEASURE, 0 ),
- MAP( "GridMode", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_MODE, XML_TYPE_LAYOUT_GRID_MODE, 0 ),
- MAP( "RubyBelow", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_RUBY_BELOW, XML_TYPE_BOOL, 0 ),
- MAP( "GridPrint", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_PRINT, XML_TYPE_BOOL, 0 ),
- MAP( "GridDisplay", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_DISPLAY, XML_TYPE_BOOL, 0 ),
-
- MAP( "UserDefinedAttributes", XML_NAMESPACE_TEXT, XML_XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ),
-
-// footnote
- MAP( "FootnoteHeight", XML_NAMESPACE_STYLE, XML_FOOTNOTE_MAX_HEIGHT, XML_TYPE_MEASURE, CTF_PM_FTN_HEIGTH ),
- MAP( "FootnoteLineAdjust", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_TEXT_HORIZONTAL_ADJUST|MID_FLAG_SPECIAL_ITEM, CTF_PM_FTN_LINE_ADJUST ),
- MAP( "FootnoteLineColor", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_COLOR|MID_FLAG_SPECIAL_ITEM, CTF_PM_FTN_LINE_COLOR ),
- MAP( "FootnoteLineDistance", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_MEASURE|MID_FLAG_SPECIAL_ITEM,CTF_PM_FTN_DISTANCE ),
- MAP( "FootnoteLineRelativeWidth", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_PERCENT8|MID_FLAG_SPECIAL_ITEM, CTF_PM_FTN_LINE_WIDTH ),
- MAP( "FootnoteLineTextDistance", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_MEASURE|MID_FLAG_SPECIAL_ITEM, CTF_PM_FTN_LINE_DISTANCE ),
- MAP( "FootnoteLineWeight", XML_NAMESPACE_STYLE, XML_FOOTNOTE_SEP, XML_TYPE_MEASURE16|MID_FLAG_ELEMENT_ITEM, CTF_PM_FTN_LINE_WEIGTH ),
-
-// header
- MAP( "HeaderHeight", XML_NAMESPACE_SVG, XML_HEIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERHEIGHT ),
- MAP( "HeaderHeight", XML_NAMESPACE_FO, XML_MIN_HEIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERMINHEIGHT ),
- MAP( "HeaderIsDynamicHeight", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_BOOL, CTF_PM_HEADERDYNAMIC ),
- MAP( "HeaderLeftMargin", XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_MEASURE, CTF_PM_HEADERFLAG ),
- MAP( "HeaderRightMargin", XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERFLAG ),
- MAP( "HeaderBodyDistance", XML_NAMESPACE_FO, XML_MARGIN_BOTTOM, XML_TYPE_MEASURE, CTF_PM_HEADERFLAG ),
- MAP( "HeaderTopBorder", XML_NAMESPACE_FO, XML_BORDER, XML_TYPE_BORDER, CTF_PM_HEADERBORDERALL ),
- MAP( "HeaderTopBorder", XML_NAMESPACE_FO, XML_BORDER_TOP, XML_TYPE_BORDER, CTF_PM_HEADERBORDERTOP ),
- MAP( "HeaderBottomBorder", XML_NAMESPACE_FO, XML_BORDER_BOTTOM, XML_TYPE_BORDER, CTF_PM_HEADERBORDERBOTTOM ),
- MAP( "HeaderLeftBorder", XML_NAMESPACE_FO, XML_BORDER_LEFT, XML_TYPE_BORDER, CTF_PM_HEADERBORDERLEFT ),
- MAP( "HeaderRightBorder", XML_NAMESPACE_FO, XML_BORDER_RIGHT, XML_TYPE_BORDER, CTF_PM_HEADERBORDERRIGHT ),
- MAP( "HeaderTopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH, XML_TYPE_BORDER_WIDTH, CTF_PM_HEADERBORDERWIDTHALL ),
- MAP( "HeaderTopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_TOP, XML_TYPE_BORDER_WIDTH, CTF_PM_HEADERBORDERWIDTHTOP ),
- MAP( "HeaderBottomBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_BOTTOM, XML_TYPE_BORDER_WIDTH, CTF_PM_HEADERBORDERWIDTHBOTTOM ),
- MAP( "HeaderLeftBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_LEFT, XML_TYPE_BORDER_WIDTH, CTF_PM_HEADERBORDERWIDTHLEFT ),
- MAP( "HeaderRightBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_RIGHT, XML_TYPE_BORDER_WIDTH, CTF_PM_HEADERBORDERWIDTHRIGHT ),
- MAP( "HeaderTopBorderDistance", XML_NAMESPACE_FO, XML_PADDING, XML_TYPE_MEASURE, CTF_PM_HEADERPADDINGALL ),
- MAP( "HeaderTopBorderDistance", XML_NAMESPACE_FO, XML_PADDING_TOP, XML_TYPE_MEASURE, CTF_PM_HEADERPADDINGTOP ),
- MAP( "HeaderBottomBorderDistance", XML_NAMESPACE_FO, XML_PADDING_BOTTOM, XML_TYPE_MEASURE, CTF_PM_HEADERPADDINGBOTTOM ),
- MAP( "HeaderLeftBorderDistance", XML_NAMESPACE_FO, XML_PADDING_LEFT, XML_TYPE_MEASURE, CTF_PM_HEADERPADDINGLEFT ),
- MAP( "HeaderRightBorderDistance", XML_NAMESPACE_FO, XML_PADDING_RIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERPADDINGRIGHT ),
- MAP( "HeaderShadowFormat", XML_NAMESPACE_STYLE, XML_SHADOW, XML_TYPE_TEXT_SHADOW, CTF_PM_HEADERFLAG ),
- MAP( "HeaderBackColor", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT | MID_FLAG_MULTI_PROPERTY, CTF_PM_HEADERFLAG ),
- MAP( "HeaderBackTransparent", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_HEADERFLAG ),
- MAP( "HeaderBackGraphicLocation", XML_NAMESPACE_STYLE, XML_POSITION, XML_TYPE_BUILDIN_CMP_ONLY | MID_FLAG_SPECIAL_ITEM, CTF_PM_HEADERGRAPHICPOSITION ),
- MAP( "HeaderBackGraphicFilter", XML_NAMESPACE_STYLE, XML_FILTER_NAME, XML_TYPE_STRING | MID_FLAG_SPECIAL_ITEM, CTF_PM_HEADERGRAPHICFILTER ),
- MAP( "HeaderBackGraphicURL", XML_NAMESPACE_STYLE, XML_BACKGROUND_IMAGE, XML_TYPE_STRING | MID_FLAG_ELEMENT_ITEM, CTF_PM_HEADERGRAPHICURL ),
- MAP( "HeaderDynamicSpacing", XML_NAMESPACE_STYLE, XML_DYNAMIC_SPACING, XML_TYPE_BOOL, CTF_PM_HEADERFLAG ),
-
-// footer
- MAP( "FooterHeight", XML_NAMESPACE_SVG, XML_HEIGHT, XML_TYPE_MEASURE, CTF_PM_FOOTERHEIGHT ),
- MAP( "FooterHeight", XML_NAMESPACE_FO, XML_MIN_HEIGHT, XML_TYPE_MEASURE, CTF_PM_FOOTERMINHEIGHT ),
- MAP( "FooterIsDynamicHeight", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_BOOL, CTF_PM_FOOTERDYNAMIC ),
- MAP( "FooterLeftMargin", XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_MEASURE, CTF_PM_FOOTERFLAG ),
- MAP( "FooterRightMargin", XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TYPE_MEASURE, CTF_PM_FOOTERFLAG ),
- MAP( "FooterBodyDistance", XML_NAMESPACE_FO, XML_MARGIN_TOP, XML_TYPE_MEASURE, CTF_PM_FOOTERFLAG ),
- MAP( "FooterTopBorder", XML_NAMESPACE_FO, XML_BORDER, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERALL ),
- MAP( "FooterTopBorder", XML_NAMESPACE_FO, XML_BORDER_TOP, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERTOP ),
- MAP( "FooterBottomBorder", XML_NAMESPACE_FO, XML_BORDER_BOTTOM, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERBOTTOM ),
- MAP( "FooterLeftBorder", XML_NAMESPACE_FO, XML_BORDER_LEFT, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERLEFT ),
- MAP( "FooterRightBorder", XML_NAMESPACE_FO, XML_BORDER_RIGHT, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERRIGHT ),
- MAP( "FooterTopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH, XML_TYPE_BORDER_WIDTH, CTF_PM_FOOTERBORDERWIDTHALL ),
- MAP( "FooterTopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_TOP, XML_TYPE_BORDER_WIDTH, CTF_PM_FOOTERBORDERWIDTHTOP ),
- MAP( "FooterBottomBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_BOTTOM, XML_TYPE_BORDER_WIDTH, CTF_PM_FOOTERBORDERWIDTHBOTTOM ),
- MAP( "FooterLeftBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_LEFT, XML_TYPE_BORDER_WIDTH, CTF_PM_FOOTERBORDERWIDTHLEFT ),
- MAP( "FooterRightBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_RIGHT, XML_TYPE_BORDER_WIDTH, CTF_PM_FOOTERBORDERWIDTHRIGHT ),
- MAP( "FooterTopBorderDistance", XML_NAMESPACE_FO, XML_PADDING, XML_TYPE_MEASURE, CTF_PM_FOOTERPADDINGALL ),
- MAP( "FooterTopBorderDistance", XML_NAMESPACE_FO, XML_PADDING_TOP, XML_TYPE_MEASURE, CTF_PM_FOOTERPADDINGTOP ),
- MAP( "FooterBottomBorderDistance", XML_NAMESPACE_FO, XML_PADDING_BOTTOM, XML_TYPE_MEASURE, CTF_PM_FOOTERPADDINGBOTTOM ),
- MAP( "FooterLeftBorderDistance", XML_NAMESPACE_FO, XML_PADDING_LEFT, XML_TYPE_MEASURE, CTF_PM_FOOTERPADDINGLEFT ),
- MAP( "FooterRightBorderDistance", XML_NAMESPACE_FO, XML_PADDING_RIGHT, XML_TYPE_MEASURE, CTF_PM_FOOTERPADDINGRIGHT ),
- MAP( "FooterShadowFormat", XML_NAMESPACE_STYLE, XML_SHADOW, XML_TYPE_TEXT_SHADOW, CTF_PM_FOOTERFLAG ),
- MAP( "FooterBackColor", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT | MID_FLAG_MULTI_PROPERTY, CTF_PM_FOOTERFLAG ),
- MAP( "FooterBackTransparent", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_FOOTERFLAG ),
- MAP( "FooterBackGraphicLocation", XML_NAMESPACE_STYLE, XML_POSITION, XML_TYPE_BUILDIN_CMP_ONLY | MID_FLAG_SPECIAL_ITEM, CTF_PM_FOOTERGRAPHICPOSITION ),
- MAP( "FooterBackGraphicFilter", XML_NAMESPACE_STYLE, XML_FILTER_NAME, XML_TYPE_STRING | MID_FLAG_SPECIAL_ITEM, CTF_PM_FOOTERGRAPHICFILTER ),
- MAP( "FooterBackGraphicURL", XML_NAMESPACE_STYLE, XML_BACKGROUND_IMAGE, XML_TYPE_STRING | MID_FLAG_ELEMENT_ITEM, CTF_PM_FOOTERGRAPHICURL ),
- MAP( "FooterDynamicSpacing", XML_NAMESPACE_STYLE, XML_DYNAMIC_SPACING, XML_TYPE_BOOL, CTF_PM_FOOTERFLAG ),
-
- { 0L }
-};
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_PagePropertySetContext.cxx b/binfilter/bf_xmloff/source/style/xmloff_PagePropertySetContext.cxx
deleted file mode 100644
index 50c61c4bea10..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_PagePropertySetContext.cxx
+++ /dev/null
@@ -1,141 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include "PagePropertySetContext.hxx"
-#include "XMLBackgroundImageContext.hxx"
-#include "XMLTextColumnsContext.hxx"
-#include "PageMasterStyleMap.hxx"
-#include "XMLFootnoteSeparatorImport.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star;
-
-PagePropertySetContext::PagePropertySetContext(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- ::std::vector< XMLPropertyState > &rProps,
- const UniReference < SvXMLImportPropertyMapper > &rMap,
- sal_Int32 nStartIndex, sal_Int32 nEndIndex,
- const PageContextType aTempType ) :
- SvXMLPropertySetContext( rImport, nPrfx, rLName, xAttrList, rProps, rMap, nStartIndex, nEndIndex )
-{
- aType = aTempType;
-}
-
-PagePropertySetContext::~PagePropertySetContext()
-{
-}
-
-SvXMLImportContext *PagePropertySetContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- ::std::vector< XMLPropertyState > &rProperties,
- const XMLPropertyState& rProp )
-{
- sal_Int32 nPos = CTF_PM_GRAPHICPOSITION;
- sal_Int32 nFil = CTF_PM_GRAPHICFILTER;
- switch ( aType )
- {
- case Header:
- {
- nPos = CTF_PM_HEADERGRAPHICPOSITION;
- nFil = CTF_PM_HEADERGRAPHICFILTER;
- }
- break;
- case Footer:
- {
- nPos = CTF_PM_FOOTERGRAPHICPOSITION;
- nFil = CTF_PM_FOOTERGRAPHICFILTER;
- }
- break;
- }
- SvXMLImportContext *pContext = 0;
-
- switch( xMapper->getPropertySetMapper()
- ->GetEntryContextId( rProp.mnIndex ) )
- {
- case CTF_PM_GRAPHICURL:
- case CTF_PM_HEADERGRAPHICURL:
- case CTF_PM_FOOTERGRAPHICURL:
- DBG_ASSERT( rProp.mnIndex >= 2 &&
- nPos == xMapper->getPropertySetMapper()
- ->GetEntryContextId( rProp.mnIndex-2 ) &&
- nFil == xMapper->getPropertySetMapper()
- ->GetEntryContextId( rProp.mnIndex-1 ),
- "invalid property map!");
- pContext =
- new XMLBackgroundImageContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- rProp,
- rProp.mnIndex-2,
- rProp.mnIndex-1,
- -1,
- rProperties );
- break;
-
- case CTF_PM_TEXTCOLUMNS:
-#ifndef SVX_LIGHT
- pContext = new XMLTextColumnsContext( GetImport(), nPrefix,
- rLocalName, xAttrList, rProp,
- rProperties );
-#else
- // create default context to skip content
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-#endif // #ifndef SVX_LIGHT
- break;
-
- case CTF_PM_FTN_LINE_WEIGTH:
-#ifndef SVX_LIGHT
- pContext = new XMLFootnoteSeparatorImport(
- GetImport(), nPrefix, rLocalName, rProperties,
- xMapper->getPropertySetMapper(), rProp.mnIndex);
-#else
- // create default context to skip content
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName);
-#endif // #ifndef SVX_LIGHT
- break;
- }
-
- if( !pContext )
- pContext = SvXMLPropertySetContext::CreateChildContext( nPrefix, rLocalName,
- xAttrList,
- rProperties, rProp );
-
- return pContext;
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_SinglePropertySetInfoCache.cxx b/binfilter/bf_xmloff/source/style/xmloff_SinglePropertySetInfoCache.cxx
deleted file mode 100644
index f9ed94456103..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_SinglePropertySetInfoCache.cxx
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/lang/XTypeProvider.hpp>
-#include <cppuhelper/weakref.hxx>
-
-#include "SinglePropertySetInfoCache.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star::uno;
-using ::com::sun::star::lang::XTypeProvider;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::beans::XPropertySetInfo;
-
-sal_Bool SinglePropertySetInfoCache::hasProperty(
- const Reference< XPropertySet >& rPropSet,
- Reference< XPropertySetInfo >& rPropSetInfo )
-{
- if( !rPropSetInfo.is() )
- rPropSetInfo = rPropSet->getPropertySetInfo();
- sal_Bool bRet = sal_False, bValid = sal_False;
- Reference < XTypeProvider > xTypeProv( rPropSet, UNO_QUERY );
- Sequence< sal_Int8 > aImplId;
- if( xTypeProv.is() )
- {
- aImplId = xTypeProv->getImplementationId();
- if( aImplId.getLength() == 16 )
- {
- // The key must not be created outside this block, because it
- // keeps a reference to the property set info.
- PropertySetInfoKey aKey( rPropSetInfo, aImplId );
- iterator aIter = find( aKey );
- if( aIter != end() )
- {
- bRet = (*aIter).second;
- bValid = sal_True;
- }
- }
- }
- if( !bValid )
- {
- bRet = rPropSetInfo->hasPropertyByName( sName );
- if( xTypeProv.is() && aImplId.getLength() == 16 )
- {
- // Check whether the property set info is destroyed if it is
- // assigned to a weak reference only. If it is destroyed, then
- // every instance of getPropertySetInfo returns a new object.
- // Such property set infos must not be cached.
- WeakReference < XPropertySetInfo > xWeakInfo( rPropSetInfo );
- rPropSetInfo = 0;
- rPropSetInfo = xWeakInfo;
- if( rPropSetInfo.is() )
- {
- PropertySetInfoKey aKey( rPropSetInfo, aImplId );
- value_type aValue( aKey, bRet );
- insert( aValue );
- }
- }
- }
-
- return bRet;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_TransGradientStyle.cxx b/binfilter/bf_xmloff/source/style/xmloff_TransGradientStyle.cxx
deleted file mode 100644
index 8c4adcc2979d..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_TransGradientStyle.cxx
+++ /dev/null
@@ -1,315 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "TransGradientStyle.hxx"
-
-#include <com/sun/star/awt/Gradient.hpp>
-
-
-#include "nmspmap.hxx"
-
-#include "xmluconv.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "rtl/ustring.hxx"
-
-#include <tools/debug.hxx>
-
-
-#include "xmlexp.hxx"
-
-#include "xmlimp.hxx"
-namespace binfilter {
-
-
-using namespace ::com::sun::star;
-using namespace ::rtl;
-using namespace ::binfilter::xmloff::token;
-
-enum SvXMLTokenMapAttrs
-{
- XML_TOK_GRADIENT_NAME,
- XML_TOK_GRADIENT_STYLE,
- XML_TOK_GRADIENT_CX,
- XML_TOK_GRADIENT_CY,
- XML_TOK_GRADIENT_START,
- XML_TOK_GRADIENT_END,
- XML_TOK_GRADIENT_ANGLE,
- XML_TOK_GRADIENT_BORDER,
- XML_TOK_TABSTOP_END=XML_TOK_UNKNOWN
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aTrGradientAttrTokenMap[] =
-{
- { XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_GRADIENT_NAME },
- { XML_NAMESPACE_DRAW, XML_STYLE, XML_TOK_GRADIENT_STYLE },
- { XML_NAMESPACE_DRAW, XML_CX, XML_TOK_GRADIENT_CX },
- { XML_NAMESPACE_DRAW, XML_CY, XML_TOK_GRADIENT_CY },
- { XML_NAMESPACE_DRAW, XML_START, XML_TOK_GRADIENT_START },
- { XML_NAMESPACE_DRAW, XML_END, XML_TOK_GRADIENT_END },
- { XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, XML_TOK_GRADIENT_ANGLE },
- { XML_NAMESPACE_DRAW, XML_GRADIENT_BORDER, XML_TOK_GRADIENT_BORDER },
- XML_TOKEN_MAP_END
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_GradientStyle_Enum[] =
-{
- { XML_GRADIENTSTYLE_LINEAR, awt::GradientStyle_LINEAR },
- { XML_GRADIENTSTYLE_AXIAL, awt::GradientStyle_AXIAL },
- { XML_GRADIENTSTYLE_RADIAL, awt::GradientStyle_RADIAL },
- { XML_GRADIENTSTYLE_ELLIPSOID, awt::GradientStyle_ELLIPTICAL },
- { XML_GRADIENTSTYLE_SQUARE, awt::GradientStyle_SQUARE },
- { XML_GRADIENTSTYLE_RECTANGULAR, awt::GradientStyle_RECT },
- { XML_TOKEN_INVALID, 0 }
-};
-
-
-//-------------------------------------------------------------
-// Import
-//-------------------------------------------------------------
-
-XMLTransGradientStyleImport::XMLTransGradientStyleImport( SvXMLImport& rImp )
- : rImport(rImp)
-{
-}
-
-XMLTransGradientStyleImport::~XMLTransGradientStyleImport()
-{
-}
-
-sal_Bool XMLTransGradientStyleImport::importXML(
- const uno::Reference< xml::sax::XAttributeList >& xAttrList,
- uno::Any& rValue,
- OUString& rStrName )
-{
- sal_Bool bRet = sal_False;
- sal_Bool bHasName = sal_False;
- sal_Bool bHasStyle = sal_False;
-
- awt::Gradient aGradient;
- aGradient.XOffset = 0;
- aGradient.YOffset = 0;
- aGradient.StartIntensity = 100;
- aGradient.EndIntensity = 100;
- aGradient.Angle = 0;
- aGradient.Border = 0;
-
- SvXMLTokenMap aTokenMap( aTrGradientAttrTokenMap );
- SvXMLNamespaceMap& rNamespaceMap = rImport.GetNamespaceMap();
- SvXMLUnitConverter& rUnitConverter = rImport.GetMM100UnitConverter();
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rFullAttrName = xAttrList->getNameByIndex( i );
- OUString aStrAttrName;
- sal_uInt16 nPrefix = rNamespaceMap.GetKeyByAttrName( rFullAttrName, &aStrAttrName );
- const OUString& rStrValue = xAttrList->getValueByIndex( i );
-
- sal_Int32 nTmpValue;
-
- switch( aTokenMap.Get( nPrefix, aStrAttrName ) )
- {
- case XML_TOK_GRADIENT_NAME:
- {
- rStrName = rStrValue;
- bHasName = sal_True;
- }
- break;
- case XML_TOK_GRADIENT_STYLE:
- {
- sal_uInt16 eValue;
- if( rUnitConverter.convertEnum( eValue, rStrValue, pXML_GradientStyle_Enum ) )
- {
- aGradient.Style = (awt::GradientStyle) eValue;
- bHasStyle = sal_True;
- }
- }
- break;
- case XML_TOK_GRADIENT_CX:
- rUnitConverter.convertPercent( nTmpValue, rStrValue );
- aGradient.XOffset = nTmpValue;
- break;
- case XML_TOK_GRADIENT_CY:
- rUnitConverter.convertPercent( nTmpValue, rStrValue );
- aGradient.YOffset = nTmpValue;
- break;
- case XML_TOK_GRADIENT_START:
- {
- sal_Int32 aStartTransparency;
- rUnitConverter.convertPercent( aStartTransparency, rStrValue );
-
- aStartTransparency = ( aStartTransparency * 255 ) / 100;
-
- Color aColor(aStartTransparency, aStartTransparency, aStartTransparency );
- aGradient.StartColor = (sal_Int32)( aColor.GetColor() );
- }
- break;
- case XML_TOK_GRADIENT_END:
- {
- sal_Int32 aEndTransparency;
- rUnitConverter.convertPercent( aEndTransparency, rStrValue );
-
- aEndTransparency = ( aEndTransparency * 255 ) / 100;
-
- Color aColor( aEndTransparency, aEndTransparency, aEndTransparency );
- aGradient.EndColor = (sal_Int32)( aColor.GetColor() );
- }
- break;
- case XML_TOK_GRADIENT_ANGLE:
- {
- sal_Int32 nValue;
- rUnitConverter.convertNumber( nValue, rStrValue, 0, 360 );
- aGradient.Angle = sal_Int16( nValue );
- }
- break;
- case XML_TOK_GRADIENT_BORDER:
- rUnitConverter.convertPercent( nTmpValue, rStrValue );
- aGradient.Border = nTmpValue;
- break;
-
- default:
- DBG_WARNING( "Unknown token at import transparency gradient style" )
- ;
- }
- }
-
- rValue <<= aGradient;
-
- bRet = bHasName && bHasStyle;
-
- return bRet;
-}
-
-
-//-------------------------------------------------------------
-// Export
-//-------------------------------------------------------------
-
-#ifndef SVX_LIGHT
-
-XMLTransGradientStyleExport::XMLTransGradientStyleExport( SvXMLExport& rExp )
- : rExport(rExp)
-{
-}
-
-XMLTransGradientStyleExport::~XMLTransGradientStyleExport()
-{
-}
-
-
-sal_Bool XMLTransGradientStyleExport::exportXML(
- const OUString& rStrName,
- const uno::Any& rValue )
-{
- sal_Bool bRet = sal_False;
- awt::Gradient aGradient;
-
- if( rStrName.getLength() )
- {
- if( rValue >>= aGradient )
- {
- OUString aStrValue;
- OUStringBuffer aOut;
-
- SvXMLUnitConverter& rUnitConverter =
- rExport.GetMM100UnitConverter();
-
- // Style
- if( !rUnitConverter.convertEnum( aOut, aGradient.Style, pXML_GradientStyle_Enum ) )
- {
- bRet = sal_False;
- }
- else
- {
- // Name
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, rStrName );
-
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue );
-
- // Center x/y
- if( aGradient.Style != awt::GradientStyle_LINEAR &&
- aGradient.Style != awt::GradientStyle_AXIAL )
- {
- rUnitConverter.convertPercent( aOut, aGradient.XOffset );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CX, aStrValue );
-
- rUnitConverter.convertPercent( aOut, aGradient.YOffset );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CY, aStrValue );
- }
-
-
- Color aColor;
-
- // Transparency start
- aColor.SetColor( aGradient.StartColor );
- sal_Int32 aStartValue = (sal_Int32)(((aColor.GetRed() + 1) * 100) / 255);
- rUnitConverter.convertPercent( aOut, aStartValue );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START, aStrValue );
-
- // Transparency end
- aColor.SetColor( aGradient.EndColor );
- sal_Int32 aEndValue = (sal_Int32)(((aColor.GetRed() + 1) * 100) / 255);
- rUnitConverter.convertPercent( aOut, aEndValue );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END, aStrValue );
-
- // Angle
- if( aGradient.Style != awt::GradientStyle_RADIAL )
- {
- rUnitConverter.convertNumber( aOut, sal_Int32( aGradient.Angle ) );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, aStrValue );
- }
-
- // Border
- rUnitConverter.convertPercent( aOut, aGradient.Border );
- aStrValue = aOut.makeStringAndClear();
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_BORDER, aStrValue );
-
- // Do Write
- SvXMLElementExport rElem( rExport,
- XML_NAMESPACE_DRAW, XML_TRANSPARENCY,
- sal_True, sal_False );
- }
- }
- }
-
- return bRet;
-}
-
-#endif // #ifndef SVX_LIGHT
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_VisAreaContext.cxx b/binfilter/bf_xmloff/source/style/xmloff_VisAreaContext.cxx
deleted file mode 100644
index 797190f32573..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_VisAreaContext.cxx
+++ /dev/null
@@ -1,123 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef _MSC_VER
-#pragma hdrstop
-#endif
-
-// INCLUDE ---------------------------------------------------------------
-
-#include "VisAreaContext.hxx"
-
-#include "xmlnmspe.hxx"
-#include "nmspmap.hxx"
-#include "xmluconv.hxx"
-#include "xmlimp.hxx"
-
-#include <tools/gen.hxx>
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-//------------------------------------------------------------------
-
-XMLVisAreaContext::XMLVisAreaContext( SvXMLImport& rImport,
- USHORT nPrfx,
- const ::rtl::OUString& rLName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList,
- ::com::sun::star::awt::Rectangle& rRect, const sal_Int16 nMeasureUnit ) :
- SvXMLImportContext( rImport, nPrfx, rLName )
-{
- process( xAttrList, rRect, nMeasureUnit );
-}
-
-XMLVisAreaContext::~XMLVisAreaContext()
-{
-}
-
-void XMLVisAreaContext::process( const uno::Reference< xml::sax::XAttributeList>& xAttrList, awt::Rectangle& rRect, const sal_Int16 nMeasureUnit )
-{
- MapUnit aMapUnit = (MapUnit)nMeasureUnit;
-
- sal_Int32 nX(0);
- sal_Int32 nY(0);
- sal_Int32 nWidth(0);
- sal_Int32 nHeight(0);
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName(
- sAttrName, &aLocalName );
- ::rtl::OUString sValue = xAttrList->getValueByIndex( i );
-
- if (nPrefix == XML_NAMESPACE_OFFICE)
- {
- if (IsXMLToken( aLocalName, XML_X ))
- {
- SvXMLUnitConverter::convertMeasure(nX, sValue, aMapUnit);
- rRect.X = nX;
- }
- else if (IsXMLToken( aLocalName, XML_Y ))
- {
- SvXMLUnitConverter::convertMeasure(nY, sValue, aMapUnit);
- rRect.Y = nY;
- }
- else if (IsXMLToken( aLocalName, XML_WIDTH ))
- {
- SvXMLUnitConverter::convertMeasure(nWidth, sValue, aMapUnit);
- rRect.Width = nWidth;
- }
- else if (IsXMLToken( aLocalName, XML_HEIGHT ))
- {
- SvXMLUnitConverter::convertMeasure(nHeight, sValue, aMapUnit);
- rRect.Height = nHeight;
- }
- }
- }
-}
-
-SvXMLImportContext *XMLVisAreaContext::CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
-{
- // here is no context
- SvXMLImportContext *pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
- return pContext;
-}
-
-void XMLVisAreaContext::EndElement()
-{
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_XMLBackgroundImageContext.cxx b/binfilter/bf_xmloff/source/style/xmloff_XMLBackgroundImageContext.cxx
deleted file mode 100644
index b1f66043b20b..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_XMLBackgroundImageContext.cxx
+++ /dev/null
@@ -1,410 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-
-#include "xmluconv.hxx"
-#include "xmlnmspe.hxx"
-#include "xmlimp.hxx"
-#include "nmspmap.hxx"
-#include "XMLBase64ImportContext.hxx"
-
-#include "XMLBackgroundImageContext.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::io;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-enum SvXMLTokenMapAttrs
-{
- XML_TOK_BGIMG_HREF,
- XML_TOK_BGIMG_TYPE,
- XML_TOK_BGIMG_ACTUATE,
- XML_TOK_BGIMG_SHOW,
- XML_TOK_BGIMG_POSITION,
- XML_TOK_BGIMG_REPEAT,
- XML_TOK_BGIMG_FILTER,
- XML_TOK_BGIMG_TRANSPARENCY,
- XML_TOK_NGIMG_END=XML_TOK_UNKNOWN
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aBGImgAttributesAttrTokenMap[] =
-{
- { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_BGIMG_HREF },
- { XML_NAMESPACE_XLINK, XML_TYPE, XML_TOK_BGIMG_TYPE },
- { XML_NAMESPACE_XLINK, XML_ACTUATE, XML_TOK_BGIMG_ACTUATE },
- { XML_NAMESPACE_XLINK, XML_SHOW, XML_TOK_BGIMG_SHOW },
- { XML_NAMESPACE_STYLE, XML_POSITION, XML_TOK_BGIMG_POSITION },
- { XML_NAMESPACE_STYLE, XML_REPEAT, XML_TOK_BGIMG_REPEAT },
- { XML_NAMESPACE_STYLE, XML_FILTER_NAME, XML_TOK_BGIMG_FILTER },
- { XML_NAMESPACE_DRAW, XML_TRANSPARENCY,XML_TOK_BGIMG_TRANSPARENCY },
- XML_TOKEN_MAP_END
-};
-
-SvXMLEnumMapEntry psXML_BrushRepeat[] =
-{
- { XML_BACKGROUND_REPEAT, GraphicLocation_TILED },
- { XML_BACKGROUND_NO_REPEAT, GraphicLocation_MIDDLE_MIDDLE },
- { XML_BACKGROUND_STRETCH, GraphicLocation_AREA },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry psXML_BrushHoriPos[] =
-{
- { XML_LEFT, GraphicLocation_LEFT_MIDDLE },
- { XML_RIGHT, GraphicLocation_RIGHT_MIDDLE },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry psXML_BrushVertPos[] =
-{
- { XML_TOP, GraphicLocation_MIDDLE_TOP },
- { XML_BOTTOM, GraphicLocation_MIDDLE_BOTTOM },
- { XML_TOKEN_INVALID, 0 }
-};
-
-void lcl_xmlbic_MergeHoriPos( GraphicLocation& ePos,
- GraphicLocation eHori )
-{
- DBG_ASSERT( GraphicLocation_LEFT_MIDDLE==eHori ||
- GraphicLocation_MIDDLE_MIDDLE==eHori ||
- GraphicLocation_RIGHT_MIDDLE==eHori,
- "lcl_xmlbic_MergeHoriPos: vertical pos must be middle" );
-
- switch( ePos )
- {
- case GraphicLocation_LEFT_TOP:
- case GraphicLocation_MIDDLE_TOP:
- case GraphicLocation_RIGHT_TOP:
- ePos = GraphicLocation_LEFT_MIDDLE==eHori
- ? GraphicLocation_LEFT_TOP
- : (GraphicLocation_MIDDLE_MIDDLE==eHori
- ? GraphicLocation_MIDDLE_TOP
- : GraphicLocation_RIGHT_TOP);
- break;
-
- case GraphicLocation_LEFT_MIDDLE:
- case GraphicLocation_MIDDLE_MIDDLE:
- case GraphicLocation_RIGHT_MIDDLE:
- ePos = eHori;
- break;
-
- case GraphicLocation_LEFT_BOTTOM:
- case GraphicLocation_MIDDLE_BOTTOM:
- case GraphicLocation_RIGHT_BOTTOM:
- ePos = GraphicLocation_LEFT_MIDDLE==eHori
- ? GraphicLocation_LEFT_BOTTOM
- : (GraphicLocation_MIDDLE_MIDDLE==eHori
- ? GraphicLocation_MIDDLE_BOTTOM
- : GraphicLocation_RIGHT_BOTTOM);
- break;
- }
-}
-
-void lcl_xmlbic_MergeVertPos( GraphicLocation& ePos,
- GraphicLocation eVert )
-{
- DBG_ASSERT( GraphicLocation_MIDDLE_TOP==eVert ||
- GraphicLocation_MIDDLE_MIDDLE==eVert ||
- GraphicLocation_MIDDLE_BOTTOM==eVert,
- "lcl_xmlbic_MergeVertPos: horizontal pos must be middle" );
-
- switch( ePos )
- {
- case GraphicLocation_LEFT_TOP:
- case GraphicLocation_LEFT_MIDDLE:
- case GraphicLocation_LEFT_BOTTOM:
- ePos = GraphicLocation_MIDDLE_TOP==eVert
- ? GraphicLocation_LEFT_TOP
- : (GraphicLocation_MIDDLE_MIDDLE==eVert
- ? GraphicLocation_LEFT_MIDDLE
- : GraphicLocation_LEFT_BOTTOM);
- ePos = eVert;
- break;
-
- case GraphicLocation_MIDDLE_TOP:
- case GraphicLocation_MIDDLE_MIDDLE:
- case GraphicLocation_MIDDLE_BOTTOM:
- ePos = eVert;
- break;
-
- case GraphicLocation_RIGHT_TOP:
- case GraphicLocation_RIGHT_MIDDLE:
- case GraphicLocation_RIGHT_BOTTOM:
- ePos = GraphicLocation_MIDDLE_TOP==eVert
- ? GraphicLocation_RIGHT_TOP
- : (GraphicLocation_MIDDLE_MIDDLE==eVert
- ? GraphicLocation_RIGHT_MIDDLE
- : GraphicLocation_RIGHT_BOTTOM);
- break;
- }
-}
-
-TYPEINIT1( XMLBackgroundImageContext, XMLElementPropertyContext );
-
-void XMLBackgroundImageContext::ProcessAttrs(
- const Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLTokenMap aTokenMap( aBGImgAttributesAttrTokenMap );
-
- ePos = GraphicLocation_NONE;
-
- SvXMLUnitConverter& rUnitConverter = GetImport().GetMM100UnitConverter();
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- switch( aTokenMap.Get( nPrefix, aLocalName ) )
- {
- case XML_TOK_BGIMG_HREF:
- sURL = rValue;
- if( GraphicLocation_NONE == ePos )
- ePos = GraphicLocation_TILED;
- break;
- case XML_TOK_BGIMG_TYPE:
- case XML_TOK_BGIMG_ACTUATE:
- case XML_TOK_BGIMG_SHOW:
- break;
- case XML_TOK_BGIMG_POSITION:
- {
- GraphicLocation eNewPos = GraphicLocation_NONE, eTmp;
- sal_uInt16 nTmp;
- SvXMLTokenEnumerator aTokenEnum( rValue );
- OUString aToken;
- sal_Bool bHori = sal_False, bVert = sal_False;
- sal_Bool bOK = sal_True;
- while( bOK && aTokenEnum.getNextToken( aToken ) )
- {
- if( bHori && bVert )
- {
- bOK = sal_False;
- }
- else if( -1 != aToken.indexOf( sal_Unicode('%') ) )
- {
- sal_Int32 nPrc = 50;
- if( rUnitConverter.convertPercent( nPrc, aToken ) )
- {
- if( !bHori )
- {
- eNewPos = nPrc < 25
- ? GraphicLocation_LEFT_TOP
- : (nPrc < 75 ? GraphicLocation_MIDDLE_MIDDLE
- : GraphicLocation_RIGHT_BOTTOM);
- bHori = sal_True;
- }
- else
- {
- eTmp = nPrc < 25
- ? GraphicLocation_LEFT_TOP
- : (nPrc < 75 ? GraphicLocation_LEFT_MIDDLE
- : GraphicLocation_LEFT_BOTTOM);
- lcl_xmlbic_MergeVertPos( eNewPos, eTmp );
- bVert = sal_True;
- }
- }
- else
- {
- // wrong percentage
- bOK = sal_False;
- }
- }
- else if( IsXMLToken( aToken, XML_CENTER ) )
- {
- if( bHori )
- lcl_xmlbic_MergeVertPos( eNewPos,
- GraphicLocation_MIDDLE_MIDDLE );
- else if ( bVert )
- lcl_xmlbic_MergeHoriPos( eNewPos,
- GraphicLocation_MIDDLE_MIDDLE );
- else
- eNewPos = GraphicLocation_MIDDLE_MIDDLE;
- }
- else if( rUnitConverter.convertEnum( nTmp, aToken,
- psXML_BrushHoriPos ) )
- {
- if( bVert )
- lcl_xmlbic_MergeHoriPos( eNewPos,
- (GraphicLocation)nTmp );
- else if( !bHori )
- eNewPos = (GraphicLocation)nTmp;
- else
- bOK = sal_False;
- bHori = sal_True;
- }
- else if( rUnitConverter.convertEnum( nTmp, aToken,
- psXML_BrushVertPos ) )
- {
- if( bHori )
- lcl_xmlbic_MergeVertPos( eNewPos,
- (GraphicLocation)nTmp );
- else if( !bVert )
- eNewPos = (GraphicLocation)nTmp;
- else
- bOK = sal_False;
- bVert = sal_True;
- }
- else
- {
- bOK = sal_False;
- }
- }
-
- bOK &= GraphicLocation_NONE != eNewPos;
- if( bOK )
- ePos = eNewPos;
- }
- break;
- case XML_TOK_BGIMG_REPEAT:
- {
- sal_uInt16 nPos = GraphicLocation_NONE;
- if( rUnitConverter.convertEnum( nPos, rValue,
- psXML_BrushRepeat ) )
- {
- if( GraphicLocation_MIDDLE_MIDDLE != nPos ||
- GraphicLocation_NONE == ePos ||
- GraphicLocation_AREA == ePos ||
- GraphicLocation_TILED == ePos )
- ePos = (GraphicLocation)nPos;
- }
- }
- break;
- case XML_TOK_BGIMG_FILTER:
- sFilter = rValue;
- break;
- case XML_TOK_BGIMG_TRANSPARENCY:
- {
- sal_Int32 nTmp;
- // convert from percent and clip
- if( SvXMLUnitConverter::convertPercent( nTmp, rValue ) )
- {
- if( (nTmp >= 0) && (nTmp <= 100) )
- nTransparency = static_cast<sal_Int8>( nTmp );
- }
- }
- break;
- }
- }
-
-}
-
-XMLBackgroundImageContext::XMLBackgroundImageContext(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- const XMLPropertyState& rProp,
- sal_Int32 nPosIdx,
- sal_Int32 nFilterIdx,
- sal_Int32 nTransparencyIdx,
- ::std::vector< XMLPropertyState > &rProps ) :
- XMLElementPropertyContext( rImport, nPrfx, rLName, rProp, rProps ),
- aPosProp( nPosIdx ),
- aFilterProp( nFilterIdx ),
- aTransparencyProp( nTransparencyIdx ),
- nTransparency( 0 )
-{
- ProcessAttrs( xAttrList );
-}
-
-XMLBackgroundImageContext::~XMLBackgroundImageContext()
-{
-}
-
-SvXMLImportContext *XMLBackgroundImageContext::CreateChildContext(
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = NULL;
- if( (XML_NAMESPACE_OFFICE == nPrefix) &&
- xmloff::token::IsXMLToken( rLocalName,
- xmloff::token::XML_BINARY_DATA ) )
- {
- if( !sURL.getLength() && !xBase64Stream.is() )
- {
- xBase64Stream = GetImport().GetStreamForGraphicObjectURLFromBase64();
- if( xBase64Stream.is() )
- pContext = new XMLBase64ImportContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- xBase64Stream );
- }
- }
- if( !pContext )
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
-
- return pContext;
-}
-
-void XMLBackgroundImageContext::EndElement()
-{
- if( sURL.getLength() )
- {
- sURL = GetImport().ResolveGraphicObjectURL( sURL, sal_False );
- }
- else if( xBase64Stream.is() )
- {
- sURL = GetImport().ResolveGraphicObjectURLFromBase64( xBase64Stream );
- xBase64Stream = 0;
- }
-
- if( !sURL.getLength() )
- ePos = GraphicLocation_NONE;
- else if( GraphicLocation_NONE == ePos )
- ePos = GraphicLocation_TILED;
-
- aProp.maValue <<= sURL;
- aPosProp.maValue <<= ePos;
- aFilterProp.maValue <<= sFilter;
- aTransparencyProp.maValue <<= nTransparency;
-
- SetInsert( sal_True );
- XMLElementPropertyContext::EndElement();
-
- if( -1 != aPosProp.mnIndex )
- rProperties.push_back( aPosProp );
- if( -1 != aFilterProp.mnIndex )
- rProperties.push_back( aFilterProp );
- if( -1 != aTransparencyProp.mnIndex )
- rProperties.push_back( aTransparencyProp );
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_XMLBackgroundImageExport.cxx b/binfilter/bf_xmloff/source/style/xmloff_XMLBackgroundImageExport.cxx
deleted file mode 100644
index 27c02d9d29c1..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_XMLBackgroundImageExport.cxx
+++ /dev/null
@@ -1,171 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/style/GraphicLocation.hpp>
-
-#include <xmlnmspe.hxx>
-
-
-#include "xmlexp.hxx"
-#include "XMLBackgroundImageExport.hxx"
-#include "xmluconv.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::style;
-using namespace ::binfilter::xmloff::token;
-
-XMLBackgroundImageExport::XMLBackgroundImageExport( SvXMLExport& rExp ) :
- rExport( rExp )
-{
-}
-
-XMLBackgroundImageExport::~XMLBackgroundImageExport()
-{
-}
-
-void XMLBackgroundImageExport::exportXML( const Any& rURL,
- const Any *pPos,
- const Any *pFilter,
- const Any *pTransparency,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName )
-{
- GraphicLocation ePos;
- if( !(pPos && ((*pPos) >>= ePos)) )
- ePos = GraphicLocation_AREA;
-
- OUString sURL;
- rURL >>= sURL;
- if( sURL.getLength() && GraphicLocation_NONE != ePos )
- {
- OUString sTempURL( GetExport().AddEmbeddedGraphicObject( sURL ) );
- if( sTempURL.getLength() )
- {
- GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sTempURL );
- GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE,
- XML_SIMPLE );
- GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE,
- XML_ONLOAD );
- }
-
- OUStringBuffer aOut;
- switch( ePos )
- {
- case GraphicLocation_LEFT_TOP:
- case GraphicLocation_MIDDLE_TOP:
- case GraphicLocation_RIGHT_TOP:
- aOut.append( GetXMLToken(XML_TOP) );
- break;
- case GraphicLocation_LEFT_MIDDLE:
- case GraphicLocation_MIDDLE_MIDDLE:
- case GraphicLocation_RIGHT_MIDDLE:
- aOut.append( GetXMLToken(XML_CENTER) );
- break;
- case GraphicLocation_LEFT_BOTTOM:
- case GraphicLocation_MIDDLE_BOTTOM:
- case GraphicLocation_RIGHT_BOTTOM:
- aOut.append( GetXMLToken(XML_BOTTOM) );
- break;
- }
-
- if( aOut.getLength() )
- {
- aOut.append( sal_Unicode( ' ' ) );
-
- switch( ePos )
- {
- case GraphicLocation_LEFT_TOP:
- case GraphicLocation_LEFT_BOTTOM:
- case GraphicLocation_LEFT_MIDDLE:
- aOut.append( GetXMLToken(XML_LEFT) );
- break;
- case GraphicLocation_MIDDLE_TOP:
- case GraphicLocation_MIDDLE_MIDDLE:
- case GraphicLocation_MIDDLE_BOTTOM:
- aOut.append( GetXMLToken(XML_CENTER) );
- break;
- case GraphicLocation_RIGHT_MIDDLE:
- case GraphicLocation_RIGHT_TOP:
- case GraphicLocation_RIGHT_BOTTOM:
- aOut.append( GetXMLToken(XML_RIGHT) );
- break;
- }
- }
- if( aOut.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_POSITION, aOut.makeStringAndClear() );
-
- if( GraphicLocation_AREA == ePos )
- {
- aOut.append( GetXMLToken(XML_BACKGROUND_STRETCH) );
- }
- else if( GraphicLocation_NONE != ePos && GraphicLocation_TILED != ePos )
- {
- aOut.append( GetXMLToken(XML_BACKGROUND_NO_REPEAT) );
- }
- if( aOut.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REPEAT,
- aOut.makeStringAndClear() );
-
- if( pFilter )
- {
- OUString sFilter;
- (*pFilter) >>= sFilter;
- if( sFilter.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_FILTER_NAME,
- sFilter );
- }
-
- if( pTransparency )
- {
- sal_Int8 nTransparency;
- if( (*pTransparency) >>= nTransparency )
- {
- OUStringBuffer aOut;
- SvXMLUnitConverter::convertPercent( aOut, nTransparency );
- GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_TRANSPARENCY,
- aOut.makeStringAndClear() );
- }
- }
- }
-
- {
- SvXMLElementExport aElem( GetExport(), nPrefix, rLocalName, sal_True, sal_True );
- if( sURL.getLength() && GraphicLocation_NONE != ePos )
- {
- // optional office:binary-data
- GetExport().AddEmbeddedGraphicObjectAsBase64( sURL );
- }
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_XMLBitmapLogicalSizePropertyHandler.cxx b/binfilter/bf_xmloff/source/style/xmloff_XMLBitmapLogicalSizePropertyHandler.cxx
deleted file mode 100644
index 794a835138de..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_XMLBitmapLogicalSizePropertyHandler.cxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-
-
-#include "XMLBitmapLogicalSizePropertyHandler.hxx"
-
-#include <comphelper/extract.hxx>
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::rtl;
-
-XMLBitmapLogicalSizePropertyHandler::XMLBitmapLogicalSizePropertyHandler()
-{
-}
-
-XMLBitmapLogicalSizePropertyHandler::~XMLBitmapLogicalSizePropertyHandler()
-{
-}
-
-sal_Bool XMLBitmapLogicalSizePropertyHandler::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- rValue = ::cppu::bool2any( rStrImpValue.indexOf( sal_Unicode('%') ) == -1 );
- return sal_True;
-}
-
-sal_Bool XMLBitmapLogicalSizePropertyHandler::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- return sal_False;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_XMLBitmapRepeatOffsetPropertyHandler.cxx b/binfilter/bf_xmloff/source/style/xmloff_XMLBitmapRepeatOffsetPropertyHandler.cxx
deleted file mode 100644
index 3fcb94822baa..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_XMLBitmapRepeatOffsetPropertyHandler.cxx
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "xmluconv.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-
-#include "XMLBitmapRepeatOffsetPropertyHandler.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::rtl;
-
-using ::binfilter::xmloff::token::GetXMLToken;
-using ::binfilter::xmloff::token::XML_VERTICAL;
-using ::binfilter::xmloff::token::XML_HORIZONTAL;
-
-
-XMLBitmapRepeatOffsetPropertyHandler::XMLBitmapRepeatOffsetPropertyHandler( sal_Bool bX )
-: mbX( bX ),
- msVertical( GetXMLToken(XML_VERTICAL) ),
- msHorizontal( GetXMLToken(XML_HORIZONTAL) )
-{
-}
-
-XMLBitmapRepeatOffsetPropertyHandler::~XMLBitmapRepeatOffsetPropertyHandler()
-{
-}
-
-sal_Bool XMLBitmapRepeatOffsetPropertyHandler::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
- OUString aToken;
- if( aTokenEnum.getNextToken( aToken ) )
- {
- sal_Int32 nValue;
- if( SvXMLUnitConverter::convertPercent( nValue, aToken ) )
- {
- if( aTokenEnum.getNextToken( aToken ) )
- {
- if( ( mbX && ( aToken == msHorizontal ) ) || ( !mbX && ( aToken == msVertical ) ) )
- {
- rValue <<= nValue;
- return sal_True;
- }
- }
- }
- }
-
- return sal_False;
-
-}
-
-sal_Bool XMLBitmapRepeatOffsetPropertyHandler::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUStringBuffer aOut;
-
- sal_Int32 nValue;
- if( rValue >>= nValue )
- {
- SvXMLUnitConverter::convertPercent( aOut, nValue );
- aOut.append( sal_Unicode( ' ' ) );
- aOut.append( mbX ? msHorizontal : msVertical );
- rStrExpValue = aOut.makeStringAndClear();
-
- return sal_True;
- }
-
- return sal_False;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_XMLClipPropertyHandler.cxx b/binfilter/bf_xmloff/source/style/xmloff_XMLClipPropertyHandler.cxx
deleted file mode 100644
index b87adcfb1b44..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_XMLClipPropertyHandler.cxx
+++ /dev/null
@@ -1,138 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLClipPropertyHandler.hxx"
-
-
-#include <rtl/ustrbuf.hxx>
-
-#include <com/sun/star/text/GraphicCrop.hpp>
-
-#include "xmluconv.hxx"
-
-#include <xmlkywd.hxx>
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::text;
-using namespace ::binfilter::xmloff::token;
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLMeasurePropHdl
-//
-
-XMLClipPropertyHandler::~XMLClipPropertyHandler()
-{
- // nothing to do
-}
-
-sal_Bool XMLClipPropertyHandler::equals(
- const Any& r1,
- const Any& r2 ) const
-{
- GraphicCrop aCrop1, aCrop2;
- r1 >>= aCrop1;
- r2 >>= aCrop2;
-
- return aCrop1.Top == aCrop2.Top &&
- aCrop1.Bottom == aCrop2.Bottom &&
- aCrop1.Left == aCrop2.Left &&
- aCrop1.Right == aCrop2.Right;
-}
-
-sal_Bool XMLClipPropertyHandler::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int32 nLen = rStrImpValue.getLength();
- if( nLen > 6 &&
- 0 == rStrImpValue.compareToAscii( sXML_rect, 4 ) &&
- rStrImpValue[4] == '(' &&
- rStrImpValue[nLen-1] == ')' )
- {
- GraphicCrop aCrop;
- OUString sTmp( rStrImpValue.copy( 5, nLen-6 ) );
- SvXMLTokenEnumerator aTokenEnum( sTmp );
-
- sal_uInt16 nPos = 0;
- OUString aToken;
- while( aTokenEnum.getNextToken( aToken ) )
- {
- sal_Int32 nVal = 0;
- if( !IsXMLToken(aToken, XML_AUTO) &&
- !rUnitConverter.convertMeasure( nVal, aToken ) )
- break;
-
- switch( nPos )
- {
- case 0: aCrop.Top = nVal; break;
- case 1: aCrop.Right = nVal; break;
- case 2: aCrop.Bottom = nVal; break;
- case 3: aCrop.Left = nVal; break;
- }
- nPos++;
- }
-
- bRet = (4 == nPos );
- if( bRet )
- rValue <<= aCrop;
- }
-
- return bRet;
-}
-
-sal_Bool XMLClipPropertyHandler::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- OUStringBuffer aOut(30);
- GraphicCrop aCrop;
-
- if( rValue >>= aCrop )
- {
- aOut.append( GetXMLToken(XML_RECT) );
- aOut.append( (sal_Unicode)'(' );
- rUnitConverter.convertMeasure( aOut, aCrop.Top );
- aOut.append( (sal_Unicode)' ' );
- rUnitConverter.convertMeasure( aOut, aCrop.Right );
- aOut.append( (sal_Unicode)' ' );
- rUnitConverter.convertMeasure( aOut, aCrop.Bottom );
- aOut.append( (sal_Unicode)' ' );
- rUnitConverter.convertMeasure( aOut, aCrop.Left );
- aOut.append( (sal_Unicode)')' );
- rStrExpValue = aOut.makeStringAndClear();
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_XMLConstantsPropertyHandler.cxx b/binfilter/bf_xmloff/source/style/xmloff_XMLConstantsPropertyHandler.cxx
deleted file mode 100644
index af1d21c71276..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_XMLConstantsPropertyHandler.cxx
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include "xmluconv.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-
-#include "XMLConstantsPropertyHandler.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star::uno;
-using namespace ::rtl;
-using ::binfilter::xmloff::token::XMLTokenEnum;
-
-XMLConstantsPropertyHandler::XMLConstantsPropertyHandler(
- const SvXMLEnumMapEntry *pM,
- enum XMLTokenEnum eDflt ) :
- pMap( pM ),
- eDefault( eDflt )
-{
-}
-
-XMLConstantsPropertyHandler::~XMLConstantsPropertyHandler()
-{
-}
-
-sal_Bool XMLConstantsPropertyHandler::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_uInt16 nEnum;
- sal_Bool bRet = rUnitConverter.convertEnum( nEnum, rStrImpValue, pMap );
-
- if( bRet )
- rValue <<= (sal_Int16)nEnum;
-
- return bRet;
-}
-
-sal_Bool XMLConstantsPropertyHandler::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUStringBuffer aOut;
-
- sal_Bool bRet = false;
-
- sal_Int32 nEnum;
-
- if( rValue.hasValue() && (rValue.getValueTypeClass() == TypeClass_ENUM))
- {
- nEnum = *((sal_Int32*)rValue.getValue());
- bRet = true;
- }
- else
- {
- bRet = (rValue >>= nEnum );
- }
-
- if( bRet )
- {
- if( (nEnum >= 0) && (nEnum <= 0xffff) )
- {
- sal_uInt16 nConst = static_cast<sal_uInt16>( nEnum );
-
- bRet = rUnitConverter.convertEnum( aOut, nConst, pMap, eDefault );
-
- rStrExpValue = aOut.makeStringAndClear();
- }
- else
- {
- DBG_ERROR("XMLConstantsPropertyHandler::exportXML() constant is out of range for implementation using sal_uInt16");
- }
- }
- else
- {
- DBG_ERROR("XMLConstantsPropertyHandler::exportXML() could not convert any to sal_Int32");
- }
-
- return bRet;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_XMLElementPropertyContext.cxx b/binfilter/bf_xmloff/source/style/xmloff_XMLElementPropertyContext.cxx
deleted file mode 100644
index 707e30256ea3..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_XMLElementPropertyContext.cxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLElementPropertyContext.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-
-
-TYPEINIT1( XMLElementPropertyContext , SvXMLImportContext );
-
-XMLElementPropertyContext::XMLElementPropertyContext (
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const XMLPropertyState& rProp,
- ::std::vector< XMLPropertyState > &rProps ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- aProp( rProp ),
- rProperties( rProps ),
- bInsert( sal_False )
-{
-}
-
-XMLElementPropertyContext::~XMLElementPropertyContext()
-{
-}
-
-void XMLElementPropertyContext::EndElement( )
-{
- if( bInsert )
- rProperties.push_back( aProp );
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_XMLFillBitmapSizePropertyHandler.cxx b/binfilter/bf_xmloff/source/style/xmloff_XMLFillBitmapSizePropertyHandler.cxx
deleted file mode 100644
index 1ef9c57e8cbc..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_XMLFillBitmapSizePropertyHandler.cxx
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "xmluconv.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-#include "XMLFillBitmapSizePropertyHandler.hxx"
-
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::rtl;
-
-XMLFillBitmapSizePropertyHandler::XMLFillBitmapSizePropertyHandler()
-{
-}
-
-XMLFillBitmapSizePropertyHandler::~XMLFillBitmapSizePropertyHandler()
-{
-}
-
-sal_Bool XMLFillBitmapSizePropertyHandler::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Int32 nValue;
- sal_Bool bRet;
-
- if( rStrImpValue.indexOf( sal_Unicode('%') ) != -1 )
- {
- bRet = rUnitConverter.convertPercent( nValue, rStrImpValue );
- nValue *= -1;
- }
- else
- {
- bRet = rUnitConverter.convertMeasure( nValue, rStrImpValue );
- }
-
- if( bRet )
- rValue <<= nValue;
-
- return bRet;
-}
-
-sal_Bool XMLFillBitmapSizePropertyHandler::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUStringBuffer aOut;
-
- sal_Int32 nValue;
- if( rValue >>= nValue )
- {
- if( nValue < 0 )
- {
- rUnitConverter.convertPercent( aOut, -nValue );
- }
- else
- {
- rUnitConverter.convertMeasure( aOut, nValue );
- }
-
- rStrExpValue = aOut.makeStringAndClear();
- return sal_True;
- }
-
- return sal_False;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_XMLFontAutoStylePool.cxx b/binfilter/bf_xmloff/source/style/xmloff_XMLFontAutoStylePool.cxx
deleted file mode 100644
index 419018ab447f..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_XMLFontAutoStylePool.cxx
+++ /dev/null
@@ -1,289 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <bf_svtools/cntnrsrt.hxx>
-
-#include "xmlnmspe.hxx"
-#include "fonthdl.hxx"
-
-#include "xmlexp.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::binfilter::xmloff::token;
-
-int XMLFontAutoStylePoolNameCmp_Impl( const OUString& r1,
- const OUString& r2 )
-{
- return (int)r1.compareTo( r2 );
-}
-
-DECLARE_CONTAINER_SORT_DEL( XMLFontAutoStylePoolNames_Impl,
- OUString )
-IMPL_CONTAINER_SORT( XMLFontAutoStylePoolNames_Impl,
- OUString,
- XMLFontAutoStylePoolNameCmp_Impl )
-
-class XMLFontAutoStylePoolEntry_Impl
-{
- OUString sName;
- OUString sFamilyName;
- OUString sStyleName;
- sal_Int16 nFamily;
- sal_Int16 nPitch;
- rtl_TextEncoding eEnc;
-
-public:
-
- inline XMLFontAutoStylePoolEntry_Impl(
- const ::rtl::OUString& rName,
- const ::rtl::OUString& rFamilyName,
- const ::rtl::OUString& rStyleName,
- sal_Int16 nFamily,
- sal_Int16 nPitch,
- rtl_TextEncoding eEnc );
-
- inline XMLFontAutoStylePoolEntry_Impl(
- const ::rtl::OUString& rFamilyName,
- const ::rtl::OUString& rStyleName,
- sal_Int16 nFamily,
- sal_Int16 nPitch,
- rtl_TextEncoding eEnc );
-
- const OUString& GetName() const { return sName; }
- const OUString& GetFamilyName() const { return sFamilyName; }
- const OUString& GetStyleName() const { return sStyleName; }
- sal_Int16 GetFamily() const { return nFamily; }
- sal_Int16 GetPitch() const { return nPitch; }
- rtl_TextEncoding GetEncoding() const { return eEnc; }
-};
-
-
-inline XMLFontAutoStylePoolEntry_Impl::XMLFontAutoStylePoolEntry_Impl(
- const ::rtl::OUString& rName,
- const ::rtl::OUString& rFamilyName,
- const ::rtl::OUString& rStyleName,
- sal_Int16 nFam,
- sal_Int16 nP,
- rtl_TextEncoding eE ) :
- sName( rName ),
- sFamilyName( rFamilyName ),
- sStyleName( rStyleName ),
- nFamily( nFam ),
- nPitch( nP ),
- eEnc( eE )
-{
-}
-
-inline XMLFontAutoStylePoolEntry_Impl::XMLFontAutoStylePoolEntry_Impl(
- const ::rtl::OUString& rFamilyName,
- const ::rtl::OUString& rStyleName,
- sal_Int16 nFam,
- sal_Int16 nP,
- rtl_TextEncoding eE ) :
- sFamilyName( rFamilyName ),
- sStyleName( rStyleName ),
- nFamily( nFam ),
- nPitch( nP ),
- eEnc( eE )
-{
-}
-int XMLFontAutoStylePoolEntryCmp_Impl(
- const XMLFontAutoStylePoolEntry_Impl& r1,
- const XMLFontAutoStylePoolEntry_Impl& r2 )
-{
- sal_Int8 nEnc1(r1.GetEncoding() != RTL_TEXTENCODING_SYMBOL);
- sal_Int8 nEnc2(r2.GetEncoding() != RTL_TEXTENCODING_SYMBOL);
- if( nEnc1 != nEnc2 )
- return nEnc1 - nEnc2;
- else if( r1.GetPitch() != r2.GetPitch() )
- return (int)r1.GetPitch() - (int)r2.GetPitch();
- else if( r1.GetFamily() != r2.GetFamily() )
- return (int)r1.GetFamily() - (int)r2.GetFamily();
- else
- {
- sal_Int32 nCmp = r1.GetFamilyName().compareTo( r2.GetFamilyName() );
- if( 0 == nCmp )
- return (int)r1.GetStyleName().compareTo( r2.GetStyleName() );
- else
- return (int)nCmp;
- }
-}
-
-typedef XMLFontAutoStylePoolEntry_Impl *XMLFontAutoStylePoolEntryPtr;
-DECLARE_CONTAINER_SORT_DEL( XMLFontAutoStylePool_Impl,
- XMLFontAutoStylePoolEntry_Impl )
-IMPL_CONTAINER_SORT( XMLFontAutoStylePool_Impl,
- XMLFontAutoStylePoolEntry_Impl,
- XMLFontAutoStylePoolEntryCmp_Impl )
-
-XMLFontAutoStylePool::XMLFontAutoStylePool( SvXMLExport& rExp ) :
- rExport( rExp ),
- pPool( new XMLFontAutoStylePool_Impl( 5, 5 ) ),
- pNames( new XMLFontAutoStylePoolNames_Impl( 5, 5 ) )
-{
-}
-
-XMLFontAutoStylePool::~XMLFontAutoStylePool()
-{
- delete pPool;
- delete pNames;
-}
-
-OUString XMLFontAutoStylePool::Add(
- const OUString& rFamilyName,
- const OUString& rStyleName,
- sal_Int16 nFamily,
- sal_Int16 nPitch,
- rtl_TextEncoding eEnc )
-{
- OUString sName;
- XMLFontAutoStylePoolEntry_Impl aTmp( rFamilyName, rStyleName, nFamily,
- nPitch, eEnc );
- ULONG nPos;
- if( pPool->Seek_Entry( &aTmp, &nPos ) )
- {
- sName = pPool->GetObject( nPos )->GetName();
- }
- else
- {
- OUString sName;
- sal_Int32 nLen = rFamilyName.indexOf( sal_Unicode(';'), 0 );
- if( -1 == nLen )
- {
- sName = rFamilyName;
- }
- else if( nLen > 0 )
- {
- sName = rFamilyName.copy( 0, nLen );
- sName.trim();
- }
-
- if( !sName.getLength() )
- sName = OUString::valueOf( sal_Unicode( 'F' ) );
-
- if( pNames->Seek_Entry( &sName, 0 ) )
- {
- sal_Int32 nCount = 1;
- OUString sPrefix( sName );
- sName += OUString::valueOf( nCount );
- while( pNames->Seek_Entry( &sName, 0 ) )
- {
- sName = sPrefix;
- sName += OUString::valueOf( ++nCount );
- }
- }
-
- XMLFontAutoStylePoolEntry_Impl *pEntry =
- new XMLFontAutoStylePoolEntry_Impl( sName, rFamilyName, rStyleName,
- nFamily, nPitch, eEnc );
- pPool->Insert( pEntry );
- pNames->Insert( new OUString( sName ) );
- }
-
- return sName;
-}
-
-::rtl::OUString XMLFontAutoStylePool::Find(
- const OUString& rFamilyName,
- const OUString& rStyleName,
- sal_Int16 nFamily,
- sal_Int16 nPitch,
- rtl_TextEncoding eEnc ) const
-{
- OUString sName;
- XMLFontAutoStylePoolEntry_Impl aTmp( rFamilyName, rStyleName, nFamily,
- nPitch, eEnc );
- ULONG nPos;
- if( pPool->Seek_Entry( &aTmp, &nPos ) )
- {
- sName = pPool->GetObject( nPos )->GetName();
- }
-
- return sName;
-}
-
-
-void XMLFontAutoStylePool::exportXML()
-{
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_OFFICE,
- XML_FONT_DECLS,
- sal_True, sal_True );
- Any aAny;
- OUString sTmp;
- XMLFontFamilyNamePropHdl aFamilyNameHdl;
- XMLFontFamilyPropHdl aFamilyHdl;
- XMLFontPitchPropHdl aPitchHdl;
- XMLFontEncodingPropHdl aEncHdl;
- const SvXMLUnitConverter& rUnitConv = GetExport().GetMM100UnitConverter();
-
- sal_uInt32 nCount = pPool->Count();
- for( sal_uInt32 i=0; i<nCount; i++ )
- {
- const XMLFontAutoStylePoolEntry_Impl *pEntry = pPool->GetObject( i );
-
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_NAME, pEntry->GetName() );
-
- aAny <<= pEntry->GetFamilyName();
- if( aFamilyNameHdl.exportXML( sTmp, aAny, rUnitConv ) )
- GetExport().AddAttribute( XML_NAMESPACE_FO,
- XML_FONT_FAMILY, sTmp );
-
- const OUString& rStyleName = pEntry->GetStyleName();
- if( rStyleName.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_FONT_STYLE_NAME,
- rStyleName );
-
- aAny <<= (sal_Int16)pEntry->GetFamily();
- if( aFamilyHdl.exportXML( sTmp, aAny, rUnitConv ) )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_FONT_FAMILY_GENERIC, sTmp );
-
- aAny <<= (sal_Int16)pEntry->GetPitch();
- if( aPitchHdl.exportXML( sTmp, aAny, rUnitConv ) )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_FONT_PITCH, sTmp );
-
- aAny <<= (sal_Int16)pEntry->GetEncoding();
- if( aEncHdl.exportXML( sTmp, aAny, rUnitConv ) )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_FONT_CHARSET, sTmp );
-
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
- XML_FONT_DECL,
- sal_True, sal_True );
- }
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_XMLFontStylesContext.cxx b/binfilter/bf_xmloff/source/style/xmloff_XMLFontStylesContext.cxx
deleted file mode 100644
index 6871f37d318c..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_XMLFontStylesContext.cxx
+++ /dev/null
@@ -1,279 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/awt/FontFamily.hpp>
-#include <com/sun/star/awt/FontPitch.hpp>
-
-#include "xmlnmspe.hxx"
-#include "fonthdl.hxx"
-#include "xmlimp.hxx"
-#include "maptype.hxx"
-
-#include "XMLFontStylesContext.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::awt;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-
-#define XML_STYLE_FAMILY_FONT 1
-
-enum XMLFontStyleAttrTokens
-{
- XML_TOK_FONT_STYLE_ATTR_FAMILY,
- XML_TOK_FONT_STYLE_ATTR_FAMILY_GENERIC,
- XML_TOK_FONT_STYLE_ATTR_STYLENAME,
- XML_TOK_FONT_STYLE_ATTR_PITCH,
- XML_TOK_FONT_STYLE_ATTR_CHARSET,
-
- XML_TOK_FONT_STYLE_ATTR_END=XML_TOK_UNKNOWN
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aFontStyleAttrTokenMap[] =
-{
- { XML_NAMESPACE_FO, XML_FONT_FAMILY,
- XML_TOK_FONT_STYLE_ATTR_FAMILY },
- { XML_NAMESPACE_STYLE, XML_FONT_FAMILY_GENERIC,
- XML_TOK_FONT_STYLE_ATTR_FAMILY_GENERIC },
- { XML_NAMESPACE_STYLE, XML_FONT_STYLE_NAME,
- XML_TOK_FONT_STYLE_ATTR_STYLENAME },
- { XML_NAMESPACE_STYLE, XML_FONT_PITCH,
- XML_TOK_FONT_STYLE_ATTR_PITCH },
- { XML_NAMESPACE_STYLE, XML_FONT_CHARSET,
- XML_TOK_FONT_STYLE_ATTR_CHARSET },
-
- XML_TOKEN_MAP_END
-};
-
-class XMLFontStyleContext_Impl : public SvXMLStyleContext
-{
- Any aFamilyName;
- Any aStyleName;
- Any aFamily;
- Any aPitch;
- Any aEnc;
-
- SvXMLImportContextRef xStyles;
-
- XMLFontStylesContext *GetStyles()
- {
- return ((XMLFontStylesContext *)&xStyles);
- }
-
-public:
-
- TYPEINFO();
-
- XMLFontStyleContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- XMLFontStylesContext& rStyles );
- virtual ~XMLFontStyleContext_Impl();
-
- void SetAttribute( sal_uInt16 nPrefixKey, const OUString& rLocalName,
- const OUString& rValue );
-
- void FillProperties( ::std::vector< XMLPropertyState > &rProps,
- sal_Int32 nFamilyNameIdx,
- sal_Int32 nStyleNameIdx,
- sal_Int32 nFamilyIdx,
- sal_Int32 nPitchIdx,
- sal_Int32 nCharsetIdx ) const;
-
-};
-
-TYPEINIT1( XMLFontStyleContext_Impl, SvXMLStyleContext );
-
-XMLFontStyleContext_Impl::XMLFontStyleContext_Impl( SvXMLImport& rImport,
- sal_uInt16 nPrfx, const OUString& rLName,
- const Reference< XAttributeList > & xAttrList,
- XMLFontStylesContext& rStyles ) :
- SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, XML_STYLE_FAMILY_FONT ),
- xStyles( &rStyles )
-{
- OUString sEmpty;
- aFamilyName <<= sEmpty;
- aStyleName <<= sEmpty;
- aFamily <<= (sal_Int16)FontFamily::DONTKNOW;
- aPitch <<= (sal_Int16)FontPitch::DONTKNOW;
- aEnc <<= (sal_Int16)rStyles.GetDfltCharset();
-}
-
-void XMLFontStyleContext_Impl::SetAttribute( sal_uInt16 nPrefixKey,
- const OUString& rLocalName,
- const OUString& rValue )
-{
- SvXMLUnitConverter& rUnitConv = GetImport().GetMM100UnitConverter();
- const SvXMLTokenMap& rTokenMap = GetStyles()->GetFontStyleAttrTokenMap();
- Any aAny;
-
- switch( rTokenMap.Get( nPrefixKey, rLocalName ) )
- {
- case XML_TOK_FONT_STYLE_ATTR_FAMILY:
- if( GetStyles()->GetFamilyNameHdl().importXML( rValue, aAny,
- rUnitConv ) )
- aFamilyName = aAny;
- break;
- case XML_TOK_FONT_STYLE_ATTR_STYLENAME:
- aStyleName <<= rValue;
- break;
- case XML_TOK_FONT_STYLE_ATTR_FAMILY_GENERIC:
- if( GetStyles()->GetFamilyHdl().importXML( rValue, aAny,
- rUnitConv ) )
- aFamily = aAny;
- break;
- case XML_TOK_FONT_STYLE_ATTR_PITCH:
- if( GetStyles()->GetPitchHdl().importXML( rValue, aAny,
- rUnitConv ) )
- aPitch = aAny;
- break;
- case XML_TOK_FONT_STYLE_ATTR_CHARSET:
- if( GetStyles()->GetEncodingHdl().importXML( rValue, aAny,
- rUnitConv ) )
- aEnc = aAny;
- break;
- default:
- SvXMLStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue );
- break;
- }
-}
-
-XMLFontStyleContext_Impl::~XMLFontStyleContext_Impl()
-{
-}
-
-void XMLFontStyleContext_Impl::FillProperties(
- ::std::vector< XMLPropertyState > &rProps,
- sal_Int32 nFamilyNameIdx,
- sal_Int32 nStyleNameIdx,
- sal_Int32 nFamilyIdx,
- sal_Int32 nPitchIdx,
- sal_Int32 nCharsetIdx ) const
-{
- if( nFamilyNameIdx != -1 )
- {
- XMLPropertyState aPropState( nFamilyNameIdx, aFamilyName );
- rProps.push_back( aPropState );
- }
- if( nStyleNameIdx != -1 )
- {
- XMLPropertyState aPropState( nStyleNameIdx, aStyleName );
- rProps.push_back( aPropState );
- }
- if( nFamilyIdx != -1 )
- {
- XMLPropertyState aPropState( nFamilyIdx, aFamily );
- rProps.push_back( aPropState );
- }
- if( nPitchIdx != -1 )
- {
- XMLPropertyState aPropState( nPitchIdx, aPitch );
- rProps.push_back( aPropState );
- }
- if( nCharsetIdx != -1 )
- {
- XMLPropertyState aPropState( nCharsetIdx, aEnc );
- rProps.push_back( aPropState );
- }
-}
-
-SvXMLStyleContext *XMLFontStylesContext::CreateStyleChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLStyleContext *pStyle;
- if( XML_NAMESPACE_STYLE == nPrefix &&
- IsXMLToken( rLocalName, XML_FONT_DECL ) )
- {
- pStyle = new XMLFontStyleContext_Impl( GetImport(), nPrefix,
- rLocalName, xAttrList, *this );
- }
- else
- {
- pStyle = SvXMLStylesContext::CreateStyleChildContext( nPrefix,
- rLocalName, xAttrList );
- }
-
- return pStyle;
-}
-
-TYPEINIT1( XMLFontStylesContext, SvXMLStylesContext );
-
-XMLFontStylesContext::XMLFontStylesContext( SvXMLImport& rImport,
- sal_uInt16 nPrfx, const OUString& rLName,
- const Reference< XAttributeList > & xAttrList,
- rtl_TextEncoding eDfltEnc ) :
- SvXMLStylesContext( rImport, nPrfx, rLName, xAttrList ),
- eDfltEncoding( eDfltEnc ),
- pFamilyNameHdl( new XMLFontFamilyNamePropHdl ),
- pFamilyHdl( new XMLFontFamilyPropHdl ),
- pPitchHdl( new XMLFontPitchPropHdl ),
- pEncHdl( new XMLFontEncodingPropHdl ),
- pFontStyleAttrTokenMap( new SvXMLTokenMap(aFontStyleAttrTokenMap) )
-{
-}
-
-XMLFontStylesContext::~XMLFontStylesContext()
-{
- delete pFamilyNameHdl;
- delete pFamilyHdl;
- delete pPitchHdl;
- delete pEncHdl;
- delete pFontStyleAttrTokenMap;
-}
-
-sal_Bool XMLFontStylesContext::FillProperties( const OUString& rName,
- ::std::vector< XMLPropertyState > &rProps,
- sal_Int32 nFamilyNameIdx,
- sal_Int32 nStyleNameIdx,
- sal_Int32 nFamilyIdx,
- sal_Int32 nPitchIdx,
- sal_Int32 nCharsetIdx ) const
-{
- const XMLFontStyleContext_Impl *pFontStyle =
- PTR_CAST( XMLFontStyleContext_Impl,
- FindStyleChildContext( XML_STYLE_FAMILY_FONT, rName, sal_True ) );
- if( pFontStyle )
- pFontStyle->FillProperties( rProps, nFamilyNameIdx, nStyleNameIdx,
- nFamilyIdx, nPitchIdx, nCharsetIdx );
- return 0 != pFontStyle;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_XMLFootnoteSeparatorExport.cxx b/binfilter/bf_xmloff/source/style/xmloff_XMLFootnoteSeparatorExport.cxx
deleted file mode 100644
index 2f7a8f247c63..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_XMLFootnoteSeparatorExport.cxx
+++ /dev/null
@@ -1,166 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLFootnoteSeparatorExport.hxx"
-
-#include <tools/debug.hxx>
-
-#include "xmlexp.hxx"
-
-#include "xmlnmspe.hxx"
-
-#include "xmluconv.hxx"
-
-
-
-#include "PageMasterStyleMap.hxx"
-
-#include <com/sun/star/text/HorizontalAdjust.hpp>
-
-namespace binfilter {
-
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-using ::rtl::OUStringBuffer;
-using ::std::vector;
-
-XMLFootnoteSeparatorExport::XMLFootnoteSeparatorExport(SvXMLExport& rExp) :
- rExport(rExp)
-{
-}
-
-XMLFootnoteSeparatorExport::~XMLFootnoteSeparatorExport()
-{
-}
-
-
-static const SvXMLEnumMapEntry aXML_HorizontalAdjust_Enum[] =
-{
- { XML_LEFT, text::HorizontalAdjust_LEFT },
- { XML_CENTER, text::HorizontalAdjust_CENTER },
- { XML_RIGHT, text::HorizontalAdjust_RIGHT },
- { XML_TOKEN_INVALID, 0 }
-};
-
-void XMLFootnoteSeparatorExport::exportXML(
- const vector<XMLPropertyState> * pProperties,
- sal_uInt32 nIdx,
- const UniReference<XMLPropertySetMapper> & rMapper)
-{
- DBG_ASSERT(NULL != pProperties, "Need property states");
-
- // intialize values
- sal_Int16 eLineAdjust = text::HorizontalAdjust_LEFT;
- sal_Int32 nLineColor = 0;
- sal_Int32 nLineDistance = 0;
- sal_Int8 nLineRelWidth = 0;
- sal_Int32 nLineTextDistance = 0;
- sal_Int16 nLineWeight = 0;
-
- // find indices into property map and get values
- sal_uInt32 nCount = pProperties->size();
- for(sal_uInt32 i = 0; i < nCount; i++)
- {
- const XMLPropertyState& rState = (*pProperties)[i];
-
- switch (rMapper->GetEntryContextId(rState.mnIndex))
- {
- case CTF_PM_FTN_LINE_ADJUST:
- rState.maValue >>= eLineAdjust;
- break;
- case CTF_PM_FTN_LINE_COLOR:
- rState.maValue >>= nLineColor;
- break;
- case CTF_PM_FTN_DISTANCE:
- rState.maValue >>= nLineDistance;
- break;
- case CTF_PM_FTN_LINE_WIDTH:
- rState.maValue >>= nLineRelWidth;
- break;
- case CTF_PM_FTN_LINE_DISTANCE:
- rState.maValue >>= nLineTextDistance;
- break;
- case CTF_PM_FTN_LINE_WEIGTH:
- DBG_ASSERT( i == nIdx,
- "received wrong property state index" );
- rState.maValue >>= nLineWeight;
- break;
- }
- }
-
- OUStringBuffer sBuf;
-
- // weight/width
- if (nLineWeight > 0)
- {
- rExport.GetMM100UnitConverter().convertMeasure(sBuf, nLineWeight);
- rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_WIDTH,
- sBuf.makeStringAndClear());
- }
-
- // line text distance
- if (nLineTextDistance > 0)
- {
- rExport.GetMM100UnitConverter().convertMeasure(sBuf,nLineTextDistance);
- rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_DISTANCE_BEFORE_SEP,
- sBuf.makeStringAndClear());
- }
-
- // line distance
- if (nLineDistance > 0)
- {
- rExport.GetMM100UnitConverter().convertMeasure(sBuf, nLineDistance);
- rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_DISTANCE_AFTER_SEP,
- sBuf.makeStringAndClear());
- }
-
- // adjustment
- if (rExport.GetMM100UnitConverter().convertEnum(
- sBuf, eLineAdjust, aXML_HorizontalAdjust_Enum))
- {
- rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_ADJUSTMENT,
- sBuf.makeStringAndClear());
- }
-
- // relative line width
- SvXMLUnitConverter::convertPercent(sBuf, nLineRelWidth);
- rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_REL_WIDTH,
- sBuf.makeStringAndClear());
-
- // color
- rExport.GetMM100UnitConverter().convertColor(sBuf, nLineColor);
- rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_COLOR,
- sBuf.makeStringAndClear());
-
- SvXMLElementExport aElem(rExport, XML_NAMESPACE_STYLE,
- XML_FOOTNOTE_SEP, sal_True, sal_True);
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_XMLFootnoteSeparatorImport.cxx b/binfilter/bf_xmloff/source/style/xmloff_XMLFootnoteSeparatorImport.cxx
deleted file mode 100644
index cf0b894d49ec..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_XMLFootnoteSeparatorImport.cxx
+++ /dev/null
@@ -1,202 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLFootnoteSeparatorImport.hxx"
-
-#include "rtl/ustring.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-#include <com/sun/star/text/HorizontalAdjust.hpp>
-
-#include "xmlimp.hxx"
-
-
-#include "xmluconv.hxx"
-
-#include "xmlprmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-#include "nmspmap.hxx"
-
-
-#include "PageMasterStyleMap.hxx"
-
-#include <tools/debug.hxx>
-
-
-#include <vector>
-namespace binfilter {
-
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::std::vector;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::xml::sax::XAttributeList;
-
-
-TYPEINIT1(XMLFootnoteSeparatorImport, SvXMLImportContext);
-
-
-XMLFootnoteSeparatorImport::XMLFootnoteSeparatorImport(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- vector<XMLPropertyState> & rProps,
- const UniReference<XMLPropertySetMapper> & rMapperRef,
- sal_Int32 nIndex) :
- SvXMLImportContext(rImport, nPrefix, rLocalName),
- rProperties(rProps),
- rMapper(rMapperRef),
- nPropIndex(nIndex)
-{
-}
-
-XMLFootnoteSeparatorImport::~XMLFootnoteSeparatorImport()
-{
-}
-
-
-static const SvXMLEnumMapEntry aXML_HorizontalAdjust_Enum[] =
-{
- { XML_LEFT, text::HorizontalAdjust_LEFT },
- { XML_CENTER, text::HorizontalAdjust_CENTER },
- { XML_RIGHT, text::HorizontalAdjust_RIGHT },
- { XML_TOKEN_INVALID, 0 }
-};
-
-void XMLFootnoteSeparatorImport::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- // get the values from the properties
- sal_Int16 nLineWeight = 0;
- sal_Int32 nLineColor = 0;
- sal_Int8 nLineRelWidth = 0;
- sal_Int16 eLineAdjust = text::HorizontalAdjust_LEFT; // enum text::HorizontalAdjust
- sal_Int32 nLineTextDistance = 0;
- sal_Int32 nLineDistance = 0;
-
- // iterate over xattribute list and fill values
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
- OUString sAttrValue = xAttrList->getValueByIndex(nAttr);
-
- sal_Int32 nTmp;
-
- if (XML_NAMESPACE_STYLE == nPrefix)
- {
- if (IsXMLToken( sLocalName, XML_WIDTH ))
- {
- if (GetImport().GetMM100UnitConverter().convertMeasure(
- nTmp, sAttrValue))
- {
- nLineWeight = (sal_Int16)nTmp;
- }
- }
- else if (IsXMLToken( sLocalName, XML_DISTANCE_BEFORE_SEP ))
- {
- if (GetImport().GetMM100UnitConverter().convertMeasure(
- nTmp, sAttrValue))
- nLineTextDistance = nTmp;
- }
- else if (IsXMLToken( sLocalName, XML_DISTANCE_AFTER_SEP ))
- {
- if (GetImport().GetMM100UnitConverter().convertMeasure(
- nTmp, sAttrValue))
- nLineDistance = nTmp;
- }
- else if (IsXMLToken( sLocalName, XML_ADJUSTMENT ))
- {
- sal_uInt16 nTmpU;
- if (SvXMLUnitConverter::convertEnum(
- nTmpU, sAttrValue, aXML_HorizontalAdjust_Enum))
- eLineAdjust = (sal_Int16)nTmpU;
- }
- else if (IsXMLToken( sLocalName, XML_REL_WIDTH ))
- {
- if (SvXMLUnitConverter::convertPercent(nTmp, sAttrValue))
- nLineRelWidth = (sal_uInt8)nTmp;
- }
- else if (IsXMLToken( sLocalName, XML_COLOR ))
- {
- Color aColor;
- if (SvXMLUnitConverter::convertColor(aColor, sAttrValue))
- nLineColor = (sal_Int32)aColor.GetColor();
- }
- }
- }
-
- // OK, now we have all values and can fill the XMLPropertyState vector
- Any aAny;
- sal_Int32 nIndex;
-
- aAny <<= eLineAdjust;
- nIndex = rMapper->FindEntryIndex(CTF_PM_FTN_LINE_ADJUST);
- XMLPropertyState aLineAdjust( nIndex, aAny);
- rProperties.push_back(aLineAdjust);
-
- aAny <<= nLineColor;
- nIndex = rMapper->FindEntryIndex(CTF_PM_FTN_LINE_COLOR);
- XMLPropertyState aLineColor( nIndex, aAny );
- rProperties.push_back(aLineColor);
-
- aAny <<= nLineDistance;
- nIndex = rMapper->FindEntryIndex(CTF_PM_FTN_DISTANCE);
- XMLPropertyState aLineDistance( nIndex, aAny );
- rProperties.push_back(aLineDistance);
-
- aAny <<= nLineRelWidth;
- nIndex = rMapper->FindEntryIndex(CTF_PM_FTN_LINE_WIDTH);
- XMLPropertyState aLineRelWidth( nIndex, aAny);
- rProperties.push_back(aLineRelWidth);
-
- aAny <<= nLineTextDistance;
- nIndex = rMapper->FindEntryIndex(CTF_PM_FTN_LINE_DISTANCE);
- XMLPropertyState aLineTextDistance( nIndex, aAny);
- rProperties.push_back(aLineTextDistance);
-
- DBG_ASSERT( rMapper->FindEntryIndex(CTF_PM_FTN_LINE_WEIGTH) == nPropIndex,
- "Received wrong property map index!" );
- aAny <<= nLineWeight;
- XMLPropertyState aLineWeight( nPropIndex, aAny );
- rProperties.push_back(aLineWeight);
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_XMLIsPercentagePropertyHandler.cxx b/binfilter/bf_xmloff/source/style/xmloff_XMLIsPercentagePropertyHandler.cxx
deleted file mode 100644
index 45545947daf4..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_XMLIsPercentagePropertyHandler.cxx
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include <com/sun/star/uno/Any.hxx>
-
-
-#include "XMLIsPercentagePropertyHandler.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::rtl;
-
-XMLIsPercentagePropertyHandler::~XMLIsPercentagePropertyHandler()
-{
-}
-
-sal_Bool XMLIsPercentagePropertyHandler::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- rValue <<= (sal_Bool)(rStrImpValue.indexOf( sal_Unicode('%') ) != -1);
- return sal_True;
-}
-
-sal_Bool XMLIsPercentagePropertyHandler::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- DBG_ERROR( "XMLIsPercentagePropertyHandler is not for export!" );
- return sal_False;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_XMLPageExport.cxx b/binfilter/bf_xmloff/source/style/xmloff_XMLPageExport.cxx
deleted file mode 100644
index c7f3fd4f61e6..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_XMLPageExport.cxx
+++ /dev/null
@@ -1,233 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <tools/debug.hxx>
-
-#include "xmlnmspe.hxx"
-
-#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-#include <com/sun/star/style/XStyle.hpp>
-
-#include <com/sun/star/container/XNameContainer.hpp>
-
-
-#include "xmlexp.hxx"
-#include "PageMasterPropHdlFactory.hxx"
-#include "PageMasterStyleMap.hxx"
-#include "PageMasterPropMapper.hxx"
-#include "PageMasterExportPropMapper.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-
-//______________________________________________________________________________
-
-sal_Bool XMLPageExport::findPageMasterName( const OUString& rStyleName, OUString& rPMName ) const
-{
- for( ::std::vector< XMLPageExportNameEntry >::const_iterator pEntry = aNameVector.begin();
- pEntry != aNameVector.end(); pEntry++ )
- {
- if( pEntry->sStyleName == rStyleName )
- {
- rPMName = pEntry->sPageMasterName;
- return sal_True;
- }
- }
- return sal_False;
-}
-
-void XMLPageExport::collectPageMasterAutoStyle(
- const Reference < XPropertySet > & rPropSet,
- OUString& rPageMasterName )
-{
- DBG_ASSERT( xPageMasterPropSetMapper.is(), "page master family/XMLPageMasterPropSetMapper not found" );
- if( xPageMasterPropSetMapper.is() )
- {
- ::std::vector<XMLPropertyState> xPropStates = xPageMasterExportPropMapper->Filter( rPropSet );
- if(xPropStates.size())
- {
- OUString sParent;
- rPageMasterName = rExport.GetAutoStylePool()->Find( XML_STYLE_FAMILY_PAGE_MASTER, sParent, xPropStates );
- if (!rPageMasterName.getLength())
- rPageMasterName = rExport.GetAutoStylePool()->Add(XML_STYLE_FAMILY_PAGE_MASTER, sParent, xPropStates);
- }
- }
-}
-
-void XMLPageExport::exportMasterPageContent(
- const Reference < XPropertySet > & rPropSet,
- sal_Bool bAutoStyles )
-{
-
-}
-
-sal_Bool XMLPageExport::exportStyle(
- const Reference< XStyle >& rStyle,
- sal_Bool bAutoStyles )
-{
- Reference< XPropertySet > xPropSet( rStyle, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
-
- Any aAny;
-
- // Don't export styles that aren't existing really. This may be the
- // case for StarOffice Writer's pool styles.
- if( xPropSetInfo->hasPropertyByName( sIsPhysical ) )
- {
- aAny = xPropSet->getPropertyValue( sIsPhysical );
- if( !*(sal_Bool *)aAny.getValue() )
- return sal_False;
- }
-
- if( bAutoStyles )
- {
- XMLPageExportNameEntry aEntry;
- collectPageMasterAutoStyle( xPropSet, aEntry.sPageMasterName );
- aEntry.sStyleName = rStyle->getName();
- aNameVector.push_back( aEntry );
-
- exportMasterPageContent( xPropSet, sal_True );
- }
- else
- {
- OUString sName( rStyle->getName() );
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NAME, sName );
-
- OUString sPMName;
- if( findPageMasterName( sName, sPMName ) )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_PAGE_MASTER_NAME, sPMName );
-
- aAny = xPropSet->getPropertyValue( sFollowStyle );
- OUString sNextName;
- aAny >>= sNextName;
- if( sName != sNextName && sNextName.getLength() )
- {
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NEXT_STYLE_NAME,
- sNextName );
- }
-// OUString sPageMaster = GetExport().GetAutoStylePool()->Find(
-// XML_STYLE_FAMILY_PAGE_MASTER,
-// xPropSet );
-// if( sPageMaster.getLength() )
-// GetExport().AddAttribute( XML_NAMESPACE_STYLE,
-// XML_PAGE_MASTER_NAME,
-// sPageMaster );
-
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
- XML_MASTER_PAGE, sal_True, sal_True );
-
- exportMasterPageContent( xPropSet, sal_False );
- }
-
- return sal_True;
-}
-
-XMLPageExport::XMLPageExport( SvXMLExport& rExp ) :
- rExport( rExp ),
- sIsPhysical( RTL_CONSTASCII_USTRINGPARAM( "IsPhysical" ) ),
- sFollowStyle( RTL_CONSTASCII_USTRINGPARAM( "FollowStyle" ) )
-{
- xPageMasterPropHdlFactory = new XMLPageMasterPropHdlFactory;
- xPageMasterPropSetMapper = new XMLPageMasterPropSetMapper(
- (XMLPropertyMapEntry*) aXMLPageMasterStyleMap,
- xPageMasterPropHdlFactory );
- xPageMasterExportPropMapper = new XMLPageMasterExportPropMapper(
- xPageMasterPropSetMapper, rExp);
-
- rExport.GetAutoStylePool()->AddFamily( XML_STYLE_FAMILY_PAGE_MASTER, OUString( RTL_CONSTASCII_USTRINGPARAM( XML_STYLE_FAMILY_PAGE_MASTER_NAME ) ),
- xPageMasterExportPropMapper, OUString( RTL_CONSTASCII_USTRINGPARAM( XML_STYLE_FAMILY_PAGE_MASTER_PREFIX ) ), sal_False );
-
- Reference< XStyleFamiliesSupplier > xFamiliesSupp( GetExport().GetModel(),
- UNO_QUERY );
- DBG_ASSERT( xFamiliesSupp.is(),
- "No XStyleFamiliesSupplier from XModel for export!" );
- if( xFamiliesSupp.is() )
- {
- Reference< XNameAccess > xFamilies( xFamiliesSupp->getStyleFamilies() );
- DBG_ASSERT( xFamiliesSupp.is(),
- "getStyleFamilies() from XModel failed for export!" );
- if( xFamilies.is() )
- {
- const OUString aPageStyleName(
- RTL_CONSTASCII_USTRINGPARAM( "PageStyles" ));
-
- if( xFamilies->hasByName( aPageStyleName ) )
- {
- Reference < XNameContainer > xStyleCont;
- xFamilies->getByName( aPageStyleName ) >>= xStyleCont;
-
- xPageStyles = Reference< XIndexAccess >( xStyleCont,
- UNO_QUERY );
-
- DBG_ASSERT( xPageStyles.is(),
- "Page Styles not found for export!" );
- }
- }
- }
-}
-
-XMLPageExport::~XMLPageExport()
-{
-}
-
-void XMLPageExport::exportStyles( sal_Bool bUsed, sal_Bool bAutoStyles )
-{
- if( xPageStyles.is() )
- {
- const sal_Int32 nStyles = xPageStyles->getCount();
-
- for( sal_Int32 i=0; i < nStyles; i++ )
- {
- Reference< XStyle > xStyle;
- xPageStyles->getByIndex( i ) >>= xStyle;
-
- if( !bUsed || xStyle->isInUse() )
- exportStyle( xStyle, bAutoStyles );
- }
- }
-}
-
-void XMLPageExport::exportAutoStyles()
-{
- rExport.GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_PAGE_MASTER
- , rExport.GetDocHandler(), rExport.GetMM100UnitConverter(),
- rExport.GetNamespaceMap()
- );
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_XMLPercentOrMeasurePropertyHandler.cxx b/binfilter/bf_xmloff/source/style/xmloff_XMLPercentOrMeasurePropertyHandler.cxx
deleted file mode 100644
index 0144ceac8d14..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_XMLPercentOrMeasurePropertyHandler.cxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-
-#include <rtl/ustrbuf.hxx>
-
-#include "XMLPercentOrMeasurePropertyHandler.hxx"
-
-#include "xmluconv.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::rtl;
-
-XMLPercentOrMeasurePropertyHandler::XMLPercentOrMeasurePropertyHandler( sal_Bool bPercent )
-: mbPercent( bPercent )
-{
-}
-
-XMLPercentOrMeasurePropertyHandler::~XMLPercentOrMeasurePropertyHandler()
-{
-}
-
-sal_Bool XMLPercentOrMeasurePropertyHandler::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- if( (rStrImpValue.indexOf( sal_Unicode('%') ) != -1) != mbPercent )
- return sal_False;
-
- sal_Int32 nValue;
-
- if( mbPercent )
- {
- if( !rUnitConverter.convertPercent( nValue, rStrImpValue ) )
- return sal_False;
- }
- else
- {
- if( !rUnitConverter.convertMeasure( nValue, rStrImpValue ) )
- return sal_False;
- }
-
- rValue <<= nValue;
- return sal_True;
-}
-
-sal_Bool XMLPercentOrMeasurePropertyHandler::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUStringBuffer aOut;
-
- sal_Int32 nValue;
- if( !(rValue >>= nValue ) )
- return sal_False;
-
- if( mbPercent )
- {
- rUnitConverter.convertPercent( aOut, nValue );
- }
- else
- {
- rUnitConverter.convertMeasure( aOut, nValue );
- }
-
- rStrExpValue = aOut.makeStringAndClear();
- return sal_True;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_XMLRectangleMembersHandler.cxx b/binfilter/bf_xmloff/source/style/xmloff_XMLRectangleMembersHandler.cxx
deleted file mode 100644
index 6a17a90de70d..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_XMLRectangleMembersHandler.cxx
+++ /dev/null
@@ -1,133 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "xmluconv.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-
-#include <com/sun/star/awt/Rectangle.hdl>
-
-#include "XMLRectangleMembersHandler.hxx"
-
-#include "xmltypes.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::rtl;
-
-XMLRectangleMembersHdl::XMLRectangleMembersHdl( sal_Int32 nType )
-: mnType( nType )
-{
-}
-
- sal_Int32 X;
- sal_Int32 Y;
- sal_Int32 Width;
- sal_Int32 Height;
-
-XMLRectangleMembersHdl::~XMLRectangleMembersHdl()
-{
-}
-
-sal_Bool XMLRectangleMembersHdl::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- awt::Rectangle aRect( 0, 0, 0, 0 );
- if( rValue.hasValue() )
- rValue >>= aRect;
-
- sal_Int32 nValue;
-
- if( rUnitConverter.convertMeasure( nValue, rStrImpValue ) )
- {
- switch( mnType )
- {
- case XML_TYPE_RECTANGLE_LEFT :
- aRect.X = nValue;
- break;
- case XML_TYPE_RECTANGLE_TOP :
- aRect.Y = nValue;
- break;
- case XML_TYPE_RECTANGLE_WIDTH :
- aRect.Width = nValue;
- break;
- case XML_TYPE_RECTANGLE_HEIGHT :
- aRect.Height = nValue;
- break;
- }
-
- rValue <<= aRect;
- return sal_True;
- }
-
- return sal_False;
-}
-
-sal_Bool XMLRectangleMembersHdl::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- awt::Rectangle aRect( 0, 0, 0, 0 );
- rValue >>= aRect;
-
- sal_Int32 nValue;
-
- switch( mnType )
- {
- case XML_TYPE_RECTANGLE_LEFT :
- nValue = aRect.X;
- break;
- case XML_TYPE_RECTANGLE_TOP :
- nValue = aRect.Y;
- break;
- case XML_TYPE_RECTANGLE_WIDTH :
- nValue = aRect.Width;
- break;
- case XML_TYPE_RECTANGLE_HEIGHT :
- nValue = aRect.Height;
- break;
- default:
- nValue = 0; // TODO What value should this be?
- break;
-
- }
-
- ::rtl::OUStringBuffer sBuffer;
- rUnitConverter.convertMeasure( sBuffer, nValue );
- rStrExpValue = sBuffer.makeStringAndClear();
- return sal_True;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_adjushdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_adjushdl.cxx
deleted file mode 100644
index 7e53ead2cf0e..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_adjushdl.cxx
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <adjushdl.hxx>
-
-#include <tools/solar.h>
-
-
-#include "xmluconv.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-#include <com/sun/star/style/ParagraphAdjust.hpp>
-
-
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::rtl;
-using namespace ::binfilter::xmloff::token;
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_Para_Adjust_Enum[] =
-{
- { XML_START, style::ParagraphAdjust_LEFT },
- { XML_END, style::ParagraphAdjust_RIGHT },
- { XML_CENTER, style::ParagraphAdjust_CENTER },
- { XML_JUSTIFY, style::ParagraphAdjust_BLOCK },
- { XML_JUSTIFIED, style::ParagraphAdjust_BLOCK }, // obsolete
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_Para_Align_Last_Enum[] =
-{
- { XML_START, style::ParagraphAdjust_LEFT },
- { XML_CENTER, style::ParagraphAdjust_CENTER },
- { XML_JUSTIFY, style::ParagraphAdjust_BLOCK },
- { XML_JUSTIFIED, style::ParagraphAdjust_BLOCK }, // obsolete
- { XML_TOKEN_INVALID, 0 }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLParaAdjustPropHdl
-//
-
-XMLParaAdjustPropHdl::~XMLParaAdjustPropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLParaAdjustPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_uInt16 eAdjust;
-
- if( ( bRet = rUnitConverter.convertEnum( eAdjust, rStrImpValue, pXML_Para_Adjust_Enum ) ) )
- rValue <<= (sal_Int16)eAdjust;
-
- return bRet;
-}
-
-sal_Bool XMLParaAdjustPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- if(!rValue.hasValue())
- return sal_False; //added by BerryJia for fixing Bug102407 2002-11-5
- OUStringBuffer aOut;
- sal_Int16 nVal;
-
- rValue >>= nVal;
-
- sal_Bool bRet = rUnitConverter.convertEnum( aOut, nVal, pXML_Para_Adjust_Enum, XML_START );
-
- rStrExpValue = aOut.makeStringAndClear();
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLLastLineAdjustPropHdl
-//
-
-XMLLastLineAdjustPropHdl::~XMLLastLineAdjustPropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLLastLineAdjustPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_uInt16 eAdjust;
-
- if( ( bRet = rUnitConverter.convertEnum( eAdjust, rStrImpValue, pXML_Para_Align_Last_Enum ) ) )
- rValue <<= (sal_Int16)eAdjust;
-
- return bRet;
-}
-
-sal_Bool XMLLastLineAdjustPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUStringBuffer aOut;
- sal_Int16 nVal;
- sal_Bool bRet = sal_False;
-
- rValue >>= nVal;
-
- if( nVal != style::ParagraphAdjust_LEFT )
- bRet = rUnitConverter.convertEnum( aOut, nVal, pXML_Para_Align_Last_Enum, XML_START );
-
- rStrExpValue = aOut.makeStringAndClear();
-
- return bRet;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_backhdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_backhdl.cxx
deleted file mode 100644
index d444f520a2c9..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_backhdl.cxx
+++ /dev/null
@@ -1,295 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include <backhdl.hxx>
-
-
-#include "xmluconv.hxx"
-
-
-#include <rtl/ustrbuf.hxx>
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-SvXMLEnumMapEntry pXML_BrushHorizontalPos[] =
-{
- { XML_LEFT, style::GraphicLocation_LEFT_MIDDLE },
- { XML_RIGHT, style::GraphicLocation_RIGHT_MIDDLE },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry pXML_BrushVerticalPos[] =
-{
- { XML_TOP, style::GraphicLocation_MIDDLE_TOP },
- { XML_BOTTOM, style::GraphicLocation_MIDDLE_BOTTOM },
- { XML_TOKEN_INVALID, 0 }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLBackGraphicPositionPropHdl
-//
-
-XMLBackGraphicPositionPropHdl::~XMLBackGraphicPositionPropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLBackGraphicPositionPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_True;
- style::GraphicLocation ePos = style::GraphicLocation_NONE, eTmp;
- sal_uInt16 nTmp;
- SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
- OUString aToken;
- sal_Bool bHori = sal_False, bVert = sal_False;
-
- while( bRet && aTokenEnum.getNextToken( aToken ) )
- {
- if( bHori && bVert )
- {
- bRet = sal_False;
- }
- else if( -1 != aToken.indexOf( sal_Unicode('%') ) )
- {
- sal_Int32 nPrc = 50;
- if( rUnitConverter.convertPercent( nPrc, aToken ) )
- {
- if( !bHori )
- {
- ePos = nPrc < 25 ? style::GraphicLocation_LEFT_TOP :
- (nPrc < 75 ? style::GraphicLocation_MIDDLE_MIDDLE :
- style::GraphicLocation_RIGHT_BOTTOM);
- bHori = sal_True;
- }
- else
- {
- eTmp = nPrc < 25 ? style::GraphicLocation_LEFT_TOP:
- (nPrc < 75 ? style::GraphicLocation_LEFT_MIDDLE :
- style::GraphicLocation_LEFT_BOTTOM);
- MergeXMLVertPos( ePos, eTmp );
- bVert = sal_True;
- }
- }
- else
- {
- // wrong percentage
- bRet = sal_False;
- }
- }
- else if( IsXMLToken( aToken, XML_CENTER ) )
- {
- if( bHori )
- MergeXMLVertPos( ePos, style::GraphicLocation_MIDDLE_MIDDLE );
- else if ( bVert )
- MergeXMLHoriPos( ePos, style::GraphicLocation_MIDDLE_MIDDLE );
- else
- ePos = style::GraphicLocation_MIDDLE_MIDDLE;
- }
- else if( rUnitConverter.convertEnum( nTmp, aToken, pXML_BrushHorizontalPos ) )
- {
- if( bVert )
- MergeXMLHoriPos( ePos, (style::GraphicLocation)nTmp );
- else if( !bHori )
- ePos = (style::GraphicLocation)nTmp;
- else
- bRet = sal_False;
-
- bHori = sal_True;
- }
- else if( rUnitConverter.convertEnum( nTmp, aToken, pXML_BrushVerticalPos ) )
- {
- if( bHori )
- MergeXMLVertPos( ePos, (style::GraphicLocation)nTmp );
- else if( !bVert )
- ePos = (style::GraphicLocation)nTmp;
- else
- bRet = sal_False;
- bVert = sal_True;
- }
- else
- {
- bRet = sal_False;
- }
- }
-
- bRet &= style::GraphicLocation_NONE != ePos;
- if( bRet )
- rValue <<= (style::GraphicLocation)(sal_uInt16)ePos;
-
- return bRet;
-}
-
-sal_Bool XMLBackGraphicPositionPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_True;
- OUStringBuffer aOut;
-
- style::GraphicLocation eLocation;
- if( !( rValue >>= eLocation ) )
- {
- sal_Int32 nValue;
- if( rValue >>= nValue )
- eLocation = (style::GraphicLocation)nValue;
- else
- bRet = sal_False;
- }
-
- if( bRet )
- {
- bRet = sal_False;
-
- switch( eLocation )
- {
- case style::GraphicLocation_LEFT_TOP:
- case style::GraphicLocation_MIDDLE_TOP:
- case style::GraphicLocation_RIGHT_TOP:
- aOut.append( GetXMLToken(XML_TOP) );
- bRet = sal_True;
- break;
- case style::GraphicLocation_LEFT_MIDDLE:
- case style::GraphicLocation_MIDDLE_MIDDLE:
- case style::GraphicLocation_RIGHT_MIDDLE:
- aOut.append( GetXMLToken(XML_CENTER) );
- bRet = sal_True;
- break;
- case style::GraphicLocation_LEFT_BOTTOM:
- case style::GraphicLocation_MIDDLE_BOTTOM:
- case style::GraphicLocation_RIGHT_BOTTOM:
- aOut.append( GetXMLToken(XML_BOTTOM) );
- bRet = sal_True;
- break;
- }
-
- if( bRet )
- {
- aOut.append( sal_Unicode( ' ' ) );
-
- switch( eLocation )
- {
- case style::GraphicLocation_LEFT_TOP:
- case style::GraphicLocation_LEFT_BOTTOM:
- case style::GraphicLocation_LEFT_MIDDLE:
- aOut.append( GetXMLToken(XML_LEFT) );
- break;
- case style::GraphicLocation_MIDDLE_TOP:
- case style::GraphicLocation_MIDDLE_MIDDLE:
- case style::GraphicLocation_MIDDLE_BOTTOM:
- aOut.append( GetXMLToken(XML_CENTER) );
- break;
- case style::GraphicLocation_RIGHT_MIDDLE:
- case style::GraphicLocation_RIGHT_TOP:
- case style::GraphicLocation_RIGHT_BOTTOM:
- aOut.append( GetXMLToken(XML_RIGHT) );
- break;
- }
- }
- }
-
- rStrExpValue = aOut.makeStringAndClear();
-
- return bRet;
-}
-
-void XMLBackGraphicPositionPropHdl::MergeXMLVertPos( style::GraphicLocation& ePos, style::GraphicLocation eVert ) const
-{
- switch( ePos )
- {
- case style::GraphicLocation_LEFT_TOP:
- case style::GraphicLocation_LEFT_MIDDLE:
- case style::GraphicLocation_LEFT_BOTTOM:
- ePos = style::GraphicLocation_MIDDLE_TOP==eVert ?
- style::GraphicLocation_LEFT_TOP :
- (style::GraphicLocation_MIDDLE_MIDDLE==eVert ?
- style::GraphicLocation_LEFT_MIDDLE :
- style::GraphicLocation_LEFT_BOTTOM);
- ePos = eVert;
- break;
-
- case style::GraphicLocation_MIDDLE_TOP:
- case style::GraphicLocation_MIDDLE_MIDDLE:
- case style::GraphicLocation_MIDDLE_BOTTOM:
- ePos = eVert;
- break;
-
- case style::GraphicLocation_RIGHT_TOP:
- case style::GraphicLocation_RIGHT_MIDDLE:
- case style::GraphicLocation_RIGHT_BOTTOM:
- ePos = style::GraphicLocation_MIDDLE_TOP==eVert ?
- style::GraphicLocation_RIGHT_TOP :
- (style::GraphicLocation_MIDDLE_MIDDLE==eVert ?
- style::GraphicLocation_RIGHT_MIDDLE :
- style::GraphicLocation_RIGHT_BOTTOM);
- break;
- }
-}
-
-void XMLBackGraphicPositionPropHdl::MergeXMLHoriPos( style::GraphicLocation& ePos, style::GraphicLocation eHori ) const
-{
- DBG_ASSERT( style::GraphicLocation_LEFT_MIDDLE==eHori || style::GraphicLocation_MIDDLE_MIDDLE==eHori || style::GraphicLocation_RIGHT_MIDDLE==eHori,
- "lcl_frmitems_MergeXMLHoriPos: vertical pos must be middle" );
-
- switch( ePos )
- {
- case style::GraphicLocation_LEFT_TOP:
- case style::GraphicLocation_MIDDLE_TOP:
- case style::GraphicLocation_RIGHT_TOP:
- ePos = style::GraphicLocation_LEFT_MIDDLE==eHori ?
- style::GraphicLocation_LEFT_TOP :
- (style::GraphicLocation_MIDDLE_MIDDLE==eHori ?
- style::GraphicLocation_MIDDLE_TOP :
- style::GraphicLocation_RIGHT_TOP);
- break;
-
- case style::GraphicLocation_LEFT_MIDDLE:
- case style::GraphicLocation_MIDDLE_MIDDLE:
- case style::GraphicLocation_RIGHT_MIDDLE:
- ePos = eHori;
- break;
-
- case style::GraphicLocation_LEFT_BOTTOM:
- case style::GraphicLocation_MIDDLE_BOTTOM:
- case style::GraphicLocation_RIGHT_BOTTOM:
- ePos = style::GraphicLocation_LEFT_MIDDLE==eHori ?
- style::GraphicLocation_LEFT_BOTTOM :
- (style::GraphicLocation_MIDDLE_MIDDLE==eHori ?
- style::GraphicLocation_MIDDLE_BOTTOM :
- style::GraphicLocation_RIGHT_BOTTOM);
- break;
- }
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_bordrhdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_bordrhdl.cxx
deleted file mode 100644
index cd0461f80804..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_bordrhdl.cxx
+++ /dev/null
@@ -1,458 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <bordrhdl.hxx>
-
-
-#include "xmluconv.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-
-
-#include <com/sun/star/table/BorderLine.hpp>
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-// copied from svx/boxitem.hxx
-#define DEF_LINE_WIDTH_0 1
-#define DEF_LINE_WIDTH_1 35
-#define DEF_LINE_WIDTH_2 88
-#define DEF_LINE_WIDTH_3 141
-#define DEF_LINE_WIDTH_4 176
-
-#define DEF_MAX_LINE_WIDHT DEF_LINE_WIDTH_4
-#define DEF_MAX_LINE_DIST DEF_LINE_WIDTH_2
-
-#define DEF_DOUBLE_LINE0_OUT DEF_LINE_WIDTH_0
-#define DEF_DOUBLE_LINE0_IN DEF_LINE_WIDTH_0
-#define DEF_DOUBLE_LINE0_DIST DEF_LINE_WIDTH_1
-
-#define DEF_DOUBLE_LINE1_OUT DEF_LINE_WIDTH_1
-#define DEF_DOUBLE_LINE1_IN DEF_LINE_WIDTH_1
-#define DEF_DOUBLE_LINE1_DIST DEF_LINE_WIDTH_1
-
-#define DEF_DOUBLE_LINE2_OUT DEF_LINE_WIDTH_2
-#define DEF_DOUBLE_LINE2_IN DEF_LINE_WIDTH_2
-#define DEF_DOUBLE_LINE2_DIST DEF_LINE_WIDTH_2
-
-#define DEF_DOUBLE_LINE3_OUT DEF_LINE_WIDTH_2
-#define DEF_DOUBLE_LINE3_IN DEF_LINE_WIDTH_1
-#define DEF_DOUBLE_LINE3_DIST DEF_LINE_WIDTH_2
-
-#define DEF_DOUBLE_LINE4_OUT DEF_LINE_WIDTH_1
-#define DEF_DOUBLE_LINE4_IN DEF_LINE_WIDTH_2
-#define DEF_DOUBLE_LINE4_DIST DEF_LINE_WIDTH_1
-
-#define DEF_DOUBLE_LINE5_OUT DEF_LINE_WIDTH_3
-#define DEF_DOUBLE_LINE5_IN DEF_LINE_WIDTH_2
-#define DEF_DOUBLE_LINE5_DIST DEF_LINE_WIDTH_2
-
-#define DEF_DOUBLE_LINE6_OUT DEF_LINE_WIDTH_2
-#define DEF_DOUBLE_LINE6_IN DEF_LINE_WIDTH_3
-#define DEF_DOUBLE_LINE6_DIST DEF_LINE_WIDTH_2
-
-#define DEF_DOUBLE_LINE7_OUT DEF_LINE_WIDTH_0
-#define DEF_DOUBLE_LINE7_IN DEF_LINE_WIDTH_0
-#define DEF_DOUBLE_LINE7_DIST DEF_LINE_WIDTH_2
-
-#define DEF_DOUBLE_LINE8_OUT DEF_LINE_WIDTH_1
-#define DEF_DOUBLE_LINE8_IN DEF_LINE_WIDTH_0
-#define DEF_DOUBLE_LINE8_DIST DEF_LINE_WIDTH_2
-
-#define DEF_DOUBLE_LINE9_OUT DEF_LINE_WIDTH_2
-#define DEF_DOUBLE_LINE9_IN DEF_LINE_WIDTH_0
-#define DEF_DOUBLE_LINE9_DIST DEF_LINE_WIDTH_2
-
-#define DEF_DOUBLE_LINE10_OUT DEF_LINE_WIDTH_3
-#define DEF_DOUBLE_LINE10_IN DEF_LINE_WIDTH_0
-#define DEF_DOUBLE_LINE10_DIST DEF_LINE_WIDTH_2
-
-// finished copy
-
-#define SVX_XML_BORDER_STYLE_NONE 0
-#define SVX_XML_BORDER_STYLE_SOLID 1
-#define SVX_XML_BORDER_STYLE_DOUBLE 2
-
-#define SVX_XML_BORDER_WIDTH_THIN 0
-#define SVX_XML_BORDER_WIDTH_MIDDLE 1
-#define SVX_XML_BORDER_WIDTH_THICK 2
-
-SvXMLEnumMapEntry pXML_BorderStyles[] =
-{
- { XML_NONE, SVX_XML_BORDER_STYLE_NONE },
- { XML_HIDDEN, SVX_XML_BORDER_STYLE_NONE },
- { XML_SOLID, SVX_XML_BORDER_STYLE_SOLID },
- { XML_DOUBLE, SVX_XML_BORDER_STYLE_DOUBLE },
- { XML_DOTTED, SVX_XML_BORDER_STYLE_SOLID },
- { XML_DASHED, SVX_XML_BORDER_STYLE_SOLID },
- { XML_GROOVE, SVX_XML_BORDER_STYLE_SOLID },
- { XML_RIDGE, SVX_XML_BORDER_STYLE_SOLID },
- { XML_INSET, SVX_XML_BORDER_STYLE_SOLID },
- { XML_OUTSET, SVX_XML_BORDER_STYLE_SOLID },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry pXML_NamedBorderWidths[] =
-{
- { XML_THIN, SVX_XML_BORDER_WIDTH_THIN },
- { XML_MIDDLE, SVX_XML_BORDER_WIDTH_MIDDLE },
- { XML_THICK, SVX_XML_BORDER_WIDTH_THICK },
- { XML_TOKEN_INVALID, 0 }
-};
-// mapping tables to map external xml input to intarnal box line widths
-
-// Ein Eintrag besteht aus vier USHORTs. Der erste ist die Gesamtbreite,
-// die anderen sind die 3 Einzelbreiten
-
-#define SBORDER_ENTRY( n ) \
- DEF_LINE_WIDTH_##n, DEF_LINE_WIDTH_##n, 0, 0
-
-#define DBORDER_ENTRY( n ) \
- DEF_DOUBLE_LINE##n##_OUT + DEF_DOUBLE_LINE##n##_IN + \
- DEF_DOUBLE_LINE##n##_DIST, \
- DEF_DOUBLE_LINE##n##_OUT, \
- DEF_DOUBLE_LINE##n##_IN, \
- DEF_DOUBLE_LINE##n##_DIST
-
-#define TDBORDER_ENTRY( n ) \
- DEF_DOUBLE_LINE##n##_OUT, \
- DEF_DOUBLE_LINE##n##_OUT, \
- DEF_DOUBLE_LINE##n##_IN, \
- DEF_DOUBLE_LINE##n##_DIST
-
-
-static sal_uInt16 __READONLY_DATA aSBorderWidths[] =
-{
- SBORDER_ENTRY( 0 ), SBORDER_ENTRY( 1 ), SBORDER_ENTRY( 2 ),
- SBORDER_ENTRY( 3 ), SBORDER_ENTRY( 4 )
-};
-
-static sal_uInt16 __READONLY_DATA aDBorderWidths[] =
-{
- DBORDER_ENTRY( 0 ),
- DBORDER_ENTRY( 7 ),
- DBORDER_ENTRY( 1 ),
- DBORDER_ENTRY( 8 ),
- DBORDER_ENTRY( 4 ),
- DBORDER_ENTRY( 9 ),
- DBORDER_ENTRY( 3 ),
- DBORDER_ENTRY( 10 ),
- DBORDER_ENTRY( 2 ),
- DBORDER_ENTRY( 6 ),
- DBORDER_ENTRY( 5 )
-};
-
-void lcl_frmitems_setXMLBorderWidth( table::BorderLine &rBorderLine,
- sal_uInt16 nWidth, sal_Bool bDouble )
-{
-#ifdef XML_CHECK_UI_CONTSTRAINS
- const sal_uInt16 *aWidths;
- sal_uInt16 nSize;
- if( !bDouble )
- {
- aWidths = aSBorderWidths;
- nSize = sizeof( aSBorderWidths );
- }
- else
- {
- aWidths = aDBorderWidths;
- nSize = sizeof( aDBorderWidths );
- }
-
- sal_uInt16 i = (nSize / sizeof(sal_uInt16)) - 4;
- while( i>0 &&
- nWidth <= ((aWidths[i] + aWidths[i-4]) / 2) )
- {
- i -= 4;
- }
-
- rBorderLine.OuterLineWidth = aWidths[i+1];
- rBorderLine.InnerLineWidth = aWidths[i+2];
- rBorderLine.LineDistance = aWidths[i+3];
-#else
- if( bDouble )
- {
- const sal_uInt16 *aWidths = aDBorderWidths;
- sal_uInt16 nSize = sizeof( aDBorderWidths );
- sal_uInt16 i = (nSize / sizeof(sal_uInt16)) - 4;
- while( i>0 &&
- nWidth <= ((aWidths[i] + aWidths[i-4]) / 2) )
- {
- i -= 4;
- }
-
- rBorderLine.OuterLineWidth = aWidths[i+1];
- rBorderLine.InnerLineWidth = aWidths[i+2];
- rBorderLine.LineDistance = aWidths[i+3];
- }
- else
- {
- rBorderLine.OuterLineWidth = 0 == nWidth ? DEF_LINE_WIDTH_0 : nWidth;
- rBorderLine.InnerLineWidth = 0;
- rBorderLine.LineDistance = 0;
-
- }
-#endif
-}
-
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLEscapementPropHdl
-//
-
-XMLBorderWidthHdl::~XMLBorderWidthHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLBorderWidthHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
-
- sal_Int32 nInWidth, nDistance, nOutWidth;
-
- OUString aToken;
- if( !aTokenEnum.getNextToken( aToken ) )
- return sal_False;
-
- if( !rUnitConverter.convertMeasure( nInWidth, aToken, 0, 500 ) )
- return sal_False;
-
- if( !aTokenEnum.getNextToken( aToken ) )
- return sal_False;
-
- if( !rUnitConverter.convertMeasure( nDistance, aToken, 0, 500 ) )
- return sal_False;
-
- if( !aTokenEnum.getNextToken( aToken ) )
- return sal_False;
-
- if( !rUnitConverter.convertMeasure( nOutWidth, aToken, 0, 500 ) )
- return sal_False;
-
-#ifdef XML_CHECK_UI_CONSTRAINS
- sal_uInt16 nSize = sizeof( aDBorderWidths );
- for( sal_uInt16 i=0; i < nSize; i += 4 )
- {
- if( aDBorderWidths[i+1] == nOutWidth &&
- aDBorderWidths[i+2] == nInWidth &&
- aDBorderWidths[i+3] == nDistance )
- break;
- }
-
- sal_uInt16 nWidth = i < nSize ? 0 : nOutWidth + nInWidth + nDistance;
-#endif
-
- table::BorderLine aBorderLine;
- if(!(rValue >>= aBorderLine))
- aBorderLine.Color = 0;
-
- aBorderLine.InnerLineWidth = nInWidth;
- aBorderLine.OuterLineWidth = nOutWidth;
- aBorderLine.LineDistance = nDistance;
-
- rValue <<= aBorderLine;
- return sal_True;
-}
-
-sal_Bool XMLBorderWidthHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUStringBuffer aOut;
-
- table::BorderLine aBorderLine;
- if(!(rValue >>= aBorderLine))
- return sal_False;
-
- if( aBorderLine.LineDistance == 0 && aBorderLine.InnerLineWidth == 0)
- return sal_False;
-
- rUnitConverter.convertMeasure( aOut, aBorderLine.InnerLineWidth );
- aOut.append( sal_Unicode( ' ' ) );
- rUnitConverter.convertMeasure( aOut, aBorderLine.LineDistance );
- aOut.append( sal_Unicode( ' ' ) );
- rUnitConverter.convertMeasure( aOut, aBorderLine.OuterLineWidth );
-
- rStrExpValue = aOut.makeStringAndClear();
- return sal_True;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLEscapementHeightPropHdl
-//
-
-XMLBorderHdl::~XMLBorderHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLBorderHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUString aToken;
- SvXMLTokenEnumerator aTokens( rStrImpValue );
-
- sal_Bool bHasStyle = sal_False;
- sal_Bool bHasWidth = sal_False;
- sal_Bool bHasColor = sal_False;
-
- sal_uInt16 nStyle = USHRT_MAX;
- sal_uInt16 nWidth = 0;
- sal_uInt16 nNamedWidth = USHRT_MAX;
- Color aColor;
-
- sal_Int32 nTemp;
- while( aTokens.getNextToken( aToken ) && aToken.getLength() != 0 )
- {
- if( !bHasWidth &&
- rUnitConverter.convertEnum( nNamedWidth, aToken,
- pXML_NamedBorderWidths ) )
- {
- bHasWidth = sal_True;
- }
- else if( !bHasStyle &&
- rUnitConverter.convertEnum( nStyle, aToken,
- pXML_BorderStyles ) )
- {
- bHasStyle = sal_True;
- }
- else if( !bHasColor && rUnitConverter.convertColor( aColor, aToken ) )
- {
- bHasColor = sal_True;
- }
- else if( !bHasWidth &&
- rUnitConverter.convertMeasure( nTemp, aToken, 0,
- USHRT_MAX ) )
- {
- nWidth = (sal_uInt16)nTemp;
- bHasWidth = sal_True;
- }
- else
- {
- // missformed
- return sal_False;
- }
- }
-
- // if there is no style or a different style than none but no width,
- // then the declaration is not valid.
- if( !bHasStyle || (SVX_XML_BORDER_STYLE_NONE != nStyle && !bHasWidth) )
- return sal_False;
-
- table::BorderLine aBorderLine;
- if(!(rValue >>= aBorderLine))
- {
- aBorderLine.Color = 0;
- aBorderLine.InnerLineWidth = 0;
- aBorderLine.OuterLineWidth = 0;
- aBorderLine.LineDistance = 0;
- }
-
- // first of all, delete an empty line
- sal_Bool bDouble = SVX_XML_BORDER_STYLE_DOUBLE == nStyle;
- if( (bHasStyle && SVX_XML_BORDER_STYLE_NONE == nStyle) ||
- (bHasWidth && USHRT_MAX == nNamedWidth && 0 == nWidth) )
- {
- aBorderLine.InnerLineWidth = 0;
- aBorderLine.OuterLineWidth = 0;
- aBorderLine.LineDistance = 0;
- }
- else if( bHasWidth )
- {
- if( USHRT_MAX != nNamedWidth )
- {
- const sal_uInt16 *aWidths = bDouble ? aDBorderWidths
- : aSBorderWidths;
- sal_uInt16 nNWidth = nNamedWidth * 4;
- aBorderLine.OuterLineWidth = aWidths[nNWidth+1];
- aBorderLine.InnerLineWidth = aWidths[nNWidth+2];
- aBorderLine.LineDistance = aWidths[nNWidth+3];
- }
- else
- {
- lcl_frmitems_setXMLBorderWidth( aBorderLine, nWidth, bDouble );
- }
- }
- else
- {
- lcl_frmitems_setXMLBorderWidth( aBorderLine, 0, bDouble );
- }
-
- // set color
- if( bHasColor )
- aBorderLine.Color = (sal_Int32)aColor.GetRGBColor();
-
- rValue <<= aBorderLine;
- return sal_True;
-}
-
-sal_Bool XMLBorderHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUStringBuffer aOut;
-
- table::BorderLine aBorderLine;
- if(!(rValue >>= aBorderLine))
- return sal_False;
-
- sal_Int32 nWidth = aBorderLine.OuterLineWidth;
- const sal_uInt16 nDistance = aBorderLine.LineDistance;
- if( 0 != nDistance )
- {
- nWidth += nDistance;
- nWidth += aBorderLine.InnerLineWidth;
- }
-
- if( nWidth == 0 )
- {
- aOut.append( GetXMLToken( XML_NONE ) );
- }
- else
- {
- rUnitConverter.convertMeasure( aOut, nWidth );
-
- aOut.append( sal_Unicode( ' ' ) );
-
- aOut.append( GetXMLToken((0 == nDistance) ? XML_SOLID : XML_DOUBLE) );
-
- aOut.append( sal_Unicode( ' ' ) );
-
- rUnitConverter.convertColor( aOut, aBorderLine.Color );
- }
-
- rStrExpValue = aOut.makeStringAndClear();
-
- return sal_True;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_breakhdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_breakhdl.cxx
deleted file mode 100644
index 162e94f7da3f..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_breakhdl.cxx
+++ /dev/null
@@ -1,182 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <breakhdl.hxx>
-
-
-#include "xmluconv.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-#include <com/sun/star/style/BreakType.hpp>
-
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-SvXMLEnumMapEntry pXML_BreakTypes[] =
-{
- { XML_AUTO, 0 },
- { XML_COLUMN, 1 },
- { XML_PAGE, 2 },
- { XML_EVEN_PAGE, 2 },
- { XML_ODD_PAGE, 2 },
- { XML_TOKEN_INVALID, 0}
-};
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLFmtBreakBeforePropHdl
-//
-
-XMLFmtBreakBeforePropHdl::~XMLFmtBreakBeforePropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLFmtBreakBeforePropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- style::BreakType eBreak = style::BreakType_NONE;
- sal_uInt16 nEnum;
-
- if( ( bRet = rUnitConverter.convertEnum( nEnum, rStrImpValue, pXML_BreakTypes ) ) )
- {
- if( nEnum != 0 )
- eBreak = ( nEnum == 1 ) ? style::BreakType_COLUMN_BEFORE : style::BreakType_PAGE_BEFORE;
-
- rValue <<= eBreak;
- }
-
- return bRet;
-}
-
-sal_Bool XMLFmtBreakBeforePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- style::BreakType eBreak;
-
- if( !( rValue >>= eBreak ) )
- {
- sal_Int32 nValue;
- if( !( rValue >>= nValue ) )
- return sal_False;
-
- eBreak = (style::BreakType) nValue;
- }
-
- sal_uInt16 nEnum = 0;
- switch( eBreak )
- {
- case style::BreakType_COLUMN_BEFORE:
- nEnum = 1;
- break;
- case style::BreakType_PAGE_BEFORE:
- nEnum = 2;
- break;
- case style::BreakType_NONE:
- nEnum = 0;
- break;
- default:
- return sal_False;
- }
-
- OUStringBuffer aOut;
- sal_Bool bOk = rUnitConverter.convertEnum( aOut, nEnum, pXML_BreakTypes );
- rStrExpValue = aOut.makeStringAndClear();
-
- return sal_True;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLFmtBreakBeforePropHdl
-//
-
-XMLFmtBreakAfterPropHdl::~XMLFmtBreakAfterPropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLFmtBreakAfterPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- style::BreakType eBreak = style::BreakType_NONE;
- sal_uInt16 nEnum;
-
- if( ( bRet = rUnitConverter.convertEnum( nEnum, rStrImpValue, pXML_BreakTypes ) ) )
- {
- if( nEnum != 0 )
- eBreak = ( nEnum == 1 ) ? style::BreakType_COLUMN_AFTER : style::BreakType_PAGE_AFTER;
-
- rValue <<= eBreak;
- }
-
- return bRet;
-}
-
-sal_Bool XMLFmtBreakAfterPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- style::BreakType eBreak;
-
- if( !( rValue >>= eBreak ) )
- {
- sal_Int32 nValue;
- if( !( rValue >>= nValue ) )
- return sal_False;
-
- eBreak = (style::BreakType) nValue;
- }
-
- sal_uInt16 nEnum = 0;
- switch( eBreak )
- {
- case style::BreakType_COLUMN_AFTER:
- nEnum = 1;
- break;
- case style::BreakType_PAGE_AFTER:
- nEnum = 2;
- break;
- case style::BreakType_NONE:
- nEnum = 0;
- break;
- default:
- return sal_False;
- }
-
- OUStringBuffer aOut;
- sal_Bool bOk = rUnitConverter.convertEnum( aOut, nEnum, pXML_BreakTypes );
- rStrExpValue = aOut.makeStringAndClear();
-
- return sal_True;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_cdouthdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_cdouthdl.cxx
deleted file mode 100644
index 0c2d0b3e4db6..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_cdouthdl.cxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <cdouthdl.hxx>
-
-
-#include "xmluconv.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-#include <vcl/vclenum.hxx>
-
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-SvXMLEnumMapEntry pXML_Crossedout_Enum[] =
-{
- { XML_CROSSEDOUT_NONE, STRIKEOUT_NONE },
- { XML_CROSSEDOUT_SINGLE, STRIKEOUT_SINGLE },
- { XML_CROSSEDOUT_DOUBLE, STRIKEOUT_DOUBLE },
- { XML_CROSSEDOUT_THICK, STRIKEOUT_BOLD },
- { XML_CROSSEDOUT_SLASH, STRIKEOUT_SLASH },
- { XML_CROSSEDOUT_CROSS, STRIKEOUT_X }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLPosturePropHdl
-//
-
-XMLCrossedOutPropHdl::~XMLCrossedOutPropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLCrossedOutPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_uInt16 eCross;
-
- if( ( bRet = rUnitConverter.convertEnum( eCross, rStrImpValue, pXML_Crossedout_Enum ) ) )
- rValue <<= (sal_Int16)eCross;
-
- return bRet;
-}
-
-sal_Bool XMLCrossedOutPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int16 nValue;
- OUStringBuffer aOut;
-
- if( rValue >>= nValue )
- {
- if( ( bRet = rUnitConverter.convertEnum( aOut, (sal_uInt16)nValue, pXML_Crossedout_Enum ) ) )
- rStrExpValue = aOut.makeStringAndClear();
- }
-
- return bRet;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_chrhghdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_chrhghdl.cxx
deleted file mode 100644
index 1abb67688ec9..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_chrhghdl.cxx
+++ /dev/null
@@ -1,171 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <chrhghdl.hxx>
-
-#include "xmluconv.hxx"
-
-#include "xmlehelp.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-
-// this is a copy of defines in svx/inc/escpitem.hxx
-#define DFLT_ESC_PROP 58
-#define DFLT_ESC_AUTO_SUPER 101
-#define DFLT_ESC_AUTO_SUB -101
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLEscapementPropHdl
-//
-
-XMLCharHeightHdl::~XMLCharHeightHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLCharHeightHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- double fSize;
-
- if( rStrImpValue.indexOf( sal_Unicode('%') ) == -1 )
- {
- MapUnit eSrcUnit = SvXMLExportHelper::GetUnitFromString( rStrImpValue, MAP_POINT );
- if( SvXMLUnitConverter::convertDouble( fSize, rStrImpValue, eSrcUnit, MAP_POINT ))
- {
- rValue <<= (float)fSize;
- return sal_True;
- }
- }
-
- return sal_False;
-}
-
-sal_Bool XMLCharHeightHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUStringBuffer aOut;
-
- float fSize = 0;
- if( rValue >>= fSize )
- {
- SvXMLUnitConverter::convertDouble( aOut, (double)fSize, TRUE, MAP_POINT, MAP_POINT );
- aOut.append( sal_Unicode('p'));
- aOut.append( sal_Unicode('t'));
- }
-
- rStrExpValue = aOut.makeStringAndClear();
- return rStrExpValue.getLength() != 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLEscapementHeightPropHdl
-//
-
-XMLCharHeightPropHdl::~XMLCharHeightPropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLCharHeightPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Int32 nPrc = 100;
-
- if( rStrImpValue.indexOf( sal_Unicode('%') ) != -1 )
- {
- if( rUnitConverter.convertPercent( nPrc, rStrImpValue ) )
- {
- rValue <<= (sal_Int16)nPrc;
- return sal_True;
- }
- }
-
- return sal_False;
-}
-
-sal_Bool XMLCharHeightPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUStringBuffer aOut( rStrExpValue );
-
- sal_Int16 nValue;
- if( rValue >>= nValue )
- {
- rUnitConverter.convertPercent( aOut, nValue );
- }
-
- rStrExpValue = aOut.makeStringAndClear();
- return rStrExpValue.getLength() != 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLEscapementPropHdl
-//
-
-XMLCharHeightDiffHdl::~XMLCharHeightDiffHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLCharHeightDiffHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Int32 nRel = 0;
-
- if( SvXMLUnitConverter::convertMeasure( nRel, rStrImpValue, MAP_POINT ) )
- {
- rValue <<= (float)nRel;
- return sal_True;
- }
-
- return sal_False;
-}
-
-sal_Bool XMLCharHeightDiffHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUStringBuffer aOut;
-
- float nRel = 0;
- if( (rValue >>= nRel) && (nRel != 0) )
- {
- SvXMLUnitConverter::convertMeasure( aOut, nRel, MAP_POINT, MAP_POINT );
- rStrExpValue = aOut.makeStringAndClear();
- }
-
- return rStrExpValue.getLength() != 0;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_chrlohdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_chrlohdl.cxx
deleted file mode 100644
index 2aa0bec0b6e8..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_chrlohdl.cxx
+++ /dev/null
@@ -1,147 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <chrlohdl.hxx>
-
-
-#include "xmluconv.hxx"
-
-
-
-
-#include <com/sun/star/lang/Locale.hpp>
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-// this is a copy of defines in svx/inc/escpitem.hxx
-#define DFLT_ESC_PROP 58
-#define DFLT_ESC_AUTO_SUPER 101
-#define DFLT_ESC_AUTO_SUB -101
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLEscapementPropHdl
-//
-
-XMLCharLanguageHdl::~XMLCharLanguageHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLCharLanguageHdl::equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const
-{
- sal_Bool bRet = sal_False;
- lang::Locale aLocale1, aLocale2;
-
- if( ( r1 >>= aLocale1 ) && ( r2 >>= aLocale2 ) )
- bRet = ( aLocale1.Language == aLocale2.Language );
-
- return bRet;
-}
-
-sal_Bool XMLCharLanguageHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- lang::Locale aLocale;
-
- rValue >>= aLocale;
-
- if( !IsXMLToken(rStrImpValue, XML_NONE) )
- aLocale.Language = rStrImpValue;
-
- rValue <<= aLocale;
- return sal_True;
-}
-
-sal_Bool XMLCharLanguageHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- lang::Locale aLocale;
- if(!(rValue >>= aLocale))
- return sal_False;
-
- rStrExpValue = aLocale.Language;
-
- if( !rStrExpValue.getLength() )
- rStrExpValue = GetXMLToken( XML_NONE );
-
- return sal_True;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLEscapementHeightPropHdl
-//
-
-XMLCharCountryHdl::~XMLCharCountryHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLCharCountryHdl::equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const
-{
- sal_Bool bRet = sal_False;
- lang::Locale aLocale1, aLocale2;
-
- if( ( r1 >>= aLocale1 ) && ( r2 >>= aLocale2 ) )
- bRet = ( aLocale1.Country == aLocale2.Country );
-
- return bRet;
-}
-
-sal_Bool XMLCharCountryHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- lang::Locale aLocale;
-
- rValue >>= aLocale;
-
- if( !IsXMLToken( rStrImpValue, XML_NONE ) )
- aLocale.Country = rStrImpValue;
-
- rValue <<= aLocale;
- return sal_True;
-}
-
-sal_Bool XMLCharCountryHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- lang::Locale aLocale;
- if(!(rValue >>= aLocale))
- return sal_False;
-
- rStrExpValue = aLocale.Country;
-
- if( !rStrExpValue.getLength() )
- rStrExpValue = GetXMLToken( XML_NONE );
-
- return sal_True;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_csmaphdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_csmaphdl.cxx
deleted file mode 100644
index 67952431c64c..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_csmaphdl.cxx
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <csmaphdl.hxx>
-
-
-#include "xmluconv.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-#include <com/sun/star/style/CaseMap.hpp>
-
-
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-static SvXMLEnumMapEntry pXML_Casemap_Enum[] =
-{
- { XML_NONE, style::CaseMap::NONE },
- { XML_CASEMAP_LOWERCASE, style::CaseMap::LOWERCASE },
- { XML_CASEMAP_UPPERCASE, style::CaseMap::UPPERCASE },
- { XML_CASEMAP_CAPITALIZE, style::CaseMap::TITLE },
- { XML_TOKEN_INVALID, 0 }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLPosturePropHdl
-//
-
-XMLCaseMapPropHdl::~XMLCaseMapPropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLCaseMapPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_uInt16 nVal;
-
- if( ( bRet = rUnitConverter.convertEnum( nVal, rStrImpValue, pXML_Casemap_Enum ) ) )
- rValue <<= nVal;
-
- return bRet;
-}
-
-sal_Bool XMLCaseMapPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_uInt16 nValue;
- OUStringBuffer aOut;
-
- if( rValue >>= nValue )
- {
- if( ( bRet = rUnitConverter.convertEnum( aOut, nValue, pXML_Casemap_Enum ) ) )
- rStrExpValue = aOut.makeStringAndClear();
- }
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLCaseMapVariantHdl
-//
-
-XMLCaseMapVariantHdl::~XMLCaseMapVariantHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLCaseMapVariantHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- if( IsXMLToken( rStrImpValue, XML_CASEMAP_SMALL_CAPS ) )
- {
- rValue <<= (sal_Int16)style::CaseMap::SMALLCAPS;
- bRet = sal_True;
- }
- else if( IsXMLToken( rStrImpValue, XML_CASEMAP_NORMAL ) )
- {
- rValue <<= (sal_Int16)style::CaseMap::NONE;
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-sal_Bool XMLCaseMapVariantHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_uInt16 nValue;
- OUStringBuffer aOut;
-
- if( rValue >>= nValue )
- {
- switch( nValue )
- {
- case style::CaseMap::NONE:
- aOut.append( GetXMLToken(XML_CASEMAP_NORMAL) );
- break;
- case style::CaseMap::SMALLCAPS:
- aOut.append( GetXMLToken(XML_CASEMAP_SMALL_CAPS) );
- break;
- }
- }
-
- rStrExpValue = aOut.makeStringAndClear();
- return rStrExpValue.getLength();
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_durationhdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_durationhdl.cxx
deleted file mode 100644
index 305be9548b3b..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_durationhdl.cxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "durationhdl.hxx"
-
-
-#include <com/sun/star/util/DateTime.hpp>
-
-#include <rtl/ustrbuf.hxx>
-
-#include "xmluconv.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::util;
-
-// ---------------------------------------------------------------------------
-
-
-sal_Bool XMLDurationMS16PropHdl_Impl::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- DateTime aTime;
- if( !SvXMLUnitConverter::convertTime( aTime, rStrImpValue ) )
- return false;
-
- const sal_Int16 nMS = ( ( aTime.Hours * 60 + aTime.Minutes ) * 60 + aTime.Seconds ) * 100 + aTime.HundredthSeconds;
- rValue <<= nMS;
-
- return sal_True;
-}
-
-sal_Bool XMLDurationMS16PropHdl_Impl::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Int16 nMS;
-
- if(rValue >>= nMS)
- {
- OUStringBuffer aOut;
- DateTime aTime( nMS, 0, 0, 0, 0, 0, 0 );
- SvXMLUnitConverter::convertTime( aOut, aTime );
- rStrExpValue = aOut.makeStringAndClear();
- return sal_True;
- }
-
- return sal_False;
-}
-
-XMLDurationMS16PropHdl_Impl::~XMLDurationMS16PropHdl_Impl()
-{
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_escphdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_escphdl.cxx
deleted file mode 100644
index 3819b2fb34f8..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_escphdl.cxx
+++ /dev/null
@@ -1,173 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <escphdl.hxx>
-
-
-#include "xmluconv.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-// this is a copy of defines in svx/inc/escpitem.hxx
-#define DFLT_ESC_PROP 58
-#define DFLT_ESC_AUTO_SUPER 101
-#define DFLT_ESC_AUTO_SUB -101
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLEscapementPropHdl
-//
-
-XMLEscapementPropHdl::~XMLEscapementPropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLEscapementPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int16 nVal;
-
- SvXMLTokenEnumerator aTokens( rStrImpValue );
-
- OUString aToken;
- if( ! aTokens.getNextToken( aToken ) )
- return sal_False;
-
- if( IsXMLToken( aToken, XML_ESCAPEMENT_SUB ) )
- {
- nVal = DFLT_ESC_AUTO_SUB;
- }
- else if( IsXMLToken( aToken, XML_ESCAPEMENT_SUPER ) )
- {
- nVal = DFLT_ESC_AUTO_SUPER;
- }
- else
- {
- sal_Int32 nNewEsc;
- if( !rUnitConverter.convertPercent( nNewEsc, aToken ) )
- return sal_False;
-
- nVal = (sal_Int16) nNewEsc;
- }
-
- rValue <<= nVal;
- return sal_True;
-}
-
-sal_Bool XMLEscapementPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int32 nValue;
- OUStringBuffer aOut;
-
- if( rValue >>= nValue )
- {
- if( nValue == DFLT_ESC_AUTO_SUPER )
- {
- aOut.append( GetXMLToken(XML_ESCAPEMENT_SUPER) );
- }
- else if( nValue == DFLT_ESC_AUTO_SUB )
- {
- aOut.append( GetXMLToken(XML_ESCAPEMENT_SUB) );
- }
- else
- {
- rUnitConverter.convertPercent( aOut, nValue );
- }
- }
-
- rStrExpValue = aOut.makeStringAndClear();
- return sal_True;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLEscapementHeightPropHdl
-//
-
-XMLEscapementHeightPropHdl::~XMLEscapementHeightPropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLEscapementHeightPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- if( IsXMLToken( rStrImpValue, XML_CASEMAP_SMALL_CAPS ) )
- return sal_False;
-
- SvXMLTokenEnumerator aTokens( rStrImpValue );
-
- OUString aToken;
- if( ! aTokens.getNextToken( aToken ) )
- return sal_False;
-
- sal_Int8 nProp;
- if( aTokens.getNextToken( aToken ) )
- {
- sal_Int32 nNewProp;
- if( !rUnitConverter.convertPercent( nNewProp, aToken ) )
- return sal_False;
- nProp = (sal_Int8)nNewProp;
- }
- else
- {
- nProp = (sal_Int8) DFLT_ESC_PROP;
- }
-
- rValue <<= nProp;
- return sal_True;
-}
-
-sal_Bool XMLEscapementHeightPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUStringBuffer aOut( rStrExpValue );
-
- sal_Int32 nValue;
- if( rValue >>= nValue )
- {
- if( rStrExpValue.getLength() )
- aOut.append( sal_Unicode(' '));
-
- rUnitConverter.convertPercent( aOut, nValue );
- }
-
- rStrExpValue = aOut.makeStringAndClear();
- return rStrExpValue.getLength();
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_fonthdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_fonthdl.cxx
deleted file mode 100644
index cffe262d5f21..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_fonthdl.cxx
+++ /dev/null
@@ -1,321 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <fonthdl.hxx>
-
-
-#include "xmluconv.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-
-#include <vcl/vclenum.hxx>
-
-
-#include <tools/string.hxx>
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-static SvXMLEnumMapEntry __READONLY_DATA aFontFamilyGenericMapping[] =
-{
- { XML_DECORATIVE, FAMILY_DECORATIVE },
-
- { XML_MODERN, FAMILY_MODERN },
- { XML_ROMAN, FAMILY_ROMAN },
- { XML_SCRIPT, FAMILY_SCRIPT },
- { XML_SWISS, FAMILY_SWISS },
- { XML_SYSTEM, FAMILY_SYSTEM },
- { XML_TOKEN_INVALID, 0 }
-};
-
-static SvXMLEnumMapEntry __READONLY_DATA aFontPitchMapping[] =
-{
- { XML_FIXED, PITCH_FIXED },
- { XML_VARIABLE, PITCH_VARIABLE },
- { XML_TOKEN_INVALID, 0 }
-};
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLFontFamilyNamePropHdl
-//
-
-XMLFontFamilyNamePropHdl::~XMLFontFamilyNamePropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLFontFamilyNamePropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- String sValue;
- sal_Int32 nPos = 0;
-
- do
- {
- sal_Int32 nFirst = nPos;
- nPos = SvXMLUnitConverter::indexOfComma( rStrImpValue, nPos );
- sal_Int32 nLast = (-1 == nPos ? rStrImpValue.getLength() : nPos);
- if( nLast > 0 )
- nLast--;
-
- // skip trailing blanks
- while( sal_Unicode(' ') == rStrImpValue[nLast] && nLast > nFirst )
- nLast--;
-
- // skip leading blanks
- while( sal_Unicode(' ') == rStrImpValue[nFirst] && nFirst <= nLast )
- nFirst++;
-
- // remove quotes
- sal_Unicode c = rStrImpValue[nFirst];
- if( nFirst < nLast && (sal_Unicode('\'') == c || sal_Unicode('\"') == c) && rStrImpValue[nLast] == c )
- {
- nFirst++;
- nLast--;
- }
-
- if( nFirst <= nLast )
- {
- if( sValue.Len() != 0 )
- sValue += sal_Unicode(';');
-
- OUString sTemp = rStrImpValue.copy( nFirst, nLast-nFirst+1 );
- sValue += sTemp.getStr();
- }
-
- if( -1 != nPos )
- nPos++;
- }
- while( -1 != nPos );
-
- if( sValue.Len() )
- {
- rValue <<= OUString(sValue.GetBuffer());
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-sal_Bool XMLFontFamilyNamePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- OUString aStrFamilyName;
-
- if( rValue >>= aStrFamilyName )
- {
- OUStringBuffer sValue( aStrFamilyName.getLength() + 2L );
- sal_Int32 nPos = 0L;
- do
- {
- sal_Int32 nFirst = nPos;
- nPos = aStrFamilyName.indexOf( sal_Unicode(';'), nPos );
- sal_Int32 nLast = ((sal_Int32)-1L == nPos ? aStrFamilyName.getLength() : nPos);
-
- // Set position to the character behind the ';', so we won't
- // forget this.
- if( -1L != nPos )
- nPos++;
-
- // If the property value was empty, we stop now.
- // If there is a ';' at the first position, the empty name
- // at the start will be removed.
- if( 0L == nLast )
- continue;
-
- // nFirst and nLast now denote the first and last character of
- // one font name.
- nLast--;
-
- // skip trailing blanks
- while( sal_Unicode(' ') == aStrFamilyName[nLast] && nLast > nFirst )
- nLast--;
-
- // skip leading blanks
- while( sal_Unicode(' ') == aStrFamilyName[nFirst] && nFirst <= nLast )
- nFirst++;
-
- if( nFirst <= nLast )
- {
- if( sValue.getLength() != 0L )
- {
- sValue.append( sal_Unicode( ',' ) );
- sValue.append( sal_Unicode( ' ' ));
- }
- sal_Int32 nLen = nLast-nFirst+(sal_Int32)1L;
- OUString sFamily( aStrFamilyName.copy( nFirst, nLen ) );
- sal_Bool bQuote = sal_False;
- for( sal_Int32 i=0; i < nLen; i++ )
- {
- sal_Unicode c = sFamily[i];
- if( sal_Unicode(' ') == c || sal_Unicode(',') == c )
- {
- bQuote = sal_True;
- break;
- }
- }
- if( bQuote )
- sValue.append( sal_Unicode('\'') );
- sValue.append( sFamily );
- if( bQuote )
- sValue.append( sal_Unicode('\'') );
- }
- }
- while( -1L != nPos );
-
- rStrExpValue = sValue.makeStringAndClear();
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLFontFamilyPropHdl
-//
-
-XMLFontFamilyPropHdl::~XMLFontFamilyPropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLFontFamilyPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_uInt16 eNewFamily;
-
- if( ( bRet = rUnitConverter.convertEnum( eNewFamily, rStrImpValue, aFontFamilyGenericMapping ) ) )
- rValue <<= (sal_Int16)eNewFamily;
-
- return bRet;
-}
-
-sal_Bool XMLFontFamilyPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- OUStringBuffer aOut;
-
- sal_Int16 nFamily;
- if( rValue >>= nFamily )
- {
- FontFamily eFamily = (FontFamily)nFamily;
- if( eFamily != FAMILY_DONTKNOW )
- bRet = rUnitConverter.convertEnum( aOut, eFamily, aFontFamilyGenericMapping );
- }
-
- rStrExpValue = aOut.makeStringAndClear();
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLFontEncodingPropHdl
-//
-
-XMLFontEncodingPropHdl::~XMLFontEncodingPropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLFontEncodingPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_True;
-
- if( IsXMLToken( rStrImpValue, XML_X_SYMBOL ) )
- rValue <<= (sal_Int16) RTL_TEXTENCODING_SYMBOL;
-
- return bRet;
-}
-
-sal_Bool XMLFontEncodingPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- OUStringBuffer aOut;
- sal_Int16 nSet;
-
- if( rValue >>= nSet )
- {
- if( (rtl_TextEncoding)nSet == RTL_TEXTENCODING_SYMBOL )
- {
- aOut.append( GetXMLToken(XML_X_SYMBOL) );
- rStrExpValue = aOut.makeStringAndClear();
- bRet = sal_True;
- }
- }
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLFontPitchPropHdl
-//
-
-XMLFontPitchPropHdl::~XMLFontPitchPropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLFontPitchPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- USHORT eNewPitch;
-
- if( ( bRet = rUnitConverter.convertEnum( eNewPitch, rStrImpValue, aFontPitchMapping ) ) )
- rValue <<= (sal_Int16)eNewPitch;
-
- return bRet;
-}
-
-sal_Bool XMLFontPitchPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int16 nPitch;
- OUStringBuffer aOut;
-
- FontPitch ePitch = PITCH_DONTKNOW;
- if( rValue >>= nPitch )
- ePitch = (FontPitch)nPitch;
-
- if( PITCH_DONTKNOW != ePitch )
- {
- bRet = rUnitConverter.convertEnum( aOut, ePitch, aFontPitchMapping, XML_FIXED );
- rStrExpValue = aOut.makeStringAndClear();
- }
-
- return bRet;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_impastp1.cxx b/binfilter/bf_xmloff/source/style/xmloff_impastp1.cxx
deleted file mode 100644
index d22aab4d5030..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_impastp1.cxx
+++ /dev/null
@@ -1,135 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-#include "impastpl.hxx"
-namespace binfilter {
-
-using namespace rtl;
-
-//#############################################################################
-//
-// Class XMLFamilyData_Impl
-//
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// ctor/dtor class XMLFamilyData_Impl
-//
-
-XMLFamilyData_Impl::XMLFamilyData_Impl(
- sal_Int32 nFamily,
- const ::rtl::OUString& rStrName,
- const UniReference < SvXMLExportPropertyMapper > &rMapper,
- const OUString& rStrPrefix,
- sal_Bool bAsFam )
- : mnFamily( nFamily ), maStrFamilyName( rStrName), mxMapper( rMapper ), maStrPrefix( rStrPrefix ),
- mnCount( 0 ), mnName( 0 ), bAsFamily( bAsFam ),
- pCache( 0 )
-{
- mpParentList = new SvXMLAutoStylePoolParentsP_Impl( 5, 5 );
- mpNameList = new SvXMLAutoStylePoolNamesP_Impl( 5, 5 );
-}
-
-XMLFamilyData_Impl::~XMLFamilyData_Impl()
-{
- if( mpParentList ) delete mpParentList;
- if( mpNameList ) delete mpNameList;
- DBG_ASSERT( !pCache || !pCache->Count(),
- "auto style pool cache is not empty!" );
- if( pCache )
- {
- while( pCache->Count() )
- delete pCache->Remove( 0UL );
- }
-}
-
-void XMLFamilyData_Impl::ClearEntries()
-{
- if( mpParentList )
- delete mpParentList;
- mpParentList = new SvXMLAutoStylePoolParentsP_Impl( 5, 5 );
- DBG_ASSERT( !pCache || !pCache->Count(),
- "auto style pool cache is not empty!" );
- if( pCache )
- {
- while( pCache->Count() )
- delete pCache->Remove( 0UL );
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// friendfunction of class XMLFamilyData_Impl for sorting listelements
-//
-
-int XMLFamilyDataSort_Impl( const XMLFamilyData_Impl& r1, const XMLFamilyData_Impl& r2 )
-{
- int nRet = 0;
-
- if( r1.mnFamily != r2.mnFamily )
- nRet = ( r1.mnFamily > r2.mnFamily ? 1 : -1 );
-
- return nRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Implementation of sorted list of XMLFamilyData_Impl - elements
-//
-
-IMPL_CONTAINER_SORT( XMLFamilyDataList_Impl, XMLFamilyData_Impl, XMLFamilyDataSort_Impl )
-
-//#############################################################################
-//
-// Sorted list of OUString - elements
-//
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Sort-function for OUString-list
-//
-
-int SvXMLAutoStylePoolNamesPCmp_Impl( const OUString& r1,
- const OUString& r2 )
-{
- return (int)r1.compareTo( r2 );
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Implementation of sorted OUString-list
-//
-
-IMPL_CONTAINER_SORT( SvXMLAutoStylePoolNamesP_Impl,
- OUString,
- SvXMLAutoStylePoolNamesPCmp_Impl )
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_impastp2.cxx b/binfilter/bf_xmloff/source/style/xmloff_impastp2.cxx
deleted file mode 100644
index 8be05804754e..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_impastp2.cxx
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <rtl/ustrbuf.hxx>
-
-#include "impastpl.hxx"
-namespace binfilter {
-
-using namespace std;
-using namespace rtl;
-
-//#############################################################################
-//
-// Class SvXMLAutoStylePoolProperties_Impl
-//
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// ctor class SvXMLAutoStylePoolProperties_Impl
-//
-
-SvXMLAutoStylePoolPropertiesP_Impl::SvXMLAutoStylePoolPropertiesP_Impl( XMLFamilyData_Impl* pFamilyData, const vector< XMLPropertyState >& rProperties )
-: maProperties( rProperties ),
- mnPos ( pFamilyData->mnCount )
-{
- // create a name that hasn't been used before. The created name has not
- // to be added to the array, because it will never tried again
- OUStringBuffer sBuffer( 7 );
- do
- {
- pFamilyData->mnName++;
- sBuffer.append( pFamilyData->maStrPrefix );
- sBuffer.append( OUString::valueOf( (sal_Int32)pFamilyData->mnName ) );
- msName = sBuffer.makeStringAndClear();
- }
- while( pFamilyData->mpNameList->Seek_Entry( &msName, 0 ) );
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_impastp3.cxx b/binfilter/bf_xmloff/source/style/xmloff_impastp3.cxx
deleted file mode 100644
index 9917ac3d2aa0..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_impastp3.cxx
+++ /dev/null
@@ -1,148 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "impastpl.hxx"
-namespace binfilter {
-
-using namespace std;
-using namespace rtl;
-
-//#############################################################################
-//
-// Class SvXMLAutoStylePoolParent_Impl
-//
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// dtor class SvXMLAutoStylePoolParent_Impl
-//
-
-SvXMLAutoStylePoolParentP_Impl::~SvXMLAutoStylePoolParentP_Impl()
-{
- while( maPropertiesList.Count() )
- delete maPropertiesList.Remove( maPropertiesList.Count() -1 );
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Adds a array of XMLPropertyState ( vector< XMLPropertyState > ) to list
-// if not added, yet.
-//
-
-sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl* pFamilyData, const vector< XMLPropertyState >& rProperties, OUString& rName )
-{
- sal_Bool bAdded = sal_False;
-
- sal_Int32 nProperties = rProperties.size();
- sal_uInt32 nCount = maPropertiesList.Count();
- SvXMLAutoStylePoolPropertiesP_Impl *pProperties = 0;
- sal_uInt32 i;
-
- for( i=0; i < nCount; i++ )
- {
- SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList.GetObject( i );
- if( nProperties > pIS->GetProperties().size() )
- {
- continue;
- }
- else if( nProperties < pIS->GetProperties().size() )
- {
- break;
- }
- else if( pFamilyData->mxMapper->Equals( pIS->GetProperties(), rProperties ) )
- {
- pProperties = pIS;
- break;
- }
- }
-
- if( !pProperties )
- {
- pProperties = new SvXMLAutoStylePoolPropertiesP_Impl( pFamilyData, rProperties );
- maPropertiesList.Insert( pProperties, i );
- bAdded = sal_True;
- }
-
- rName = pProperties->GetName();
-
- return bAdded;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Search for a array of XMLPropertyState ( vector< XMLPropertyState > ) in list
-//
-
-OUString SvXMLAutoStylePoolParentP_Impl::Find( const XMLFamilyData_Impl* pFamilyData, const vector< XMLPropertyState >& rProperties ) const
-{
- OUString sName;
- sal_uInt16 nItems = rProperties.size();
- sal_uInt32 nCount = maPropertiesList.Count();
- for( sal_uInt32 i=0; i < nCount; i++ )
- {
- SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList.GetObject( i );
- if( nItems > pIS->GetProperties().size() )
- {
- continue;
- }
- else if( nItems < pIS->GetProperties().size() )
- {
- break;
- }
- else if( pFamilyData->mxMapper->Equals( pIS->GetProperties(), rProperties ) )
- {
- sName = pIS->GetName();
- break;
- }
- }
-
- return sName;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Sort-function for sorted list of SvXMLAutoStylePoolParent_Impl-elements
-//
-
-int SvXMLAutoStylePoolParentPCmp_Impl( const SvXMLAutoStylePoolParentP_Impl& r1,
- const SvXMLAutoStylePoolParentP_Impl& r2)
-{
- return (int)r1.GetParent().compareTo( r2.GetParent() );
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Implementation of sorted list of SvXMLAutoStylePoolParent_Impl-elements
-//
-
-IMPL_CONTAINER_SORT( SvXMLAutoStylePoolParentsP_Impl,
- SvXMLAutoStylePoolParentP_Impl,
- SvXMLAutoStylePoolParentPCmp_Impl )
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_impastp4.cxx b/binfilter/bf_xmloff/source/style/xmloff_impastp4.cxx
deleted file mode 100644
index a5af6854286c..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_impastp4.cxx
+++ /dev/null
@@ -1,369 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include "xmlnmspe.hxx"
-#include "impastpl.hxx"
-#include "xmlexp.hxx"
-#include "PageMasterStyleMap.hxx"
-namespace binfilter {
-
-using namespace ::std;
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-//#############################################################################
-//
-// Class SvXMLAutoStylePool_Impl
-//
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// ctor/dtor class SvXMLAutoStylePool_Impl
-//
-
-SvXMLAutoStylePoolP_Impl::SvXMLAutoStylePoolP_Impl( SvXMLExport& rExp)
- : rExport( rExp ),
- maFamilyList( 5, 5 )
-{
-}
-
-SvXMLAutoStylePoolP_Impl::~SvXMLAutoStylePoolP_Impl()
-{
- XMLFamilyData_Impl* pData = NULL;
- while( ( pData = maFamilyList.Remove( ULONG(0) ) ) )
- delete pData;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Adds stylefamily-informations to sorted list
-//
-
-void SvXMLAutoStylePoolP_Impl::AddFamily(
- sal_Int32 nFamily,
- const OUString& rStrName,
- const UniReference < SvXMLExportPropertyMapper > & rMapper,
- const OUString& rStrPrefix,
- sal_Bool bAsFamily )
-{
- // store family in a list if not already stored
- ULONG nPos;
- XMLFamilyData_Impl *pFamily = new XMLFamilyData_Impl( nFamily, rStrName, rMapper, rStrPrefix, bAsFamily );
- if( !maFamilyList.Seek_Entry( pFamily, &nPos ) )
- maFamilyList.Insert( pFamily );
- else
- delete pFamily;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Adds a name to list
-//
-
-void SvXMLAutoStylePoolP_Impl::RegisterName( sal_Int32 nFamily, const OUString& rName )
-{
- SvXMLAutoStylePoolNamesP_Impl *pNames = 0;
-
- ULONG nPos;
- XMLFamilyData_Impl aTmp( nFamily );
- if( maFamilyList.Seek_Entry( &aTmp, &nPos ) )
- pNames = maFamilyList.GetObject( nPos )->mpNameList;
-
- DBG_ASSERT( pNames,
- "SvXMLAutoStylePool_Impl::RegisterName: unknown family" );
- if( pNames )
- {
- OUString *pName = new OUString( rName );
- if( !pNames->Insert( pName ) )
- delete pName;
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Adds a array of XMLPropertyState ( vector< XMLPropertyState > ) to list
-// if not added, yet.
-//
-
-/*OUString SvXMLAutoStylePoolP_Impl::Add( sal_Int32 nFamily,
- const OUString& rParent,
- const vector< XMLPropertyState >& rProperties,
- sal_Bool bCache )*/
-sal_Bool SvXMLAutoStylePoolP_Impl::Add(OUString& rName, sal_Int32 nFamily,
- const OUString& rParent,
- const ::std::vector< XMLPropertyState >& rProperties,
- sal_Bool bCache)
-{
- sal_Bool bRet(sal_False);
- ULONG nPos;
-
- XMLFamilyData_Impl *pFamily = 0;
- XMLFamilyData_Impl aTmp( nFamily );
- if( maFamilyList.Seek_Entry( &aTmp, &nPos ) )
- {
- pFamily = maFamilyList.GetObject( nPos );
- }
-
- DBG_ASSERT( pFamily, "SvXMLAutoStylePool_Impl::Add: unknown family" );
- if( pFamily )
- {
- SvXMLAutoStylePoolParentP_Impl aTmp( rParent );
- SvXMLAutoStylePoolParentP_Impl *pParent = 0;
-
- SvXMLAutoStylePoolParentsP_Impl *pParents = pFamily->mpParentList;
- if( pParents->Seek_Entry( &aTmp, &nPos ) )
- {
- pParent = pParents->GetObject( nPos );
- }
- else
- {
- pParent = new SvXMLAutoStylePoolParentP_Impl( rParent );
- pParents->Insert( pParent );
- }
-
- if( pParent->Add( pFamily, rProperties, rName ) )
- {
- pFamily->mnCount++;
- bRet = sal_True;
- }
-
- if( bCache )
- {
- if( !pFamily->pCache )
- pFamily->pCache = new SvXMLAutoStylePoolCache_Impl( 256, 256 );
- if( pFamily->pCache->Count() < MAX_CACHE_SIZE )
- pFamily->pCache->Insert( new OUString( rName ),
- pFamily->pCache->Count() );
- }
- }
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Search for a array of XMLPropertyState ( vector< XMLPropertyState > ) in list
-//
-
-OUString SvXMLAutoStylePoolP_Impl::Find( sal_Int32 nFamily,
- const OUString& rParent,
- const vector< XMLPropertyState >& rProperties ) const
-{
- OUString sName;
-
- ULONG nPos;
- XMLFamilyData_Impl aTmp( nFamily );
- XMLFamilyData_Impl *pFamily = 0;
- if( maFamilyList.Seek_Entry( &aTmp, &nPos ) )
- {
- pFamily = maFamilyList.GetObject( nPos );
- }
-
- DBG_ASSERT( pFamily, "SvXMLAutoStylePool_Impl::Find: unknown family" );
-
- if( pFamily )
- {
- SvXMLAutoStylePoolParentP_Impl aTmp( rParent );
-
- const SvXMLAutoStylePoolParentsP_Impl* pParents =
- pFamily->mpParentList;
- if( pParents->Seek_Entry( &aTmp, &nPos ) )
- sName = pParents->GetObject( nPos )->Find( pFamily, rProperties );
- }
-
- return sName;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// export
-//
-
-void SvXMLAutoStylePoolP_Impl::exportXML(
- sal_Int32 nFamily,
- const uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap,
- const SvXMLAutoStylePoolP *pAntiImpl) const
-{
- sal_uInt32 nCount = 0;
-
- // Get list of parents for current family (nFamily)
- ULONG nPos;
- XMLFamilyData_Impl aTmp( nFamily );
- XMLFamilyData_Impl *pFamily = 0;
- if( maFamilyList.Seek_Entry( &aTmp, &nPos ) )
- {
- pFamily = maFamilyList.GetObject( nPos );
- nCount = pFamily->mnCount;
- }
-
- DBG_ASSERT( pFamily,
- "SvXMLAutoStylePool_Impl::exportXML: unknown family" );
- if( pFamily && nCount > 0 )
- {
- /////////////////////////////////////////////////////////////////////////////////////
- // create, initialize and fill helper-structure (SvXMLAutoStylePoolProperties_Impl)
- // wich contains a parent-name and a SvXMLAutoStylePoolProperties_Impl
- //
- const SvXMLAutoStylePoolParentsP_Impl *pParents =
- pFamily->mpParentList;
-
- SvXMLAutoStylePoolPExport_Impl* aExpStyles =
- new SvXMLAutoStylePoolPExport_Impl[nCount];
-
- sal_uInt32 i;
- for( i=0; i < nCount; i++ )
- {
- aExpStyles[i].mpParent = 0;
- aExpStyles[i].mpProperties = 0;
- }
-
- sal_uInt32 nParents = pParents->Count();
- for( i=0; i < nParents; i++ )
- {
- const SvXMLAutoStylePoolParentP_Impl* pParent =
- pParents->GetObject( i );
- sal_uInt32 nProperties = pParent->GetPropertiesList().Count();
- for( sal_uInt32 j=0; j < nProperties; j++ )
- {
- const SvXMLAutoStylePoolPropertiesP_Impl *pProperties =
- pParent->GetPropertiesList().GetObject( j );
- sal_uInt32 nPos = pProperties->GetPos();
- DBG_ASSERT( nPos < nCount,
- "SvXMLAutoStylePool_Impl::exportXML: wrong position" );
- if( nPos < nCount )
- {
- DBG_ASSERT( !aExpStyles[nPos].mpProperties,
- "SvXMLAutoStylePool_Impl::exportXML: double position" );
- aExpStyles[nPos].mpProperties = pProperties;
- aExpStyles[nPos].mpParent = &pParent->GetParent();
- }
- }
- }
-
- /////////////////////////////////////////////////////////////////////////////////////
- //
- // create string to export for each XML-style. That means for each property-list
- //
- OUString aStrFamilyName = pFamily->maStrFamilyName;
-
- for( i=0; i<nCount; i++ )
- {
- DBG_ASSERT( aExpStyles[i].mpProperties,
- "SvXMLAutoStylePool_Impl::exportXML: empty position" );
-
- if( aExpStyles[i].mpProperties )
- {
- GetExport().AddAttribute(
- XML_NAMESPACE_STYLE, XML_NAME,
- aExpStyles[i].mpProperties->GetName() );
-
- if( pFamily->bAsFamily )
- {
- GetExport().AddAttribute(
- XML_NAMESPACE_STYLE, XML_FAMILY, aStrFamilyName );
- }
-
- if( aExpStyles[i].mpParent->getLength() )
- {
- GetExport().AddAttribute(
- XML_NAMESPACE_STYLE, XML_PARENT_STYLE_NAME,
- *aExpStyles[i].mpParent );
- }
-
- OUString sName;
- if( pFamily->bAsFamily )
- sName = GetXMLToken(XML_STYLE);
- else
- sName = pFamily->maStrFamilyName;
-
- pAntiImpl->exportStyleAttributes(
- GetExport().GetAttrList(),
- nFamily,
- aExpStyles[i].mpProperties->GetProperties(),
- *pFamily->mxMapper.get()
- , GetExport().GetMM100UnitConverter(),
- GetExport().GetNamespaceMap()
- );
-
- SvXMLElementExport aElem( GetExport(),
- XML_NAMESPACE_STYLE, sName,
- sal_True, sal_True );
-
- sal_Int32 nStart(-1);
- sal_Int32 nEnd(-1);
- if (nFamily == XML_STYLE_FAMILY_PAGE_MASTER)
- {
- nStart = 0;
- sal_Int32 nIndex = 0;
- UniReference< XMLPropertySetMapper > aPropMapper =
- pFamily->mxMapper->getPropertySetMapper();
- sal_Int16 nContextID;
- while(nIndex < aPropMapper->GetEntryCount() && nEnd == -1)
- {
- nContextID = aPropMapper->GetEntryContextId( nIndex );
- if (nContextID && ((nContextID & CTF_PM_FLAGMASK) != XML_PM_CTF_START))
- nEnd = nIndex;
- nIndex++;
- }
- if (nEnd == -1)
- nEnd = nIndex;
- }
-
- pFamily->mxMapper->exportXML(
- GetExport(),
- aExpStyles[i].mpProperties->GetProperties(),
- nStart, nEnd, XML_EXPORT_FLAG_IGN_WS );
-
- pAntiImpl->exportStyleContent(
- GetExport().GetDocHandler(),
- nFamily,
- aExpStyles[i].mpProperties->GetProperties(),
- *pFamily->mxMapper.get(),
- GetExport().GetMM100UnitConverter(),
- GetExport().GetNamespaceMap()
- );
- }
- }
-
- delete[] aExpStyles;
- }
-}
-
-void SvXMLAutoStylePoolP_Impl::ClearEntries()
-{
- for(sal_uInt32 a = 0L; a < maFamilyList.Count(); a++)
- maFamilyList[a]->ClearEntries();
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_kernihdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_kernihdl.cxx
deleted file mode 100644
index 207543bcfacd..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_kernihdl.cxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "kernihdl.hxx"
-
-
-#include <rtl/ustrbuf.hxx>
-
-// --
-
-
-#include "xmluconv.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::binfilter::xmloff::token;
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLKerningPropHdl
-//
-
-XMLKerningPropHdl::~XMLKerningPropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLKerningPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_True;
- sal_Int32 nKerning = 0;
-
- if( ! IsXMLToken( rStrImpValue, XML_KERNING_NORMAL ) )
- {
- bRet = rUnitConverter.convertMeasure( nKerning, rStrImpValue );
- }
-
- rValue <<= (sal_Int16)nKerning;
-
- return bRet;
-}
-
-sal_Bool XMLKerningPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int16 nValue;
-
- if( rValue >>= nValue )
- {
- OUStringBuffer aOut;
-
- if( nValue == 0 )
- aOut.append( GetXMLToken(XML_KERNING_NORMAL) );
- else
- rUnitConverter.convertMeasure( aOut, nValue );
-
- rStrExpValue = aOut.makeStringAndClear();
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_lspachdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_lspachdl.cxx
deleted file mode 100644
index 267dc8ce4d12..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_lspachdl.cxx
+++ /dev/null
@@ -1,199 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <lspachdl.hxx>
-
-
-#include "xmluconv.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-
-#include <com/sun/star/style/LineSpacing.hpp>
-#include <com/sun/star/style/LineSpacingMode.hpp>
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_CASEMAP_NORMAL;
-
-// this is a copy of defines in svx/inc/escpitem.hxx
-#define DFLT_ESC_PROP 58
-#define DFLT_ESC_AUTO_SUPER 101
-#define DFLT_ESC_AUTO_SUB -101
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLEscapementPropHdl
-//
-
-XMLLineHeightHdl::~XMLLineHeightHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLLineHeightHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- style::LineSpacing aLSp;
- sal_Int32 nTemp = 0;
-
- if( -1 != rStrImpValue.indexOf( sal_Unicode( '%' ) ) )
- {
- aLSp.Mode = style::LineSpacingMode::PROP;
- if(!rUnitConverter.convertPercent( nTemp, rStrImpValue ))
- return sal_False;
- aLSp.Height = nTemp;
- }
- else if( IsXMLToken( rStrImpValue, XML_CASEMAP_NORMAL) )
- {
- aLSp.Mode = style::LineSpacingMode::PROP;
- aLSp.Height = 100;
- }
- else
- {
- aLSp.Mode = style::LineSpacingMode::FIX;
- if(!rUnitConverter.convertMeasure( nTemp, rStrImpValue, 0x0000, 0xffff ))
- return sal_False;
- aLSp.Height = nTemp;
- }
-
- rValue <<= aLSp;
- return sal_True;
-}
-
-sal_Bool XMLLineHeightHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUStringBuffer aOut;
-
- style::LineSpacing aLSp;
- if(!(rValue >>= aLSp))
- return sal_False;
-
- if( style::LineSpacingMode::PROP != aLSp.Mode && style::LineSpacingMode::FIX != aLSp.Mode )
- return sal_False;
-
- if( style::LineSpacingMode::PROP == aLSp.Mode )
- {
- rUnitConverter.convertPercent( aOut, aLSp.Height );
- }
- else
- {
- rUnitConverter.convertMeasure( aOut, aLSp.Height );
- }
-
- rStrExpValue = aOut.makeStringAndClear();
- return rStrExpValue.getLength() != 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLLineHeightAtLeastHdl
-//
-
-XMLLineHeightAtLeastHdl::~XMLLineHeightAtLeastHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLLineHeightAtLeastHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- style::LineSpacing aLSp;
-
- sal_Int32 nTemp;
- aLSp.Mode = style::LineSpacingMode::MINIMUM;
- if(!rUnitConverter.convertMeasure( nTemp, rStrImpValue, 0x0000, 0xffff ))
- return sal_False;
- aLSp.Height = nTemp;
-
- rValue <<= aLSp;
- return sal_True;
-}
-
-sal_Bool XMLLineHeightAtLeastHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUStringBuffer aOut;
-
- style::LineSpacing aLSp;
- if(!(rValue >>= aLSp))
- return sal_False;
-
- if( style::LineSpacingMode::MINIMUM != aLSp.Mode )
- return sal_False;
-
- rUnitConverter.convertMeasure( aOut, aLSp.Height );
-
- rStrExpValue = aOut.makeStringAndClear();
- return rStrExpValue.getLength() != 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLLineSpacingHdl
-//
-
-XMLLineSpacingHdl::~XMLLineSpacingHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLLineSpacingHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- style::LineSpacing aLSp;
- sal_Int32 nTemp;
-
- aLSp.Mode = style::LineSpacingMode::LEADING;
- if(!rUnitConverter.convertMeasure( nTemp, rStrImpValue, 0x0000, 0xffff ))
- return sal_False;
- aLSp.Height = nTemp;
-
- rValue <<= aLSp;
- return sal_True;
-}
-
-sal_Bool XMLLineSpacingHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUStringBuffer aOut;
-
- style::LineSpacing aLSp;
- if(!(rValue >>= aLSp))
- return sal_False;
-
- if( style::LineSpacingMode::LEADING != aLSp.Mode )
- return sal_False;
-
- rUnitConverter.convertMeasure( aOut, aLSp.Height );
-
- rStrExpValue = aOut.makeStringAndClear();
- return rStrExpValue.getLength() != 0;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_numehelp.cxx b/binfilter/bf_xmloff/source/style/xmloff_numehelp.cxx
deleted file mode 100644
index ac8471b81835..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_numehelp.cxx
+++ /dev/null
@@ -1,559 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "numehelp.hxx"
-
-#include "nmspmap.hxx"
-#include "xmluconv.hxx"
-
-#include "xmlexp.hxx"
-#include <com/sun/star/uno/Reference.h>
-#include <bf_svtools/zforlist.hxx>
-#include <com/sun/star/util/NumberFormat.hpp>
-#include <rtl/math.hxx>
-#include <tools/debug.hxx>
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace xmloff::token;
-
-#define XML_TYPE "Type"
-#define XML_CURRENCYSYMBOL "CurrencySymbol"
-#define XML_CURRENCYABBREVIATION "CurrencyAbbreviation"
-#define XML_STANDARDFORMAT "StandardFormat"
-
-XMLNumberFormatAttributesExportHelper::XMLNumberFormatAttributesExportHelper(
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xTempNumberFormatsSupplier)
- : pExport(NULL),
- xNumberFormats(xTempNumberFormatsSupplier.is() ? xTempNumberFormatsSupplier->getNumberFormats() : ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats > ()),
- aNumberFormats(),
- sStandardFormat(RTL_CONSTASCII_USTRINGPARAM(XML_STANDARDFORMAT)),
- sType(RTL_CONSTASCII_USTRINGPARAM(XML_TYPE))
-{
-}
-
-XMLNumberFormatAttributesExportHelper::XMLNumberFormatAttributesExportHelper(
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xTempNumberFormatsSupplier,
- SvXMLExport& rTempExport, sal_uInt16 nTempNamespace)
- : pExport(&rTempExport),
- xNumberFormats(xTempNumberFormatsSupplier.is() ? xTempNumberFormatsSupplier->getNumberFormats() : ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats > ()),
- aNumberFormats(),
- nNamespace(nTempNamespace),
- sAttrValueType(rTempExport.GetNamespaceMap().GetQNameByKey( nTempNamespace, GetXMLToken(XML_VALUE_TYPE))),
- sAttrValue(rTempExport.GetNamespaceMap().GetQNameByKey( nTempNamespace, GetXMLToken(XML_VALUE))),
- sAttrDateValue(rTempExport.GetNamespaceMap().GetQNameByKey( nTempNamespace, GetXMLToken(XML_DATE_VALUE))),
- sAttrTimeValue(rTempExport.GetNamespaceMap().GetQNameByKey( nTempNamespace, GetXMLToken(XML_TIME_VALUE))),
- sAttrBooleanValue(rTempExport.GetNamespaceMap().GetQNameByKey( nTempNamespace, GetXMLToken(XML_BOOLEAN_VALUE))),
- sAttrStringValue(rTempExport.GetNamespaceMap().GetQNameByKey( nTempNamespace, GetXMLToken(XML_STRING_VALUE))),
- sAttrCurrency(rTempExport.GetNamespaceMap().GetQNameByKey( nTempNamespace, GetXMLToken(XML_CURRENCY))),
- sStandardFormat(RTL_CONSTASCII_USTRINGPARAM(XML_STANDARDFORMAT)),
- sType(RTL_CONSTASCII_USTRINGPARAM(XML_TYPE))
-{
-}
-
-XMLNumberFormatAttributesExportHelper::~XMLNumberFormatAttributesExportHelper()
-{
-}
-
-sal_Int16 XMLNumberFormatAttributesExportHelper::GetCellType(const sal_Int32 nNumberFormat, ::rtl::OUString& sCurrency, sal_Bool& bIsStandard)
-{
- XMLNumberFormat aFormat(sEmpty, nNumberFormat, 0);
- XMLNumberFormatSet::iterator aItr = aNumberFormats.find(aFormat);
- if (aItr != aNumberFormats.end())
- {
- bIsStandard = aItr->bIsStandard;
- sCurrency = aItr->sCurrency;
- return aItr->nType;
- }
- else
- {
- aFormat.nType = GetCellType(nNumberFormat, bIsStandard);
- aFormat.bIsStandard = bIsStandard;
- if ((aFormat.nType & ~util::NumberFormat::DEFINED) == util::NumberFormat::CURRENCY)
- if (GetCurrencySymbol(nNumberFormat, aFormat.sCurrency))
- sCurrency = aFormat.sCurrency;
- aNumberFormats.insert(aFormat);
- return aFormat.nType;
- }
- return 0;
-}
-
-void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExport,
- const sal_Int16 nTypeKey,
- const double& rValue,
- const ::rtl::OUString& rCurrency,
- sal_uInt16 nNamespace,
- sal_Bool bExportValue)
-{
- sal_Bool bWasSetTypeAttribute = sal_False;
- switch(nTypeKey & ~util::NumberFormat::DEFINED)
- {
- case 0:
- case util::NumberFormat::NUMBER:
- case util::NumberFormat::SCIENTIFIC:
- case util::NumberFormat::FRACTION:
- {
- if (!bWasSetTypeAttribute)
- {
- rXMLExport.AddAttribute(nNamespace, XML_VALUE_TYPE, XML_FLOAT);
- bWasSetTypeAttribute = sal_True;
- }
- } // No Break
- case util::NumberFormat::PERCENT:
- {
- if (!bWasSetTypeAttribute)
- {
- rXMLExport.AddAttribute(nNamespace, XML_VALUE_TYPE, XML_PERCENTAGE);
- bWasSetTypeAttribute = sal_True;
- }
- } // No Break
- case util::NumberFormat::CURRENCY:
- {
- if (!bWasSetTypeAttribute)
- {
- rXMLExport.AddAttribute(nNamespace, XML_VALUE_TYPE, XML_CURRENCY);
- if (rCurrency.getLength() > 0)
- rXMLExport.AddAttribute(nNamespace, XML_CURRENCY, rCurrency);
- bWasSetTypeAttribute = sal_True;
- }
-
- if (bExportValue)
- {
- ::rtl::OUString sValue( ::rtl::math::doubleToUString( rValue,
- rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', sal_True));
- rXMLExport.AddAttribute(nNamespace, XML_VALUE, sValue);
- }
- }
- break;
- case util::NumberFormat::DATE:
- case util::NumberFormat::DATETIME:
- {
- if (!bWasSetTypeAttribute)
- {
- rXMLExport.AddAttribute(nNamespace, XML_VALUE_TYPE, XML_DATE);
- bWasSetTypeAttribute = sal_True;
- }
- if (bExportValue)
- {
- if ( rXMLExport.GetMM100UnitConverter().setNullDate(rXMLExport.GetModel()) )
- {
- ::rtl::OUStringBuffer sBuffer;
- rXMLExport.GetMM100UnitConverter().convertDateTime(sBuffer, rValue);
- rXMLExport.AddAttribute(nNamespace, XML_DATE_VALUE, sBuffer.makeStringAndClear());
- }
- }
- }
- break;
- case util::NumberFormat::TIME:
- {
- if (!bWasSetTypeAttribute)
- {
- rXMLExport.AddAttribute(nNamespace, XML_VALUE_TYPE, XML_TIME);
- bWasSetTypeAttribute = sal_True;
- }
- if (bExportValue)
- {
- ::rtl::OUStringBuffer sBuffer;
- rXMLExport.GetMM100UnitConverter().convertTime(sBuffer, rValue);
- rXMLExport.AddAttribute(nNamespace, XML_TIME_VALUE, sBuffer.makeStringAndClear());
- }
- }
- break;
- case util::NumberFormat::LOGICAL:
- {
- if (!bWasSetTypeAttribute)
- {
- rXMLExport.AddAttribute(nNamespace, XML_VALUE_TYPE, XML_BOOLEAN);
- bWasSetTypeAttribute = sal_True;
- }
- if (bExportValue)
- {
- double fTempValue = rValue;
- if (::rtl::math::approxEqual( fTempValue, 1.0 ))
- {
- rXMLExport.AddAttribute(nNamespace, XML_BOOLEAN_VALUE, XML_TRUE);
- }
- else
- {
- if (::rtl::math::approxEqual( rValue, 0.0 ))
- {
- rXMLExport.AddAttribute(nNamespace, XML_BOOLEAN_VALUE, XML_FALSE);
- }
- else
- {
- ::rtl::OUString sValue( ::rtl::math::doubleToUString(
- fTempValue,
- rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.',
- sal_True));
- rXMLExport.AddAttribute(nNamespace, XML_BOOLEAN_VALUE, sValue);
- }
- }
- }
- }
- break;
- case util::NumberFormat::TEXT:
- {
- if (!bWasSetTypeAttribute)
- {
- rXMLExport.AddAttribute(nNamespace, XML_VALUE_TYPE, XML_FLOAT);
- bWasSetTypeAttribute = sal_True;
- if (bExportValue)
- {
- ::rtl::OUString sValue( ::rtl::math::doubleToUString( rValue,
- rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', sal_True));
- rXMLExport.AddAttribute(nNamespace, XML_VALUE, sValue);
- }
- }
- }
- break;
- }
-}
-
-sal_Bool XMLNumberFormatAttributesExportHelper::GetCurrencySymbol(const sal_Int32 nNumberFormat, ::rtl::OUString& sCurrencySymbol,
- uno::Reference <util::XNumberFormatsSupplier>& xNumberFormatsSupplier)
-{
- if (xNumberFormatsSupplier.is())
- {
- uno::Reference <util::XNumberFormats> xNumberFormats = xNumberFormatsSupplier->getNumberFormats();
- if (xNumberFormats.is())
- {
- try
- {
- uno::Reference <beans::XPropertySet> xNumberPropertySet = xNumberFormats->getByKey(nNumberFormat);
- uno::Any aCurrencySymbol = xNumberPropertySet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_CURRENCYSYMBOL)));
- if ( aCurrencySymbol >>= sCurrencySymbol)
- {
- ::rtl::OUString sCurrencyAbbreviation;
- uno::Any aCurrencyAbbreviation = xNumberPropertySet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_CURRENCYABBREVIATION)));
- if ( aCurrencyAbbreviation >>= sCurrencyAbbreviation)
- {
- if ( sCurrencyAbbreviation.getLength() != 0 )
- sCurrencySymbol = sCurrencyAbbreviation;
- else
- {
- if ( sCurrencySymbol.getLength() == 1 && sCurrencySymbol.toChar() == NfCurrencyEntry::GetEuroSymbol() )
- sCurrencySymbol = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EUR"));
- }
- }
- return sal_True;
- }
- }
- catch ( uno::Exception& )
- {
- DBG_ERROR("Numberformat not found");
- }
- }
- }
- return sal_False;
-}
-
-
-sal_Int16 XMLNumberFormatAttributesExportHelper::GetCellType(const sal_Int32 nNumberFormat, sal_Bool& bIsStandard,
- uno::Reference <util::XNumberFormatsSupplier>& xNumberFormatsSupplier)
-{
- if (xNumberFormatsSupplier.is())
- {
- uno::Reference <util::XNumberFormats> xNumberFormats = xNumberFormatsSupplier->getNumberFormats();
- if (xNumberFormats.is())
- {
- try
- {
- uno::Reference <beans::XPropertySet> xNumberPropertySet = xNumberFormats->getByKey(nNumberFormat);
- uno::Any aIsStandardFormat = xNumberPropertySet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STANDARDFORMAT)));
- aIsStandardFormat >>= bIsStandard;
- uno::Any aNumberType = xNumberPropertySet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_TYPE)));
- sal_Int16 nNumberType;
- if ( aNumberType >>= nNumberType )
- {
- return nNumberType;
- }
- }
- catch ( uno::Exception& )
- {
- DBG_ERROR("Numberformat not found");
- }
- }
- }
- return 0;
-}
-
-void XMLNumberFormatAttributesExportHelper::SetNumberFormatAttributes(SvXMLExport& rXMLExport,
- const sal_Int32 nNumberFormat, const double& rValue, sal_uInt16 nNamespace, sal_Bool bExportValue)
-{
- sal_Bool bIsStandard;
- sal_Int16 nTypeKey = GetCellType(nNumberFormat, bIsStandard, rXMLExport.GetNumberFormatsSupplier());
- ::rtl::OUString sCurrency;
- if ((nTypeKey & ~util::NumberFormat::DEFINED) == util::NumberFormat::CURRENCY)
- GetCurrencySymbol(nNumberFormat, sCurrency, rXMLExport.GetNumberFormatsSupplier());
- WriteAttributes(rXMLExport, nTypeKey, rValue, sCurrency, nNamespace, bExportValue);
-}
-
-void XMLNumberFormatAttributesExportHelper::SetNumberFormatAttributes(SvXMLExport& rXMLExport,
- const ::rtl::OUString& rValue, const ::rtl::OUString& rCharacters, sal_uInt16 nNamespace,
- sal_Bool bExportValue, sal_Bool bExportTypeAttribute)
-{
- if (bExportTypeAttribute)
- rXMLExport.AddAttribute(nNamespace, XML_VALUE_TYPE, XML_STRING);
- if (bExportValue && rValue.getLength() && (rValue != rCharacters))
- rXMLExport.AddAttribute(nNamespace, XML_STRING_VALUE, rValue);
-}
-
-sal_Bool XMLNumberFormatAttributesExportHelper::GetCurrencySymbol(const sal_Int32 nNumberFormat, ::rtl::OUString& sCurrencySymbol)
-{
- if (!xNumberFormats.is() && pExport && pExport->GetNumberFormatsSupplier().is())
- xNumberFormats = pExport->GetNumberFormatsSupplier()->getNumberFormats();
-
- if (xNumberFormats.is())
- {
- try
- {
- uno::Reference <beans::XPropertySet> xNumberPropertySet = xNumberFormats->getByKey(nNumberFormat);
- uno::Any aCurrencySymbol = xNumberPropertySet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_CURRENCYSYMBOL)));
- if ( aCurrencySymbol >>= sCurrencySymbol)
- {
- ::rtl::OUString sCurrencyAbbreviation;
- uno::Any aCurrencyAbbreviation = xNumberPropertySet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_CURRENCYABBREVIATION)));
- if ( aCurrencyAbbreviation >>= sCurrencyAbbreviation)
- {
- if ( sCurrencyAbbreviation.getLength() != 0 )
- sCurrencySymbol = sCurrencyAbbreviation;
- else
- {
- if ( sCurrencySymbol.getLength() == 1 && sCurrencySymbol.toChar() == NfCurrencyEntry::GetEuroSymbol() )
- sCurrencySymbol = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EUR"));
- }
- }
- return sal_True;
- }
- }
- catch ( uno::Exception& )
- {
- DBG_ERROR("Numberformat not found");
- }
- }
- return sal_False;
-}
-
-sal_Int16 XMLNumberFormatAttributesExportHelper::GetCellType(const sal_Int32 nNumberFormat, sal_Bool& bIsStandard)
-{
- if (!xNumberFormats.is() && pExport && pExport->GetNumberFormatsSupplier().is())
- xNumberFormats = pExport->GetNumberFormatsSupplier()->getNumberFormats();
-
- if (xNumberFormats.is())
- {
- try
- {
- uno::Reference <beans::XPropertySet> xNumberPropertySet = xNumberFormats->getByKey(nNumberFormat);
- uno::Any aIsStandardFormat = xNumberPropertySet->getPropertyValue(sStandardFormat);
- aIsStandardFormat >>= bIsStandard;
- uno::Any aNumberType = xNumberPropertySet->getPropertyValue(sType);
- sal_Int16 nNumberType;
- if ( aNumberType >>= nNumberType )
- {
- return nNumberType;
- }
- }
- catch ( uno::Exception& )
- {
- DBG_ERROR("Numberformat not found");
- }
- }
- return 0;
-}
-
-void XMLNumberFormatAttributesExportHelper::WriteAttributes(
- const sal_Int16 nTypeKey,
- const double& rValue,
- const ::rtl::OUString& rCurrency,
- sal_Bool bExportValue)
-{
- if (!pExport)
- return;
-
- sal_Bool bWasSetTypeAttribute = sal_False;
- switch(nTypeKey & ~util::NumberFormat::DEFINED)
- {
- case 0:
- case util::NumberFormat::NUMBER:
- case util::NumberFormat::SCIENTIFIC:
- case util::NumberFormat::FRACTION:
- {
- if (!bWasSetTypeAttribute)
- {
- pExport->AddAttribute(sAttrValueType, XML_FLOAT);
- bWasSetTypeAttribute = sal_True;
- }
- } // No Break
- case util::NumberFormat::PERCENT:
- {
- if (!bWasSetTypeAttribute)
- {
- pExport->AddAttribute(sAttrValueType, XML_PERCENTAGE);
- bWasSetTypeAttribute = sal_True;
- }
- } // No Break
- case util::NumberFormat::CURRENCY:
- {
- if (!bWasSetTypeAttribute)
- {
- pExport->AddAttribute(sAttrValueType, XML_CURRENCY);
- if (rCurrency.getLength() > 0)
- pExport->AddAttribute(sAttrCurrency, rCurrency);
- bWasSetTypeAttribute = sal_True;
- }
-
- if (bExportValue)
- {
- ::rtl::OUString sValue( ::rtl::math::doubleToUString( rValue,
- rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', sal_True));
- pExport->AddAttribute(sAttrValue, sValue);
- }
- }
- break;
- case util::NumberFormat::DATE:
- case util::NumberFormat::DATETIME:
- {
- if (!bWasSetTypeAttribute)
- {
- pExport->AddAttribute(sAttrValueType, XML_DATE);
- bWasSetTypeAttribute = sal_True;
- }
- if (bExportValue)
- {
- if ( pExport->GetMM100UnitConverter().setNullDate(pExport->GetModel()) )
- {
- ::rtl::OUStringBuffer sBuffer;
- pExport->GetMM100UnitConverter().convertDateTime(sBuffer, rValue);
- pExport->AddAttribute(sAttrDateValue, sBuffer.makeStringAndClear());
- }
- }
- }
- break;
- case util::NumberFormat::TIME:
- {
- if (!bWasSetTypeAttribute)
- {
- pExport->AddAttribute(sAttrValueType, XML_TIME);
- bWasSetTypeAttribute = sal_True;
- }
- if (bExportValue)
- {
- ::rtl::OUStringBuffer sBuffer;
- pExport->GetMM100UnitConverter().convertTime(sBuffer, rValue);
- pExport->AddAttribute(sAttrTimeValue, sBuffer.makeStringAndClear());
- }
- }
- break;
- case util::NumberFormat::LOGICAL:
- {
- if (!bWasSetTypeAttribute)
- {
- pExport->AddAttribute(sAttrValueType, XML_BOOLEAN);
- bWasSetTypeAttribute = sal_True;
- }
- if (bExportValue)
- {
- ::rtl::OUString sOUValue;
- double fTempValue = rValue;
- if (::rtl::math::approxEqual( fTempValue, 1.0 ))
- {
- pExport->AddAttribute(sAttrBooleanValue, XML_TRUE);
- }
- else
- {
- if (::rtl::math::approxEqual( rValue, 0.0 ))
- {
- pExport->AddAttribute(nNamespace, XML_BOOLEAN_VALUE, XML_FALSE);
- }
- else
- {
- ::rtl::OUString sValue( ::rtl::math::doubleToUString(
- fTempValue,
- rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.',
- sal_True));
- pExport->AddAttribute(sAttrBooleanValue, sValue);
- }
- }
- }
- }
- break;
- case util::NumberFormat::TEXT:
- {
- if (!bWasSetTypeAttribute)
- {
- pExport->AddAttribute(sAttrValueType, XML_FLOAT);
- bWasSetTypeAttribute = sal_True;
- if (bExportValue)
- {
- ::rtl::OUString sValue( ::rtl::math::doubleToUString( rValue,
- rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', sal_True));
- pExport->AddAttribute(sAttrValue, sValue);
- }
- }
- }
- break;
- }
-}
-
-void XMLNumberFormatAttributesExportHelper::SetNumberFormatAttributes(
- const sal_Int32 nNumberFormat, const double& rValue, sal_Bool bExportValue)
-{
- if (pExport)
- {
- sal_Bool bIsStandard;
- ::rtl::OUString sCurrency;
- sal_Int16 nTypeKey = GetCellType(nNumberFormat, sCurrency, bIsStandard);
- WriteAttributes(nTypeKey, rValue, sCurrency, bExportValue);
- }
- else
- DBG_ERROR("no SvXMLExport given");
-}
-
-void XMLNumberFormatAttributesExportHelper::SetNumberFormatAttributes(
- const ::rtl::OUString& rValue, const ::rtl::OUString& rCharacters,
- sal_Bool bExportValue, sal_Bool bExportTypeAttribute)
-{
- if (pExport)
- {
- if (bExportTypeAttribute)
- pExport->AddAttribute(sAttrValueType, XML_STRING);
- if (bExportValue && rValue.getLength() && (rValue != rCharacters))
- pExport->AddAttribute(sAttrStringValue, rValue);
- }
- else
- DBG_ERROR("no SvXMLExport given");
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_opaquhdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_opaquhdl.cxx
deleted file mode 100644
index e096cf760557..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_opaquhdl.cxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "opaquhdl.hxx"
-
-
-
-// --
-
-
-#include "xmluconv.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::binfilter::xmloff::token;
-
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLOpaquePropHdl
-//
-
-XMLOpaquePropHdl::~XMLOpaquePropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLOpaquePropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_True;
-
- sal_Bool bValue = IsXMLToken( rStrImpValue, XML_OPAQUE_FOREGROUND );
- rValue <<= sal_Bool(bValue);
- bRet = sal_True;
-
- return bRet;
-}
-
-sal_Bool XMLOpaquePropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Bool bValue;
-
- if (rValue >>= bValue)
- {
- if( bValue )
- rStrExpValue = GetXMLToken( XML_OPAQUE_FOREGROUND );
- else
- rStrExpValue = GetXMLToken( XML_OPAQUE_BACKGROUND );
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_postuhdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_postuhdl.cxx
deleted file mode 100644
index 0e9ccb27363c..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_postuhdl.cxx
+++ /dev/null
@@ -1,100 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <postuhdl.hxx>
-
-
-#include "xmluconv.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-
-#include <com/sun/star/awt/FontSlant.hpp>
-
-#include <vcl/vclenum.hxx>
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-SvXMLEnumMapEntry __READONLY_DATA aPostureGenericMapping[] =
-{
- { XML_POSTURE_NORMAL, ITALIC_NONE },
- { XML_POSTURE_ITALIC, ITALIC_NORMAL },
- { XML_POSTURE_OBLIQUE, ITALIC_OBLIQUE },
- { XML_TOKEN_INVALID, 0 }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLPosturePropHdl
-//
-
-XMLPosturePropHdl::~XMLPosturePropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLPosturePropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_uInt16 ePosture;
-
- if( ( bRet = rUnitConverter.convertEnum( ePosture, rStrImpValue, aPostureGenericMapping ) ) )
- rValue <<= (awt::FontSlant)ePosture;
-
- return bRet;
-}
-
-sal_Bool XMLPosturePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- OUStringBuffer aOut;
- awt::FontSlant eSlant;
-
- if( !( rValue >>= eSlant ) )
- {
- sal_Int32 nValue;
-
- if( !( rValue >>= nValue ) )
- return sal_False;
-
- eSlant = (awt::FontSlant)nValue;
- }
-
- if( ( bRet = rUnitConverter.convertEnum( aOut, (sal_Int32)eSlant, aPostureGenericMapping ) ) )
- rStrExpValue = aOut.makeStringAndClear();
-
- return bRet;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_prhdlfac.cxx b/binfilter/bf_xmloff/source/style/xmloff_prhdlfac.cxx
deleted file mode 100644
index 8302777cdbee..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_prhdlfac.cxx
+++ /dev/null
@@ -1,392 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/drawing/ColorMode.hpp>
-#include <com/sun/star/text/HorizontalAdjust.hpp>
-#include <com/sun/star/text/WritingMode2.hpp>
-
-#include <tools/debug.hxx>
-#include <prhdlfac.hxx>
-
-#include "xmltypes.hxx"
-
-
-#include "xmlbahdl.hxx"
-
-#include "NamedBoolPropertyHdl.hxx"
-
-#include "XMLConstantsPropertyHandler.hxx"
-
-#include "cdouthdl.hxx"
-#include "csmaphdl.hxx"
-#include "fonthdl.hxx"
-#include "kernihdl.hxx"
-#include <postuhdl.hxx>
-#include "shadwhdl.hxx"
-#include "shdwdhdl.hxx"
-#include "undlihdl.hxx"
-#include "weighhdl.hxx"
-#include "splithdl.hxx"
-#include "breakhdl.hxx"
-#include <adjushdl.hxx>
-#include <escphdl.hxx>
-#include <chrhghdl.hxx>
-#include <chrlohdl.hxx>
-#include <lspachdl.hxx>
-#include <bordrhdl.hxx>
-#include <tabsthdl.hxx>
-#include "EnumPropertyHdl.hxx"
-#include "AttributeContainerHandler.hxx"
-#include "durationhdl.hxx"
-#include "XMLRectangleMembersHandler.hxx"
-#include "DrawAspectHdl.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-SvXMLEnumMapEntry aXML_ColorMode_EnumMap[] =
-{
- { XML_GREYSCALE, drawing::ColorMode_GREYS },
- { XML_MONO, drawing::ColorMode_MONO },
- { XML_WATERMARK, drawing::ColorMode_WATERMARK },
- { XML_STANDARD, drawing::ColorMode_STANDARD },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA aXML_HorizontalAdjust_Enum[] =
-{
- { XML_LEFT, text::HorizontalAdjust_LEFT },
- { XML_CENTER, text::HorizontalAdjust_CENTER },
- { XML_RIGHT, text::HorizontalAdjust_RIGHT },
- { XML_TOKEN_INVALID, 0 }
-};
-
-// aXML_WritingDirection_Enum is used with and without 'page'
-// attribute, so you'll find uses of aXML_WritingDirection_Enum
-// directly, as well as &(aXML_WritingDirection_Enum[1])
-SvXMLEnumMapEntry __READONLY_DATA aXML_WritingDirection_Enum[] =
-{
- // aXML_WritingDirection_Enum
- { XML_PAGE, text::WritingMode2::PAGE },
-
- // &(aXML_WritingDirection_Enum[1])
- { XML_LR_TB, text::WritingMode2::LR_TB },
- { XML_RL_TB, text::WritingMode2::RL_TB },
- { XML_TB_RL, text::WritingMode2::TB_RL },
- { XML_TB_LR, text::WritingMode2::TB_LR },
-
- // alternative names of the above, as accepted by XSL
- { XML_LR, text::WritingMode2::LR_TB },
- { XML_RL, text::WritingMode2::RL_TB },
- { XML_TB, text::WritingMode2::TB_RL },
-
- { XML_TOKEN_INVALID, 0 }
-};
-
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Dtor
-//
-XMLPropertyHandlerFactory::~XMLPropertyHandlerFactory()
-{
- for( CacheMap::iterator pPos = maHandlerCache.begin(); pPos != maHandlerCache.end(); pPos++ )
- delete pPos->second;
-}
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Interface
-//
-const XMLPropertyHandler* XMLPropertyHandlerFactory::GetPropertyHandler( sal_Int32 nType ) const
-{
- DBG_ASSERT( (nType & ~((sal_uInt32)MID_FLAG_MASK)) == 0,
- "GetPropertyHandler called with flags in type" );
- return GetBasicHandler( nType );
-}
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Helper-methods to create and cache PropertyHandler
-//
-XMLPropertyHandler* XMLPropertyHandlerFactory::GetHdlCache( sal_Int32 nType ) const
-{
- XMLPropertyHandler* pRet = NULL;
-
- if( maHandlerCache.find( nType ) != maHandlerCache.end() )
- pRet = maHandlerCache.find( nType )->second;
-
- return pRet;
-}
-
-void XMLPropertyHandlerFactory::PutHdlCache( sal_Int32 nType, const XMLPropertyHandler* pHdl ) const
-{
- // Don't be wondered about the following construct. The sense is to be able to provide a const-
- // method as class-interface.
- ((XMLPropertyHandlerFactory*)this)->maHandlerCache[ nType ] = (XMLPropertyHandler*)pHdl;
-}
-
-const XMLPropertyHandler* XMLPropertyHandlerFactory::GetBasicHandler( sal_Int32 nType ) const
-{
- const XMLPropertyHandler* pPropHdl = GetHdlCache( nType );
-
- if( !pPropHdl )
- {
- pPropHdl = CreatePropertyHandler( nType );
-
- if( pPropHdl )
- PutHdlCache( nType, pPropHdl );
- }
-
- return pPropHdl;
-}
-
-const XMLPropertyHandler* XMLPropertyHandlerFactory::CreatePropertyHandler( sal_Int32 nType )
-{
- XMLPropertyHandler* pPropHdl = NULL;
-
- switch( nType )
- {
- case XML_TYPE_BOOL :
- pPropHdl = new XMLBoolPropHdl;
- break;
- case XML_TYPE_MEASURE :
- pPropHdl = new XMLMeasurePropHdl( 4 );
- break;
- case XML_TYPE_MEASURE8 :
- pPropHdl = new XMLMeasurePropHdl( 1 );
- break;
- case XML_TYPE_MEASURE16:
- pPropHdl = new XMLMeasurePropHdl( 2 );
- break;
- case XML_TYPE_PERCENT :
- pPropHdl = new XMLPercentPropHdl( 4 );
- break;
- case XML_TYPE_PERCENT8 :
- pPropHdl = new XMLPercentPropHdl( 1 );
- break;
- case XML_TYPE_PERCENT16 :
- pPropHdl = new XMLPercentPropHdl( 2 );
- break;
- case XML_TYPE_MEASURE_PX :
- pPropHdl = new XMLMeasurePxPropHdl( 4 );
- break;
- case XML_TYPE_STRING :
- pPropHdl = new XMLStringPropHdl;
- break;
- case XML_TYPE_COLOR :
- pPropHdl = new XMLColorPropHdl;
- break;
- case XML_TYPE_NUMBER :
- pPropHdl = new XMLNumberPropHdl( 4 );
- break;
- case XML_TYPE_NUMBER8 :
- pPropHdl = new XMLNumberPropHdl( 1 );
- break;
- case XML_TYPE_NUMBER16:
- pPropHdl = new XMLNumberPropHdl( 2 );
- break;
- case XML_TYPE_NUMBER_NONE :
- pPropHdl = new XMLNumberNonePropHdl;
- break;
- case XML_TYPE_NUMBER8_NONE :
- pPropHdl = new XMLNumberNonePropHdl( 1 );
- break;
- case XML_TYPE_NUMBER16_NONE :
- pPropHdl = new XMLNumberNonePropHdl( 2 );
- break;
- case XML_TYPE_DOUBLE :
- pPropHdl = new XMLDoublePropHdl;
- break;
- case XML_TYPE_NBOOL :
- pPropHdl = new XMLNBoolPropHdl;
- break;
- case XML_TYPE_COLORTRANSPARENT :
- pPropHdl = new XMLColorTransparentPropHdl;
- break;
- case XML_TYPE_ISTRANSPARENT :
- pPropHdl = new XMLIsTransparentPropHdl;
- break;
- case XML_TYPE_COLORAUTO :
- pPropHdl = new XMLColorAutoPropHdl;
- break;
- case XML_TYPE_ISAUTOCOLOR :
- pPropHdl = new XMLIsAutoColorPropHdl;
- break;
- case XML_TYPE_BUILDIN_CMP_ONLY :
- pPropHdl = new XMLCompareOnlyPropHdl;
- break;
-
- case XML_TYPE_RECTANGLE_LEFT :
- case XML_TYPE_RECTANGLE_TOP :
- case XML_TYPE_RECTANGLE_WIDTH :
- case XML_TYPE_RECTANGLE_HEIGHT :
- pPropHdl = new XMLRectangleMembersHdl( nType );
- break;
-
- case XML_TYPE_TEXT_CROSSEDOUT:
- pPropHdl = new XMLCrossedOutPropHdl ;
- break;
- case XML_TYPE_TEXT_BOOLCROSSEDOUT:
- pPropHdl = new XMLNamedBoolPropertyHdl(
- GetXMLToken(XML_CROSSEDOUT_SINGLE),
- GetXMLToken(XML_CROSSEDOUT_NONE) );
- break;
- case XML_TYPE_TEXT_ESCAPEMENT:
- pPropHdl = new XMLEscapementPropHdl;
- break;
- case XML_TYPE_TEXT_ESCAPEMENT_HEIGHT:
- pPropHdl = new XMLEscapementHeightPropHdl;
- break;
- case XML_TYPE_TEXT_CASEMAP:
- pPropHdl = new XMLCaseMapPropHdl;
- break;
- case XML_TYPE_TEXT_CASEMAP_VAR:
- pPropHdl = new XMLCaseMapVariantHdl;
- break;
- case XML_TYPE_TEXT_FONTFAMILYNAME:
- pPropHdl = new XMLFontFamilyNamePropHdl;
- break;
- case XML_TYPE_TEXT_FONTFAMILY:
- pPropHdl = new XMLFontFamilyPropHdl;
- break;
- case XML_TYPE_TEXT_FONTENCODING:
- pPropHdl = new XMLFontEncodingPropHdl;
- break;
- case XML_TYPE_TEXT_FONTPITCH:
- pPropHdl = new XMLFontPitchPropHdl;
- break;
- case XML_TYPE_TEXT_KERNING:
- pPropHdl = new XMLKerningPropHdl;
- break;
- case XML_TYPE_TEXT_POSTURE:
- pPropHdl = new XMLPosturePropHdl;
- break;
- case XML_TYPE_TEXT_SHADOWED:
- pPropHdl = new XMLShadowedPropHdl;
- break;
- case XML_TYPE_TEXT_UNDERLINE:
- pPropHdl = new XMLUnderlinePropHdl;
- break;
- case XML_TYPE_TEXT_UNDERLINE_COLOR:
- pPropHdl = new XMLColorTransparentPropHdl( XML_FONT_COLOR );
- break;
- case XML_TYPE_TEXT_UNDERLINE_HASCOLOR:
- pPropHdl = new XMLIsTransparentPropHdl( XML_FONT_COLOR,
- sal_False );
- break;
- case XML_TYPE_TEXT_WEIGHT:
- pPropHdl = new XMLFontWeightPropHdl;
- break;
- case XML_TYPE_TEXT_SPLIT:
- pPropHdl = new XMLFmtSplitPropHdl;
- break;
- case XML_TYPE_TEXT_BREAKBEFORE:
- pPropHdl = new XMLFmtBreakBeforePropHdl;
- break;
- case XML_TYPE_TEXT_BREAKAFTER:
- pPropHdl = new XMLFmtBreakAfterPropHdl;
- break;
- case XML_TYPE_TEXT_SHADOW:
- pPropHdl = new XMLShadowPropHdl;
- break;
- case XML_TYPE_TEXT_ADJUST:
- pPropHdl = new XMLParaAdjustPropHdl;
- break;
- case XML_TYPE_TEXT_ADJUSTLAST:
- pPropHdl = new XMLLastLineAdjustPropHdl;
- break;
- case XML_TYPE_CHAR_HEIGHT:
- pPropHdl = new XMLCharHeightHdl;
- break;
- case XML_TYPE_CHAR_HEIGHT_PROP:
- pPropHdl = new XMLCharHeightPropHdl;
- break;
- case XML_TYPE_CHAR_HEIGHT_DIFF:
- pPropHdl = new XMLCharHeightDiffHdl;
- break;
- case XML_TYPE_CHAR_LANGUAGE:
- pPropHdl = new XMLCharLanguageHdl;
- break;
- case XML_TYPE_CHAR_COUNTRY:
- pPropHdl = new XMLCharCountryHdl;
- break;
- case XML_TYPE_LINE_SPACE_FIXED:
- pPropHdl = new XMLLineHeightHdl;
- break;
- case XML_TYPE_LINE_SPACE_MINIMUM:
- pPropHdl = new XMLLineHeightAtLeastHdl;
- break;
- case XML_TYPE_LINE_SPACE_DISTANCE:
- pPropHdl = new XMLLineSpacingHdl;
- break;
- case XML_TYPE_BORDER_WIDTH:
- pPropHdl = new XMLBorderWidthHdl;
- break;
- case XML_TYPE_BORDER:
- pPropHdl = new XMLBorderHdl;
- break;
- case XML_TYPE_TEXT_TABSTOP:
- pPropHdl = new XMLTabStopPropHdl;
- break;
- case XML_TYPE_ATTRIBUTE_CONTAINER:
- pPropHdl = new XMLAttributeContainerHandler;
- break;
- case XML_TYPE_COLOR_MODE:
- pPropHdl = new XMLEnumPropertyHdl( aXML_ColorMode_EnumMap,
- ::getCppuType((const drawing::ColorMode*)0) );
- break;
- case XML_TYPE_DURATION16_MS:
- pPropHdl = new XMLDurationMS16PropHdl_Impl;
- break;
- case XML_TYPE_TEXT_HORIZONTAL_ADJUST:
- pPropHdl = new XMLEnumPropertyHdl(
- aXML_HorizontalAdjust_Enum,
- ::getCppuType((const text::HorizontalAdjust*)0) );
- break;
- case XML_TYPE_TEXT_DRAW_ASPECT:
- pPropHdl = new DrawAspectHdl;
- break;
- case XML_TYPE_TEXT_WRITING_MODE:
- pPropHdl = new XMLConstantsPropertyHandler(
- &(aXML_WritingDirection_Enum[1]),
- XML_LR_TB);
- break;
- case XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT:
- pPropHdl = new XMLConstantsPropertyHandler(
- aXML_WritingDirection_Enum,
- XML_PAGE);
- break;
- }
-
- return pPropHdl;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_prstylei.cxx b/binfilter/bf_xmloff/source/style/xmloff_prstylei.cxx
deleted file mode 100644
index efd3aa94dedc..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_prstylei.cxx
+++ /dev/null
@@ -1,327 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <tools/debug.hxx>
-#ifndef __SGI_STL_SET
-#include <set>
-#endif
-#include "xmlnmspe.hxx"
-#include "xmlprcon.hxx"
-#include <com/sun/star/beans/XPropertyState.hpp>
-#include <com/sun/star/beans/XMultiPropertyStates.hpp>
-#include "xmlimp.hxx"
-
-#include "prstylei.hxx"
-#include "xmlerror.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-
-void XMLPropStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
- const OUString& rLocalName,
- const OUString& rValue )
-{
- if( XML_NAMESPACE_STYLE == nPrefixKey && IsXMLToken( rLocalName, XML_FAMILY ) )
- {
- DBG_ASSERT( GetFamily() == ((SvXMLStylesContext *)&xStyles)->GetFamily( rValue ), "unexpected style family" );
- }
- else
- {
- SvXMLStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue );
- }
-}
-
-TYPEINIT1( XMLPropStyleContext, SvXMLStyleContext );
-
-XMLPropStyleContext::XMLPropStyleContext( SvXMLImport& rImport,
- sal_uInt16 nPrfx, const OUString& rLName,
- const Reference< XAttributeList > & xAttrList,
- SvXMLStylesContext& rStyles, sal_uInt16 nFamily,
- sal_Bool bDefault ) :
- SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, nFamily, bDefault ),
- xStyles( &rStyles ),
- sIsPhysical( RTL_CONSTASCII_USTRINGPARAM( "IsPhysical" ) ),
- sFollowStyle( RTL_CONSTASCII_USTRINGPARAM( "FollowStyle" ) )
-{
-}
-
-XMLPropStyleContext::~XMLPropStyleContext()
-{
-}
-
-SvXMLImportContext *XMLPropStyleContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
-
- if( XML_NAMESPACE_STYLE == nPrefix &&
- IsXMLToken( rLocalName, XML_PROPERTIES ) )
- {
- UniReference < SvXMLImportPropertyMapper > xImpPrMap =
- ((SvXMLStylesContext *)&xStyles)->GetImportPropertyMapper(
- GetFamily() );
- if( xImpPrMap.is() )
- pContext = new SvXMLPropertySetContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- aProperties,
- xImpPrMap );
- }
-
- if( !pContext )
- pContext = SvXMLStyleContext::CreateChildContext( nPrefix, rLocalName,
- xAttrList );
-
- return pContext;
-}
-
-void XMLPropStyleContext::FillPropertySet(
- const Reference< XPropertySet > & rPropSet )
-{
- UniReference < SvXMLImportPropertyMapper > xImpPrMap =
- ((SvXMLStylesContext *)&xStyles)->GetImportPropertyMapper(
- GetFamily() );
- DBG_ASSERT( xImpPrMap.is(), "There is the import prop mapper" );
- if( xImpPrMap.is() )
- xImpPrMap->FillPropertySet( aProperties, rPropSet );
-}
-
-void XMLPropStyleContext::SetDefaults()
-{
-}
-
-Reference < XStyle > XMLPropStyleContext::Create()
-{
- Reference < XStyle > xNewStyle;
-
- OUString sServiceName(
- ((SvXMLStylesContext *)&xStyles)->GetServiceName( GetFamily() ) );
- if( sServiceName.getLength() )
- {
- Reference< XMultiServiceFactory > xFactory( GetImport().GetModel(),
- UNO_QUERY );
- if( xFactory.is() )
- {
- Reference < XInterface > xIfc =
- xFactory->createInstance( sServiceName );
- if( xIfc.is() )
- xNewStyle = Reference < XStyle >( xIfc, UNO_QUERY );
- }
- }
-
- return xNewStyle;
-}
-
-typedef ::std::set < OUString, ::comphelper::UStringLess > PropertyNameSet;
-
-void XMLPropStyleContext::CreateAndInsert( sal_Bool bOverwrite )
-{
- const OUString& rName = GetName();
- if( 0 == rName.getLength() || IsDefaultStyle() )
- return;
-
- Reference < XNameContainer > xFamilies =
- ((SvXMLStylesContext *)&xStyles)->GetStylesContainer( GetFamily() );
- if( !xFamilies.is() )
- return;
-
- sal_Bool bNew = sal_False;
- if( xFamilies->hasByName( rName ) )
- {
- Any aAny = xFamilies->getByName( rName );
- aAny >>= xStyle;
- }
- else
- {
- xStyle = Create();
- if( !xStyle.is() )
- return;
-
- Any aAny;
- aAny <<= xStyle;
- xFamilies->insertByName( rName, aAny );
- bNew = sal_True;
- }
-
- Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
- if( !bNew && xPropSetInfo->hasPropertyByName( sIsPhysical ) )
- {
- Any aAny = xPropSet->getPropertyValue( sIsPhysical );
- bNew = !*(sal_Bool *)aAny.getValue();
- }
- SetNew( bNew );
-
- if( bOverwrite || bNew )
- {
- Reference< XPropertyState > xPropState( xPropSet, uno::UNO_QUERY );
-
- UniReference < XMLPropertySetMapper > xPrMap;
- UniReference < SvXMLImportPropertyMapper > xImpPrMap =
- ((SvXMLStylesContext *)&xStyles)->GetImportPropertyMapper(
- GetFamily() );
- DBG_ASSERT( xImpPrMap.is(), "There is the import prop mapper" );
- if( xImpPrMap.is() )
- xPrMap = xImpPrMap->getPropertySetMapper();
- if( xPrMap.is() )
- {
- Reference < XMultiPropertyStates > xMultiStates( xPropSet,
- UNO_QUERY );
- if( xMultiStates.is() )
- {
- xMultiStates->setAllPropertiesToDefault();
- }
- else
- {
- PropertyNameSet aNameSet;
- sal_Int32 nCount = xPrMap->GetEntryCount();
- sal_Int32 i;
- for( i = 0; i < nCount; i++ )
- {
- const OUString& rName = xPrMap->GetEntryAPIName( i );
- if( xPropSetInfo->hasPropertyByName( rName ) )
- aNameSet.insert( rName );
- }
-
- nCount = aNameSet.size();
- Sequence < OUString > aNames( nCount );
- OUString *pNames = aNames.getArray();
- PropertyNameSet::iterator aIter = aNameSet.begin();
- while( aIter != aNameSet.end() )
- *pNames++ = *aIter++;
-
- Sequence < PropertyState > aStates(
- xPropState->getPropertyStates( aNames ) );
- const PropertyState *pStates = aStates.getConstArray();
- pNames = aNames.getArray();
-
- for( i = 0; i < nCount; i++ )
- {
- if( PropertyState_DIRECT_VALUE == *pStates++ )
- xPropState->setPropertyToDefault( pNames[i] );
- }
- }
- }
-
- if (xStyle.is())
- xStyle->setParentStyle(OUString());
-
- FillPropertySet( xPropSet );
- }
- else
- {
- SetValid( sal_False );
- }
-}
-
-void XMLPropStyleContext::Finish( sal_Bool bOverwrite )
-{
- if( xStyle.is() && (IsNew() || bOverwrite) )
- {
- // The families cintaner must exist
- Reference < XNameContainer > xFamilies =
- ((SvXMLStylesContext *)&xStyles)->GetStylesContainer( GetFamily() );
- DBG_ASSERT( xFamilies.is(), "Families lost" );
- if( !xFamilies.is() )
- return;
-
- // connect parent
- OUString sParent( GetParent() );
- if( sParent.getLength() && !xFamilies->hasByName( sParent ) )
- sParent = OUString();
-
- if( sParent != xStyle->getParentStyle() )
- {
- // this may except if setting the parent style forms a
- // circle in the style depencies; especially if the parent
- // style is the same as the current style
- try
- {
- xStyle->setParentStyle( sParent );
- }
- catch( uno::Exception e )
- {
- // according to the API definition, I would expect a
- // container::NoSuchElementException. But it throws an
- // uno::RuntimeException instead. I catch
- // uno::Exception in order to process both of them.
-
- // We can't set the parent style. For a proper
- // Error-Message, we should pass in the name of the
- // style, as well as the desired parent style.
- Sequence<OUString> aSequence(2);
-
- // getName() throws no non-Runtime exception:
- aSequence[0] = xStyle->getName();
- aSequence[1] = sParent;
-
- GetImport().SetError(
- XMLERROR_FLAG_ERROR | XMLERROR_PARENT_STYLE_NOT_ALLOWED,
- aSequence, e.Message, NULL );
- }
- }
-
- // connect follow
- OUString sFollow( GetFollow() );
- if( !sFollow.getLength() || !xFamilies->hasByName( sFollow ) )
- sFollow = xStyle->getName();
-
- Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
- if( xPropSetInfo->hasPropertyByName( sFollowStyle ) )
- {
- Any aAny = xPropSet->getPropertyValue( sFollowStyle );
- OUString sCurrFollow;
- aAny >>= sCurrFollow;
- if( sCurrFollow != sFollow )
- {
- aAny <<= sFollow;
- xPropSet->setPropertyValue( sFollowStyle, aAny );
- }
- }
- }
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_shadwhdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_shadwhdl.cxx
deleted file mode 100644
index 5daf089bdaa9..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_shadwhdl.cxx
+++ /dev/null
@@ -1,178 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "shadwhdl.hxx"
-
-
-#include <rtl/ustrbuf.hxx>
-
-// --
-
-#include <com/sun/star/table/ShadowFormat.hpp>
-
-#include "xmluconv.hxx"
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLMeasurePropHdl
-//
-
-XMLShadowPropHdl::~XMLShadowPropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLShadowPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- table::ShadowFormat aShadow;
- aShadow.Location = table::ShadowLocation_BOTTOM_RIGHT;
-
- sal_Bool bColorFound = sal_False;
- sal_Bool bOffsetFound = sal_False;
- SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
- Color aColor( 128,128, 128 );
- OUString aToken;
-
- while( aTokenEnum.getNextToken( aToken ) )
- {
- if( IsXMLToken( aToken, XML_NONE ) )
- {
- aShadow.Location = table::ShadowLocation_NONE;
- bRet = sal_True;
- break;
- }
- else if( !bColorFound && aToken.compareToAscii( "#", 1 ) == 0 )
- {
- bRet = rUnitConverter.convertColor( aColor, aToken );
- if( !bRet )
- return sal_False;
-
- bColorFound = sal_True;
- }
- else if( !bOffsetFound )
- {
- sal_Int32 nX = 0, nY = 0;
-
- bRet = rUnitConverter.convertMeasure( nX, aToken );
- if( bRet && aTokenEnum.getNextToken( aToken ) )
- bRet = rUnitConverter.convertMeasure( nY, aToken );
-
- if( bRet )
- {
- if( nX < 0 )
- {
- if( nY < 0 )
- aShadow.Location = table::ShadowLocation_TOP_LEFT;
- else
- aShadow.Location = table::ShadowLocation_BOTTOM_LEFT;
- }
- else
- {
- if( nY < 0 )
- aShadow.Location = table::ShadowLocation_TOP_RIGHT;
- else
- aShadow.Location = table::ShadowLocation_BOTTOM_RIGHT;
- }
-
- if( nX < 0 ) nX *= -1;
- if( nY < 0 ) nY *= -1;
-
- aShadow.ShadowWidth = (nX + nY) >> 1;
- }
- }
- }
-
- if( bRet && ( bColorFound || bOffsetFound ) )
- {
- aShadow.IsTransparent = aColor.GetTransparency() > 0;
- aShadow.Color = aColor.GetColor();
- bRet = sal_True;
- }
-
- rValue <<= aShadow;
-
- return bRet;
-}
-
-sal_Bool XMLShadowPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- OUStringBuffer aOut;
- table::ShadowFormat aShadow;
-
- if( rValue >>= aShadow )
- {
- sal_Int32 nX = 1, nY = 1;
-
- switch( aShadow.Location )
- {
- case table::ShadowLocation_TOP_LEFT:
- nX = -1;
- nY = -1;
- break;
- case table::ShadowLocation_TOP_RIGHT:
- nY = -1;
- break;
- case table::ShadowLocation_BOTTOM_LEFT:
- nX = -1;
- break;
- case table::ShadowLocation_BOTTOM_RIGHT:
- break;
- case table::ShadowLocation_NONE:
- default:
- rStrExpValue = GetXMLToken(XML_NONE);
- return sal_True;
- }
-
- nX *= aShadow.ShadowWidth;
- nY *= aShadow.ShadowWidth;
-
- rUnitConverter.convertColor( aOut, aShadow.Color );
-
- aOut.append( sal_Unicode(' ') );
- rUnitConverter.convertMeasure( aOut, nX );
- aOut.append( sal_Unicode(' ') );
- rUnitConverter.convertMeasure( aOut, nY );
-
- rStrExpValue = aOut.makeStringAndClear();
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_shdwdhdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_shdwdhdl.cxx
deleted file mode 100644
index 3bd79dcda7e1..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_shdwdhdl.cxx
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "shdwdhdl.hxx"
-
-#include <com/sun/star/uno/Any.hxx>
-
-
-// --
-
-#include <xmltoken.hxx>
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::binfilter::xmloff::token;
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLFmtSplitPropHdl
-//
-
-XMLShadowedPropHdl::~XMLShadowedPropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLShadowedPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- sal_Bool bValue = ! IsXMLToken( rStrImpValue, XML_NONE );
- rValue <<= sal_Bool(bValue);
- bRet = sal_True;
-
- return bRet;
-}
-
-sal_Bool XMLShadowedPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Bool bValue;
-
- if (rValue >>= bValue)
- {
- if( bValue )
- {
- rStrExpValue = OUString( RTL_CONSTASCII_USTRINGPARAM( "1pt 1pt" ) );
- }
- else
- {
- rStrExpValue = GetXMLToken( XML_NONE );
- }
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_splithdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_splithdl.cxx
deleted file mode 100644
index 270eed4e042e..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_splithdl.cxx
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "splithdl.hxx"
-
-#include <com/sun/star/uno/Any.hxx>
-
-
-// --
-
-#include <xmltoken.hxx>
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::binfilter::xmloff::token;
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLFmtSplitPropHdl
-//
-
-XMLFmtSplitPropHdl::~XMLFmtSplitPropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLFmtSplitPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bValue = IsXMLToken( rStrImpValue, XML_COLUMNSPLIT_AUTO );
- rValue <<= sal_Bool(bValue);
- return sal_True;
-}
-
-sal_Bool XMLFmtSplitPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Bool bValue;
-
- if (rValue >>= bValue)
- {
- if( bValue )
- {
- rStrExpValue = GetXMLToken( XML_COLUMNSPLIT_AUTO );
- }
- else
- {
- rStrExpValue = GetXMLToken( XML_COLUMNSPLIT_AVOID );
- }
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_styleexp.cxx b/binfilter/bf_xmloff/source/style/xmloff_styleexp.cxx
deleted file mode 100644
index c70fe2906a11..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_styleexp.cxx
+++ /dev/null
@@ -1,413 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-#ifndef _SVSTDARR_STRINGSSORTDTOR_DECL
-#define _SVSTDARR_STRINGSSORTDTOR
-#include <bf_svtools/svstdarr.hxx>
-#endif
-
-#include "xmlnmspe.hxx"
-
-#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-#include <com/sun/star/style/XStyle.hpp>
-#include <com/sun/star/beans/XPropertyState.hpp>
-#include <com/sun/star/document/XEventsSupplier.hpp>
-
-#include "xmlaustp.hxx"
-#include "xmlexp.hxx"
-#include "XMLEventExport.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
-
-using rtl::OUString;
-//using namespace ::com::sun::star::text;
-using namespace ::binfilter::xmloff::token;
-
-using ::com::sun::star::document::XEventsSupplier;
-
-XMLStyleExport::XMLStyleExport(
- SvXMLExport& rExp,
- const ::rtl::OUString& rPoolStyleName,
- SvXMLAutoStylePoolP *pAutoStyleP ) :
- rExport( rExp ),
- sIsPhysical( RTL_CONSTASCII_USTRINGPARAM( "IsPhysical" ) ),
- sFollowStyle( RTL_CONSTASCII_USTRINGPARAM( "FollowStyle" ) ),
- sNumberingStyleName( RTL_CONSTASCII_USTRINGPARAM( "NumberingStyleName" ) ),
- sIsAutoUpdate( RTL_CONSTASCII_USTRINGPARAM( "IsAutoUpdate" ) ),
- sPoolStyleName( rPoolStyleName ),
- pAutoStylePool( pAutoStyleP )
-{
-}
-
-XMLStyleExport::~XMLStyleExport()
-{
-}
-
-void XMLStyleExport::exportStyleAttributes( const Reference< XStyle >& rStyle )
-{
-}
-
-void XMLStyleExport::exportStyleContent( const Reference< XStyle >& rStyle )
-{
-}
-
-sal_Bool XMLStyleExport::exportStyle(
- const Reference< XStyle >& rStyle,
- const OUString& rXMLFamily,
- const UniReference < SvXMLExportPropertyMapper >& rPropMapper,
- const OUString* pPrefix )
-{
- Reference< XPropertySet > xPropSet( rStyle, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
-
- Any aAny;
-
- // Don't export styles that aren't existing really. This may be the
- // case for StarOffice Writer's pool styles.
- if( xPropSetInfo->hasPropertyByName( sIsPhysical ) )
- {
- aAny = xPropSet->getPropertyValue( sIsPhysical );
- if( !*(sal_Bool *)aAny.getValue() )
- return sal_False;
- }
-
- // <style:style ...>
- GetExport().CheckAttrList();
-
- // style:name="..."
- OUString sName;
-
- if(pPrefix)
- sName = *pPrefix;
- sName += rStyle->getName();
-
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NAME, sName );
-
- // style:family="..."
- if( rXMLFamily.getLength() > 0 )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_FAMILY, rXMLFamily);
-
- // style:parent-style-name="..."
- OUString sParentString(rStyle->getParentStyle());
- OUString sParent;
-
- if(sParentString.getLength())
- {
- if(pPrefix)
- sParent = *pPrefix;
- sParent += sParentString;
- }
- else
- sParent = sPoolStyleName;
-
- if( sParent.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_PARENT_STYLE_NAME,
- sParent );
-
- // style:next-style-name="..." (paragraph styles only)
- if( xPropSetInfo->hasPropertyByName( sFollowStyle ) )
- {
- aAny = xPropSet->getPropertyValue( sFollowStyle );
- OUString sNextName;
- aAny >>= sNextName;
- if( sName != sNextName )
- {
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NEXT_STYLE_NAME,
- sNextName );
- }
- }
-
- // style:auto-update="..." (SW only)
- if( xPropSetInfo->hasPropertyByName( sIsAutoUpdate ) )
- {
- aAny = xPropSet->getPropertyValue( sIsAutoUpdate );
- if( *(sal_Bool *)aAny.getValue() )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_AUTO_UPDATE,
- XML_TRUE );
- }
-
- // style:list-style-name="..." (SW paragarph styles only)
- if( xPropSetInfo->hasPropertyByName( sNumberingStyleName ) )
- {
- Reference< XPropertyState > xPropState( xPropSet, uno::UNO_QUERY );
- if( PropertyState_DIRECT_VALUE ==
- xPropState->getPropertyState( sNumberingStyleName ) )
- {
- aAny = xPropSet->getPropertyValue( sNumberingStyleName );
- if( aAny.hasValue() )
- {
- OUString sListName;
- aAny >>= sListName;
- if( sListName.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_LIST_STYLE_NAME,
- sListName );
- }
- }
- }
-
- // style:pool-id="..." is not required any longer since we use
- // english style names only
- exportStyleAttributes( rStyle );
-
- // TODO: style:help-file-name="..." and style:help-id="..." can neither
- // be modified by UI nor by API and that for, have not to be exported
- // currently.
-
- {
- // <style:style>
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, XML_STYLE,
- sal_True, sal_True );
- // <style:properties>
- ::std::vector< XMLPropertyState > xPropStates =
- rPropMapper->Filter( xPropSet );
- rPropMapper->exportXML( GetExport(), xPropStates,
- XML_EXPORT_FLAG_IGN_WS );
- exportStyleContent( rStyle );
-
- // <script:events>, if they are supported by this style
- Reference<XEventsSupplier> xEventsSupp(rStyle, UNO_QUERY);
- GetExport().GetEventExport().Export(xEventsSupp);
- }
- return sal_True;
-}
-
-sal_Bool XMLStyleExport::exportDefaultStyle(
- const Reference< XPropertySet >& xPropSet,
- const OUString& rXMLFamily,
- const UniReference < SvXMLExportPropertyMapper >& rPropMapper )
-{
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
-
- Any aAny;
-
- // <style:default-style ...>
- GetExport().CheckAttrList();
-
- {
- // style:family="..."
- if( rXMLFamily.getLength() > 0 )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_FAMILY,
- rXMLFamily );
- // <style:style>
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
- XML_DEFAULT_STYLE,
- sal_True, sal_True );
- // <style:properties>
- //::std::vector< XMLPropertyState > xPropStates =
- // rPropMapper->FilterDefaults( xPropSet );
- ::std::vector< XMLPropertyState > xPropStates =
- rPropMapper->FilterDefaults( xPropSet );
- rPropMapper->exportXML( GetExport(), xPropStates,
- XML_EXPORT_FLAG_IGN_WS );
-// exportStyleContent( rStyle );
- }
- return sal_True;
-}
-
-#if 0
-void XMLStyleExport::exportStyleFamily(
- const sal_Char *pFamily,
- const OUString& rXMLFamily,
- const UniReference < XMLPropertySetMapper >& rPropMapper,
- sal_Bool bUsed, sal_uInt16 nFamily, const OUString* pPrefix)
-{
- const OUString sFamily(OUString::createFromAscii(pFamily ));
- UniReference < SvXMLExportPropertyMapper > xExpPropMapper =
- new SvXMLExportPropertyMapper( rPropMapper );
- exportStyleFamily( sFamily, rXMLFamily, xExpPropMapper, bUsed, nFamily,
- pPrefix);
-}
-
-void XMLStyleExport::exportStyleFamily(
- const OUString& rFamily, const OUString& rXMLFamily,
- const UniReference < XMLPropertySetMapper >& rPropMapper,
- sal_Bool bUsed, sal_uInt16 nFamily, const OUString* pPrefix)
-{
- UniReference < SvXMLExportPropertyMapper > xExpPropMapper =
- new SvXMLExportPropertyMapper( rPropMapper );
- exportStyleFamily( rFamily, rXMLFamily, xExpPropMapper, bUsed, nFamily,
- pPrefix);
-}
-#endif
-
-void XMLStyleExport::exportStyleFamily(
- const sal_Char *pFamily,
- const OUString& rXMLFamily,
- const UniReference < SvXMLExportPropertyMapper >& rPropMapper,
- sal_Bool bUsed, sal_uInt16 nFamily, const OUString* pPrefix)
-{
- const OUString sFamily(OUString::createFromAscii(pFamily ));
- exportStyleFamily( sFamily, rXMLFamily, rPropMapper, bUsed, nFamily,
- pPrefix);
-}
-
-void XMLStyleExport::exportStyleFamily(
- const OUString& rFamily, const OUString& rXMLFamily,
- const UniReference < SvXMLExportPropertyMapper >& rPropMapper,
- sal_Bool bUsed, sal_uInt16 nFamily, const OUString* pPrefix)
-{
- DBG_ASSERT( GetExport().GetModel().is(), "There is the model?" );
- Reference< XStyleFamiliesSupplier > xFamiliesSupp( GetExport().GetModel(),
- UNO_QUERY );
- Reference< XNameAccess > xStyleCont;
-
- Reference< XNameAccess > xFamilies( xFamiliesSupp->getStyleFamilies() );
- if( xFamilies->hasByName( rFamily ) )
- xFamilies->getByName( rFamily ) >>= xStyleCont;
-
- if( !xStyleCont.is() )
- return;
-
- Reference< XIndexAccess > xStyles( xStyleCont, UNO_QUERY );
- const sal_Int32 nStyles = xStyles->getCount();
-
- // If next styles are supported and used styles should be exported only,
- // the next style may be unused but has to be exported, too. In this case
- // the names of all exported styles are remembered.
- SvStringsSortDtor *pExportedStyles = 0;
- sal_Bool bFirstStyle = sal_True;
- sal_Int32 i;
-
- for( i=0; i < nStyles; i++ )
- {
- Reference< XStyle > xStyle;
- try
- {
- xStyles->getByIndex( i ) >>= xStyle;
- }
- catch( lang::IndexOutOfBoundsException )
- {
- // due to bugs in prior versions it is possible that
- // a binary file is missing some critical styles.
- // The only possible way to deal with this is to
- // not export them here and remain silent.
- continue;
- }
-
- DBG_ASSERT( xStyle.is(), "Style not found for export!" );
- if( xStyle.is() )
- {
- if( !bUsed || xStyle->isInUse() )
- {
- BOOL bExported = exportStyle( xStyle, rXMLFamily, rPropMapper,
- pPrefix );
- if( bUsed && bFirstStyle && bExported )
- {
- // If this is the first style, find out wether next styles
- // are supported.
- Reference< XPropertySet > xPropSet( xStyle, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
-
- if( xPropSetInfo->hasPropertyByName( sFollowStyle ) )
- pExportedStyles = new SvStringsSortDtor;
- bFirstStyle = sal_False;
- }
-
- if( pExportedStyles && bExported )
- {
- // If next styles are supported, remember this style's name.
- String *pTmp = new String( xStyle->getName() );
- if( !pExportedStyles->Insert( pTmp ) )
- delete pTmp;
- }
- }
-
- // if an auto style pool is given, remember this style's name as a
- // style name that must not be used by automatic styles.
- if( pAutoStylePool )
- pAutoStylePool->RegisterName( nFamily, xStyle->getName() );
- }
- }
-
- if( pExportedStyles )
- {
- // if next styles are supported, export all next styles that are
- // unused and that for, haven't been exported in the first loop.
- for( i=0; i < nStyles; i++ )
- {
- Reference< XStyle > xStyle;
- xStyles->getByIndex( i ) >>= xStyle;
-
- DBG_ASSERT( xStyle.is(), "Style not found for export!" );
- if( xStyle.is() )
- {
- Reference< XPropertySet > xPropSet( xStyle, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
-
- // styles that aren't existing realy are ignored.
- if( xPropSetInfo->hasPropertyByName( sIsPhysical ) )
- {
- Any aAny( xPropSet->getPropertyValue( sIsPhysical ) );
- if( !*(sal_Bool *)aAny.getValue() )
- continue;
- }
-
- if( !xStyle->isInUse() )
- continue;
-
- if( !xPropSetInfo->hasPropertyByName( sFollowStyle ) )
- {
- DBG_ASSERT( 0==sFollowStyle.getLength(),
- "no follow style???" );
- continue;
- }
-
- OUString sNextName;
- xPropSet->getPropertyValue( sFollowStyle ) >>= sNextName;
- String sTmp( sNextName );
- // if the next style hasn't been exported by now, export it now
- // and remember its name.
- if( xStyle->getName() != sNextName &&
- !pExportedStyles->Seek_Entry( &sTmp ) )
- {
- xStyleCont->getByName( sNextName ) >>= xStyle;
- DBG_ASSERT( xStyle.is(), "Style not found for export!" );
-
- if( xStyle.is() && exportStyle( xStyle, rXMLFamily, rPropMapper, pPrefix ) )
- pExportedStyles->Insert( new String( sTmp ) );
- }
- }
- }
- }
-
- delete pExportedStyles;
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_tabsthdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_tabsthdl.cxx
deleted file mode 100644
index 633dad39c436..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_tabsthdl.cxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tabsthdl.hxx>
-
-#include <com/sun/star/uno/Sequence.hxx>
-
-#include <com/sun/star/style/TabStop.hpp>
-namespace binfilter {
-
-using namespace ::com::sun::star;
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLFontFamilyNamePropHdl
-//
-
-XMLTabStopPropHdl::~XMLTabStopPropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLTabStopPropHdl::equals( const uno::Any& r1, const uno::Any& r2 ) const
-{
- sal_Bool bEqual = sal_False;
-
- uno::Sequence< style::TabStop> aSeq1;
- if( r1 >>= aSeq1 )
- {
- uno::Sequence< style::TabStop> aSeq2;
- if( r2 >>= aSeq2 )
- {
- if( aSeq1.getLength() == aSeq2.getLength() )
- {
- bEqual = sal_True;
- if( aSeq1.getLength() > 0 )
- {
- const style::TabStop* pTabs1 = aSeq1.getConstArray();
- const style::TabStop* pTabs2 = aSeq2.getConstArray();
-
- int i=0;
-
- do
- {
- bEqual = ( pTabs1[i].Position == pTabs2[i].Position &&
- pTabs1[i].Alignment == pTabs2[i].Alignment &&
- pTabs1[i].DecimalChar == pTabs2[i].DecimalChar &&
- pTabs1[i].FillChar == pTabs2[i].FillChar );
- i++;
-
- } while( bEqual && i < aSeq1.getLength() );
- }
- }
- }
- }
-
- return bEqual;
-}
-
-sal_Bool XMLTabStopPropHdl::importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- return sal_False;
-}
-
-sal_Bool XMLTabStopPropHdl::exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- return sal_False;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_undlihdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_undlihdl.cxx
deleted file mode 100644
index f01c71c49a61..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_undlihdl.cxx
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <undlihdl.hxx>
-
-
-#include "xmluconv.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-
-#include <com/sun/star/awt/FontUnderline.hpp>
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::awt;
-using namespace ::binfilter::xmloff::token;
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_Underline_Enum[] =
-{
- { XML_UNDERLINE_NONE, FontUnderline::NONE },
- { XML_UNDERLINE_SINGLE, FontUnderline::SINGLE },
- { XML_UNDERLINE_DOUBLE, FontUnderline::DOUBLE },
- { XML_UNDERLINE_DOTTED, FontUnderline::DOTTED },
- { XML_UNDERLINE_DASH, FontUnderline::DASH },
- { XML_UNDERLINE_LONG_DASH, FontUnderline::LONGDASH },
- { XML_UNDERLINE_DOT_DASH, FontUnderline::DASHDOT },
- { XML_UNDERLINE_DOT_DOT_DASH, FontUnderline::DASHDOTDOT },
- { XML_UNDERLINE_WAVE, FontUnderline::WAVE },
- { XML_UNDERLINE_BOLD, FontUnderline::BOLD },
- { XML_UNDERLINE_BOLD_DOTTED, FontUnderline::BOLDDOTTED },
- { XML_UNDERLINE_BOLD_DASH, FontUnderline::BOLDDASH },
- { XML_UNDERLINE_BOLD_LONG_DASH, FontUnderline::BOLDLONGDASH },
- { XML_UNDERLINE_BOLD_DOT_DASH, FontUnderline::BOLDDASHDOT },
- { XML_UNDERLINE_BOLD_DOT_DOT_DASH, FontUnderline::BOLDDASHDOTDOT },
- { XML_UNDERLINE_BOLD_WAVE, FontUnderline::BOLDWAVE },
- { XML_UNDERLINE_DOUBLE_WAVE, FontUnderline::DOUBLEWAVE },
- { XML_UNDERLINE_SMALL_WAVE, FontUnderline::SMALLWAVE },
- { XML_TOKEN_INVALID, 0 }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLPosturePropHdl
-//
-
-XMLUnderlinePropHdl::~XMLUnderlinePropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLUnderlinePropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_uInt16 eUnderline;
-
- if( ( bRet = rUnitConverter.convertEnum( eUnderline, rStrImpValue, pXML_Underline_Enum ) ) )
- rValue <<= (sal_Int16)eUnderline;
-
- return bRet;
-}
-
-sal_Bool XMLUnderlinePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int16 nValue;
- OUStringBuffer aOut;
-
- if( rValue >>= nValue )
- {
- if( ( bRet = rUnitConverter.convertEnum( aOut, (sal_uInt16)nValue,
- pXML_Underline_Enum ) ) )
- rStrExpValue = aOut.makeStringAndClear();
- }
-
- return bRet;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_uniref.cxx b/binfilter/bf_xmloff/source/style/xmloff_uniref.cxx
deleted file mode 100644
index a339533bbe98..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_uniref.cxx
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "uniref.hxx"
-namespace binfilter {
-
-UniRefBase::~UniRefBase()
-{
-}
-
-void UniRefBase::release()
-{
- if( !osl_decrementInterlockedCount( &m_refCount ) )
- delete this;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_weighhdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_weighhdl.cxx
deleted file mode 100644
index ceecb82444e6..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_weighhdl.cxx
+++ /dev/null
@@ -1,182 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <weighhdl.hxx>
-
-
-#include "xmluconv.hxx"
-
-
-#include <tools/solar.h>
-
-#ifndef _INC_LIMITS
-#include <limits.h>
-#endif
-
-#include <rtl/ustrbuf.hxx>
-
-#include "rtl/ustring.hxx"
-
-#include <toolkit/unohlp.hxx>
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::binfilter::xmloff::token;
-
-struct FontWeightMapper
-{
- FontWeight eWeight;
- USHORT nValue;
-};
-
-FontWeightMapper const aFontWeightMap[] =
-{
- { WEIGHT_DONTKNOW, 0 },
- { WEIGHT_THIN, 100 },
- { WEIGHT_ULTRALIGHT, 150 },
- { WEIGHT_LIGHT, 250 },
- { WEIGHT_SEMILIGHT, 350 },
- { WEIGHT_NORMAL, 400 },
- { WEIGHT_MEDIUM, 450 },
- { WEIGHT_SEMIBOLD, 600 },
- { WEIGHT_BOLD, 700 },
- { WEIGHT_ULTRABOLD, 800 },
- { WEIGHT_BLACK, 900 },
- { (FontWeight)USHRT_MAX, 1000 }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLFmtBreakBeforePropHdl
-//
-
-XMLFontWeightPropHdl::~XMLFontWeightPropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLFontWeightPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_uInt16 nWeight = 0;
-
- if( IsXMLToken( rStrImpValue, XML_WEIGHT_NORMAL ) )
- {
- nWeight = 400;
- bRet = sal_True;
- }
- else if( IsXMLToken( rStrImpValue, XML_WEIGHT_BOLD ) )
- {
- nWeight = 700;
- bRet = sal_True;
- }
- else
- {
- sal_Int32 nTemp;
- if( ( bRet = rUnitConverter.convertNumber( nTemp, rStrImpValue, 100, 900 ) ) )
- nWeight = nTemp;
- }
-
- if( bRet )
- {
- bRet = sal_False;
-
- for( int i = 0; aFontWeightMap[i].eWeight != USHRT_MAX; i++ )
- {
- if( (nWeight >= aFontWeightMap[i].nValue) && (nWeight <= aFontWeightMap[i+1].nValue) )
- {
- sal_uInt16 nDiff1 = nWeight - aFontWeightMap[i].nValue;
- sal_uInt16 nDiff2 = aFontWeightMap[i+1].nValue - nWeight;
-
- if( nDiff1 < nDiff2 )
- rValue <<= (float)( VCLUnoHelper::ConvertFontWeight( aFontWeightMap[i].eWeight ) );
- else
- rValue <<= (float)( VCLUnoHelper::ConvertFontWeight( aFontWeightMap[i+1].eWeight ) );
-
- bRet = sal_True;
- break;
- }
- }
- }
-
- return bRet;
-}
-
-sal_Bool XMLFontWeightPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- FontWeight eWeight;
-
- float fValue = float();
- if( !( rValue >>= fValue ) )
- {
- sal_Int32 nValue;
- if( rValue >>= nValue )
- {
- fValue = (float)nValue;
- bRet = sal_True;
- }
- }
- else
- bRet = sal_True;
-
- eWeight = VCLUnoHelper::ConvertFontWeight( fValue );
-
- if( bRet )
- {
- sal_uInt16 nWeight = 0;
-
- for( int i = 0; aFontWeightMap[i].eWeight != -1; i++ )
- {
- if( aFontWeightMap[i].eWeight == eWeight )
- {
- nWeight = aFontWeightMap[i].nValue;
- break;
- }
- }
-
- OUStringBuffer aOut;
-
- if( 400 == nWeight )
- aOut.append( GetXMLToken(XML_WEIGHT_NORMAL) );
- else if( 700 == nWeight )
- aOut.append( GetXMLToken(XML_WEIGHT_BOLD) );
- else
- rUnitConverter.convertNumber( aOut, (sal_Int32)nWeight );
-
- rStrExpValue = aOut.makeStringAndClear();
- }
-
- return bRet;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_xmlaustp.cxx b/binfilter/bf_xmloff/source/style/xmloff_xmlaustp.cxx
deleted file mode 100644
index dde02a2df8a5..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_xmlaustp.cxx
+++ /dev/null
@@ -1,365 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <com/sun/star/container/XIndexReplace.hpp>
-
-#include <tools/debug.hxx>
-#include "impastpl.hxx"
-#include "xmlnmspe.hxx"
-#include "xmlexp.hxx"
-
-#include "XMLTextListAutoStylePool.hxx"
-
-#include "PageMasterStyleMap.hxx"
-namespace binfilter {
-
-
-using namespace ::std;
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-
-namespace
-{
- static void lcl_exportDataStyle( SvXMLExport& _rExport, const UniReference< XMLPropertySetMapper >& _rxMapper,
- const XMLPropertyState& _rProperty )
- {
- DBG_ASSERT( _rxMapper.is(), "xmloff::lcl_exportDataStyle: invalid property mapper!" );
- // obtain the data style name
- ::rtl::OUString sDataStyleName;
- _rProperty.maValue >>= sDataStyleName;
- DBG_ASSERT( sDataStyleName.getLength(), "xmloff::lcl_exportDataStyle: invalid property value for the data style name!" );
-
- // add the attribute
- _rExport.AddAttribute(
- _rxMapper->GetEntryNameSpace( _rProperty.mnIndex ),
- _rxMapper->GetEntryXMLName( _rProperty.mnIndex ),
- sDataStyleName );
- }
-}
-
-void SvXMLAutoStylePoolP::exportStyleAttributes(
- SvXMLAttributeList& rAttrList,
- sal_Int32 nFamily,
- const vector< XMLPropertyState >& rProperties,
- const SvXMLExportPropertyMapper& rPropExp,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap
- ) const
-{
- if ( XML_STYLE_FAMILY_CONTROL_ID == nFamily )
- { // it's a control-related style
- UniReference< XMLPropertySetMapper > aPropertyMapper = rPropExp.getPropertySetMapper();
-
- for ( vector< XMLPropertyState >::const_iterator pProp = rProperties.begin();
- pProp != rProperties.end();
- ++pProp
- )
- {
- if ( ( pProp->mnIndex > -1 )
- && ( CTF_FORMS_DATA_STYLE == aPropertyMapper->GetEntryContextId( pProp->mnIndex ) )
- )
- { // it's the data-style for a grid column
- lcl_exportDataStyle( GetExport(), aPropertyMapper, *pProp );
- }
- }
- }
-
- if( (XML_STYLE_FAMILY_SD_GRAPHICS_ID == nFamily) || (XML_STYLE_FAMILY_SD_PRESENTATION_ID == nFamily) )
- { // it's a graphics style
- UniReference< XMLPropertySetMapper > aPropertyMapper = rPropExp.getPropertySetMapper();
- DBG_ASSERT(aPropertyMapper.is(), "SvXMLAutoStylePoolP::exportStyleAttributes: invalid property set mapper!");
-
- sal_Bool bFoundControlShapeDataStyle = sal_False;
- sal_Bool bFoundNumberingRulesName = sal_False;
-
- for ( vector< XMLPropertyState >::const_iterator pProp = rProperties.begin();
- pProp != rProperties.end();
- ++pProp
- )
- {
- if (pProp->mnIndex > -1)
- { // it's a valid property
- switch( aPropertyMapper->GetEntryContextId(pProp->mnIndex) )
- {
- case CTF_SD_CONTROL_SHAPE_DATA_STYLE:
- { // it's the control shape data style property
-
- if (bFoundControlShapeDataStyle)
- {
- DBG_ERROR("SvXMLAutoStylePoolP::exportStyleAttributes: found two properties with the ControlShapeDataStyle context id!");
- // already added the attribute for the first occurence
- break;
- }
-
- lcl_exportDataStyle( GetExport(), aPropertyMapper, *pProp );
-
- // check if there is another property with the special context id we're handling here
- bFoundControlShapeDataStyle = sal_True;
- break;
- }
- case CTF_SD_NUMBERINGRULES_NAME:
- {
- if (bFoundNumberingRulesName)
- {
- DBG_ERROR("SvXMLAutoStylePoolP::exportStyleAttributes: found two properties with the numbering rules name context id!");
- // already added the attribute for the first occurence
- break;
- }
-
- uno::Reference< container::XIndexReplace > xNumRule;
- pProp->maValue >>= xNumRule;
- if( xNumRule.is() && (xNumRule->getCount() > 0 ) )
- {
- const OUString sName(((XMLTextListAutoStylePool*)&GetExport().GetTextParagraphExport()->GetListAutoStylePool())->Add( xNumRule ));
-
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_LIST_STYLE_NAME, sName );
- }
-
- bFoundNumberingRulesName = sal_True;
- break;
- }
- }
- }
- }
- }
-
- if( nFamily == XML_STYLE_FAMILY_PAGE_MASTER )
- {
- for( vector< XMLPropertyState >::const_iterator pProp = rProperties.begin(); pProp != rProperties.end(); pProp++ )
- {
- if (pProp->mnIndex > -1)
- {
- UniReference< XMLPropertySetMapper > aPropMapper = rPropExp.getPropertySetMapper();
- sal_Int32 nIndex = pProp->mnIndex;
- sal_Int16 nContextID = aPropMapper->GetEntryContextId( nIndex );
- switch( nContextID )
- {
- case CTF_PM_PAGEUSAGE:
- {
- OUString sValue;
- const XMLPropertyHandler* pPropHdl = aPropMapper->GetPropertyHandler( nIndex );
- if( pPropHdl &&
- pPropHdl->exportXML( sValue, pProp->maValue,
- GetExport().GetMM100UnitConverter() ) &&
- ( ! IsXMLToken( sValue, XML_ALL ) ) )
- {
- GetExport().AddAttribute( aPropMapper->GetEntryNameSpace( nIndex ), aPropMapper->GetEntryXMLName( nIndex ), sValue );
- }
- }
- break;
- }
- }
- }
- }
-}
-
-void SvXMLAutoStylePoolP::exportStyleContent(
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
- sal_Int32 nFamily,
- const vector< XMLPropertyState >& rProperties,
- const SvXMLExportPropertyMapper& rPropExp,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap
- ) const
-{
- if( nFamily == XML_STYLE_FAMILY_PAGE_MASTER )
- {
- OUString sWS( GetXMLToken(XML_WS) );
-
- sal_Int32 nHeaderStartIndex(-1);
- sal_Int32 nHeaderEndIndex(-1);
- sal_Int32 nFooterStartIndex(-1);
- sal_Int32 nFooterEndIndex(-1);
- sal_Bool bHeaderStartIndex(sal_False);
- sal_Bool bHeaderEndIndex(sal_False);
- sal_Bool bFooterStartIndex(sal_False);
- sal_Bool bFooterEndIndex(sal_False);
-
- UniReference< XMLPropertySetMapper > aPropMapper = rPropExp.getPropertySetMapper();
-
- sal_Int32 nIndex(0);
- while(nIndex < aPropMapper->GetEntryCount())
- {
- switch( aPropMapper->GetEntryContextId( nIndex ) & CTF_PM_FLAGMASK )
- {
- case CTF_PM_HEADERFLAG:
- {
- if (!bHeaderStartIndex)
- {
- nHeaderStartIndex = nIndex;
- bHeaderStartIndex = sal_True;
- }
- if (bFooterStartIndex && !bFooterEndIndex)
- {
- nFooterEndIndex = nIndex;
- bFooterEndIndex = sal_True;
- }
- }
- break;
- case CTF_PM_FOOTERFLAG:
- {
- if (!bFooterStartIndex)
- {
- nFooterStartIndex = nIndex;
- bFooterStartIndex = sal_True;
- }
- if (bHeaderStartIndex && !bHeaderEndIndex)
- {
- nHeaderEndIndex = nIndex;
- bHeaderEndIndex = sal_True;
- }
- }
- break;
- }
- nIndex++;
- }
- if (!bHeaderEndIndex)
- nHeaderEndIndex = nIndex;
- if (!bFooterEndIndex)
- nFooterEndIndex = nIndex;
-
- // export header style element
- {
- SvXMLElementExport aElem(
- GetExport(), XML_NAMESPACE_STYLE, XML_HEADER_STYLE,
- sal_True, sal_True );
-
- rPropExp.exportXML(
- GetExport(), rProperties,
- nHeaderStartIndex, nHeaderEndIndex, XML_EXPORT_FLAG_IGN_WS);
- }
-
- // export footer style
- {
- SvXMLElementExport aElem(
- GetExport(), XML_NAMESPACE_STYLE, XML_FOOTER_STYLE,
- sal_True, sal_True );
-
- rPropExp.exportXML(
- GetExport(), rProperties,
- nFooterStartIndex, nFooterEndIndex, XML_EXPORT_FLAG_IGN_WS);
- }
- }
-}
-
-SvXMLAutoStylePoolP::SvXMLAutoStylePoolP( SvXMLExport& rExport )
-{
- pImpl = new SvXMLAutoStylePoolP_Impl( rExport );
-}
-
-SvXMLAutoStylePoolP::~SvXMLAutoStylePoolP()
-{
- delete pImpl;
-}
-
-SvXMLExport& SvXMLAutoStylePoolP::GetExport() const
-{
- return pImpl->GetExport();
-}
-
-// TODO: romove this
-void SvXMLAutoStylePoolP::AddFamily(
- sal_Int32 nFamily,
- const OUString& rStrName,
- SvXMLExportPropertyMapper* pMapper,
- OUString aStrPrefix,
- sal_Bool bAsFamily )
-{
- UniReference <SvXMLExportPropertyMapper> xTmp = pMapper;
- AddFamily( nFamily, rStrName, xTmp, aStrPrefix, bAsFamily );
-}
-
-void SvXMLAutoStylePoolP::AddFamily(
- sal_Int32 nFamily,
- const OUString& rStrName,
- const UniReference < SvXMLExportPropertyMapper > & rMapper,
- const OUString& rStrPrefix,
- sal_Bool bAsFamily )
-{
- pImpl->AddFamily( nFamily, rStrName, rMapper, rStrPrefix, bAsFamily );
-}
-
-void SvXMLAutoStylePoolP::RegisterName( sal_Int32 nFamily,
- const OUString& rName )
-{
- pImpl->RegisterName( nFamily, rName );
-}
-
-OUString SvXMLAutoStylePoolP::Add( sal_Int32 nFamily,
- const vector< XMLPropertyState >& rProperties )
-{
- OUString sEmpty;
- OUString sName;
- pImpl->Add(sName, nFamily, sEmpty, rProperties );
- return sName;
-}
-
-OUString SvXMLAutoStylePoolP::Add( sal_Int32 nFamily,
- const OUString& rParent,
- const vector< XMLPropertyState >& rProperties )
-{
- OUString sName;
- pImpl->Add(sName, nFamily, rParent, rProperties );
- return sName;
-}
-
-sal_Bool SvXMLAutoStylePoolP::Add(OUString& rName, sal_Int32 nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties )
-{
- return pImpl->Add(rName, nFamily, rParent, rProperties);
-}
-
-OUString SvXMLAutoStylePoolP::Find( sal_Int32 nFamily,
- const OUString& rParent,
- const vector< XMLPropertyState >& rProperties ) const
-{
- return pImpl->Find( nFamily, rParent, rProperties );
-}
-
-void SvXMLAutoStylePoolP::exportXML( sal_Int32 nFamily,
- const uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap
- ) const
-{
- pImpl->exportXML( nFamily,
- GetExport().GetDocHandler(),
- GetExport().GetMM100UnitConverter(),
- GetExport().GetNamespaceMap(),
- this);
-}
-
-void SvXMLAutoStylePoolP::ClearEntries()
-{
- pImpl->ClearEntries();
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_xmlbahdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_xmlbahdl.cxx
deleted file mode 100644
index 1723c119ab70..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_xmlbahdl.cxx
+++ /dev/null
@@ -1,710 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-#include <xmlbahdl.hxx>
-
-#include "xmluconv.hxx"
-
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::binfilter::xmloff::token;
-
-void lcl_xmloff_setAny( Any& rValue, sal_Int32 nValue, sal_Int8 nBytes )
-{
- switch( nBytes )
- {
- case 1:
- if( nValue < SCHAR_MIN )
- nValue = SCHAR_MIN;
- else if( nValue > SCHAR_MAX )
- nValue = SCHAR_MAX;
- rValue <<= (sal_Int8)nValue;
- break;
- case 2:
- if( nValue < SHRT_MIN )
- nValue = SHRT_MIN;
- else if( nValue > SHRT_MAX )
- nValue = SHRT_MAX;
- rValue <<= (sal_Int16)nValue;
- break;
- case 4:
- rValue <<= nValue;
- break;
- }
-}
-
-sal_Bool lcl_xmloff_getAny( const Any& rValue, sal_Int32& nValue,
- sal_Int8 nBytes )
-{
- sal_Bool bRet = sal_False;
-
- switch( nBytes )
- {
- case 1:
- {
- sal_Int8 nValue8;
- bRet = rValue >>= nValue8;
- nValue = nValue8;
- }
- break;
- case 2:
- {
- sal_Int16 nValue16;
- bRet = rValue >>= nValue16;
- nValue = nValue16;
- }
- break;
- case 4:
- bRet = rValue >>= nValue;
- break;
- }
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLNumberPropHdl
-//
-
-XMLNumberPropHdl::~XMLNumberPropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLNumberPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- sal_Int32 nValue = 0;
- bRet = rUnitConverter.convertNumber( nValue, rStrImpValue );
- lcl_xmloff_setAny( rValue, nValue, nBytes );
-
- return bRet;
-}
-
-sal_Bool XMLNumberPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int32 nValue;
- OUStringBuffer aOut;
-
- if( lcl_xmloff_getAny( rValue, nValue, nBytes ) )
- {
- rUnitConverter.convertNumber( aOut, nValue );
- rStrExpValue = aOut.makeStringAndClear();
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// class XMLNumberNonePropHdl
-//
-
-XMLNumberNonePropHdl::XMLNumberNonePropHdl( sal_Int8 nB ) :
- sZeroStr( GetXMLToken(XML_NO_LIMIT) ),
- nBytes( nB )
-{
-}
-
-XMLNumberNonePropHdl::XMLNumberNonePropHdl( enum XMLTokenEnum eZeroString, sal_Int8 nB ) :
- sZeroStr( GetXMLToken( eZeroString ) ),
- nBytes( nB )
-{
-}
-
-XMLNumberNonePropHdl::~XMLNumberNonePropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLNumberNonePropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- sal_Int32 nValue = 0;
- if( rStrImpValue == sZeroStr )
- {
- nValue = 0;
- bRet = sal_True;
- }
- else
- {
- bRet = rUnitConverter.convertNumber( nValue, rStrImpValue );
- }
- lcl_xmloff_setAny( rValue, nValue, nBytes );
-
- return bRet;
-}
-
-sal_Bool XMLNumberNonePropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int32 nValue;
-
- if( lcl_xmloff_getAny( rValue, nValue, nBytes ) )
- {
- OUStringBuffer aOut;
-
- if( nValue == 0 )
- {
- aOut.append( sZeroStr );
- }
- else
- {
- rUnitConverter.convertNumber( aOut, nValue );
- }
-
- rStrExpValue = aOut.makeStringAndClear();
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLMeasurePropHdl
-//
-
-XMLMeasurePropHdl::~XMLMeasurePropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLMeasurePropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- sal_Int32 nValue = 0;
- bRet = rUnitConverter.convertMeasure( nValue, rStrImpValue );
- lcl_xmloff_setAny( rValue, nValue, nBytes );
-
- return bRet;
-}
-
-sal_Bool XMLMeasurePropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int32 nValue;
- OUStringBuffer aOut;
-
- if( lcl_xmloff_getAny( rValue, nValue, nBytes ) )
- {
- rUnitConverter.convertMeasure( aOut, nValue );
- rStrExpValue = aOut.makeStringAndClear();
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLBoolPropHdl
-//
-
-XMLBoolPropHdl::~XMLBoolPropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLBoolPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- sal_Bool bValue;
- bRet = rUnitConverter.convertBool( bValue, rStrImpValue );
- rValue <<= sal_Bool(bValue);
-
- return bRet;
-}
-
-sal_Bool XMLBoolPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- OUStringBuffer aOut;
- sal_Bool bValue;
-
- if (rValue >>= bValue)
- {
- rUnitConverter.convertBool( aOut, bValue );
- rStrExpValue = aOut.makeStringAndClear();
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLNBoolPropHdl
-//
-
-XMLNBoolPropHdl::~XMLNBoolPropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLNBoolPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- sal_Bool bValue;
- bRet = rUnitConverter.convertBool( bValue, rStrImpValue );
- rValue <<= sal_Bool(!bValue);
-
- return bRet;
-}
-
-sal_Bool XMLNBoolPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- OUStringBuffer aOut;
- sal_Bool bValue;
-
- if (rValue >>= bValue)
- {
- rUnitConverter.convertBool( aOut, !bValue );
- rStrExpValue = aOut.makeStringAndClear();
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLPercentPropHdl
-//
-
-XMLPercentPropHdl::~XMLPercentPropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLPercentPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- sal_Int32 nValue = 0;
- bRet = rUnitConverter.convertPercent( nValue, rStrImpValue );
- lcl_xmloff_setAny( rValue, nValue, nBytes );
-
- return bRet;
-}
-
-sal_Bool XMLPercentPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int32 nValue;
- OUStringBuffer aOut;
-
- if( lcl_xmloff_getAny( rValue, nValue, nBytes ) )
- {
- rUnitConverter.convertPercent( aOut, nValue );
- rStrExpValue = aOut.makeStringAndClear();
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLMeasurePxPropHdl
-//
-
-XMLMeasurePxPropHdl::~XMLMeasurePxPropHdl()
-{
- // nothing to do
-}
-
-sal_Bool XMLMeasurePxPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- sal_Int32 nValue = 0;
- bRet = rUnitConverter.convertMeasurePx( nValue, rStrImpValue );
- lcl_xmloff_setAny( rValue, nValue, nBytes );
-
- return bRet;
-}
-
-sal_Bool XMLMeasurePxPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int32 nValue;
- OUStringBuffer aOut;
-
- if( lcl_xmloff_getAny( rValue, nValue, nBytes ) )
- {
- rUnitConverter.convertMeasurePx( aOut, nValue );
- rStrExpValue = aOut.makeStringAndClear();
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLColorPropHdl
-//
-
-XMLColorPropHdl::~XMLColorPropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLColorPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- Color aColor;
-
- bRet = rUnitConverter.convertColor( aColor, rStrImpValue );
- rValue <<= (sal_Int32)( aColor.GetColor() );
-
- return bRet;
-}
-
-sal_Bool XMLColorPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- Color aColor;
- sal_Int32 nColor;
-
- if( rValue >>= nColor )
- {
- aColor.SetColor( nColor );
-
- OUStringBuffer aOut;
- rUnitConverter.convertColor( aOut, aColor );
- rStrExpValue = aOut.makeStringAndClear();
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLStringPropHdl
-//
-
-XMLStringPropHdl::~XMLStringPropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLStringPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- rValue <<= rStrImpValue;
- bRet = sal_True;
-
- return bRet;
-}
-
-sal_Bool XMLStringPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- if( rValue >>= rStrExpValue )
- bRet = sal_True;
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLDoublePropHdl
-//
-
-XMLDoublePropHdl::~XMLDoublePropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLDoublePropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- double fDblValue;
- sal_Bool bRet = rUnitConverter.convertDouble( fDblValue, rStrImpValue );
- rValue <<= fDblValue;
- return bRet;
-}
-
-sal_Bool XMLDoublePropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- double fValue;
-
- if( rValue >>= fValue )
- {
- OUStringBuffer aOut;
- rUnitConverter.convertDouble( aOut, fValue );
- rStrExpValue = aOut.makeStringAndClear();
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLColorTransparentPropHdl
-//
-
-XMLColorTransparentPropHdl::XMLColorTransparentPropHdl(
- enum XMLTokenEnum eTransparent ) :
- sTransparent( GetXMLToken(
- eTransparent != XML_TOKEN_INVALID ? eTransparent : XML_TRANSPARENT ) )
-{
- // Nothing to do
-}
-
-XMLColorTransparentPropHdl::~XMLColorTransparentPropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLColorTransparentPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- if( rStrImpValue != sTransparent )
- {
- Color aColor;
- bRet = rUnitConverter.convertColor( aColor, rStrImpValue );
- rValue <<= (sal_Int32)( aColor.GetColor() );
- }
-
- return bRet;
-}
-
-sal_Bool XMLColorTransparentPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int32 nColor;
-
- if( rStrExpValue == sTransparent )
- bRet = sal_False;
- else if( rValue >>= nColor )
- {
- Color aColor( nColor );
- OUStringBuffer aOut;
- rUnitConverter.convertColor( aOut, aColor );
- rStrExpValue = aOut.makeStringAndClear();
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLIsTransparentPropHdl
-//
-
-XMLIsTransparentPropHdl::XMLIsTransparentPropHdl(
- enum XMLTokenEnum eTransparent, sal_Bool bTransPropVal ) :
- sTransparent( GetXMLToken(
- eTransparent != XML_TOKEN_INVALID ? eTransparent : XML_TRANSPARENT ) ),
- bTransPropValue( bTransPropVal )
-{
-}
-
-XMLIsTransparentPropHdl::~XMLIsTransparentPropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLIsTransparentPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bValue = ( (rStrImpValue == sTransparent) == bTransPropValue);
- rValue.setValue( &bValue, ::getBooleanCppuType() );
-
- return sal_True;
-}
-
-sal_Bool XMLIsTransparentPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- // MIB: This looks a bit strange, because bTransPropValue == bValue should
- // do the same, but this only applies if 'true' is represented by the same
- // 8 bit value in bValue and bTransPropValue. Who will ensure this?
- sal_Bool bValue = *(sal_Bool *)rValue.getValue();
- sal_Bool bIsTrans = bTransPropValue ? bValue : !bValue;
-
- if( bIsTrans )
- {
- rStrExpValue = sTransparent;
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLColorAutoPropHdl
-//
-
-XMLColorAutoPropHdl::XMLColorAutoPropHdl()
-{
- // Nothing to do
-}
-
-XMLColorAutoPropHdl::~XMLColorAutoPropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLColorAutoPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- // This is a multi property: the value might be set to AUTO_COLOR
- // already by the XMLIsAutoColorPropHdl!
- sal_Int32 nColor;
- if( !(rValue >>= nColor) || -1 != nColor )
- {
- Color aColor;
- bRet = rUnitConverter.convertColor( aColor, rStrImpValue );
- if( bRet )
- rValue <<= (sal_Int32)( aColor.GetColor() );
- }
-
- return bRet;
-}
-
-sal_Bool XMLColorAutoPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- sal_Int32 nColor;
- if( (rValue >>= nColor) && -1 != nColor )
- {
- Color aColor( nColor );
- OUStringBuffer aOut;
- rUnitConverter.convertColor( aOut, aColor );
- rStrExpValue = aOut.makeStringAndClear();
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLIsAutoColorPropHdl
-//
-
-XMLIsAutoColorPropHdl::XMLIsAutoColorPropHdl()
-{
-}
-
-XMLIsAutoColorPropHdl::~XMLIsAutoColorPropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLIsAutoColorPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bValue;
-
- // An auto color overrides any other color set!
- sal_Bool bRet = rUnitConverter.convertBool( bValue, rStrImpValue );
- if( bRet && bValue )
- rValue <<= (sal_Int32)-1;
-
- return sal_True;
-}
-
-sal_Bool XMLIsAutoColorPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int32 nColor;
-
- if( (rValue >>= nColor) && -1 == nColor )
- {
- OUStringBuffer aOut;
- rUnitConverter.convertBool( aOut, sal_True );
- rStrExpValue = aOut.makeStringAndClear();
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// class XMLCompareOnlyPropHdl
-//
-
-XMLCompareOnlyPropHdl::~XMLCompareOnlyPropHdl()
-{
- // Nothing to do
-}
-
-sal_Bool XMLCompareOnlyPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- DBG_ASSERT( !this, "importXML called for compare-only-property" );
- return sal_False;
-}
-
-sal_Bool XMLCompareOnlyPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const
-{
- DBG_ASSERT( !this, "exportXML called for compare-only-property" );
- return sal_False;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_xmlexppr.cxx b/binfilter/bf_xmloff/source/style/xmloff_xmlexppr.cxx
deleted file mode 100644
index 679f2819d312..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_xmlexppr.cxx
+++ /dev/null
@@ -1,939 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/container/XNameContainer.hpp>
-
-#include <com/sun/star/xml/AttributeData.hpp>
-
-
-#include <com/sun/star/beans/XPropertyState.hpp>
-#include <com/sun/star/beans/XMultiPropertySet.hpp>
-
-#include <list>
-#include <hash_map>
-
-
-
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-#include "xmlexp.hxx"
-
-
-
-#ifndef _SVSTDARR_USHORTS
-#define _SVSTDARR_USHORTS
-#include <bf_svtools/svstdarr.hxx>
-#endif
-namespace binfilter {
-
-using namespace ::std;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// public methods
-//
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Take all properties of the XPropertySet which are also found in the
-// XMLPropertyMapEntry-array and which are not set to their default-value,
-// if a state is available.
-//
-// After that I call the method 'ContextFilter'.
-//
-
-typedef ::std::list<XMLPropertyState> XMLPropertyStateList_Impl;
-
-class XMLPropertyStates_Impl
-{
- XMLPropertyStateList_Impl aPropStates;
- XMLPropertyStateList_Impl::iterator aLastItr;
- sal_uInt32 nCount;
-public:
- XMLPropertyStates_Impl();
- void AddPropertyState(const XMLPropertyState& rPropState);
- void FillPropertyStateVector(std::vector<XMLPropertyState>& rVector);
-};
-
-XMLPropertyStates_Impl::XMLPropertyStates_Impl() :
- aPropStates(),
- nCount(0)
-{
- aLastItr = aPropStates.begin();
-}
-
-void XMLPropertyStates_Impl::AddPropertyState(
- const XMLPropertyState& rPropState)
-{
- XMLPropertyStateList_Impl::iterator aItr = aPropStates.begin();
- sal_Bool bInserted(sal_False);
- if (nCount)
- {
- if (aLastItr->mnIndex < rPropState.mnIndex)
- aItr = ++aLastItr;
- }
- do
- {
- // TODO: one path required only
- if (aItr == aPropStates.end())
- {
- aLastItr = aPropStates.insert(aPropStates.end(), rPropState);
- bInserted = sal_True;
- nCount++;
- }
- else if (aItr->mnIndex > rPropState.mnIndex)
- {
- aLastItr = aPropStates.insert(aItr, rPropState);
- bInserted = sal_True;
- nCount++;
- }
- }
- while(!bInserted && (aItr++ != aPropStates.end()));
-}
-
-void XMLPropertyStates_Impl::FillPropertyStateVector(
- std::vector<XMLPropertyState>& rVector)
-{
- if (nCount)
- {
- rVector.resize(nCount, XMLPropertyState(-1));
- XMLPropertyStateList_Impl::iterator aItr = aPropStates.begin();
- sal_Int32 i (0);
- while (aItr != aPropStates.end())
- {
- rVector[i] = *aItr;
- aItr++;
- i++;
- }
- }
-}
-
-class FilterPropertyInfo_Impl
-{
- const ::rtl::OUString sApiName;
- std::list<sal_uInt32> aIndexes;
- sal_uInt32 nCount;
-
-public:
-
- FilterPropertyInfo_Impl( const ::rtl::OUString& rApiName,
- const sal_uInt32 nIndex);
-
- const OUString& GetApiName() const { return sApiName; }
- std::list<sal_uInt32>& GetIndexes() { return aIndexes; }
-
- void AddIndex( sal_uInt32 nIndex )
- {
- aIndexes.push_back(nIndex);
- nCount++;
- }
-
- // for sort
- sal_Bool operator< ( const FilterPropertyInfo_Impl& rArg ) const
- {
- return (GetApiName() < rArg.GetApiName());
- }
-};
-
-FilterPropertyInfo_Impl::FilterPropertyInfo_Impl(
- const ::rtl::OUString& rApiName,
- const sal_uInt32 nIndex ) :
- sApiName( rApiName ),
- aIndexes(),
- nCount(1)
-{
- aIndexes.push_back(nIndex);
-}
-
-typedef ::std::list<FilterPropertyInfo_Impl> FilterPropertyInfoList_Impl;
-
-// ----------------------------------------------------------------------------
-
-class FilterPropertiesInfo_Impl
-{
- sal_uInt32 nCount;
- FilterPropertyInfoList_Impl aPropInfos;
- FilterPropertyInfoList_Impl::iterator aLastItr;
-
- Sequence <OUString> *pApiNames;
-
-public:
- FilterPropertiesInfo_Impl();
- ~FilterPropertiesInfo_Impl();
-
- void AddProperty(const ::rtl::OUString& rApiName, const sal_uInt32 nIndex);
- const uno::Sequence<OUString>& GetApiNames();
- void FillPropertyStateArray(
- vector< XMLPropertyState >& rPropStates,
- const Reference< XPropertySet >& xPropSet,
- const UniReference< XMLPropertySetMapper >& maPropMapper,
- const sal_Bool bDefault = sal_False);
- sal_uInt32 GetPropertyCount() const { return nCount; }
-};
-
-// ----------------------------------------------------------------------------
-
-typedef ::std::hash_map
-<
- PropertySetInfoKey,
- FilterPropertiesInfo_Impl *,
- PropertySetInfoHash,
- PropertySetInfoHash
->
-FilterOropertiesHashMap_Impl;
-
-class FilterPropertiesInfos_Impl : public FilterOropertiesHashMap_Impl
-{
-public:
- ~FilterPropertiesInfos_Impl ();
-};
-
-FilterPropertiesInfos_Impl::~FilterPropertiesInfos_Impl ()
-{
- FilterOropertiesHashMap_Impl::iterator aIter = begin();
- FilterOropertiesHashMap_Impl::iterator aEnd = end();
- while( aIter != aEnd )
- {
- delete (*aIter).second;
- (*aIter).second = 0;
- ++aIter;
- }
-}
-
-// ----------------------------------------------------------------------------
-
-FilterPropertiesInfo_Impl::FilterPropertiesInfo_Impl() :
- aPropInfos(),
- nCount(0),
- pApiNames( 0 )
-{
- aLastItr = aPropInfos.begin();
-}
-
-FilterPropertiesInfo_Impl::~FilterPropertiesInfo_Impl()
-{
- delete pApiNames;
-}
-
-void FilterPropertiesInfo_Impl::AddProperty(
- const ::rtl::OUString& rApiName, const sal_uInt32 nIndex)
-{
- aPropInfos.push_back(FilterPropertyInfo_Impl(rApiName, nIndex));
- nCount++;
-
- OSL_ENSURE( !pApiNames, "perfomance warning: API names already retrieved" );
- if( pApiNames )
- {
- delete pApiNames;
- pApiNames = NULL;
- }
-}
-const uno::Sequence<OUString>& FilterPropertiesInfo_Impl::GetApiNames()
-{
- OSL_ENSURE(nCount == aPropInfos.size(), "wrong property count");
- if( !pApiNames )
- {
- // we have to do three things:
- // 1) sort API names,
- // 2) merge duplicates,
- // 3) construct sequence
-
- // sort names
- aPropInfos.sort();
-
- // merge duplicates
- if ( nCount > 1 )
- {
- FilterPropertyInfoList_Impl::iterator aOld = aPropInfos.begin();
- FilterPropertyInfoList_Impl::iterator aEnd = aPropInfos.end();
- FilterPropertyInfoList_Impl::iterator aCurrent = aOld;
- aCurrent++;
-
- while ( aCurrent != aEnd )
- {
- // equal to next element?
- if ( aOld->GetApiName().equals( aCurrent->GetApiName() ) )
- {
- // if equal: merge index lists
- aOld->GetIndexes().merge( aCurrent->GetIndexes() );
- // erase element, and continue with next
- aCurrent = aPropInfos.erase( aCurrent );
- nCount--;
- }
- else
- {
- // remember old element and continue with next
- aOld = aCurrent;
- aCurrent++;
- }
- }
- }
-
- // construct sequence
- pApiNames = new Sequence < OUString >( nCount );
- OUString *pNames = pApiNames->getArray();
- FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin();
- FilterPropertyInfoList_Impl::iterator aEnd = aPropInfos.end();
- for ( ; aItr != aEnd; aItr++, pNames++)
- *pNames = aItr->GetApiName();
- }
-
- return *pApiNames;
-}
-
-void FilterPropertiesInfo_Impl::FillPropertyStateArray(
- vector< XMLPropertyState >& rPropStates,
- const Reference< XPropertySet >& rPropSet,
- const UniReference< XMLPropertySetMapper >& rPropMapper,
- const sal_Bool bDefault )
-{
- XMLPropertyStates_Impl aPropStates;
-
- const uno::Sequence<OUString>& rApiNames = GetApiNames();
-
- Sequence < PropertyState > aStates;
- const PropertyState *pStates = 0;
- Reference< XPropertyState > xPropState( rPropSet, UNO_QUERY );
- if( xPropState.is() )
- {
- aStates = xPropState->getPropertyStates( rApiNames );
- pStates = aStates.getConstArray();
- }
-
- Reference < XMultiPropertySet > xMultiPropSet( rPropSet, UNO_QUERY );
- if( xMultiPropSet.is() && !bDefault )
- {
- Sequence < Any > aValues;
- if( pStates )
- {
- // step 1: get value count
- sal_uInt32 nValueCount = 0;
- sal_uInt32 i;
-
- for( i = 0; i < nCount; i++, pStates++ )
- {
- if( *pStates == PropertyState_DIRECT_VALUE )
- nValueCount++;
- }
-
- if( nValueCount )
- {
- // step 2: collect property names
- Sequence < OUString > aAPINames( nValueCount );
- OUString *pAPINames = aAPINames.getArray();
-
- FilterPropertyInfoList_Impl::iterator *aPropIters =
- new FilterPropertyInfoList_Impl::iterator[nValueCount];
- FilterPropertyInfoList_Impl::iterator *pPropIter = aPropIters;
-
- FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin();
-
- pStates = aStates.getConstArray();
- i = 0;
- while( i < nValueCount )
- {
- if( *pStates == PropertyState_DIRECT_VALUE )
- {
- *pAPINames++ = aItr->GetApiName();
- *pPropIter++ = aItr;
- i++;
- }
- aItr++;
- pStates++;
- }
-
- aValues = xMultiPropSet->getPropertyValues( aAPINames );
- const Any *pValues = aValues.getConstArray();
- pPropIter = aPropIters;
- XMLPropertyState aNewProperty( -1 );
- for( i = 0; i < nValueCount; i++ )
- {
- aNewProperty.mnIndex = -1;
- aNewProperty.maValue = *pValues;
-
- for( ::std::list<sal_uInt32>::iterator aIndexItr =
- (*pPropIter)->GetIndexes().begin();
- aIndexItr != (*pPropIter)->GetIndexes().end();
- aIndexItr++ )
- {
- aNewProperty.mnIndex = *aIndexItr;
- aPropStates.AddPropertyState( aNewProperty );
- }
-
- pPropIter++;
- pValues++;
- }
- delete[] aPropIters;
- }
- }
- else
- {
- aValues = xMultiPropSet->getPropertyValues( rApiNames );
- const Any *pValues = aValues.getConstArray();
-
- FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin();
- for(sal_uInt32 i = 0; i < nCount; i++ )
- {
- // The value is stored in the PropertySet itself, add to list.
- sal_Bool bGotValue = sal_False;
- XMLPropertyState aNewProperty( -1 );
- aNewProperty.maValue = *pValues;
- for( ::std::list<sal_uInt32>::iterator aIndexItr =
- aItr->GetIndexes().begin();
- aIndexItr != aItr->GetIndexes().end();
- aIndexItr++ )
- {
- aNewProperty.mnIndex = *aIndexItr;
- aPropStates.AddPropertyState( aNewProperty );
- }
- aItr++;
- }
- }
- }
- else
- {
- FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin();
- for(sal_uInt32 i = 0; i < nCount; i++ )
- {
- sal_Bool bDirectValue =
- !pStates || *pStates == PropertyState_DIRECT_VALUE;
- if( bDirectValue || bDefault )
- {
- // The value is stored in the PropertySet itself, add to list.
- sal_Bool bGotValue = sal_False;
- XMLPropertyState aNewProperty( -1 );
- for( ::std::list<sal_uInt32>::iterator aIndexItr =
- aItr->GetIndexes().begin();
- aIndexItr != aItr->GetIndexes().end();
- aIndexItr++ )
- {
- if( bDirectValue ||
- (rPropMapper->GetEntryFlags( *aIndexItr ) &
- MID_FLAG_DEFAULT_ITEM_EXPORT) != 0 )
- {
- try
- {
- if( !bGotValue )
- {
- aNewProperty.maValue =
- rPropSet->getPropertyValue( aItr->GetApiName() );
- bGotValue = sal_True;
- }
- aNewProperty.mnIndex = *aIndexItr;
- aPropStates.AddPropertyState( aNewProperty );
- }
- catch( UnknownPropertyException& )
- {
- // might be a problem of getImplemenetationId
- OSL_ENSURE( !this, "unknown property in getPropertyValue" );
- }
-
- }
- }
- }
-
- aItr++;
- if( pStates )
- pStates++;
- }
- }
- aPropStates.FillPropertyStateVector(rPropStates);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// ctor/dtor , class SvXMLExportPropertyMapper
-//
-
-SvXMLExportPropertyMapper::SvXMLExportPropertyMapper(
- const UniReference< XMLPropertySetMapper >& rMapper ) :
- maPropMapper( rMapper ),
- pCache( 0 )
-{
-}
-
-SvXMLExportPropertyMapper::~SvXMLExportPropertyMapper()
-{
- delete pCache;
- mxNextMapper = 0;
-}
-
-void SvXMLExportPropertyMapper::ChainExportMapper(
- const UniReference< SvXMLExportPropertyMapper>& rMapper )
-{
- // add map entries from rMapper to current map
- maPropMapper->AddMapperEntry( rMapper->getPropertySetMapper() );
- // rMapper uses the same map as 'this'
- rMapper->maPropMapper = maPropMapper;
-
- // set rMapper as last mapper in current chain
- UniReference< SvXMLExportPropertyMapper > xNext = mxNextMapper;
- if( xNext.is())
- {
- while( xNext->mxNextMapper.is())
- xNext = xNext->mxNextMapper;
- xNext->mxNextMapper = rMapper;
- }
- else
- mxNextMapper = rMapper;
-
- // if rMapper was already chained, correct
- // map pointer of successors
- xNext = rMapper;
-
- while( xNext->mxNextMapper.is())
- {
- xNext = xNext->mxNextMapper;
- xNext->maPropMapper = maPropMapper;
- }
-}
-
-
-vector< XMLPropertyState > SvXMLExportPropertyMapper::_Filter(
- const Reference< XPropertySet > xPropSet,
- const sal_Bool bDefault ) const
-{
- vector< XMLPropertyState > aPropStateArray;
-
- // Retrieve XPropertySetInfo and XPropertyState
- Reference< XPropertySetInfo > xInfo( xPropSet->getPropertySetInfo() );
- if( !xInfo.is() )
- return aPropStateArray;
-
- sal_Int32 nProps = maPropMapper->GetEntryCount();
-
- FilterPropertiesInfo_Impl *pFilterInfo = 0;
-
- Reference < XTypeProvider > xTypeProv( xPropSet, UNO_QUERY );
- Sequence< sal_Int8 > aImplId;
- if( xTypeProv.is() )
- {
- aImplId = xTypeProv->getImplementationId();
- if( aImplId.getLength() == 16 )
- {
- if( pCache )
- {
- // The key must not be created outside this block, because it
- // keeps a reference to the property set info.
- PropertySetInfoKey aKey( xInfo, aImplId );
- FilterPropertiesInfos_Impl::iterator aIter =
- pCache->find( aKey );
- if( aIter != pCache->end() )
- pFilterInfo = (*aIter).second;
- }
- }
- }
-
- sal_Bool bDelInfo = sal_False;
- if( !pFilterInfo )
- {
- pFilterInfo = new FilterPropertiesInfo_Impl;
- for( sal_Int32 i=0; i < nProps; i++ )
- {
- // Are we allowed to ask for the property? (MID_FLAG_NO_PROP..)
- // Does the PropertySet contain name of mpEntries-array ?
- const OUString& rAPIName = maPropMapper->GetEntryAPIName( i );
- const sal_Int32 nFlags = maPropMapper->GetEntryFlags( i );
- if( (0 == (nFlags & MID_FLAG_NO_PROPERTY_EXPORT)) &&
- ( (0 != (nFlags & MID_FLAG_MUST_EXIST)) ||
- xInfo->hasPropertyByName( rAPIName ) ) )
- pFilterInfo->AddProperty(rAPIName, i);
- }
-
- if( xTypeProv.is() && aImplId.getLength() == 16 )
- {
- // Check whether the property set info is destroyed if it is
- // assigned to a weak reference only. If it is destroyed, then
- // every instance of getPropertySetInfo returns a new object.
- // Such property set infos must not be cached.
- WeakReference < XPropertySetInfo > xWeakInfo( xInfo );
- xInfo = 0;
- xInfo = xWeakInfo;
- if( xInfo.is() )
- {
- if( !pCache )
- ((SvXMLExportPropertyMapper *)this)->pCache =
- new FilterPropertiesInfos_Impl;
- PropertySetInfoKey aKey( xInfo, aImplId );
- (*pCache)[aKey] = pFilterInfo;
- }
- else
- bDelInfo = sal_True;
- }
- else
- {
- OSL_ENSURE(sal_False, "here is no TypeProvider or the ImplId is wrong");
- bDelInfo = sal_True;
- }
- }
-
- if( pFilterInfo->GetPropertyCount() )
- {
- try
- {
- pFilterInfo->FillPropertyStateArray(aPropStateArray,
- xPropSet, maPropMapper,
- bDefault);
- }
- catch( UnknownPropertyException& )
- {
- // might be a problem of getImplemenetationId
- OSL_ENSURE( !this, "unknown property in getPropertyStates" );
- }
- }
-
- // Call centext-filter
- if( aPropStateArray.size() > 0 )
- ContextFilter( aPropStateArray, xPropSet );
-
- // Have to do if we change from a vector to a list or something like that
- /*vector< XMLPropertyState >::iterator aItr = aPropStateArray.begin();
- while (aItr != aPropStateArray.end())
- {
- if (aItr->mnIndex == -1)
- aItr = aPropStateArray.erase(aItr);
- else
- aItr++;
- }*/
-
- if( bDelInfo )
- delete pFilterInfo;
-
- return aPropStateArray;
-}
-
-void SvXMLExportPropertyMapper::ContextFilter(
- vector< XMLPropertyState >& rProperties,
- Reference< XPropertySet > rPropSet ) const
-{
- // Derived class could implement this.
- if( mxNextMapper.is() )
- mxNextMapper->ContextFilter( rProperties, rPropSet );
-}
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Compares two Sequences of XMLPropertyState:
-// 1.Number of elements equal ?
-// 2.Index of each element equal ? (So I know whether the propertynames are the same)
-// 3.Value of each element equal ?
-//
-sal_Bool SvXMLExportPropertyMapper::Equals(
- const vector< XMLPropertyState >& aProperties1,
- const vector< XMLPropertyState >& aProperties2 ) const
-{
- sal_Bool bRet = sal_True;
- sal_uInt32 nCount = aProperties1.size();
-
- if( nCount == aProperties2.size() )
- {
- sal_uInt32 nIndex = 0;
- while( bRet && nIndex < nCount )
- {
- const XMLPropertyState& rProp1 = aProperties1[ nIndex ];
- const XMLPropertyState& rProp2 = aProperties2[ nIndex ];
-
- // Compare index. If equal, compare value
- if( rProp1.mnIndex == rProp2.mnIndex )
- {
- if( rProp1.mnIndex != -1 )
- {
- // Now compare values
- if( ( maPropMapper->GetEntryType( rProp1.mnIndex ) &
- XML_TYPE_BUILDIN_CMP ) != 0 )
- // simple type ( binary compare )
- bRet = ( rProp1.maValue == rProp2.maValue );
- else
- // complex type ( ask for compare-function )
- bRet = maPropMapper->GetPropertyHandler(
- rProp1.mnIndex )->equals( rProp1.maValue,
- rProp2.maValue );
- }
- }
- else
- bRet = sal_False;
-
- nIndex++;
- }
- }
- else
- bRet = sal_False;
-
- return bRet;
-}
-
-void SvXMLExportPropertyMapper::exportXML(
- SvXMLExport& rExport,
- const ::std::vector< XMLPropertyState >& rProperties,
- sal_uInt16 nFlags ) const
-{
- exportXML( rExport, rProperties, -1, -1, nFlags );
-}
-
-void SvXMLExportPropertyMapper::exportXML(
- SvXMLExport& rExport,
- const ::std::vector< XMLPropertyState >& rProperties,
- sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx,
- sal_uInt16 nFlags ) const
-{
- SvUShorts aIndexArray;
-
- _exportXML( rExport.GetAttrList(), rProperties,
- rExport.GetMM100UnitConverter(), rExport.GetNamespaceMap(),
- nFlags, &aIndexArray, nPropMapStartIdx, nPropMapEndIdx );
-
- if( rExport.GetAttrList().getLength() > 0L ||
- (nFlags & XML_EXPORT_FLAG_EMPTY) != 0 ||
- aIndexArray.Count() != 0 )
- {
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_STYLE, XML_PROPERTIES,
- (nFlags & XML_EXPORT_FLAG_IGN_WS) != 0,
- sal_False );
-
- exportElementItems( rExport, rProperties, nFlags, aIndexArray );
- }
-}
-
-/** this method is called for every item that has the
- MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
-void SvXMLExportPropertyMapper::handleSpecialItem(
- SvXMLAttributeList& rAttrList,
- const XMLPropertyState& rProperty,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap,
- const ::std::vector< XMLPropertyState > *pProperties,
- sal_uInt32 nIdx ) const
-{
- OSL_ENSURE( mxNextMapper.is(), "special item not handled in xml export" );
- if( mxNextMapper.is() )
- mxNextMapper->handleSpecialItem( rAttrList, rProperty, rUnitConverter,
- rNamespaceMap, pProperties, nIdx );
-}
-
-/** this method is called for every item that has the
- MID_FLAG_ELEMENT_EXPORT flag set */
-void SvXMLExportPropertyMapper::handleElementItem(
- SvXMLExport& rExport,
- const XMLPropertyState& rProperty,
- sal_uInt16 nFlags,
- const ::std::vector< XMLPropertyState > *pProperties,
- sal_uInt32 nIdx ) const
-{
- OSL_ENSURE( mxNextMapper.is(), "element item not handled in xml export" );
- if( mxNextMapper.is() )
- mxNextMapper->handleElementItem( rExport, rProperty, nFlags,
- pProperties, nIdx );
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// protected methods
-//
-
-/** fills the given attribute list with the items in the given set */
-void SvXMLExportPropertyMapper::_exportXML(
- SvXMLAttributeList& rAttrList,
- const ::std::vector< XMLPropertyState >& rProperties,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap,
- sal_uInt16 nFlags,
- SvUShorts* pIndexArray,
- sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx ) const
-{
- const sal_uInt32 nCount = rProperties.size();
- sal_uInt32 nIndex = 0;
-
- if( -1 == nPropMapStartIdx )
- nPropMapStartIdx = 0;
- if( -1 == nPropMapEndIdx )
- nPropMapEndIdx = maPropMapper->GetEntryCount();
-
- while( nIndex < nCount )
- {
- sal_Int32 nPropMapIdx = rProperties[nIndex].mnIndex;
- if( nPropMapIdx >= nPropMapStartIdx &&
- nPropMapIdx < nPropMapEndIdx )// valid entry?
- {
- // we have a valid map entry here, so lets use it...
- if( ( maPropMapper->GetEntryFlags( nPropMapIdx )
- & MID_FLAG_ELEMENT_ITEM_EXPORT ) != 0 )
- {
- // element items do not add any properties,
- // we export it later
- if( pIndexArray )
- pIndexArray->Insert( (sal_uInt16)nIndex, pIndexArray->Count() );
- }
- else
- {
- _exportXML( rAttrList, rProperties[nIndex], rUnitConverter,
- rNamespaceMap, nFlags, &rProperties, nIndex );
- }
- }
-
- nIndex++;
- }
-}
-
-void SvXMLExportPropertyMapper::_exportXML(
- SvXMLAttributeList& rAttrList,
- const XMLPropertyState& rProperty,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap,
- sal_uInt16 nFlags,
- const ::std::vector< XMLPropertyState > *pProperties,
- sal_uInt32 nIdx ) const
-{
- OUString sCDATA( GetXMLToken(XML_CDATA) );
-
- if ( ( maPropMapper->GetEntryFlags( rProperty.mnIndex ) &
- MID_FLAG_SPECIAL_ITEM_EXPORT ) != 0 )
- {
- uno::Reference< container::XNameContainer > xAttrContainer;
- if( (rProperty.maValue >>= xAttrContainer) && xAttrContainer.is() )
- {
- SvXMLNamespaceMap *pNewNamespaceMap = 0;
- const SvXMLNamespaceMap *pNamespaceMap = &rNamespaceMap;
-
- uno::Sequence< OUString > aAttribNames( xAttrContainer->getElementNames() );
- const OUString* pAttribName = aAttribNames.getConstArray();
-
- const sal_Int32 nCount = aAttribNames.getLength();
-
- OUStringBuffer sName;
- xml::AttributeData aData;
- for( sal_Int32 i=0; i < nCount; i++, pAttribName++ )
- {
- xAttrContainer->getByName( *pAttribName ) >>= aData;
-
- // extract namespace prefix from attribute name if it exists
- OUString sPrefix;
- const sal_Int32 nPos = pAttribName->indexOf( sal_Unicode(':') );
- if( nPos != -1 )
- sPrefix = pAttribName->copy( 0, nPos );
-
- if( sPrefix.getLength() )
- {
- OUString sNamespace( aData.Namespace );
-
- // if the prefix isn't defined yet or has another meaning,
- // we have to redefine it now.
- sal_uInt16 nKey = pNamespaceMap->GetKeyByPrefix( sPrefix );
- if( USHRT_MAX == nKey || pNamespaceMap->GetNameByKey( nKey ) != sNamespace )
- {
- if( !pNewNamespaceMap )
- {
- pNewNamespaceMap = new SvXMLNamespaceMap( rNamespaceMap );
- pNamespaceMap = pNewNamespaceMap;
- }
- pNewNamespaceMap->Add( sPrefix, sNamespace );
-
- sName.append( GetXMLToken(XML_XMLNS) );
- sName.append( sal_Unicode(':') );
- sName.append( sPrefix );
- rAttrList.AddAttribute( sName.makeStringAndClear(),
- sNamespace );
- }
- }
- OSL_ENSURE(aData.Type == GetXMLToken(XML_CDATA), "different type to our default type which should be written out");
- rAttrList.AddAttribute( *pAttribName, aData.Value );
- }
-
- delete pNewNamespaceMap;
- }
- else
- {
- handleSpecialItem( rAttrList, rProperty, rUnitConverter,
- rNamespaceMap, pProperties, nIdx );
- }
- }
- else if ( ( maPropMapper->GetEntryFlags( rProperty.mnIndex ) &
- MID_FLAG_ELEMENT_ITEM_EXPORT ) == 0 )
- {
- OUString aValue;
- const OUString sName( rNamespaceMap.GetQNameByKey(
- maPropMapper->GetEntryNameSpace( rProperty.mnIndex ),
- maPropMapper->GetEntryXMLName( rProperty.mnIndex ) ) );
-
- sal_Bool bRemove = sal_False;
- if( ( maPropMapper->GetEntryFlags( rProperty.mnIndex ) &
- MID_FLAG_MERGE_ATTRIBUTE ) != 0 )
- {
- aValue = rAttrList.getValueByName( sName );
- bRemove = sal_True; //aValue.getLength() != 0;
- }
-
- if( maPropMapper->exportXML( aValue, rProperty, rUnitConverter ) )
- {
- if( bRemove )
- rAttrList.RemoveAttribute( sName );
- rAttrList.AddAttribute( sName, aValue );
- }
- }
-}
-
-void SvXMLExportPropertyMapper::exportElementItems(
- SvXMLExport& rExport,
- const ::std::vector< XMLPropertyState >& rProperties,
- sal_uInt16 nFlags,
- const SvUShorts& rIndexArray ) const
-{
- const sal_uInt16 nCount = rIndexArray.Count();
-
- sal_Bool bItemsExported = sal_False;
- OUString sWS( GetXMLToken(XML_WS) );
- for( sal_uInt16 nIndex = 0; nIndex < nCount; nIndex++ )
- {
- const sal_uInt16 nElement = rIndexArray.GetObject( nIndex );
-
- OSL_ENSURE( 0 != ( maPropMapper->GetEntryFlags(
- rProperties[nElement].mnIndex ) & MID_FLAG_ELEMENT_ITEM_EXPORT),
- "wrong mid flag!" );
-
- rExport.IgnorableWhitespace();
- handleElementItem( rExport, rProperties[nElement],
- nFlags, &rProperties, nElement );
- bItemsExported = sal_True;
- }
-
- if( bItemsExported )
- rExport.IgnorableWhitespace();
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_xmlimppr.cxx b/binfilter/bf_xmloff/source/style/xmloff_xmlimppr.cxx
deleted file mode 100644
index 48b3326d90dd..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_xmlimppr.cxx
+++ /dev/null
@@ -1,584 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/xml/AttributeData.hpp>
-
-
-
-
-
-
-#include <rtl/ustrbuf.hxx>
-
-#include "xmlprmap.hxx"
-#include "nmspmap.hxx"
-
-
-#include "xmlimp.hxx"
-
-#include "unoatrcn.hxx"
-#include "xmlnmspe.hxx"
-
-#include "xmlerror.hxx"
-
-
-// STL includes
-#include <algorithm>
-#include <functional>
-#include <utility>
-#include <vector>
-namespace binfilter {
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::xml;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::std;
-using namespace ::binfilter::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;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-
-SvXMLImportPropertyMapper::SvXMLImportPropertyMapper(
- const UniReference< XMLPropertySetMapper >& rMapper,
- SvXMLImport& rImp ):
- maPropMapper ( rMapper ),
- rImport(rImp)
-{
-}
-
-SvXMLImportPropertyMapper::~SvXMLImportPropertyMapper()
-{
- mxNextMapper = 0;
-}
-
-void SvXMLImportPropertyMapper::ChainImportMapper(
- const UniReference< SvXMLImportPropertyMapper>& rMapper )
-{
- // add map entries from rMapper to current map
- maPropMapper->AddMapperEntry( rMapper->getPropertySetMapper() );
- // rMapper uses the same map as 'this'
- rMapper->maPropMapper = maPropMapper;
-
- // set rMapper as last mapper in current chain
- UniReference< SvXMLImportPropertyMapper > xNext = mxNextMapper;
- if( xNext.is())
- {
- while( xNext->mxNextMapper.is())
- xNext = xNext->mxNextMapper;
- xNext->mxNextMapper = rMapper;
- }
- else
- mxNextMapper = rMapper;
-
- // if rMapper was already chained, correct
- // map pointer of successors
- xNext = rMapper;
-
- while( xNext->mxNextMapper.is())
- {
- xNext = xNext->mxNextMapper;
- xNext->maPropMapper = maPropMapper;
- }
-}
-
-/** fills the given itemset with the attributes in the given list */
-void SvXMLImportPropertyMapper::importXML(
- vector< XMLPropertyState >& rProperties,
- Reference< XAttributeList > xAttrList,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap,
- sal_Int32 nStartIdx,
- sal_Int32 nEndIdx ) const
-{
- INT16 nAttr = xAttrList->getLength();
-
- Reference< XNameContainer > xAttrContainer;
-
- if( -1 == nStartIdx )
- nStartIdx = 0;
- if( -1 == nEndIdx )
- nEndIdx = maPropMapper->GetEntryCount();
- for( INT16 i=0; i < nAttr; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName, aPrefix, aNamespace;
- USHORT nPrefix = rNamespaceMap.GetKeyByAttrName( rAttrName, &aPrefix,
- &aLocalName, &aNamespace );
-
- if( XML_NAMESPACE_XMLNS == nPrefix )
- continue;
-
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- // index of actual property map entry
- // This looks very strange, but it works well:
- // If the start index is 0, the new value will become -1, and
- // GetEntryIndex will start searching with position 0.
- // Otherwise GetEntryIndex will start with the next position specified.
- sal_Int32 nIndex = nStartIdx - 1;
- sal_uInt32 nFlags = 0; // flags of actual property map entry
- sal_Bool bFound = sal_False;
-
- // for better error reporting: this should be set true if no
- // warning is needed
- sal_Bool bNoWarning = sal_False;
-
- do
- {
- // find an entry for this attribute
- nIndex = maPropMapper->GetEntryIndex( nPrefix, aLocalName, nIndex );
-
- if( nIndex > -1 && nIndex < nEndIdx )
- {
- // create a XMLPropertyState with an empty value
-
- nFlags = maPropMapper->GetEntryFlags( nIndex );
- if( ( nFlags & MID_FLAG_ELEMENT_ITEM_IMPORT ) == 0 )
- {
- XMLPropertyState aNewProperty( nIndex );
- sal_Int32 nReference = -1;
-
- // if this is a multi attribute check if another attribute already set
- // this any. If so use this as a initial value
- if( ( nFlags & MID_FLAG_MERGE_PROPERTY ) != 0 )
- {
- const OUString aAPIName( maPropMapper->GetEntryAPIName( nIndex ) );
- const sal_Int32 nSize = rProperties.size();
- for( nReference = 0; nReference < nSize; nReference++ )
- {
- if( (nIndex != rProperties[nReference].mnIndex) && (maPropMapper->GetEntryAPIName( rProperties[nReference].mnIndex ) == aAPIName ))
- {
- aNewProperty = rProperties[nReference];
- aNewProperty.mnIndex = nIndex;
- break;
- }
- }
-
- if( nReference == nSize )
- nReference = -1;
- }
-
- sal_Bool bSet = sal_False;
- if( ( nFlags & MID_FLAG_SPECIAL_ITEM_IMPORT ) == 0 )
- {
- // let the XMLPropertySetMapper decide how to import the value
- bSet = maPropMapper->importXML( rValue, aNewProperty,
- rUnitConverter );
- }
- else
- {
- sal_uInt32 nOldSize = rProperties.size();
-
- bSet = handleSpecialItem( aNewProperty, rProperties,
- rValue, rUnitConverter,
- rNamespaceMap );
-
- // no warning if handleSpecialItem added properties
- bNoWarning |= ( nOldSize != rProperties.size() );
- }
-
- // no warning if we found could set the item. This
- // 'remembers' bSet across multi properties.
- bNoWarning |= bSet;
-
- // store the property in the given vector
- if( bSet )
- {
- if( nReference == -1 )
- rProperties.push_back( aNewProperty );
- else
- rProperties[nReference] = aNewProperty;
- }
- else
- {
- // warn about unknown value. Unless it's a
- // multi property: Then we get another chance
- // to set the value.
- if( !bNoWarning &&
- ((nFlags & MID_FLAG_MULTI_PROPERTY) == 0) )
- {
- Sequence<OUString> aSeq(2);
- aSeq[0] = rAttrName;
- aSeq[1] = rValue;
- rImport.SetError( XMLERROR_FLAG_WARNING |
- XMLERROR_STYLE_ATTR_VALUE,
- aSeq );
- }
- }
- }
- bFound = sal_True;
- }
- else if( !bFound )
- {
- if( !xAttrContainer.is() )
- {
- // add an unknown attribute container to the properties
- Reference< XNameContainer > xNew( SvUnoAttributeContainer_CreateInstance(), UNO_QUERY );
- xAttrContainer = xNew;
-
- // find map entry and create new property state
- nIndex = maPropMapper->FindEntryIndex( "UserDefinedAttributes", XML_NAMESPACE_TEXT, GetXMLToken(XML_XMLNS) );
- if( -1 == nIndex )
- nIndex = maPropMapper->FindEntryIndex( "ParaUserDefinedAttributes", XML_NAMESPACE_TEXT, GetXMLToken(XML_XMLNS) );
- if( -1 == nIndex )
- nIndex = maPropMapper->FindEntryIndex( "TextUserDefinedAttributes", XML_NAMESPACE_TEXT, GetXMLToken(XML_XMLNS) );
-
- // #i41083# no assertion because an extra attribute (writing-mode) is in
- // spreadsheet table styles, which don't have user defined attributes.
- // In normal xmloff, the assertion was removed for #i30395#.
-
- // #106963#; use userdefined attribute only if it is in the specified property range
- if( nIndex != -1 && nIndex >= nStartIdx && nIndex < nEndIdx)
- {
- Any aAny;
- aAny <<= xAttrContainer;
- XMLPropertyState aNewProperty( nIndex, aAny );
-
- // push it on our stack so we export it later
- rProperties.push_back( aNewProperty );
- }
- }
-
- if( xAttrContainer.is() )
- {
- AttributeData aData;
- aData.Type = GetXMLToken( XML_CDATA );
- aData.Value = rValue;
-
- OUStringBuffer sName;
- if( XML_NAMESPACE_NONE != nPrefix )
- {
- sName.append( aPrefix );
- sName.append( sal_Unicode(':') );
- aData.Namespace = aNamespace;
- }
-
- sName.append( aLocalName );
-
- Any aAny;
- aAny <<= aData;
- xAttrContainer->insertByName( sName.makeStringAndClear(), aAny );
- }
- }
- }
- while( ( nIndex >= 0 ) && (( nFlags & MID_FLAG_MULTI_PROPERTY ) != 0 ) );
- }
-
- finished( rProperties, nStartIdx, nEndIdx );
-
- // Have to do if we change from a vector to a list or something like that
- /*std::vector <XMLPropertyState>::iterator aItr = rProperties.begin();
- while (aItr != rProperties.end())
- {
- if (aItr->mnIndex == -1)
- aItr = rProperties.erase(aItr);
- else
- aItr++;
- }*/
-}
-
-/** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_IMPORT flag set */
-BOOL SvXMLImportPropertyMapper::handleSpecialItem(
- XMLPropertyState& rProperty,
- vector< XMLPropertyState >& rProperties,
- const OUString& rValue,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap ) const
-{
- OSL_ENSURE( mxNextMapper.is(), "unsuported special item in xml import" );
- if( mxNextMapper.is() )
- return mxNextMapper->handleSpecialItem( rProperty, rProperties, rValue,
- rUnitConverter, rNamespaceMap );
- else
- return FALSE;
-}
-
-
-sal_Bool SvXMLImportPropertyMapper::FillPropertySet(
- const vector< XMLPropertyState >& aProperties,
- const Reference< XPropertySet > rPropSet ) const
-{
- sal_Bool bSet = sal_False;
-
- // get property set info
- Reference< XPropertySetInfo > xInfo = rPropSet->getPropertySetInfo();
-
- // check for multi-property set
- Reference<XMultiPropertySet> xMultiPropSet( rPropSet, UNO_QUERY );
- if ( xMultiPropSet.is() )
- {
- // Try XMultiPropertySet. If that fails, try the regular route.
- bSet = _FillMultiPropertySet( aProperties, xMultiPropSet,
- xInfo, maPropMapper );
- if ( !bSet )
- bSet = _FillPropertySet( aProperties, rPropSet,
- xInfo, maPropMapper, rImport);
- }
- else
- bSet = _FillPropertySet( aProperties, rPropSet, xInfo,
- maPropMapper, rImport );
-
- return bSet;
-}
-
-sal_Bool SvXMLImportPropertyMapper::_FillPropertySet(
- const vector<XMLPropertyState> & rProperties,
- 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" );
- OSL_ENSURE( rPropSetInfo.is(), "need an XPropertySetInfo" );
-
- // preliminaries
- sal_Bool bSet = sal_False;
- sal_Int32 nCount = rProperties.size();
-
- // iterate over property states that we want to set
- for( sal_Int32 i=0; i < nCount; i++ )
- {
- const XMLPropertyState& rProp = rProperties[i];
- sal_Int32 nIdx = rProp.mnIndex;
-
- // disregard property state if it has an invalid index
- if( -1 == nIdx )
- continue;
-
- const OUString& rPropName = rPropMapper->GetEntryAPIName( nIdx );
- const sal_Int32 nPropFlags = rPropMapper->GetEntryFlags( nIdx );
-
- if ( ( 0 == ( nPropFlags & MID_FLAG_NO_PROPERTY ) ) &&
- ( ( 0 != ( nPropFlags & MID_FLAG_MUST_EXIST ) ) ||
- rPropSetInfo->hasPropertyByName( rPropName ) ) )
- {
- // try setting the property
- try
- {
- rPropSet->setPropertyValue( rPropName, rProp.maValue );
- bSet = sal_True;
- }
- catch ( IllegalArgumentException& e )
- {
- // 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 );
- }
- }
-
- // handle no-property and special items
- if( ( pSpecialContextIds != NULL ) &&
- ( ( 0 != ( nPropFlags & MID_FLAG_NO_PROPERTY_IMPORT ) ) ||
- ( 0 != ( nPropFlags & MID_FLAG_SPECIAL_ITEM_IMPORT ) ) ) )
- {
- // maybe it's one of our special context ids?
- sal_Int16 nContextId = rPropMapper->GetEntryContextId(nIdx);
-
- for ( sal_Int32 n = 0;
- pSpecialContextIds[n].nContextID != -1;
- n++ )
- {
- // found: set index in pSpecialContextIds array
- if ( pSpecialContextIds[n].nContextID == nContextId )
- {
- pSpecialContextIds[n].nIndex = i;
- break; // early out
- }
- }
- }
- }
-
- return bSet;
-}
-
-
-
-typedef pair<const OUString*, const Any* > PropertyPair;
-typedef vector<PropertyPair> PropertyPairs;
-
-struct PropertyPairLessFunctor :
- public binary_function<PropertyPair, PropertyPair, bool>
-{
- bool operator()( const PropertyPair& a, const PropertyPair& b ) const
- {
- return (*a.first < *b.first ? true : false);
- }
-};
-
-sal_Bool SvXMLImportPropertyMapper::_FillMultiPropertySet(
- const vector<XMLPropertyState> & rProperties,
- const Reference<XMultiPropertySet> & rMultiPropSet,
- const Reference<XPropertySetInfo> & rPropSetInfo,
- const UniReference<XMLPropertySetMapper> & rPropMapper,
- struct _ContextID_Index_Pair* pSpecialContextIds )
-{
- OSL_ENSURE( rMultiPropSet.is(), "Need multi property set. ");
- OSL_ENSURE( rPropSetInfo.is(), "Need property set info." );
-
- sal_Bool bSuccessful = sal_False;
- sal_Int32 nCount = rProperties.size();
-
- // property pairs structure stores names + values of properties to be set.
- PropertyPairs aPropertyPairs;
- aPropertyPairs.reserve( nCount );
-
- // iterate over property states that we want to set
- sal_Int32 i;
-
- for( i=0; i < nCount; i++ )
- {
- const XMLPropertyState& rProp = rProperties[i];
- sal_Int32 nIdx = rProp.mnIndex;
-
- // disregard property state if it has an invalid index
- if( -1 == nIdx )
- continue;
-
- const OUString& rPropName = rPropMapper->GetEntryAPIName( nIdx );
- const sal_Int32 nPropFlags = rPropMapper->GetEntryFlags( nIdx );
-
- if ( ( 0 == ( nPropFlags & MID_FLAG_NO_PROPERTY ) ) &&
- ( ( 0 != ( nPropFlags & MID_FLAG_MUST_EXIST ) ) ||
- rPropSetInfo->hasPropertyByName( rPropName ) ) )
- {
- // save property into property pair structure
- PropertyPair aPair( &rPropName, &rProp.maValue );
- aPropertyPairs.push_back( aPair );
- }
-
- // handle no-property and special items
- if( ( pSpecialContextIds != NULL ) &&
- ( ( 0 != ( nPropFlags & MID_FLAG_NO_PROPERTY_IMPORT ) ) ||
- ( 0 != ( nPropFlags & MID_FLAG_SPECIAL_ITEM_IMPORT ) ) ) )
- {
- // maybe it's one of our special context ids?
- sal_Int16 nContextId = rPropMapper->GetEntryContextId(nIdx);
- for ( sal_Int32 n = 0;
- pSpecialContextIds[n].nContextID != -1;
- n++ )
- {
- // found: set index in pSpecialContextIds array
- if ( pSpecialContextIds[n].nContextID == nContextId )
- {
- pSpecialContextIds[n].nIndex = i;
- break; // early out
- }
- }
- }
- }
-
- // We now need to construct the sequences and actually the set
- // values.
-
- // sort the property pairs
- sort( aPropertyPairs.begin(), aPropertyPairs.end(),
- PropertyPairLessFunctor());
-
- // create sequences
- Sequence<OUString> aNames( aPropertyPairs.size() );
- OUString* pNamesArray = aNames.getArray();
- Sequence<Any> aValues( aPropertyPairs.size() );
- Any* pValuesArray = aValues.getArray();
-
- // copy values into sequences
- i = 0;
- for( PropertyPairs::iterator aIter = aPropertyPairs.begin();
- aIter != aPropertyPairs.end();
- aIter++ )
- {
- pNamesArray[i] = *(aIter->first);
- pValuesArray[i++] = *(aIter->second);
- }
-
- // and, finally, try to set the values
- try
- {
- rMultiPropSet->setPropertyValues( aNames, aValues );
- bSuccessful = sal_True;
- }
- catch ( ... )
- {
- OSL_ENSURE(bSuccessful, "Exception caught; style may not be imported correctly.");
- }
-
- return bSuccessful;
-}
-
-void SvXMLImportPropertyMapper::finished(
- vector< XMLPropertyState >& rProperties,
- sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const
-{
- // nothing to do here
- if( mxNextMapper.is() )
- mxNextMapper->finished( rProperties, nStartIndex, nEndIndex );
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_xmlnume.cxx b/binfilter/bf_xmloff/source/style/xmloff_xmlnume.cxx
deleted file mode 100644
index c6a77b20d99e..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_xmlnume.cxx
+++ /dev/null
@@ -1,684 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <tools/debug.hxx>
-
-#include "nmspmap.hxx"
-#include "xmlnmspe.hxx"
-#include "xmluconv.hxx"
-#include "fonthdl.hxx"
-
-#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-#include <com/sun/star/style/NumberingType.hpp>
-#include <com/sun/star/style/XStyle.hpp>
-
-
-#include <com/sun/star/awt/XBitmap.hpp>
-#include <com/sun/star/awt/FontDescriptor.hpp>
-
-#include <com/sun/star/text/HoriOrientation.hpp>
-#include <com/sun/star/text/VertOrientation.hpp>
-#include <com/sun/star/text/XChapterNumberingSupplier.hpp>
-
-
-#include "XMLTextListAutoStylePool.hxx"
-#include "xmlnume.hxx"
-#include "xmlexp.hxx"
-
-#include <vcl/vclenum.hxx>
-#include "bf_so3/staticbaseurl.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_SYMBOL_TEXT_DISTANCE[] = "SymbolTextDistance";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_PARENT_NUMBERING[] = "ParentNumbering";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_CHAR_STYLE_NAME[] = "CharStyleName";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_CHAR[] = "BulletChar";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_RELSIZE[] = "BulletRelSize";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_COLOR[] = "BulletColor";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_GRAPHIC_BITMAP[] = "GraphicBitmap";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_GRAPHIC_SIZE[] = "GraphicSize";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_VERT_ORIENT[] = "VertOrient";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_NUMBERINGTYPE[] = "NumberingType";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_PREFIX[] = "Prefix";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_SUFFIX[] = "Suffix";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_ADJUST[] = "Adjust";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_LEFT_MARGIN[] = "LeftMargin";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_FIRST_LINE_OFFSET[] =
- "FirstLineOffset";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_FONT[] = "BulletFont";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_GRAPHICURL[] = "GraphicURL";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_START_WITH[] = "StartWith";
-
-void SvxXMLNumRuleExport::exportLevelStyles( const uno::Reference< ::com::sun::star::container::XIndexReplace > & xNumRule,
- sal_Bool bOutline )
-{
- sal_Int32 nCount = xNumRule ->getCount();
- for( sal_Int32 i=0; i<nCount; i++ )
- {
- uno::Any aEntry( xNumRule->getByIndex( i ) );
- uno::Sequence<beans::PropertyValue> aSeq;
- if( aEntry >>= aSeq )
- {
- exportLevelStyle( i, aSeq, bOutline );
- }
- }
-}
-
-void SvxXMLNumRuleExport::exportLevelStyle( INT32 nLevel,
- const uno::Sequence<beans::PropertyValue>& rProps,
- BOOL bOutline )
-{
- sal_Int16 eType = NumberingType::CHAR_SPECIAL;
-
- sal_Int16 eAdjust = HoriOrientation::LEFT;
- OUString sPrefix, sSuffix;
- OUString sTextStyleName;
- sal_Bool bHasColor = sal_False;
- sal_Int32 nColor = 0;
- sal_Int32 nSpaceBefore = 0, nMinLabelWidth = 0, nMinLabelDist = 0;
-
- sal_Int16 nStartValue = 1, nDisplayLevels = 1, nBullRelSize = 0;
-
- sal_Unicode cBullet = 0xf095;
- OUString sBulletFontName, sBulletFontStyleName ;
- sal_Int16 eBulletFontFamily = FAMILY_DONTKNOW;
- sal_Int16 eBulletFontPitch = PITCH_DONTKNOW;
- rtl_TextEncoding eBulletFontEncoding = RTL_TEXTENCODING_DONTKNOW;
-
- OUString sImageURL;
- uno::Reference< ::com::sun::star::awt::XBitmap > xBitmap;
- sal_Int32 nImageWidth = 0, nImageHeight = 0;
- sal_Int16 eImageVertOrient = VertOrientation::LINE_CENTER;
-
- sal_Int32 nCount = rProps.getLength();
- const beans::PropertyValue* pPropArray = rProps.getConstArray();
- for( sal_Int32 i=0; i<nCount; i++ )
- {
- const beans::PropertyValue& rProp = pPropArray[i];
-
- if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_NUMBERINGTYPE, sizeof(XML_UNO_NAME_NRULE_NUMBERINGTYPE)-1 ) )
- {
- rProp.Value >>= eType;
- }
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_PREFIX, sizeof(XML_UNO_NAME_NRULE_PREFIX)-1 ) )
- {
- rProp.Value >>= sPrefix;
- }
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_SUFFIX, sizeof(XML_UNO_NAME_NRULE_SUFFIX)-1 ) )
- {
- rProp.Value >>= sSuffix;
- }
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_BULLET_CHAR, sizeof(XML_UNO_NAME_NRULE_BULLET_CHAR)-1 ) )
- {
- OUString sValue;
- rProp.Value >>= sValue;
- if( sValue.getLength() > 0 )
- {
- cBullet = (sal_Unicode)sValue[0];
- }
- }
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_BULLET_RELSIZE, sizeof(XML_UNO_NAME_NRULE_BULLET_RELSIZE)-1 ) )
- {
- rProp.Value >>= nBullRelSize;
- }
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_ADJUST, sizeof(XML_UNO_NAME_NRULE_ADJUST)-1 ) )
- {
- sal_Int16 nValue;
- rProp.Value >>= nValue;
- eAdjust = nValue;
- }
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_BULLET_FONT, sizeof(XML_UNO_NAME_NRULE_BULLET_FONT)-1 ) )
- {
- awt::FontDescriptor rFDesc;
- if( rProp.Value >>= rFDesc )
- {
- sBulletFontName = rFDesc.Name;
- sBulletFontStyleName = rFDesc.StyleName;
- eBulletFontFamily = (sal_Int16)rFDesc.Family;
- eBulletFontPitch = (sal_Int16)rFDesc.Pitch;
- eBulletFontEncoding = (rtl_TextEncoding)rFDesc.CharSet;
- }
- }
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_GRAPHICURL, sizeof(XML_UNO_NAME_NRULE_GRAPHICURL)-1 ) )
- {
- rProp.Value >>= sImageURL;
- }
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_GRAPHIC_BITMAP, sizeof(XML_UNO_NAME_NRULE_GRAPHIC_BITMAP)-1 ) )
- {
- rProp.Value >>= xBitmap;
- }
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_BULLET_COLOR, sizeof(XML_UNO_NAME_NRULE_BULLET_COLOR)-1 ) )
- {
- rProp.Value >>= nColor;
- bHasColor = sal_True;
- }
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_START_WITH, sizeof(XML_UNO_NAME_NRULE_START_WITH)-1 ) )
- {
- rProp.Value >>= nStartValue;
- }
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_LEFT_MARGIN, sizeof(XML_UNO_NAME_NRULE_LEFT_MARGIN)-1 ) )
- {
- rProp.Value >>= nSpaceBefore;
- }
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_FIRST_LINE_OFFSET, sizeof(XML_UNO_NAME_NRULE_FIRST_LINE_OFFSET)-1 ) )
- {
- rProp.Value >>= nMinLabelWidth;
- }
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_SYMBOL_TEXT_DISTANCE, sizeof(XML_UNO_NAME_NRULE_SYMBOL_TEXT_DISTANCE)-1 ) )
- {
- rProp.Value >>= nMinLabelDist;
- }
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_PARENT_NUMBERING, sizeof(XML_UNO_NAME_NRULE_PARENT_NUMBERING)-1 ) )
- {
- rProp.Value >>= nDisplayLevels;
- if( nDisplayLevels > nLevel+1 )
- nDisplayLevels = nLevel+1;
- }
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_CHAR_STYLE_NAME, sizeof(XML_UNO_NAME_NRULE_CHAR_STYLE_NAME)-1 ) )
- {
- rProp.Value >>= sTextStyleName;
- }
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_GRAPHIC_SIZE, sizeof(XML_UNO_NAME_NRULE_GRAPHIC_SIZE)-1 ) )
- {
- awt::Size aSize;
- if( rProp.Value >>= aSize )
- {
- nImageWidth = aSize.Width;
- nImageHeight = aSize.Height;
- }
- }
- else if( rProp.Name.equalsAsciiL( XML_UNO_NAME_NRULE_VERT_ORIENT, sizeof(XML_UNO_NAME_NRULE_VERT_ORIENT)-1 ) )
- {
- sal_Int16 nValue;
- rProp.Value >>= nValue;
- eImageVertOrient = nValue;
- }
- }
-
- if( bOutline && (NumberingType::CHAR_SPECIAL == eType ||
- NumberingType::BITMAP == eType) )
- {
- DBG_ASSERT( !bOutline,
- "SvxXMLNumRuleExport::exportLevelStyle: invalid style for outline" );
- return;
- }
-
- GetExport().CheckAttrList();
-
- // text:level
- OUStringBuffer sTmp;
- sTmp.append( nLevel+1L );
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_LEVEL, sTmp.makeStringAndClear() );
- if( sTextStyleName.getLength() > 0 )
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, sTextStyleName );
- if( sPrefix.getLength() > 0 )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NUM_PREFIX, sPrefix );
- if( sSuffix.getLength() > 0 )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NUM_SUFFIX, sSuffix );
-
- enum XMLTokenEnum eElem = XML_LIST_LEVEL_STYLE_NUMBER;
- if( NumberingType::CHAR_SPECIAL == eType )
- {
- // <text:list-level-style-bullet>
- eElem = XML_LIST_LEVEL_STYLE_BULLET;
-
- if( cBullet )
- {
- if( cBullet < ' ' )
- {
- cBullet = 0xF000 + 149;
- }
- // text:bullet-char="..."
- sTmp.append( cBullet );
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_BULLET_CHAR,
- sTmp.makeStringAndClear() );
- }
-
- }
- else if( NumberingType::BITMAP == eType )
- {
- // <text:list-level-style-image>
-
- eElem = XML_LIST_LEVEL_STYLE_IMAGE;
-
-
- if( sImageURL.getLength() )
- {
-// String sURL( sImageURL );
-// ::binfilter::StaticBaseUrl::AbsToRel( sURL );
-// sImageURL = sURL;
- OUString sURL( GetExport().AddEmbeddedGraphicObject( sImageURL ) );
- if( sURL.getLength() )
- {
- GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sURL );
-
- GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
- GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED );
- GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD );
- }
- }
- else
- {
- DBG_ASSERT( !xBitmap.is(),
- "embedded images are not supported by now" );
- }
- }
- else
- {
- // <text:list-level-style-number> or <text:outline-level-style>
- if( bOutline )
- eElem = XML_OUTLINE_LEVEL_STYLE;
- else
- eElem = XML_LIST_LEVEL_STYLE_NUMBER;
-
- GetExport().GetMM100UnitConverter().convertNumFormat( sTmp, eType );
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NUM_FORMAT,
- sTmp.makeStringAndClear() );
- GetExport().GetMM100UnitConverter().convertNumLetterSync( sTmp, eType );
- if( sTmp.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_NUM_LETTER_SYNC,
- sTmp.makeStringAndClear() );
-
- if( nStartValue != 1 )
- {
- sTmp.append( (sal_Int32)nStartValue );
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE,
- sTmp.makeStringAndClear() );
- }
- if( nDisplayLevels > 1 && NumberingType::NUMBER_NONE != eType )
- {
- sTmp.append( (sal_Int32)nDisplayLevels );
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_DISPLAY_LEVELS,
- sTmp.makeStringAndClear() );
- }
- }
-
- {
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, eElem,
- sal_True, sal_True );
-
- nSpaceBefore += nMinLabelWidth;
- nMinLabelWidth = -nMinLabelWidth;
- OUStringBuffer sBuffer;
- if( nSpaceBefore > 0 )
- {
- GetExport().GetMM100UnitConverter().convertMeasure( sBuffer, nSpaceBefore );
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_SPACE_BEFORE,
- sBuffer.makeStringAndClear() );
- }
- if( nMinLabelWidth != 0 )
- {
- GetExport().GetMM100UnitConverter().convertMeasure( sBuffer, nMinLabelWidth );
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_MIN_LABEL_WIDTH,
- sBuffer.makeStringAndClear() );
- }
- if( nMinLabelDist > 0 )
- {
- GetExport().GetMM100UnitConverter().convertMeasure( sBuffer, nMinLabelDist );
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_MIN_LABEL_DISTANCE,
- sBuffer.makeStringAndClear() );
- }
- if( HoriOrientation::LEFT != eAdjust )
- {
- enum XMLTokenEnum eValue = XML_TOKEN_INVALID;
- switch( eAdjust )
- {
- case HoriOrientation::RIGHT: eValue = XML_END; break;
- case HoriOrientation::CENTER: eValue = XML_CENTER; break;
- }
- if( eValue != XML_TOKEN_INVALID )
- GetExport().AddAttribute( XML_NAMESPACE_FO, XML_TEXT_ALIGN, eValue );
- }
-
- if( NumberingType::CHAR_SPECIAL == eType )
- {
- if( sBulletFontName.getLength() )
- {
- OUString sStyleName =
- GetExport().GetFontAutoStylePool()->Find(
- sBulletFontName, sBulletFontStyleName,
- eBulletFontFamily, eBulletFontPitch,
- eBulletFontEncoding );
-
- if( sStyleName.getLength() )
- {
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_FONT_NAME,
- sStyleName );
- }
- else
- {
- Any aAny;
- OUString sTmp;
-
- const SvXMLUnitConverter& rUnitConv =
- GetExport().GetMM100UnitConverter();
- XMLFontFamilyNamePropHdl aFamilyNameHdl;
- aAny <<= sBulletFontName;
- if( aFamilyNameHdl.exportXML( sTmp, aAny, rUnitConv ) )
- GetExport().AddAttribute( XML_NAMESPACE_FO,
- XML_FONT_FAMILY, sTmp );
-
- if( sBulletFontStyleName.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_FONT_STYLE_NAME,
- sBulletFontStyleName );
-
- XMLFontFamilyPropHdl aFamilyHdl;
- aAny <<= (sal_Int16)eBulletFontFamily;
- if( aFamilyHdl.exportXML( sTmp, aAny, rUnitConv ) )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_FONT_FAMILY_GENERIC,
- sTmp );
-
- XMLFontPitchPropHdl aPitchHdl;
- aAny <<= (sal_Int16)eBulletFontPitch;
- if( aPitchHdl.exportXML( sTmp, aAny, rUnitConv ) )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_FONT_PITCH, sTmp );
-
- XMLFontEncodingPropHdl aEncHdl;
- aAny <<= (sal_Int16)eBulletFontEncoding;
- if( aEncHdl.exportXML( sTmp, aAny, rUnitConv ) )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_FONT_CHARSET, sTmp );
- }
- }
- }
- else if( NumberingType::BITMAP == eType )
- {
- enum XMLTokenEnum eValue = XML_TOKEN_INVALID;
- switch( eImageVertOrient )
- {
- case VertOrientation::BOTTOM: // yes, its OK: BOTTOM means that the baseline
- // hits the frame at its topmost position
- case VertOrientation::LINE_TOP:
- case VertOrientation::CHAR_TOP:
- eValue = XML_TOP;
- break;
- case VertOrientation::CENTER:
- case VertOrientation::LINE_CENTER:
- case VertOrientation::CHAR_CENTER:
- eValue = XML_MIDDLE;
- break;
- case VertOrientation::TOP: // yes, its OK: TOP means that the baseline
- // hits the frame at its bottommost position
- case VertOrientation::LINE_BOTTOM:
- case VertOrientation::CHAR_BOTTOM:
- eValue = XML_BOTTOM;
- break;
- }
- if( eValue != XML_TOKEN_INVALID )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_VERTICAL_POS, eValue );
-
- eValue = XML_TOKEN_INVALID;
- switch( eImageVertOrient )
- {
- case VertOrientation::TOP:
- case VertOrientation::CENTER:
- case VertOrientation::BOTTOM:
- eValue = XML_BASELINE;
- break;
- case VertOrientation::LINE_TOP:
- case VertOrientation::LINE_CENTER:
- case VertOrientation::LINE_BOTTOM:
- eValue = XML_LINE;
- break;
- case VertOrientation::CHAR_TOP:
- case VertOrientation::CHAR_CENTER:
- case VertOrientation::CHAR_BOTTOM:
- eValue = XML_CHAR;
- break;
- }
- if( eValue != XML_TOKEN_INVALID )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_VERTICAL_REL, eValue );
-
- if( nImageWidth > 0 )
- {
- GetExport().GetMM100UnitConverter().convertMeasure( sBuffer, nImageWidth );
- GetExport().AddAttribute( XML_NAMESPACE_FO, XML_WIDTH,
- sBuffer.makeStringAndClear() );
- }
-
- if( nImageHeight > 0 )
- {
- GetExport().GetMM100UnitConverter().convertMeasure( sBuffer, nImageHeight );
- GetExport().AddAttribute( XML_NAMESPACE_FO, XML_HEIGHT,
- sBuffer.makeStringAndClear() );
- }
- }
-
- if( NumberingType::BITMAP != eType )
- {
- // fo:color = "#..."
- if( bHasColor )
- {
- const Color aColor( nColor );
- if( aColor.GetColor() == 0xffffffff )
- {
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_USE_WINDOW_FONT_COLOR, XML_TRUE );
- }
- else
- {
- SvXMLUnitConverter::convertColor( sBuffer, aColor );
- GetExport().AddAttribute( XML_NAMESPACE_FO, XML_COLOR,
- sBuffer.makeStringAndClear() );
- }
- }
-
- // fo:height="...%"
- if( nBullRelSize )
- {
- GetExport().GetMM100UnitConverter().convertPercent( sTmp, nBullRelSize );
- GetExport().AddAttribute( XML_NAMESPACE_FO, XML_FONT_SIZE,
- sTmp.makeStringAndClear() );
- }
- }
-
- if( GetExport().GetAttrList().getLength() > 0 )
- {
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
- XML_PROPERTIES, sal_True, sal_True );
- }
- if( NumberingType::BITMAP == eType && sImageURL.getLength() )
- {
- // optional office:binary-data
- GetExport().AddEmbeddedGraphicObjectAsBase64( sImageURL );
- }
- }
-}
-
-
-uno::Reference< ::com::sun::star::container::XIndexReplace > SvxXMLNumRuleExport::GetUNONumRule() const
-{
- return uno::Reference< ::com::sun::star::container::XIndexReplace > ();
-}
-
-void SvxXMLNumRuleExport::AddListStyleAttributes()
-{
-}
-
-
-SvxXMLNumRuleExport::SvxXMLNumRuleExport( SvXMLExport& rExp ) :
- rExport( rExp ),
- sNumberingRules( RTL_CONSTASCII_USTRINGPARAM( "NumberingRules" ) ),
- sIsPhysical( RTL_CONSTASCII_USTRINGPARAM( "IsPhysical" ) ),
- sIsContinuousNumbering( RTL_CONSTASCII_USTRINGPARAM( "IsContinuousNumbering" ) )
-{
-}
-
-SvxXMLNumRuleExport::~SvxXMLNumRuleExport()
-{
-}
-
-void SvxXMLNumRuleExport::exportNumberingRule(
- const OUString& rName,
- const Reference< XIndexReplace >& rNumRule )
-{
- Reference< XPropertySet > xPropSet( rNumRule, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo;
- if( xPropSet.is() )
- xPropSetInfo = xPropSet->getPropertySetInfo();
-
- GetExport().CheckAttrList();
-
- // style:name="..."
- if( rName.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NAME, rName );
-
- // text:consecutive-numbering="..."
- sal_Bool bContNumbering = sal_False;
- if( xPropSetInfo.is() &&
- xPropSetInfo->hasPropertyByName( sIsContinuousNumbering ) )
- {
- Any aAny( xPropSet->getPropertyValue( sIsContinuousNumbering ) );
- bContNumbering = *(sal_Bool *)aAny.getValue();
- }
- if( bContNumbering )
- GetExport().AddAttribute( XML_NAMESPACE_TEXT,
- XML_CONSECUTIVE_NUMBERING, XML_TRUE );
-
- // other application specific attributes
- AddListStyleAttributes();
-
- {
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, XML_LIST_STYLE ,
- sal_True, sal_True );
- exportLevelStyles( rNumRule );
- }
-}
-
-sal_Bool SvxXMLNumRuleExport::exportStyle( const Reference< XStyle >& rStyle )
-{
- Reference< XPropertySet > xPropSet( rStyle, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
-
- Any aAny;
-
- // Don't export styles that aren't existing really. This may be the
- // case for StarOffice Writer's pool styles.
- if( xPropSetInfo->hasPropertyByName( sIsPhysical ) )
- {
- aAny = xPropSet->getPropertyValue( sIsPhysical );
- if( !*(sal_Bool *)aAny.getValue() )
- return sal_False;
- }
-
- aAny = xPropSet->getPropertyValue( sNumberingRules );
- Reference<XIndexReplace> xNumRule;
- aAny >>= xNumRule;
-
- OUString sName = rStyle->getName();
-
- exportNumberingRule( sName, xNumRule );
-
- return sal_True;
-}
-
-void SvxXMLNumRuleExport::exportOutline()
-{
- Reference< XChapterNumberingSupplier > xCNSupplier( GetExport().GetModel(),
- UNO_QUERY );
- DBG_ASSERT( xCNSupplier.is(), "no chapter numbering supplier" );
-
- if( xCNSupplier.is() )
- {
- Reference< XIndexReplace > xNumRule( xCNSupplier->getChapterNumberingRules() );
- DBG_ASSERT( xNumRule.is(), "no chapter numbering rules" );
-
- if( xNumRule.is() )
- {
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT,
- XML_OUTLINE_STYLE, sal_True, sal_True );
- exportLevelStyles( xNumRule, sal_True );
- }
- }
-}
-
-void SvxXMLNumRuleExport::exportStyles( sal_Bool bUsed,
- XMLTextListAutoStylePool *pPool,
- sal_Bool bExportChapterNumbering )
-{
- if( bExportChapterNumbering )
- exportOutline();
-
- Reference< XStyleFamiliesSupplier > xFamiliesSupp( GetExport().GetModel(), UNO_QUERY );
- DBG_ASSERT( xFamiliesSupp.is(), "No XStyleFamiliesSupplier from XModel for export!" );
- if( xFamiliesSupp.is() )
- {
- Reference< XNameAccess > xFamilies( xFamiliesSupp->getStyleFamilies() );
- DBG_ASSERT( xFamiliesSupp.is(), "getStyleFamilies() from XModel failed for export!" );
-
- if( xFamilies.is() )
- {
- const OUString aNumberStyleName( RTL_CONSTASCII_USTRINGPARAM( "NumberingStyles" ));
-
- Reference< XIndexAccess > xStyles;
- if( xFamilies->hasByName( aNumberStyleName ) )
- {
- xFamilies->getByName( aNumberStyleName ) >>= xStyles;
-
- DBG_ASSERT( xStyles.is(), "Style not found for export!" );
-
- if( xStyles.is() )
- {
- const sal_Int32 nStyles = xStyles->getCount();
-
- for( sal_Int32 i=0; i < nStyles; i++ )
- {
- Reference< XStyle > xStyle;
- xStyles->getByIndex( i ) >>= xStyle;
-
- if( !bUsed || xStyle->isInUse() )
- {
- exportStyle( xStyle );
- if( pPool )
- pPool->RegisterName( xStyle->getName() );
- }
- }
- }
- }
- }
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_xmlnumfe.cxx b/binfilter/bf_xmloff/source/style/xmloff_xmlnumfe.cxx
deleted file mode 100644
index a3becfc0d671..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_xmlnumfe.cxx
+++ /dev/null
@@ -1,1785 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define _SVSTDARR_ULONGS
-#define _ZFORLIST_DECLARE_TABLE
-
-#include <bf_svtools/zformat.hxx>
-#include <bf_svtools/numuno.hxx>
-#include <bf_svtools/nfsymbol.hxx>
-#include <i18npool/mslangid.hxx>
-#include <tools/debug.hxx>
-#include <rtl/math.hxx>
-
-#include "xmlnmspe.hxx"
-#include "xmluconv.hxx"
-#include "xmlnumfi.hxx" // SvXMLNumFmtDefaults
-
-#define _SVSTDARR_USHORTS
-#include <bf_svtools/svstdarr.hxx>
-
-
-#include "xmlexp.hxx"
-
-#include <set>
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-//-------------------------------------------------------------------------
-
-// 4th condition for text formats doesn't work
-//#define XMLNUM_MAX_PARTS 4
-#define XMLNUM_MAX_PARTS 3
-
-//-------------------------------------------------------------------------
-
-struct LessuInt32
-{
- sal_Bool operator() (const sal_uInt32 rValue1, const sal_uInt32 rValue2) const
- {
- return rValue1 < rValue2;
- }
-};
-
-typedef ::std::set< sal_uInt32, LessuInt32 > SvXMLuInt32Set;
-
-class SvXMLNumUsedList_Impl
-{
- SvXMLuInt32Set aUsed;
- SvXMLuInt32Set aWasUsed;
- SvXMLuInt32Set::iterator aCurrentUsedPos;
- sal_uInt32 nUsedCount;
- sal_uInt32 nWasUsedCount;
-
-public:
- SvXMLNumUsedList_Impl();
- ~SvXMLNumUsedList_Impl();
-
- void SetUsed( sal_uInt32 nKey );
- sal_Bool IsUsed( sal_uInt32 nKey ) const;
- sal_Bool IsWasUsed( sal_uInt32 nKey ) const;
- void Export();
-
- sal_Bool GetFirstUsed(sal_uInt32& nKey);
- sal_Bool GetNextUsed(sal_uInt32& nKey);
-
- void GetWasUsed(uno::Sequence<sal_Int32>& rWasUsed);
- void SetWasUsed(const uno::Sequence<sal_Int32>& rWasUsed);
-};
-
-//-------------------------------------------------------------------------
-
-struct SvXMLEmbeddedTextEntry
-{
- sal_uInt16 nSourcePos; // position in NumberFormat (to skip later)
- sal_Int32 nFormatPos; // resulting position in embedded-text element
- ::rtl::OUString aText;
-
- SvXMLEmbeddedTextEntry( sal_uInt16 nSP, sal_Int32 nFP, const ::rtl::OUString& rT ) :
- nSourcePos(nSP), nFormatPos(nFP), aText(rT) {}
-};
-
-typedef SvXMLEmbeddedTextEntry* SvXMLEmbeddedTextEntryPtr;
-SV_DECL_PTRARR_DEL( SvXMLEmbeddedTextEntryArr, SvXMLEmbeddedTextEntryPtr, 4, 4 )//STRIP007 ;
-
-//-------------------------------------------------------------------------
-
-SV_IMPL_PTRARR( SvXMLEmbeddedTextEntryArr, SvXMLEmbeddedTextEntryPtr );
-
-//-------------------------------------------------------------------------
-
-//
-//! SvXMLNumUsedList_Impl should be optimized!
-//
-
-SvXMLNumUsedList_Impl::SvXMLNumUsedList_Impl() :
- nUsedCount(0),
- nWasUsedCount(0)
-{
-}
-
-SvXMLNumUsedList_Impl::~SvXMLNumUsedList_Impl()
-{
-}
-
-void SvXMLNumUsedList_Impl::SetUsed( sal_uInt32 nKey )
-{
- if ( !IsWasUsed(nKey) )
- {
- std::pair<SvXMLuInt32Set::iterator, bool> aPair = aUsed.insert( nKey );
- if (aPair.second)
- nUsedCount++;
- }
-}
-
-sal_Bool SvXMLNumUsedList_Impl::IsUsed( sal_uInt32 nKey ) const
-{
- SvXMLuInt32Set::const_iterator aItr = aUsed.find(nKey);
- return (aItr != aUsed.end());
-}
-
-sal_Bool SvXMLNumUsedList_Impl::IsWasUsed( sal_uInt32 nKey ) const
-{
- SvXMLuInt32Set::const_iterator aItr = aWasUsed.find(nKey);
- return (aItr != aWasUsed.end());
-}
-
-void SvXMLNumUsedList_Impl::Export()
-{
- SvXMLuInt32Set::iterator aItr = aUsed.begin();
- while (aItr != aUsed.end())
- {
- std::pair<SvXMLuInt32Set::iterator, bool> aPair = aWasUsed.insert( *aItr );
- if (aPair.second)
- nWasUsedCount++;
- aItr++;
- }
- aUsed.clear();
- nUsedCount = 0;
-}
-
-sal_Bool SvXMLNumUsedList_Impl::GetFirstUsed(sal_uInt32& nKey)
-{
- sal_Bool bRet(sal_False);
- aCurrentUsedPos = aUsed.begin();
- if(nUsedCount)
- {
- DBG_ASSERT(aCurrentUsedPos != aUsed.end(), "something went wrong");
- nKey = *aCurrentUsedPos;
- bRet = sal_True;
- }
- return bRet;
-}
-
-sal_Bool SvXMLNumUsedList_Impl::GetNextUsed(sal_uInt32& nKey)
-{
- sal_Bool bRet(sal_False);
- if (aCurrentUsedPos != aUsed.end())
- {
- aCurrentUsedPos++;
- if (aCurrentUsedPos != aUsed.end())
- {
- nKey = *aCurrentUsedPos;
- bRet = sal_True;
- }
- }
- return bRet;
-}
-
-void SvXMLNumUsedList_Impl::GetWasUsed(uno::Sequence<sal_Int32>& rWasUsed)
-{
- rWasUsed.realloc(nWasUsedCount);
- sal_Int32* pWasUsed = rWasUsed.getArray();
- if (pWasUsed)
- {
- SvXMLuInt32Set::iterator aItr = aWasUsed.begin();
- while (aItr != aWasUsed.end())
- {
- *pWasUsed = *aItr;
- aItr++;
- pWasUsed++;
- }
- }
-}
-
-void SvXMLNumUsedList_Impl::SetWasUsed(const uno::Sequence<sal_Int32>& rWasUsed)
-{
- DBG_ASSERT(nWasUsedCount == 0, "WasUsed should be empty");
- sal_Int32 nCount(rWasUsed.getLength());
- const sal_Int32* pWasUsed = rWasUsed.getConstArray();
- for (sal_uInt16 i = 0; i < nCount; i++, pWasUsed++)
- {
- std::pair<SvXMLuInt32Set::iterator, bool> aPair = aWasUsed.insert( *pWasUsed );
- if (aPair.second)
- nWasUsedCount++;
- }
-}
-
-//-------------------------------------------------------------------------
-
-SvXMLNumFmtExport::SvXMLNumFmtExport(
- SvXMLExport& rExp,
- const uno::Reference< util::XNumberFormatsSupplier >& rSupp ) :
- rExport( rExp ),
- pFormatter( NULL ),
- pCharClass( NULL ),
- pLocaleData( NULL ),
- sPrefix( OUString::createFromAscii( "N" ) )
-{
- // supplier must be SvNumberFormatsSupplierObj
- SvNumberFormatsSupplierObj* pObj =
- SvNumberFormatsSupplierObj::getImplementation( rSupp );
- if (pObj)
- pFormatter = pObj->GetNumberFormatter();
-
- if ( pFormatter )
- {
- pCharClass = new CharClass( pFormatter->GetServiceManager(),
- pFormatter->GetLocale() );
- pLocaleData = new LocaleDataWrapper( pFormatter->GetServiceManager(),
- pFormatter->GetLocale() );
- }
- else
- {
- lang::Locale aLocale( MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage() ) );
-
- // #110680#
- // pCharClass = new CharClass( ::comphelper::getProcessServiceFactory(), aLocale );
- // pLocaleData = new LocaleDataWrapper( ::comphelper::getProcessServiceFactory(), aLocale );
- pCharClass = new CharClass( rExport.getServiceFactory(), aLocale );
- pLocaleData = new LocaleDataWrapper( rExport.getServiceFactory(), aLocale );
- }
-
- pUsedList = new SvXMLNumUsedList_Impl;
-}
-
-SvXMLNumFmtExport::SvXMLNumFmtExport(
- SvXMLExport& rExp,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::util::XNumberFormatsSupplier >& rSupp,
- const ::rtl::OUString& rPrefix ) :
- rExport( rExp ),
- pFormatter( NULL ),
- pCharClass( NULL ),
- pLocaleData( NULL ),
- sPrefix( rPrefix )
-{
- // supplier must be SvNumberFormatsSupplierObj
- SvNumberFormatsSupplierObj* pObj =
- SvNumberFormatsSupplierObj::getImplementation( rSupp );
- if (pObj)
- pFormatter = pObj->GetNumberFormatter();
-
- if ( pFormatter )
- {
- pCharClass = new CharClass( pFormatter->GetServiceManager(),
- pFormatter->GetLocale() );
- pLocaleData = new LocaleDataWrapper( pFormatter->GetServiceManager(),
- pFormatter->GetLocale() );
- }
- else
- {
- lang::Locale aLocale( MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage() ) );
-
- // #110680#
- // pCharClass = new CharClass( ::comphelper::getProcessServiceFactory(), aLocale );
- // pLocaleData = new LocaleDataWrapper( ::comphelper::getProcessServiceFactory(), aLocale );
- pCharClass = new CharClass( rExport.getServiceFactory(), aLocale );
- pLocaleData = new LocaleDataWrapper( rExport.getServiceFactory(), aLocale );
- }
-
- pUsedList = new SvXMLNumUsedList_Impl;
-}
-
-SvXMLNumFmtExport::~SvXMLNumFmtExport()
-{
- delete pUsedList;
- delete pLocaleData;
- delete pCharClass;
-}
-
-//-------------------------------------------------------------------------
-
-//
-// helper methods
-//
-
-OUString lcl_CreateStyleName( sal_Int32 nKey, sal_Int32 nPart, sal_Bool bDefPart, const ::rtl::OUString& rPrefix )
-{
- OUStringBuffer aFmtName( 10L );
- aFmtName.append( rPrefix );
- aFmtName.append( nKey );
- if (!bDefPart)
- {
- aFmtName.append( (sal_Unicode)'P' );
- aFmtName.append( nPart );
- }
- return aFmtName.makeStringAndClear();
-}
-
-void SvXMLNumFmtExport::AddCalendarAttr_Impl( const OUString& rCalendar )
-{
- if ( rCalendar.getLength() )
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_CALENDAR, rCalendar );
- }
-}
-
-void SvXMLNumFmtExport::AddTextualAttr_Impl( sal_Bool bText )
-{
- if ( bText ) // non-textual
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_TEXTUAL, XML_TRUE );
- }
-}
-
-void SvXMLNumFmtExport::AddStyleAttr_Impl( sal_Bool bLong )
-{
- if ( bLong ) // short is default
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_STYLE, XML_LONG );
- }
-}
-
-void SvXMLNumFmtExport::AddLanguageAttr_Impl( sal_Int32 nLang )
-{
- if ( nLang != LANGUAGE_SYSTEM )
- {
- OUString aLangStr, aCountryStr;
- MsLangId::convertLanguageToIsoNames( (LanguageType)nLang, aLangStr, aCountryStr );
-
- if (aLangStr.getLength())
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_LANGUAGE, aLangStr );
- }
- if (aCountryStr.getLength())
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_COUNTRY, aCountryStr );
- }
- }
-}
-
-//-------------------------------------------------------------------------
-
-//
-// methods to write individual elements within a format
-//
-
-void SvXMLNumFmtExport::AddToTextElement_Impl( const OUString& rString )
-{
- // append to sTextContent, write element in FinishTextElement_Impl
- // to avoid several text elements following each other
-
- sTextContent.append( rString );
-}
-
-void SvXMLNumFmtExport::FinishTextElement_Impl()
-{
- if ( sTextContent.getLength() )
- {
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_TEXT,
- sal_True, sal_False );
- rExport.Characters( sTextContent.makeStringAndClear() );
- }
-}
-
-void SvXMLNumFmtExport::WriteColorElement_Impl( const Color& rColor )
-{
- FinishTextElement_Impl();
-
- OUStringBuffer aColStr( 7 );
- SvXMLUnitConverter::convertColor( aColStr, rColor );
- rExport.AddAttribute( XML_NAMESPACE_FO, XML_COLOR,
- aColStr.makeStringAndClear() );
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_STYLE, XML_PROPERTIES,
- sal_True, sal_False );
-}
-
-void SvXMLNumFmtExport::WriteCurrencyElement_Impl( const OUString& rString,
- const OUString& rExt )
-{
- FinishTextElement_Impl();
-
- if ( rExt.getLength() )
- {
- sal_Int32 nLang = rExt.toInt32(16); // hex
- if ( nLang < 0 ) // extension string may contain "-" separator
- nLang = -nLang;
- AddLanguageAttr_Impl( nLang ); // adds to pAttrList
- }
-
- SvXMLElementExport aElem( rExport,
- XML_NAMESPACE_NUMBER, XML_CURRENCY_SYMBOL,
- sal_True, sal_False );
- rExport.Characters( rString );
-}
-
-void SvXMLNumFmtExport::WriteBooleanElement_Impl()
-{
- FinishTextElement_Impl();
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_BOOLEAN,
- sal_True, sal_False );
-}
-
-void SvXMLNumFmtExport::WriteTextContentElement_Impl()
-{
- FinishTextElement_Impl();
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_TEXT_CONTENT,
- sal_True, sal_False );
-}
-
-// date elements
-
-void SvXMLNumFmtExport::WriteDayElement_Impl( const OUString& rCalendar, sal_Bool bLong )
-{
- FinishTextElement_Impl();
-
- AddCalendarAttr_Impl( rCalendar ); // adds to pAttrList
- AddStyleAttr_Impl( bLong ); // adds to pAttrList
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_DAY,
- sal_True, sal_False );
-}
-
-void SvXMLNumFmtExport::WriteMonthElement_Impl( const OUString& rCalendar, sal_Bool bLong, sal_Bool bText )
-{
- FinishTextElement_Impl();
-
- AddCalendarAttr_Impl( rCalendar ); // adds to pAttrList
- AddStyleAttr_Impl( bLong ); // adds to pAttrList
- AddTextualAttr_Impl( bText ); // adds to pAttrList
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_MONTH,
- sal_True, sal_False );
-}
-
-void SvXMLNumFmtExport::WriteYearElement_Impl( const OUString& rCalendar, sal_Bool bLong )
-{
- FinishTextElement_Impl();
-
- AddCalendarAttr_Impl( rCalendar ); // adds to pAttrList
- AddStyleAttr_Impl( bLong ); // adds to pAttrList
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_YEAR,
- sal_True, sal_False );
-}
-
-void SvXMLNumFmtExport::WriteEraElement_Impl( const OUString& rCalendar, sal_Bool bLong )
-{
- FinishTextElement_Impl();
-
- AddCalendarAttr_Impl( rCalendar ); // adds to pAttrList
- AddStyleAttr_Impl( bLong ); // adds to pAttrList
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_ERA,
- sal_True, sal_False );
-}
-
-void SvXMLNumFmtExport::WriteDayOfWeekElement_Impl( const OUString& rCalendar, sal_Bool bLong )
-{
- FinishTextElement_Impl();
-
- AddCalendarAttr_Impl( rCalendar ); // adds to pAttrList
- AddStyleAttr_Impl( bLong ); // adds to pAttrList
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_DAY_OF_WEEK,
- sal_True, sal_False );
-}
-
-void SvXMLNumFmtExport::WriteWeekElement_Impl( const OUString& rCalendar )
-{
- FinishTextElement_Impl();
-
- AddCalendarAttr_Impl( rCalendar ); // adds to pAttrList
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_WEEK_OF_YEAR,
- sal_True, sal_False );
-}
-
-void SvXMLNumFmtExport::WriteQuarterElement_Impl( const OUString& rCalendar, sal_Bool bLong )
-{
- FinishTextElement_Impl();
-
- AddCalendarAttr_Impl( rCalendar ); // adds to pAttrList
- AddStyleAttr_Impl( bLong ); // adds to pAttrList
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_QUARTER,
- sal_True, sal_False );
-}
-
-// time elements
-
-void SvXMLNumFmtExport::WriteHoursElement_Impl( sal_Bool bLong )
-{
- FinishTextElement_Impl();
-
- AddStyleAttr_Impl( bLong ); // adds to pAttrList
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_HOURS,
- sal_True, sal_False );
-}
-
-void SvXMLNumFmtExport::WriteMinutesElement_Impl( sal_Bool bLong )
-{
- FinishTextElement_Impl();
-
- AddStyleAttr_Impl( bLong ); // adds to pAttrList
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_MINUTES,
- sal_True, sal_False );
-}
-
-void SvXMLNumFmtExport::WriteSecondsElement_Impl( sal_Bool bLong, sal_uInt16 nDecimals )
-{
- FinishTextElement_Impl();
-
- AddStyleAttr_Impl( bLong ); // adds to pAttrList
- if ( nDecimals > 0 )
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_DECIMAL_PLACES,
- OUString::valueOf( (sal_Int32) nDecimals ) );
- }
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_SECONDS,
- sal_True, sal_False );
-}
-
-void SvXMLNumFmtExport::WriteAMPMElement_Impl()
-{
- FinishTextElement_Impl();
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_AM_PM,
- sal_True, sal_False );
-}
-
-// numbers
-
-void SvXMLNumFmtExport::WriteNumberElement_Impl(
- sal_Int32 nDecimals, sal_Int32 nInteger,
- const OUString& rDashStr, sal_Bool bVarDecimals,
- sal_Bool bGrouping, sal_Int32 nTrailingThousands,
- const SvXMLEmbeddedTextEntryArr& rEmbeddedEntries )
-{
- FinishTextElement_Impl();
-
- // decimals
- if ( nDecimals >= 0 ) // negative = automatic
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_DECIMAL_PLACES,
- OUString::valueOf( nDecimals ) );
- }
-
- // integer digits
- if ( nInteger >= 0 ) // negative = automatic
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_MIN_INTEGER_DIGITS,
- OUString::valueOf( nInteger ) );
- }
-
- // decimal replacement (dashes) or variable decimals (#)
- if ( rDashStr.getLength() || bVarDecimals )
- {
- // variable decimals means an empty replacement string
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_DECIMAL_REPLACEMENT,
- rDashStr );
- }
-
- // (automatic) grouping separator
- if ( bGrouping )
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_GROUPING, XML_TRUE );
- }
-
- // display-factor if there are trailing thousands separators
- if ( nTrailingThousands )
- {
- // each separator character removes three digits
- double fFactor = ::rtl::math::pow10Exp( 1.0, 3 * nTrailingThousands );
-
- OUStringBuffer aFactStr;
- SvXMLUnitConverter::convertDouble( aFactStr, fFactor );
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_DISPLAY_FACTOR, aFactStr.makeStringAndClear() );
- }
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_NUMBER,
- sal_True, sal_True );
-
- // number:embedded-text as child elements
-
- sal_uInt16 nEntryCount = rEmbeddedEntries.Count();
- for (sal_uInt16 nEntry=0; nEntry<nEntryCount; nEntry++)
- {
- SvXMLEmbeddedTextEntry* pObj = rEmbeddedEntries[nEntry];
-
- // position attribute
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_POSITION,
- OUString::valueOf( pObj->nFormatPos ) );
- SvXMLElementExport aChildElem( rExport, XML_NAMESPACE_NUMBER, XML_EMBEDDED_TEXT,
- sal_True, sal_False );
-
- // text as element content
- rExport.Characters( pObj->aText );
- }
-}
-
-void SvXMLNumFmtExport::WriteScientificElement_Impl(
- sal_Int32 nDecimals, sal_Int32 nInteger,
- sal_Bool bGrouping, sal_Int32 nExp )
-{
- FinishTextElement_Impl();
-
- // decimals
- if ( nDecimals >= 0 ) // negative = automatic
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_DECIMAL_PLACES,
- OUString::valueOf( nDecimals ) );
- }
-
- // integer digits
- if ( nInteger >= 0 ) // negative = automatic
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_MIN_INTEGER_DIGITS,
- OUString::valueOf( nInteger ) );
- }
-
- // (automatic) grouping separator
- if ( bGrouping )
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_GROUPING, XML_TRUE );
- }
-
- // exponent digits
- if ( nExp >= 0 )
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_MIN_EXPONENT_DIGITS,
- OUString::valueOf( nExp ) );
- }
-
- SvXMLElementExport aElem( rExport,
- XML_NAMESPACE_NUMBER, XML_SCIENTIFIC_NUMBER,
- sal_True, sal_False );
-}
-
-void SvXMLNumFmtExport::WriteFractionElement_Impl(
- sal_Int32 nInteger, sal_Bool bGrouping,
- sal_Int32 nNumerator, sal_Int32 nDenominator )
-{
- FinishTextElement_Impl();
-
- // integer digits
- if ( nInteger >= 0 ) // negative = default (no integer part)
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_MIN_INTEGER_DIGITS,
- OUString::valueOf( nInteger ) );
- }
-
- // (automatic) grouping separator
- if ( bGrouping )
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_GROUPING, XML_TRUE );
- }
-
- // numerator digits
- if ( nNumerator >= 0 )
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_MIN_NUMERATOR_DIGITS,
- OUString::valueOf( nNumerator ) );
- }
-
- // denominator digits
- if ( nDenominator >= 0 )
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_MIN_DENOMINATOR_DIGITS,
- OUString::valueOf( nDenominator ) );
- }
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, XML_FRACTION,
- sal_True, sal_False );
-}
-
-// mapping (condition)
-
-void SvXMLNumFmtExport::WriteMapElement_Impl( sal_Int32 nOp, double fLimit,
- sal_Int32 nKey, sal_Int32 nPart )
-{
- FinishTextElement_Impl();
-
- if ( nOp != NUMBERFORMAT_OP_NO )
- {
- // style namespace
-
- OUStringBuffer aCondStr( 20L );
- aCondStr.appendAscii( "value()" ); //! define constant
- switch ( nOp )
- {
- case NUMBERFORMAT_OP_EQ: aCondStr.append( (sal_Unicode) '=' ); break;
- case NUMBERFORMAT_OP_NE: aCondStr.appendAscii( "<>" ); break;
- case NUMBERFORMAT_OP_LT: aCondStr.append( (sal_Unicode) '<' ); break;
- case NUMBERFORMAT_OP_LE: aCondStr.appendAscii( "<=" ); break;
- case NUMBERFORMAT_OP_GT: aCondStr.append( (sal_Unicode) '>' ); break;
- case NUMBERFORMAT_OP_GE: aCondStr.appendAscii( ">=" ); break;
- default:
- DBG_ERROR("unknown operator");
- }
- ::rtl::math::doubleToUStringBuffer( aCondStr, fLimit,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true );
-
- rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_CONDITION,
- aCondStr.makeStringAndClear() );
-
- rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_APPLY_STYLE_NAME,
- lcl_CreateStyleName( nKey, nPart, sal_False,
- sPrefix ) );
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_STYLE, XML_MAP,
- sal_True, sal_False );
- }
-}
-
-//-------------------------------------------------------------------------
-// for old (automatic) currency formats: parse currency symbol from text
-
-xub_StrLen lcl_FindSymbol( const String& sUpperStr, const String& sCurString )
-{
- // search for currency symbol
- // Quoting as in ImpSvNumberformatScan::Symbol_Division
-
- xub_StrLen nCPos = 0;
- while (nCPos != STRING_NOTFOUND)
- {
- nCPos = sUpperStr.Search( sCurString, nCPos );
- if (nCPos != STRING_NOTFOUND)
- {
- // in Quotes?
- xub_StrLen nQ = SvNumberformat::GetQuoteEnd( sUpperStr, nCPos );
- if ( nQ == STRING_NOTFOUND )
- {
- // dm can be escaped as "dm or \d
- sal_Unicode c;
- if ( nCPos == 0 ||
- ((c = sUpperStr.GetChar(xub_StrLen(nCPos-1))) != '"'
- && c != '\\') )
- {
- return nCPos; // found
- }
- else
- nCPos++; // continue
- }
- else
- nCPos = nQ + 1; // continue after quote end
- }
- }
- return STRING_NOTFOUND; // not found
-}
-
-sal_Bool SvXMLNumFmtExport::WriteTextWithCurrency_Impl( const OUString& rString,
- const ::com::sun::star::lang::Locale& rLocale )
-{
- // returns TRUE if currency element was written
-
- sal_Bool bRet = sal_False;
-
-// pLocaleData->setLocale( rLocale );
-// String sCurString = pLocaleData->getCurrSymbol();
-
- LanguageType nLang = MsLangId::convertIsoNamesToLanguage( rLocale.Language, rLocale.Country );
- pFormatter->ChangeIntl( nLang );
- String sCurString, sDummy;
- pFormatter->GetCompatibilityCurrency( sCurString, sDummy );
-
- pCharClass->setLocale( rLocale );
- String sUpperStr = pCharClass->upper(rString);
- xub_StrLen nPos = lcl_FindSymbol( sUpperStr, sCurString );
- if ( nPos != STRING_NOTFOUND )
- {
- sal_Int32 nLength = rString.getLength();
- sal_Int32 nCurLen = sCurString.Len();
- sal_Int32 nCont = nPos + nCurLen;
-
- // text before currency symbol
- if ( nPos > 0 )
- AddToTextElement_Impl( rString.copy( 0, nPos ) );
-
- // currency symbol (empty string -> default)
- OUString sEmpty;
- WriteCurrencyElement_Impl( sEmpty, sEmpty );
- bRet = sal_True;
-
- // text after currency symbol
- if ( nCont < nLength )
- AddToTextElement_Impl( rString.copy( nCont, nLength-nCont ) );
- }
- else
- AddToTextElement_Impl( rString ); // simple text
-
- return bRet; // TRUE: currency element written
-}
-
-//-------------------------------------------------------------------------
-
-OUString lcl_GetDefaultCalendar( SvNumberFormatter* pFormatter, LanguageType nLang )
-{
- // get name of first non-gregorian calendar for the language
-
- OUString aCalendar;
- CalendarWrapper* pCalendar = pFormatter->GetCalendar();
- if (pCalendar)
- {
- lang::Locale aLocale( MsLangId::convertLanguageToLocale( nLang ));
-
- uno::Sequence<OUString> aCals = pCalendar->getAllCalendars( aLocale );
- sal_Int32 nCnt = aCals.getLength();
- sal_Bool bFound = sal_False;
- for ( sal_Int32 j=0; j < nCnt && !bFound; j++ )
- {
- if ( !aCals[j].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("gregorian") ) )
- {
- aCalendar = aCals[j];
- bFound = sal_True;
- }
- }
- }
- return aCalendar;
-}
-
-//-------------------------------------------------------------------------
-
-sal_Bool lcl_IsInEmbedded( const SvXMLEmbeddedTextEntryArr& rEmbeddedEntries, sal_uInt16 nPos )
-{
- sal_uInt16 nCount = rEmbeddedEntries.Count();
- for (sal_uInt16 i=0; i<nCount; i++)
- if ( rEmbeddedEntries[i]->nSourcePos == nPos )
- return sal_True;
-
- return sal_False; // not found
-}
-
-BOOL lcl_IsDefaultDateFormat( const SvNumberformat& rFormat, sal_Bool bSystemDate, NfIndexTableOffset eBuiltIn )
-{
- // make an extra loop to collect date elements, to check if it is a default format
- // before adding the automatic-order attribute
-
- SvXMLDateElementAttributes eDateDOW = XML_DEA_NONE;
- SvXMLDateElementAttributes eDateDay = XML_DEA_NONE;
- SvXMLDateElementAttributes eDateMonth = XML_DEA_NONE;
- SvXMLDateElementAttributes eDateYear = XML_DEA_NONE;
- SvXMLDateElementAttributes eDateHours = XML_DEA_NONE;
- SvXMLDateElementAttributes eDateMins = XML_DEA_NONE;
- SvXMLDateElementAttributes eDateSecs = XML_DEA_NONE;
- sal_Bool bDateNoDefault = sal_False;
-
- sal_uInt16 nPos = 0;
- sal_Bool bEnd = sal_False;
- short nLastType = 0;
- while (!bEnd)
- {
- short nElemType = rFormat.GetNumForType( 0, nPos, sal_False );
- switch ( nElemType )
- {
- case 0:
- if ( nLastType == NF_SYMBOLTYPE_STRING )
- bDateNoDefault = sal_True; // text at the end -> no default date format
- bEnd = sal_True; // end of format reached
- break;
- case NF_SYMBOLTYPE_STRING:
- case NF_SYMBOLTYPE_DATESEP:
- case NF_SYMBOLTYPE_TIMESEP:
- case NF_SYMBOLTYPE_TIME100SECSEP:
- // text is ignored, except at the end
- break;
- // same mapping as in SvXMLNumFormatContext::AddNfKeyword:
- case NF_KEY_NN: eDateDOW = XML_DEA_SHORT; break;
- case NF_KEY_NNN:
- case NF_KEY_NNNN: eDateDOW = XML_DEA_LONG; break;
- case NF_KEY_D: eDateDay = XML_DEA_SHORT; break;
- case NF_KEY_DD: eDateDay = XML_DEA_LONG; break;
- case NF_KEY_M: eDateMonth = XML_DEA_SHORT; break;
- case NF_KEY_MM: eDateMonth = XML_DEA_LONG; break;
- case NF_KEY_MMM: eDateMonth = XML_DEA_TEXTSHORT; break;
- case NF_KEY_MMMM: eDateMonth = XML_DEA_TEXTLONG; break;
- case NF_KEY_YY: eDateYear = XML_DEA_SHORT; break;
- case NF_KEY_YYYY: eDateYear = XML_DEA_LONG; break;
- case NF_KEY_H: eDateHours = XML_DEA_SHORT; break;
- case NF_KEY_HH: eDateHours = XML_DEA_LONG; break;
- case NF_KEY_MI: eDateMins = XML_DEA_SHORT; break;
- case NF_KEY_MMI: eDateMins = XML_DEA_LONG; break;
- case NF_KEY_S: eDateSecs = XML_DEA_SHORT; break;
- case NF_KEY_SS: eDateSecs = XML_DEA_LONG; break;
- case NF_KEY_AP:
- case NF_KEY_AMPM: break; // AM/PM may or may not be in date/time formats -> ignore by itself
- default:
- bDateNoDefault = sal_True; // any other element -> no default format
- }
- nLastType = nElemType;
- ++nPos;
- }
-
- if ( bDateNoDefault )
- return FALSE; // additional elements
- else
- {
- NfIndexTableOffset eFound = (NfIndexTableOffset) SvXMLNumFmtDefaults::GetDefaultDateFormat(
- eDateDOW, eDateDay, eDateMonth, eDateYear, eDateHours, eDateMins, eDateSecs, bSystemDate );
-
- return ( eFound == eBuiltIn );
- }
-}
-
-//
-// export one part (condition)
-//
-
-void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt32 nKey,
- sal_uInt16 nPart, sal_Bool bDefPart )
-{
- //! for the default part, pass the coditions from the other parts!
-
- //
- // element name
- //
-
- NfIndexTableOffset eBuiltIn = pFormatter->GetIndexTableOffset( nKey );
-
- short nFmtType = 0;
- sal_Bool bThousand = sal_False;
- sal_uInt16 nPrecision = 0;
- sal_uInt16 nLeading = 0;
- rFormat.GetNumForInfo( nPart, nFmtType, bThousand, nPrecision, nLeading);
- nFmtType &= ~NUMBERFORMAT_DEFINED;
-
- // special treatment of builtin formats that aren't detected by normal parsing
- // (the same formats that get the type set in SvNumberFormatter::ImpGenerateFormats)
- if ( eBuiltIn == NF_NUMBER_STANDARD )
- nFmtType = NUMBERFORMAT_NUMBER;
- else if ( eBuiltIn == NF_BOOLEAN )
- nFmtType = NUMBERFORMAT_LOGICAL;
- else if ( eBuiltIn == NF_TEXT )
- nFmtType = NUMBERFORMAT_TEXT;
-
- // #101606# An empty subformat is a valid number-style resulting in an
- // empty display string for the condition of the subformat.
- if ( nFmtType == NUMBERFORMAT_UNDEFINED && rFormat.GetNumForType( nPart,
- 0, sal_False ) == 0 )
- nFmtType = 0;
-
- XMLTokenEnum eType = XML_TOKEN_INVALID;
- switch ( nFmtType )
- {
- // type is 0 if a format contains no recognized elements
- // (like text only) - this is handled as a number-style.
- case 0:
- case NUMBERFORMAT_NUMBER:
- case NUMBERFORMAT_SCIENTIFIC:
- case NUMBERFORMAT_FRACTION:
- eType = XML_NUMBER_STYLE;
- break;
- case NUMBERFORMAT_PERCENT:
- eType = XML_PERCENTAGE_STYLE;
- break;
- case NUMBERFORMAT_CURRENCY:
- eType = XML_CURRENCY_STYLE;
- break;
- case NUMBERFORMAT_DATE:
- case NUMBERFORMAT_DATETIME:
- eType = XML_DATE_STYLE;
- break;
- case NUMBERFORMAT_TIME:
- eType = XML_TIME_STYLE;
- break;
- case NUMBERFORMAT_TEXT:
- eType = XML_TEXT_STYLE;
- break;
- case NUMBERFORMAT_LOGICAL:
- eType = XML_BOOLEAN_STYLE;
- break;
- }
- DBG_ASSERT( eType != XML_TOKEN_INVALID, "unknown format type" );
-
- OUString sAttrValue;
- sal_Bool bUserDef = ( ( rFormat.GetType() & NUMBERFORMAT_DEFINED ) != 0 );
-
- //
- // common attributes for format
- //
-
- // format name (generated from key) - style namespace
- rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_NAME,
- lcl_CreateStyleName( nKey, nPart, bDefPart, sPrefix ) );
- rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_FAMILY,
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- XML_STYLE_FAMILY_DATA_STYLE_NAME)) );
-
- // "volatile" attribute for styles used only in maps
- if ( !bDefPart )
- rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_VOLATILE, XML_TRUE );
-
- // language / country
- LanguageType nLang = rFormat.GetLanguage();
- AddLanguageAttr_Impl( nLang ); // adds to pAttrList
-
- // title (comment)
- // titles for builtin formats are not written
- sAttrValue = rFormat.GetComment();
- if ( sAttrValue.getLength() && bUserDef && bDefPart )
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_TITLE, sAttrValue );
- }
-
- // automatic ordering for currency and date formats
- // only used for some built-in formats
- BOOL bAutoOrder = ( eBuiltIn == NF_CURRENCY_1000INT || eBuiltIn == NF_CURRENCY_1000DEC2 ||
- eBuiltIn == NF_CURRENCY_1000INT_RED || eBuiltIn == NF_CURRENCY_1000DEC2_RED ||
- eBuiltIn == NF_CURRENCY_1000DEC2_DASHED ||
- eBuiltIn == NF_DATE_SYSTEM_SHORT || eBuiltIn == NF_DATE_SYSTEM_LONG ||
- eBuiltIn == NF_DATE_SYS_MMYY || eBuiltIn == NF_DATE_SYS_DDMMM ||
- eBuiltIn == NF_DATE_SYS_DDMMYYYY || eBuiltIn == NF_DATE_SYS_DDMMYY ||
- eBuiltIn == NF_DATE_SYS_DMMMYY || eBuiltIn == NF_DATE_SYS_DMMMYYYY ||
- eBuiltIn == NF_DATE_SYS_DMMMMYYYY || eBuiltIn == NF_DATE_SYS_NNDMMMYY ||
- eBuiltIn == NF_DATE_SYS_NNDMMMMYYYY || eBuiltIn == NF_DATE_SYS_NNNNDMMMMYYYY ||
- eBuiltIn == NF_DATETIME_SYSTEM_SHORT_HHMM || eBuiltIn == NF_DATETIME_SYS_DDMMYYYY_HHMMSS );
-
- // format source (for date and time formats)
- // only used for some built-in formats
- BOOL bSystemDate = ( eBuiltIn == NF_DATE_SYSTEM_SHORT ||
- eBuiltIn == NF_DATE_SYSTEM_LONG ||
- eBuiltIn == NF_DATETIME_SYSTEM_SHORT_HHMM );
- BOOL bLongSysDate = ( eBuiltIn == NF_DATE_SYSTEM_LONG );
-
- // check if the format definition matches the key
- if ( bAutoOrder && ( nFmtType == NUMBERFORMAT_DATE || nFmtType == NUMBERFORMAT_DATETIME ) &&
- !lcl_IsDefaultDateFormat( rFormat, bSystemDate, eBuiltIn ) )
- {
- bAutoOrder = bSystemDate = bLongSysDate = FALSE; // don't write automatic-order attribute then
- }
-
- if ( bAutoOrder &&
- ( nFmtType == NUMBERFORMAT_CURRENCY || nFmtType == NUMBERFORMAT_DATE || nFmtType == NUMBERFORMAT_DATETIME ) )
- {
- // #85109# format type must be checked to avoid dtd errors if
- // locale data contains other format types at the built-in positions
-
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_AUTOMATIC_ORDER,
- XML_TRUE );
- }
-
- if ( bSystemDate && bAutoOrder &&
- ( nFmtType == NUMBERFORMAT_DATE || nFmtType == NUMBERFORMAT_DATETIME ) )
- {
- // #85109# format type must be checked to avoid dtd errors if
- // locale data contains other format types at the built-in positions
-
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_FORMAT_SOURCE,
- XML_LANGUAGE );
- }
-
- // overflow for time formats as in [hh]:mm
- // controlled by bThousand from number format info
- // default for truncate-on-overflow is true
- if ( nFmtType == NUMBERFORMAT_TIME && bThousand )
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_TRUNCATE_ON_OVERFLOW,
- XML_FALSE );
- }
-
- //
- // Native number transliteration
- //
- ::com::sun::star::i18n::NativeNumberXmlAttributes aAttr;
- rFormat.GetNatNumXml( aAttr, nPart );
- if ( aAttr.Format.getLength() )
- {
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_TRANSLITERATION_FORMAT,
- aAttr.Format );
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_TRANSLITERATION_LANGUAGE,
- aAttr.Locale.Language );
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_TRANSLITERATION_COUNTRY,
- aAttr.Locale.Country );
- rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_TRANSLITERATION_STYLE,
- aAttr.Style );
- }
-
- //
- // The element
- //
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_NUMBER, eType,
- sal_True, sal_True );
-
- //
- // color (properties element)
- //
-
- const Color* pCol = rFormat.GetColor( nPart );
- if (pCol)
- WriteColorElement_Impl(*pCol);
-
-
- // detect if there is "real" content, excluding color and maps
- //! move to implementation of Write... methods?
- sal_Bool bAnyContent = sal_False;
-
- //
- // format elements
- //
-
- SvXMLEmbeddedTextEntryArr aEmbeddedEntries(0);
- if ( eBuiltIn == NF_NUMBER_STANDARD )
- {
- // default number format contains just one number element
- WriteNumberElement_Impl( -1, 1, OUString(), sal_False, sal_False, 0, aEmbeddedEntries );
- bAnyContent = sal_True;
- }
- else if ( eBuiltIn == NF_BOOLEAN )
- {
- // boolean format contains just one boolean element
- WriteBooleanElement_Impl();
- bAnyContent = sal_True;
- }
- else
- {
- // first loop to collect attributes
-
- sal_Bool bDecDashes = sal_False;
- sal_Bool bVarDecimals = sal_False;
- sal_Bool bExpFound = sal_False;
- sal_Bool bCurrFound = sal_False;
- sal_Bool bInInteger = sal_True;
- sal_Int32 nExpDigits = 0;
- sal_Int32 nIntegerSymbols = 0; // for embedded-text, including "#"
- sal_Int32 nTrailingThousands = 0; // thousands-separators after all digits
- OUString sCurrExt;
- OUString aCalendar;
- sal_uInt16 nPos = 0;
- sal_Bool bEnd = sal_False;
- while (!bEnd)
- {
- short nElemType = rFormat.GetNumForType( nPart, nPos, sal_False );
- const XubString* pElemStr = rFormat.GetNumForString( nPart, nPos, sal_False );
-
- switch ( nElemType )
- {
- case 0:
- bEnd = sal_True; // end of format reached
- break;
- case NF_SYMBOLTYPE_DIGIT:
- if ( bExpFound && pElemStr )
- nExpDigits += pElemStr->Len();
- else if ( !bDecDashes && pElemStr && pElemStr->GetChar(0) == '-' )
- bDecDashes = TRUE;
- else if ( !bVarDecimals && !bInInteger && pElemStr && pElemStr->GetChar(0) == '#' )
- {
- // If the decimal digits string starts with a '#', variable
- // decimals is assumed (for 0.###, but not 0.0##).
- bVarDecimals = sal_True;
- }
- if ( bInInteger && pElemStr )
- nIntegerSymbols += pElemStr->Len();
- nTrailingThousands = 0;
- break;
- case NF_SYMBOLTYPE_DECSEP:
- bInInteger = sal_False;
- break;
- case NF_SYMBOLTYPE_THSEP:
- if (pElemStr)
- nTrailingThousands += pElemStr->Len(); // is reset to 0 if digits follow
- break;
- case NF_SYMBOLTYPE_EXP:
- bExpFound = sal_True; // following digits are exponent digits
- bInInteger = sal_False;
- break;
- case NF_SYMBOLTYPE_CURRENCY:
- bCurrFound = TRUE;
- break;
- case NF_SYMBOLTYPE_CURREXT:
- if (pElemStr)
- sCurrExt = *pElemStr;
- break;
-
- // E, EE, R, RR: select non-gregorian calendar
- // AAA, AAAA: calendar is switched at the position of the element
- case NF_KEY_EC:
- case NF_KEY_EEC:
- case NF_KEY_R:
- case NF_KEY_RR:
- if (!aCalendar.getLength())
- aCalendar = lcl_GetDefaultCalendar( pFormatter, nLang );
- break;
- }
- ++nPos;
- }
-
- // collect strings for embedded-text (must be known before number element is written)
-
- sal_Bool bAllowEmbedded = ( nFmtType == 0 || nFmtType == NUMBERFORMAT_NUMBER ||
- nFmtType == NUMBERFORMAT_CURRENCY ||
- nFmtType == NUMBERFORMAT_PERCENT );
- if ( bAllowEmbedded )
- {
- sal_Int32 nDigitsPassed = 0;
- nPos = 0;
- bEnd = sal_False;
- while (!bEnd)
- {
- short nElemType = rFormat.GetNumForType( nPart, nPos, sal_False );
- const XubString* pElemStr = rFormat.GetNumForString( nPart, nPos, sal_False );
-
- switch ( nElemType )
- {
- case 0:
- bEnd = sal_True; // end of format reached
- break;
- case NF_SYMBOLTYPE_DIGIT:
- if ( pElemStr )
- nDigitsPassed += pElemStr->Len();
- break;
- case NF_SYMBOLTYPE_STRING:
- case NF_SYMBOLTYPE_BLANK:
- case NF_SYMBOLTYPE_PERCENT:
- if ( nDigitsPassed > 0 && nDigitsPassed < nIntegerSymbols && pElemStr )
- {
- // text (literal or underscore) within the integer part of a number:number element
-
- String aEmbeddedStr;
- if ( nElemType == NF_SYMBOLTYPE_STRING || nElemType == NF_SYMBOLTYPE_PERCENT )
- aEmbeddedStr = *pElemStr;
- else
- SvNumberformat::InsertBlanks( aEmbeddedStr, 0, pElemStr->GetChar(1) );
-
- sal_Int32 nEmbedPos = nIntegerSymbols - nDigitsPassed;
-
- SvXMLEmbeddedTextEntry* pObj = new SvXMLEmbeddedTextEntry( nPos, nEmbedPos, aEmbeddedStr );
- aEmbeddedEntries.Insert( pObj, aEmbeddedEntries.Count() );
- }
- break;
- }
- ++nPos;
- }
- }
-
- // final loop to write elements
-
- sal_Bool bNumWritten = sal_False;
- sal_Bool bCurrencyWritten = sal_False;
- short nPrevType = 0;
- nPos = 0;
- bEnd = sal_False;
- while (!bEnd)
- {
- short nElemType = rFormat.GetNumForType( nPart, nPos, sal_False );
- const XubString* pElemStr = rFormat.GetNumForString( nPart, nPos, sal_False );
-
- switch ( nElemType )
- {
- case 0:
- bEnd = sal_True; // end of format reached
- break;
- case NF_SYMBOLTYPE_STRING:
- case NF_SYMBOLTYPE_DATESEP:
- case NF_SYMBOLTYPE_TIMESEP:
- case NF_SYMBOLTYPE_TIME100SECSEP:
- case NF_SYMBOLTYPE_PERCENT:
- if (pElemStr)
- {
- if ( ( nPrevType == NF_KEY_S || nPrevType == NF_KEY_SS ) &&
- ( nElemType == NF_SYMBOLTYPE_TIME100SECSEP ) &&
- nPrecision > 0 )
- {
- // decimal separator after seconds is implied by
- // "decimal-places" attribute and must not be written
- // as text element
- //! difference between '.' and ',' is lost here
- }
- else if ( lcl_IsInEmbedded( aEmbeddedEntries, nPos ) )
- {
- // text is written as embedded-text child of the number,
- // don't create a text element
- }
- else if ( nFmtType == NUMBERFORMAT_CURRENCY && !bCurrFound && !bCurrencyWritten )
- {
- // automatic currency symbol is implemented as part of
- // normal text -> search for the symbol
- bCurrencyWritten = WriteTextWithCurrency_Impl( *pElemStr,
- MsLangId::convertLanguageToLocale( nLang ) );
- bAnyContent = sal_True;
- }
- else
- AddToTextElement_Impl( *pElemStr );
- }
- break;
- case NF_SYMBOLTYPE_BLANK:
- if (pElemStr)
- {
- // turn "_x" into the number of spaces used for x in InsertBlanks in the NumberFormat
-
- String aBlanks;
- SvNumberformat::InsertBlanks( aBlanks, 0, pElemStr->GetChar(1) );
- AddToTextElement_Impl( aBlanks );
- }
- break;
- case NF_KEY_GENERAL :
- WriteNumberElement_Impl( -1, 1, OUString(), sal_False, sal_False, 0, aEmbeddedEntries );
- break;
- case NF_KEY_CCC:
- if (pElemStr)
- {
- if ( bCurrencyWritten )
- AddToTextElement_Impl( *pElemStr ); // never more than one currency element
- else
- {
- //! must be different from short automatic format
- //! but should still be empty (meaning automatic)
- // pElemStr is "CCC"
-
- WriteCurrencyElement_Impl( *pElemStr, OUString() );
- bAnyContent = sal_True;
- bCurrencyWritten = sal_True;
- }
- }
- break;
- case NF_SYMBOLTYPE_CURRENCY:
- if (pElemStr)
- {
- if ( bCurrencyWritten )
- AddToTextElement_Impl( *pElemStr ); // never more than one currency element
- else
- {
- WriteCurrencyElement_Impl( *pElemStr, sCurrExt );
- bAnyContent = sal_True;
- bCurrencyWritten = sal_True;
- }
- }
- break;
- case NF_SYMBOLTYPE_DIGIT:
- if (!bNumWritten) // write number part
- {
- switch ( nFmtType )
- {
- // for type 0 (not recognized as a special type),
- // write a "normal" number
- case 0:
- case NUMBERFORMAT_NUMBER:
- case NUMBERFORMAT_CURRENCY:
- case NUMBERFORMAT_PERCENT:
- {
- // decimals
- // only some built-in formats have automatic decimals
- sal_Int32 nDecimals = nPrecision; // from GetFormatSpecialInfo
- if ( eBuiltIn == NF_NUMBER_STANDARD ||
- eBuiltIn == NF_CURRENCY_1000DEC2 ||
- eBuiltIn == NF_CURRENCY_1000DEC2_RED ||
- eBuiltIn == NF_CURRENCY_1000DEC2_CCC ||
- eBuiltIn == NF_CURRENCY_1000DEC2_DASHED )
- nDecimals = -1;
-
- // integer digits
- // only one built-in format has automatic integer digits
- sal_Int32 nInteger = nLeading;
- if ( eBuiltIn == NF_NUMBER_SYSTEM )
- nInteger = -1;
-
- // string for decimal replacement
- // has to be taken from nPrecision
- // (positive number even for automatic decimals)
- String sDashStr;
- if ( bDecDashes && nPrecision > 0 )
- sDashStr.Fill( nPrecision, '-' );
-
- WriteNumberElement_Impl( nDecimals, nInteger, sDashStr, bVarDecimals,
- bThousand, nTrailingThousands, aEmbeddedEntries );
- bAnyContent = sal_True;
- }
- break;
- case NUMBERFORMAT_SCIENTIFIC:
- WriteScientificElement_Impl( nPrecision, nLeading, bThousand, nExpDigits );
- bAnyContent = sal_True;
- break;
- case NUMBERFORMAT_FRACTION:
- WriteFractionElement_Impl( nLeading, bThousand, nPrecision, nPrecision );
- bAnyContent = sal_True;
- break;
- }
-
- bNumWritten = sal_True;
- }
- break;
- case NF_SYMBOLTYPE_DEL:
- if ( pElemStr && *pElemStr == XubString('@') )
- {
- WriteTextContentElement_Impl();
- bAnyContent = sal_True;
- }
- break;
-
- case NF_SYMBOLTYPE_CALENDAR:
- if ( pElemStr )
- aCalendar = *pElemStr;
- break;
-
- // date elements:
-
- case NF_KEY_D:
- case NF_KEY_DD:
- {
- sal_Bool bLong = ( nElemType == NF_KEY_DD );
- WriteDayElement_Impl( aCalendar, ( bSystemDate ? bLongSysDate : bLong ) );
- bAnyContent = sal_True;
- }
- break;
- case NF_KEY_DDD:
- case NF_KEY_DDDD:
- case NF_KEY_NN:
- case NF_KEY_NNN:
- case NF_KEY_NNNN:
- case NF_KEY_AAA:
- case NF_KEY_AAAA:
- {
- OUString aCalAttr = aCalendar;
- if ( nElemType == NF_KEY_AAA || nElemType == NF_KEY_AAAA )
- {
- // calendar attribute for AAA and AAAA is switched only for this element
- if (!aCalAttr.getLength())
- aCalAttr = lcl_GetDefaultCalendar( pFormatter, nLang );
- }
-
- sal_Bool bLong = ( nElemType == NF_KEY_NNN || nElemType == NF_KEY_NNNN ||
- nElemType == NF_KEY_DDDD || nElemType == NF_KEY_AAAA );
- WriteDayOfWeekElement_Impl( aCalAttr, ( bSystemDate ? bLongSysDate : bLong ) );
- bAnyContent = sal_True;
- if ( nElemType == NF_KEY_NNNN )
- {
- // write additional text element for separator
- pLocaleData->setLocale( MsLangId::convertLanguageToLocale( nLang ) );
- AddToTextElement_Impl( pLocaleData->getLongDateDayOfWeekSep() );
- }
- }
- break;
- case NF_KEY_M:
- case NF_KEY_MM:
- case NF_KEY_MMM:
- case NF_KEY_MMMM:
- case NF_KEY_MMMMM: //! first letter of month name, no attribute available
- {
- sal_Bool bLong = ( nElemType == NF_KEY_MM || nElemType == NF_KEY_MMMM );
- sal_Bool bText = ( nElemType == NF_KEY_MMM || nElemType == NF_KEY_MMMM ||
- nElemType == NF_KEY_MMMMM );
- WriteMonthElement_Impl( aCalendar, ( bSystemDate ? bLongSysDate : bLong ), bText );
- bAnyContent = sal_True;
- }
- break;
- case NF_KEY_YY:
- case NF_KEY_YYYY:
- case NF_KEY_EC:
- case NF_KEY_EEC:
- case NF_KEY_R: //! R acts as EE, no attribute available
- {
- //! distinguish EE and R
- // calendar attribute for E and EE and R is set in first loop
- sal_Bool bLong = ( nElemType == NF_KEY_YYYY || nElemType == NF_KEY_EEC ||
- nElemType == NF_KEY_R );
- WriteYearElement_Impl( aCalendar, ( bSystemDate ? bLongSysDate : bLong ) );
- bAnyContent = sal_True;
- }
- break;
- case NF_KEY_G:
- case NF_KEY_GG:
- case NF_KEY_GGG:
- case NF_KEY_RR: //! RR acts as GGGEE, no attribute available
- {
- //! distinguish GG and GGG and RR
- sal_Bool bLong = ( nElemType == NF_KEY_GGG || nElemType == NF_KEY_RR );
- WriteEraElement_Impl( aCalendar, ( bSystemDate ? bLongSysDate : bLong ) );
- bAnyContent = sal_True;
- if ( nElemType == NF_KEY_RR )
- {
- // calendar attribute for RR is set in first loop
- WriteYearElement_Impl( aCalendar, ( bSystemDate ? bLongSysDate : sal_True ) );
- }
- }
- break;
- case NF_KEY_Q:
- case NF_KEY_QQ:
- {
- sal_Bool bLong = ( nElemType == NF_KEY_QQ );
- WriteQuarterElement_Impl( aCalendar, ( bSystemDate ? bLongSysDate : bLong ) );
- bAnyContent = sal_True;
- }
- break;
- case NF_KEY_WW:
- WriteWeekElement_Impl( aCalendar );
- bAnyContent = sal_True;
- break;
-
- // time elements (bSystemDate is not used):
-
- case NF_KEY_H:
- case NF_KEY_HH:
- WriteHoursElement_Impl( nElemType == NF_KEY_HH );
- bAnyContent = sal_True;
- break;
- case NF_KEY_MI:
- case NF_KEY_MMI:
- WriteMinutesElement_Impl( nElemType == NF_KEY_MMI );
- bAnyContent = sal_True;
- break;
- case NF_KEY_S:
- case NF_KEY_SS:
- WriteSecondsElement_Impl( ( nElemType == NF_KEY_SS ), nPrecision );
- bAnyContent = sal_True;
- break;
- case NF_KEY_AMPM:
- case NF_KEY_AP:
- WriteAMPMElement_Impl(); // short/long?
- bAnyContent = sal_True;
- break;
- default:
-#ifdef DBG_UTIL
- // NF_SYMBOLTYPE_PERCENT is the last known value newly
- // introduced, alert on newer values, decreasing <0, which
- // most certainly means having to synchronize with module
- // 'xmloff'.
- if (nElemType < NF_SYMBOLTYPE_PERCENT)
- {
- ByteString aMsg( "SvXMLNumFmtExport::ExportPart_Impl: unhandled symbol type: ");
- aMsg += ByteString::CreateFromInt32( nElemType);
- DBG_ERRORFILE( aMsg.GetBuffer());
- }
-#endif
- break;
- }
- nPrevType = nElemType;
- ++nPos;
- }
- }
-
- if ( sTextContent.getLength() )
- bAnyContent = sal_True; // element written in FinishTextElement_Impl
-
- FinishTextElement_Impl(); // final text element - before maps
-
- if ( !bAnyContent )
- {
- // for an empty format, write an empty text element
- SvXMLElementExport aTElem( rExport, XML_NAMESPACE_NUMBER, XML_TEXT,
- sal_True, sal_False );
- }
-
- //
- // mapping (conditions) must be last elements
- //
-
- if (bDefPart)
- {
- SvNumberformatLimitOps eOp1, eOp2;
- double fLimit1, fLimit2;
- rFormat.GetConditions( eOp1, fLimit1, eOp2, fLimit2 );
-
- WriteMapElement_Impl( eOp1, fLimit1, nKey, 0 );
- WriteMapElement_Impl( eOp2, fLimit2, nKey, 1 );
-
- if ( rFormat.HasTextFormat() )
- {
- // 4th part is for text -> make an "all other numbers" condition for the 3rd part
- // by reversing the 2nd condition
-
- SvNumberformatLimitOps eOp3 = NUMBERFORMAT_OP_NO;
- double fLimit3 = fLimit2;
- switch ( eOp2 )
- {
- case NUMBERFORMAT_OP_EQ: eOp3 = NUMBERFORMAT_OP_NE; break;
- case NUMBERFORMAT_OP_NE: eOp3 = NUMBERFORMAT_OP_EQ; break;
- case NUMBERFORMAT_OP_LT: eOp3 = NUMBERFORMAT_OP_GE; break;
- case NUMBERFORMAT_OP_LE: eOp3 = NUMBERFORMAT_OP_GT; break;
- case NUMBERFORMAT_OP_GT: eOp3 = NUMBERFORMAT_OP_LE; break;
- case NUMBERFORMAT_OP_GE: eOp3 = NUMBERFORMAT_OP_LT; break;
- }
-
- if ( fLimit1 == fLimit2 &&
- ( ( eOp1 == NUMBERFORMAT_OP_LT && eOp2 == NUMBERFORMAT_OP_GT ) ||
- ( eOp1 == NUMBERFORMAT_OP_GT && eOp2 == NUMBERFORMAT_OP_LT ) ) )
- {
- // For <x and >x, add =x as last condition
- // (just for readability, <=x would be valid, too)
-
- eOp3 = NUMBERFORMAT_OP_EQ;
- }
-
- WriteMapElement_Impl( eOp3, fLimit3, nKey, 2 );
- }
- }
-}
-
-//-------------------------------------------------------------------------
-
-//
-// export one format
-//
-
-void SvXMLNumFmtExport::ExportFormat_Impl( const SvNumberformat& rFormat, sal_uInt32 nKey )
-{
- sal_uInt16 nUsedParts = 0;
- sal_uInt16 nPart;
- for (nPart=0; nPart<XMLNUM_MAX_PARTS; nPart++)
- if (rFormat.GetNumForType( nPart, 0, sal_False ) != 0)
- nUsedParts = nPart+1;
-
- SvNumberformatLimitOps eOp1, eOp2;
- double fLimit1, fLimit2;
- rFormat.GetConditions( eOp1, fLimit1, eOp2, fLimit2 );
-
- // if conditions are set, even empty formats must be written
-
- if ( eOp1 != NUMBERFORMAT_OP_NO && nUsedParts < 2 )
- nUsedParts = 2;
- if ( eOp2 != NUMBERFORMAT_OP_NO && nUsedParts < 3 )
- nUsedParts = 3;
- if ( rFormat.HasTextFormat() && nUsedParts < 4 )
- nUsedParts = 4;
-
- for (nPart=0; nPart<nUsedParts; nPart++)
- {
- sal_Bool bDefault = ( nPart+1 == nUsedParts ); // last = default
- ExportPart_Impl( rFormat, nKey, nPart, bDefault );
- }
-}
-
-//-------------------------------------------------------------------------
-
-//
-// export method called by application
-//
-
-void SvXMLNumFmtExport::Export( sal_Bool bIsAutoStyle )
-{
- if ( !pFormatter )
- return; // no formatter -> no entries
-
- sal_uInt32 nKey;
- const SvNumberformat* pFormat = NULL;
- sal_Bool bNext(pUsedList->GetFirstUsed(nKey));
- while(bNext)
- {
- pFormat = pFormatter->GetEntry(nKey);
- if(pFormat)
- ExportFormat_Impl( *pFormat, nKey );
- bNext = pUsedList->GetNextUsed(nKey);
- }
- if (!bIsAutoStyle)
- {
- SvUShorts aLanguages;
- pFormatter->GetUsedLanguages( aLanguages );
- sal_uInt16 nLangCount = aLanguages.Count();
- for (sal_uInt16 nLangPos=0; nLangPos<nLangCount; nLangPos++)
- {
- LanguageType nLang = aLanguages[nLangPos];
-
- sal_uInt32 nStandard;
- SvNumberFormatTable& rTable = pFormatter->GetEntryTable(
- NUMBERFORMAT_DEFINED, nStandard, nLang );
- SvNumberformat* pFormat = rTable.First();
- while (pFormat)
- {
- sal_uInt32 nKey(rTable.GetCurKey());
- if (!pUsedList->IsUsed(nKey))
- {
- DBG_ASSERT((pFormat->GetType() & NUMBERFORMAT_DEFINED) != 0, "a not user defined numberformat found");
- // user-defined and used formats are exported
- ExportFormat_Impl( *pFormat, nKey );
- // if it is a user-defined Format it will be added else nothing will hapen
- pUsedList->SetUsed(nKey);
- }
-
- pFormat = rTable.Next();
- }
- }
- }
- pUsedList->Export();
-}
-
-OUString SvXMLNumFmtExport::GetStyleName( sal_uInt32 nKey )
-{
- if(pUsedList->IsUsed(nKey) || pUsedList->IsWasUsed(nKey))
- return lcl_CreateStyleName( nKey, 0, sal_True, sPrefix );
- else
- {
- DBG_ERROR("There is no written Data-Style");
- return ::rtl::OUString();
- }
-}
-
-void SvXMLNumFmtExport::SetUsed( sal_uInt32 nKey )
-{
- if (pFormatter->GetEntry(nKey))
- pUsedList->SetUsed( nKey );
- else
- DBG_ERROR("no existing Numberformat found with this key");
-}
-
-void SvXMLNumFmtExport::GetWasUsed(uno::Sequence<sal_Int32>& rWasUsed)
-{
- if (pUsedList)
- pUsedList->GetWasUsed(rWasUsed);
-}
-
-void SvXMLNumFmtExport::SetWasUsed(const uno::Sequence<sal_Int32>& rWasUsed)
-{
- if (pUsedList)
- pUsedList->SetWasUsed(rWasUsed);
-}
-
-
-
-const SvNumberformat* lcl_GetFormat( SvNumberFormatter* pFormatter,
- sal_uInt32 nKey )
-{
- return ( pFormatter != NULL ) ? pFormatter->GetEntry( nKey ) : NULL;
-}
-
-sal_uInt32 SvXMLNumFmtExport::ForceSystemLanguage( sal_uInt32 nKey )
-{
- sal_uInt32 nRet = nKey;
-
- const SvNumberformat* pFormat = lcl_GetFormat( pFormatter, nKey );
- if( pFormat != NULL )
- {
- DBG_ASSERT( pFormatter != NULL, "format without formatter?" );
-
- xub_StrLen nErrorPos;
- short nType = pFormat->GetType();
-
- sal_uInt32 nNewKey = pFormatter->GetFormatForLanguageIfBuiltIn(
- nKey, LANGUAGE_SYSTEM );
-
- if( nNewKey != nKey )
- {
- nRet = nNewKey;
- }
- else
- {
- String aFormatString( pFormat->GetFormatstring() );
- pFormatter->PutandConvertEntry(
- aFormatString,
- nErrorPos, nType, nNewKey,
- pFormat->GetLanguage(), LANGUAGE_SYSTEM );
-
- // success? Then use new key.
- if( nErrorPos == 0 )
- nRet = nNewKey;
- }
- }
-
- return nRet;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_xmlnumfi.cxx b/binfilter/bf_xmloff/source/style/xmloff_xmlnumfi.cxx
deleted file mode 100644
index d26ecaddb8f8..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_xmlnumfi.cxx
+++ /dev/null
@@ -1,2274 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <bf_svtools/syslocale.hxx>
-
-#define _ZFORLIST_DECLARE_TABLE
-
-#include <bf_svtools/zformat.hxx>
-#include <bf_svtools/numuno.hxx>
-#include <rtl/math.hxx>
-#include <i18npool/mslangid.hxx>
-#include <tools/debug.hxx>
-
-#include "xmlnumfi.hxx"
-#include "xmlnmspe.hxx"
-#include "xmlimp.hxx"
-#include "xmluconv.hxx"
-#include "nmspmap.hxx"
-
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-//-------------------------------------------------------------------------
-
-struct SvXMLNumFmtEntry
-{
- ::rtl::OUString aName;
- sal_uInt32 nKey;
- sal_Bool bRemoveAfterUse;
-
- SvXMLNumFmtEntry( const ::rtl::OUString& rN, sal_uInt32 nK, sal_Bool bR ) :
- aName(rN), nKey(nK), bRemoveAfterUse(bR) {}
-};
-
-typedef SvXMLNumFmtEntry* SvXMLNumFmtEntryPtr;
-SV_DECL_PTRARR_DEL( SvXMLNumFmtEntryArr, SvXMLNumFmtEntryPtr, 4, 4 )//STRIP007;
-
-struct SvXMLEmbeddedElement
-{
- sal_Int32 nFormatPos;
- ::rtl::OUString aText;
-
- SvXMLEmbeddedElement( sal_Int32 nFP, const ::rtl::OUString& rT ) :
- nFormatPos(nFP), aText(rT) {}
-
- // comparison operators for PTRARR sorting - sorted by position
- BOOL operator ==( const SvXMLEmbeddedElement& r ) const { return nFormatPos == r.nFormatPos; }
- BOOL operator < ( const SvXMLEmbeddedElement& r ) const { return nFormatPos < r.nFormatPos; }
-};
-
-typedef SvXMLEmbeddedElement* SvXMLEmbeddedElementPtr;
-SV_DECL_PTRARR_SORT_DEL( SvXMLEmbeddedElementArr, SvXMLEmbeddedElementPtr, 0, 4 )//STRIP007 ;
-
-//-------------------------------------------------------------------------
-
-class SvXMLNumImpData
-{
- SvNumberFormatter* pFormatter;
- SvXMLTokenMap* pStylesElemTokenMap;
- SvXMLTokenMap* pStyleElemTokenMap;
- SvXMLTokenMap* pStyleAttrTokenMap;
- SvXMLTokenMap* pStyleElemAttrTokenMap;
- LocaleDataWrapper* pLocaleData;
- SvXMLNumFmtEntryArr aNameEntries;
-
- // #110680#
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory;
-
-public:
- // #110680#
- // SvXMLNumImpData( SvNumberFormatter* pFmt );
- SvXMLNumImpData(
- SvNumberFormatter* pFmt,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory );
- ~SvXMLNumImpData();
-
- SvNumberFormatter* GetNumberFormatter() const { return pFormatter; }
- const SvXMLTokenMap& GetStylesElemTokenMap();
- const SvXMLTokenMap& GetStyleElemTokenMap();
- const SvXMLTokenMap& GetStyleAttrTokenMap();
- const SvXMLTokenMap& GetStyleElemAttrTokenMap();
- const LocaleDataWrapper& GetLocaleData( LanguageType nLang );
- sal_uInt32 GetKeyForName( const ::rtl::OUString& rName );
- void AddKey( sal_uInt32 nKey, const ::rtl::OUString& rName, sal_Bool bRemoveAfterUse );
- void SetUsed( sal_uInt32 nKey );
- void RemoveVolatileFormats();
-};
-
-
-struct SvXMLNumberInfo
-{
- sal_Int32 nDecimals;
- sal_Int32 nInteger;
- sal_Int32 nExpDigits;
- sal_Int32 nNumerDigits;
- sal_Int32 nDenomDigits;
- sal_Bool bGrouping;
- sal_Bool bDecReplace;
- sal_Bool bVarDecimals;
- double fDisplayFactor;
- SvXMLEmbeddedElementArr aEmbeddedElements;
-
- SvXMLNumberInfo()
- {
- nDecimals = nInteger = nExpDigits = nNumerDigits = nDenomDigits = -1;
- bGrouping = bDecReplace = bVarDecimals = sal_False;
- fDisplayFactor = 1.0;
- }
-};
-
-class SvXMLNumFmtElementContext : public SvXMLImportContext
-{
- SvXMLNumFormatContext& rParent;
- sal_uInt16 nType;
- ::rtl::OUStringBuffer aContent;
- SvXMLNumberInfo aNumInfo;
- LanguageType nElementLang;
- sal_Bool bLong;
- sal_Bool bTextual;
- ::rtl::OUString sCalendar;
-
-public:
- SvXMLNumFmtElementContext( SvXMLImport& rImport, USHORT nPrfx,
- const ::rtl::OUString& rLName,
- SvXMLNumFormatContext& rParentContext, sal_uInt16 nNewType,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
- virtual ~SvXMLNumFmtElementContext();
-
- virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
- virtual void Characters( const ::rtl::OUString& rChars );
- virtual void EndElement();
-
- void AddEmbeddedElement( sal_Int32 nFormatPos, const ::rtl::OUString& rContent );
-};
-
-
-class SvXMLNumFmtEmbeddedTextContext : public SvXMLImportContext
-{
- SvXMLNumFmtElementContext& rParent;
- ::rtl::OUStringBuffer aContent;
- sal_Int32 nTextPosition;
-
-public:
- SvXMLNumFmtEmbeddedTextContext( SvXMLImport& rImport, USHORT nPrfx,
- const ::rtl::OUString& rLName,
- SvXMLNumFmtElementContext& rParentContext,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
- virtual ~SvXMLNumFmtEmbeddedTextContext();
-
- virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
- virtual void Characters( const ::rtl::OUString& rChars );
- virtual void EndElement();
-};
-
-
-class SvXMLNumFmtMapContext : public SvXMLImportContext
-{
- SvXMLNumFormatContext& rParent;
- ::rtl::OUString sCondition;
- ::rtl::OUString sName;
-
-public:
- SvXMLNumFmtMapContext( SvXMLImport& rImport, USHORT nPrfx,
- const ::rtl::OUString& rLName,
- SvXMLNumFormatContext& rParentContext,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
- virtual ~SvXMLNumFmtMapContext();
-
- virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
- virtual void Characters( const ::rtl::OUString& rChars );
- virtual void EndElement();
-};
-
-
-class SvXMLNumFmtPropContext : public SvXMLImportContext
-{
- SvXMLNumFormatContext& rParent;
- Color aColor;
- sal_Bool bColSet;
-
-public:
- SvXMLNumFmtPropContext( SvXMLImport& rImport, USHORT nPrfx,
- const ::rtl::OUString& rLName,
- SvXMLNumFormatContext& rParentContext,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
- virtual ~SvXMLNumFmtPropContext();
-
- virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
- virtual void Characters( const ::rtl::OUString& rChars );
- virtual void EndElement();
-};
-
-
-//-------------------------------------------------------------------------
-
-enum SvXMLStyleTokens
-{
- XML_TOK_STYLE_TEXT,
- XML_TOK_STYLE_NUMBER,
- XML_TOK_STYLE_SCIENTIFIC_NUMBER,
- XML_TOK_STYLE_FRACTION,
- XML_TOK_STYLE_CURRENCY_SYMBOL,
- XML_TOK_STYLE_DAY,
- XML_TOK_STYLE_MONTH,
- XML_TOK_STYLE_YEAR,
- XML_TOK_STYLE_ERA,
- XML_TOK_STYLE_DAY_OF_WEEK,
- XML_TOK_STYLE_WEEK_OF_YEAR,
- XML_TOK_STYLE_QUARTER,
- XML_TOK_STYLE_HOURS,
- XML_TOK_STYLE_AM_PM,
- XML_TOK_STYLE_MINUTES,
- XML_TOK_STYLE_SECONDS,
- XML_TOK_STYLE_BOOLEAN,
- XML_TOK_STYLE_TEXT_CONTENT,
- XML_TOK_STYLE_PROPERTIES,
- XML_TOK_STYLE_MAP
-};
-
-enum SvXMLStyleAttrTokens
-{
- XML_TOK_STYLE_ATTR_NAME,
- XML_TOK_STYLE_ATTR_LANGUAGE,
- XML_TOK_STYLE_ATTR_COUNTRY,
- XML_TOK_STYLE_ATTR_TITLE,
- XML_TOK_STYLE_ATTR_AUTOMATIC_ORDER,
- XML_TOK_STYLE_ATTR_FORMAT_SOURCE,
- XML_TOK_STYLE_ATTR_TRUNCATE_ON_OVERFLOW,
- XML_TOK_STYLE_ATTR_VOLATILE,
- XML_TOK_STYLE_ATTR_TRANSL_FORMAT,
- XML_TOK_STYLE_ATTR_TRANSL_LANGUAGE,
- XML_TOK_STYLE_ATTR_TRANSL_COUNTRY,
- XML_TOK_STYLE_ATTR_TRANSL_STYLE
-};
-
-enum SvXMLStyleElemAttrTokens
-{
- XML_TOK_ELEM_ATTR_DECIMAL_PLACES,
- XML_TOK_ELEM_ATTR_MIN_INTEGER_DIGITS,
- XML_TOK_ELEM_ATTR_GROUPING,
- XML_TOK_ELEM_ATTR_DISPLAY_FACTOR,
- XML_TOK_ELEM_ATTR_DECIMAL_REPLACEMENT,
- XML_TOK_ELEM_ATTR_MIN_EXPONENT_DIGITS,
- XML_TOK_ELEM_ATTR_MIN_NUMERATOR_DIGITS,
- XML_TOK_ELEM_ATTR_MIN_DENOMINATOR_DIGITS,
- XML_TOK_ELEM_ATTR_LANGUAGE,
- XML_TOK_ELEM_ATTR_COUNTRY,
- XML_TOK_ELEM_ATTR_STYLE,
- XML_TOK_ELEM_ATTR_TEXTUAL,
- XML_TOK_ELEM_ATTR_CALENDAR
-};
-
-//-------------------------------------------------------------------------
-
-//
-// standard colors
-//
-
-#define XML_NUMF_COLORCOUNT 10
-
-static ColorData aNumFmtStdColors[XML_NUMF_COLORCOUNT] =
-{
- COL_BLACK,
- COL_LIGHTBLUE,
- COL_LIGHTGREEN,
- COL_LIGHTCYAN,
- COL_LIGHTRED,
- COL_LIGHTMAGENTA,
- COL_BROWN,
- COL_GRAY,
- COL_YELLOW,
- COL_WHITE
-};
-
-//
-// token maps
-//
-
-static __FAR_DATA SvXMLTokenMapEntry aStylesElemMap[] =
-{
- // style elements
- { XML_NAMESPACE_NUMBER, XML_NUMBER_STYLE, XML_TOK_STYLES_NUMBER_STYLE },
- { XML_NAMESPACE_NUMBER, XML_CURRENCY_STYLE, XML_TOK_STYLES_CURRENCY_STYLE },
- { XML_NAMESPACE_NUMBER, XML_PERCENTAGE_STYLE, XML_TOK_STYLES_PERCENTAGE_STYLE },
- { XML_NAMESPACE_NUMBER, XML_DATE_STYLE, XML_TOK_STYLES_DATE_STYLE },
- { XML_NAMESPACE_NUMBER, XML_TIME_STYLE, XML_TOK_STYLES_TIME_STYLE },
- { XML_NAMESPACE_NUMBER, XML_BOOLEAN_STYLE, XML_TOK_STYLES_BOOLEAN_STYLE },
- { XML_NAMESPACE_NUMBER, XML_TEXT_STYLE, XML_TOK_STYLES_TEXT_STYLE },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aStyleElemMap[] =
-{
- // elements in a style
- { XML_NAMESPACE_NUMBER, XML_TEXT, XML_TOK_STYLE_TEXT },
- { XML_NAMESPACE_NUMBER, XML_NUMBER, XML_TOK_STYLE_NUMBER },
- { XML_NAMESPACE_NUMBER, XML_SCIENTIFIC_NUMBER, XML_TOK_STYLE_SCIENTIFIC_NUMBER },
- { XML_NAMESPACE_NUMBER, XML_FRACTION, XML_TOK_STYLE_FRACTION },
- { XML_NAMESPACE_NUMBER, XML_CURRENCY_SYMBOL, XML_TOK_STYLE_CURRENCY_SYMBOL },
- { XML_NAMESPACE_NUMBER, XML_DAY, XML_TOK_STYLE_DAY },
- { XML_NAMESPACE_NUMBER, XML_MONTH, XML_TOK_STYLE_MONTH },
- { XML_NAMESPACE_NUMBER, XML_YEAR, XML_TOK_STYLE_YEAR },
- { XML_NAMESPACE_NUMBER, XML_ERA, XML_TOK_STYLE_ERA },
- { XML_NAMESPACE_NUMBER, XML_DAY_OF_WEEK, XML_TOK_STYLE_DAY_OF_WEEK },
- { XML_NAMESPACE_NUMBER, XML_WEEK_OF_YEAR, XML_TOK_STYLE_WEEK_OF_YEAR },
- { XML_NAMESPACE_NUMBER, XML_QUARTER, XML_TOK_STYLE_QUARTER },
- { XML_NAMESPACE_NUMBER, XML_HOURS, XML_TOK_STYLE_HOURS },
- { XML_NAMESPACE_NUMBER, XML_AM_PM, XML_TOK_STYLE_AM_PM },
- { XML_NAMESPACE_NUMBER, XML_MINUTES, XML_TOK_STYLE_MINUTES },
- { XML_NAMESPACE_NUMBER, XML_SECONDS, XML_TOK_STYLE_SECONDS },
- { XML_NAMESPACE_NUMBER, XML_BOOLEAN, XML_TOK_STYLE_BOOLEAN },
- { XML_NAMESPACE_NUMBER, XML_TEXT_CONTENT, XML_TOK_STYLE_TEXT_CONTENT },
- { XML_NAMESPACE_STYLE, XML_PROPERTIES, XML_TOK_STYLE_PROPERTIES },
- { XML_NAMESPACE_STYLE, XML_MAP, XML_TOK_STYLE_MAP },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aStyleAttrMap[] =
-{
- // attributes for a style
- { XML_NAMESPACE_STYLE, XML_NAME, XML_TOK_STYLE_ATTR_NAME },
- { XML_NAMESPACE_NUMBER, XML_LANGUAGE, XML_TOK_STYLE_ATTR_LANGUAGE },
- { XML_NAMESPACE_NUMBER, XML_COUNTRY, XML_TOK_STYLE_ATTR_COUNTRY },
- { XML_NAMESPACE_NUMBER, XML_TITLE, XML_TOK_STYLE_ATTR_TITLE },
- { XML_NAMESPACE_NUMBER, XML_AUTOMATIC_ORDER, XML_TOK_STYLE_ATTR_AUTOMATIC_ORDER },
- { XML_NAMESPACE_NUMBER, XML_FORMAT_SOURCE, XML_TOK_STYLE_ATTR_FORMAT_SOURCE },
- { XML_NAMESPACE_NUMBER, XML_TRUNCATE_ON_OVERFLOW, XML_TOK_STYLE_ATTR_TRUNCATE_ON_OVERFLOW },
- { XML_NAMESPACE_STYLE, XML_VOLATILE, XML_TOK_STYLE_ATTR_VOLATILE },
- { XML_NAMESPACE_NUMBER, XML_TRANSLITERATION_FORMAT, XML_TOK_STYLE_ATTR_TRANSL_FORMAT },
- { XML_NAMESPACE_NUMBER, XML_TRANSLITERATION_LANGUAGE, XML_TOK_STYLE_ATTR_TRANSL_LANGUAGE },
- { XML_NAMESPACE_NUMBER, XML_TRANSLITERATION_COUNTRY, XML_TOK_STYLE_ATTR_TRANSL_COUNTRY },
- { XML_NAMESPACE_NUMBER, XML_TRANSLITERATION_STYLE, XML_TOK_STYLE_ATTR_TRANSL_STYLE },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aStyleElemAttrMap[] =
-{
- // attributes for an element within a style
- { XML_NAMESPACE_NUMBER, XML_DECIMAL_PLACES, XML_TOK_ELEM_ATTR_DECIMAL_PLACES },
- { XML_NAMESPACE_NUMBER, XML_MIN_INTEGER_DIGITS, XML_TOK_ELEM_ATTR_MIN_INTEGER_DIGITS },
- { XML_NAMESPACE_NUMBER, XML_GROUPING, XML_TOK_ELEM_ATTR_GROUPING },
- { XML_NAMESPACE_NUMBER, XML_DISPLAY_FACTOR, XML_TOK_ELEM_ATTR_DISPLAY_FACTOR },
- { XML_NAMESPACE_NUMBER, XML_DECIMAL_REPLACEMENT, XML_TOK_ELEM_ATTR_DECIMAL_REPLACEMENT },
- { XML_NAMESPACE_NUMBER, XML_MIN_EXPONENT_DIGITS, XML_TOK_ELEM_ATTR_MIN_EXPONENT_DIGITS },
- { XML_NAMESPACE_NUMBER, XML_MIN_NUMERATOR_DIGITS, XML_TOK_ELEM_ATTR_MIN_NUMERATOR_DIGITS },
- { XML_NAMESPACE_NUMBER, XML_MIN_DENOMINATOR_DIGITS, XML_TOK_ELEM_ATTR_MIN_DENOMINATOR_DIGITS },
- { XML_NAMESPACE_NUMBER, XML_LANGUAGE, XML_TOK_ELEM_ATTR_LANGUAGE },
- { XML_NAMESPACE_NUMBER, XML_COUNTRY, XML_TOK_ELEM_ATTR_COUNTRY },
- { XML_NAMESPACE_NUMBER, XML_STYLE, XML_TOK_ELEM_ATTR_STYLE },
- { XML_NAMESPACE_NUMBER, XML_TEXTUAL, XML_TOK_ELEM_ATTR_TEXTUAL },
- { XML_NAMESPACE_NUMBER, XML_CALENDAR, XML_TOK_ELEM_ATTR_CALENDAR },
- XML_TOKEN_MAP_END
-};
-
-// maps for SvXMLUnitConverter::convertEnum
-
-static __FAR_DATA SvXMLEnumMapEntry aStyleValueMap[] =
-{
- { XML_SHORT, sal_False },
- { XML_LONG, sal_True },
- { XML_TOKEN_INVALID, 0 }
-};
-
-static __FAR_DATA SvXMLEnumMapEntry aFormatSourceMap[] =
-{
- { XML_FIXED, sal_False },
- { XML_LANGUAGE, sal_True },
- { XML_TOKEN_INVALID, 0 }
-};
-
-//-------------------------------------------------------------------------
-
-struct SvXMLDefaultDateFormat
-{
- NfIndexTableOffset eFormat;
- SvXMLDateElementAttributes eDOW;
- SvXMLDateElementAttributes eDay;
- SvXMLDateElementAttributes eMonth;
- SvXMLDateElementAttributes eYear;
- SvXMLDateElementAttributes eHours;
- SvXMLDateElementAttributes eMins;
- SvXMLDateElementAttributes eSecs;
- sal_Bool bSystem;
-};
-
-static __FAR_DATA SvXMLDefaultDateFormat aDefaultDateFormats[] =
-{
- // format day-of-week day month year hours minutes seconds format-source
-
- { NF_DATE_SYSTEM_SHORT, XML_DEA_NONE, XML_DEA_ANY, XML_DEA_ANY, XML_DEA_ANY, XML_DEA_NONE, XML_DEA_NONE, XML_DEA_NONE, sal_True },
- { NF_DATE_SYSTEM_LONG, XML_DEA_ANY, XML_DEA_ANY, XML_DEA_ANY, XML_DEA_ANY, XML_DEA_NONE, XML_DEA_NONE, XML_DEA_NONE, sal_True },
- { NF_DATE_SYS_MMYY, XML_DEA_NONE, XML_DEA_NONE, XML_DEA_LONG, XML_DEA_SHORT, XML_DEA_NONE, XML_DEA_NONE, XML_DEA_NONE, sal_False },
- { NF_DATE_SYS_DDMMM, XML_DEA_NONE, XML_DEA_LONG, XML_DEA_TEXTSHORT, XML_DEA_NONE, XML_DEA_NONE, XML_DEA_NONE, XML_DEA_NONE, sal_False },
- { NF_DATE_SYS_DDMMYYYY, XML_DEA_NONE, XML_DEA_LONG, XML_DEA_LONG, XML_DEA_LONG, XML_DEA_NONE, XML_DEA_NONE, XML_DEA_NONE, sal_False },
- { NF_DATE_SYS_DDMMYY, XML_DEA_NONE, XML_DEA_LONG, XML_DEA_LONG, XML_DEA_SHORT, XML_DEA_NONE, XML_DEA_NONE, XML_DEA_NONE, sal_False },
- { NF_DATE_SYS_DMMMYY, XML_DEA_NONE, XML_DEA_SHORT, XML_DEA_TEXTSHORT, XML_DEA_SHORT, XML_DEA_NONE, XML_DEA_NONE, XML_DEA_NONE, sal_False },
- { NF_DATE_SYS_DMMMYYYY, XML_DEA_NONE, XML_DEA_SHORT, XML_DEA_TEXTSHORT, XML_DEA_LONG, XML_DEA_NONE, XML_DEA_NONE, XML_DEA_NONE, sal_False },
- { NF_DATE_SYS_DMMMMYYYY, XML_DEA_NONE, XML_DEA_SHORT, XML_DEA_TEXTLONG, XML_DEA_LONG, XML_DEA_NONE, XML_DEA_NONE, XML_DEA_NONE, sal_False },
- { NF_DATE_SYS_NNDMMMYY, XML_DEA_SHORT, XML_DEA_SHORT, XML_DEA_TEXTSHORT, XML_DEA_SHORT, XML_DEA_NONE, XML_DEA_NONE, XML_DEA_NONE, sal_False },
- { NF_DATE_SYS_NNDMMMMYYYY, XML_DEA_SHORT, XML_DEA_SHORT, XML_DEA_TEXTLONG, XML_DEA_LONG, XML_DEA_NONE, XML_DEA_NONE, XML_DEA_NONE, sal_False },
- { NF_DATE_SYS_NNNNDMMMMYYYY, XML_DEA_LONG, XML_DEA_SHORT, XML_DEA_TEXTLONG, XML_DEA_LONG, XML_DEA_NONE, XML_DEA_NONE, XML_DEA_NONE, sal_False },
- { NF_DATETIME_SYSTEM_SHORT_HHMM, XML_DEA_NONE, XML_DEA_ANY, XML_DEA_ANY, XML_DEA_ANY, XML_DEA_ANY, XML_DEA_ANY, XML_DEA_NONE, sal_True },
- { NF_DATETIME_SYS_DDMMYYYY_HHMMSS, XML_DEA_NONE, XML_DEA_ANY, XML_DEA_ANY, XML_DEA_ANY, XML_DEA_ANY, XML_DEA_ANY, XML_DEA_ANY, sal_False }
-};
-
-//-------------------------------------------------------------------------
-
-SV_IMPL_PTRARR( SvXMLNumFmtEntryArr, SvXMLNumFmtEntryPtr );
-SV_IMPL_OP_PTRARR_SORT( SvXMLEmbeddedElementArr, SvXMLEmbeddedElementPtr );
-
-//-------------------------------------------------------------------------
-
-//
-// SvXMLNumImpData
-//
-
-// #110680#
-// SvXMLNumImpData::SvXMLNumImpData( SvNumberFormatter* pFmt ) :
-SvXMLNumImpData::SvXMLNumImpData(
- SvNumberFormatter* pFmt,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory )
-: pFormatter(pFmt),
- pStylesElemTokenMap(NULL),
- pStyleElemTokenMap(NULL),
- pStyleAttrTokenMap(NULL),
- pStyleElemAttrTokenMap(NULL),
- pLocaleData(NULL),
-
- // #110680#
- mxServiceFactory(xServiceFactory)
-{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
-}
-
-SvXMLNumImpData::~SvXMLNumImpData()
-{
- delete pStylesElemTokenMap;
- delete pStyleElemTokenMap;
- delete pStyleAttrTokenMap;
- delete pStyleElemAttrTokenMap;
- delete pLocaleData;
-}
-
-sal_uInt32 SvXMLNumImpData::GetKeyForName( const ::rtl::OUString& rName )
-{
- USHORT nCount = aNameEntries.Count();
- for (USHORT i=0; i<nCount; i++)
- {
- const SvXMLNumFmtEntry* pObj = aNameEntries[i];
- if ( pObj->aName == rName )
- return pObj->nKey; // found
- }
- return NUMBERFORMAT_ENTRY_NOT_FOUND;
-}
-
-void SvXMLNumImpData::AddKey( sal_uInt32 nKey, const ::rtl::OUString& rName, sal_Bool bRemoveAfterUse )
-{
- if ( bRemoveAfterUse )
- {
- // if there is already an entry for this key without the bRemoveAfterUse flag,
- // clear the flag for this entry, too
-
- USHORT nCount = aNameEntries.Count();
- for (USHORT i=0; i<nCount; i++)
- {
- SvXMLNumFmtEntry* pObj = aNameEntries[i];
- if ( pObj->nKey == nKey && !pObj->bRemoveAfterUse )
- {
- bRemoveAfterUse = sal_False; // clear flag for new entry
- break;
- }
- }
- }
- else
- {
- // call SetUsed to clear the bRemoveAfterUse flag for other entries for this key
- SetUsed( nKey );
- }
-
- SvXMLNumFmtEntry* pObj = new SvXMLNumFmtEntry( rName, nKey, bRemoveAfterUse );
- aNameEntries.Insert( pObj, aNameEntries.Count() );
-}
-
-void SvXMLNumImpData::SetUsed( sal_uInt32 nKey )
-{
- USHORT nCount = aNameEntries.Count();
- for (USHORT i=0; i<nCount; i++)
- {
- SvXMLNumFmtEntry* pObj = aNameEntries[i];
- if ( pObj->nKey == nKey )
- {
- pObj->bRemoveAfterUse = sal_False; // used -> don't remove
-
- // continue searching - there may be several entries for the same key
- // (with different names), the format must not be deleted if any one of
- // them is used
- }
- }
-}
-
-void SvXMLNumImpData::RemoveVolatileFormats()
-{
- // remove temporary (volatile) formats from NumberFormatter
- // called at the end of each import (styles and content), so volatile formats
- // from styles can't be used in content
-
- if ( !pFormatter )
- return;
-
- USHORT nCount = aNameEntries.Count();
- for (USHORT i=0; i<nCount; i++)
- {
- const SvXMLNumFmtEntry* pObj = aNameEntries[i];
- if ( pObj->bRemoveAfterUse )
- {
- const SvNumberformat* pFormat = pFormatter->GetEntry(pObj->nKey);
- if (pFormat && (pFormat->GetType() & NUMBERFORMAT_DEFINED))
- pFormatter->DeleteEntry( pObj->nKey );
- }
- }
-}
-
-const SvXMLTokenMap& SvXMLNumImpData::GetStylesElemTokenMap()
-{
- if( !pStylesElemTokenMap )
- pStylesElemTokenMap = new SvXMLTokenMap( aStylesElemMap );
- return *pStylesElemTokenMap;
-}
-
-const SvXMLTokenMap& SvXMLNumImpData::GetStyleElemTokenMap()
-{
- if( !pStyleElemTokenMap )
- pStyleElemTokenMap = new SvXMLTokenMap( aStyleElemMap );
- return *pStyleElemTokenMap;
-}
-
-const SvXMLTokenMap& SvXMLNumImpData::GetStyleAttrTokenMap()
-{
- if( !pStyleAttrTokenMap )
- pStyleAttrTokenMap = new SvXMLTokenMap( aStyleAttrMap );
- return *pStyleAttrTokenMap;
-}
-
-const SvXMLTokenMap& SvXMLNumImpData::GetStyleElemAttrTokenMap()
-{
- if( !pStyleElemAttrTokenMap )
- pStyleElemAttrTokenMap = new SvXMLTokenMap( aStyleElemAttrMap );
- return *pStyleElemAttrTokenMap;
-}
-
-const LocaleDataWrapper& SvXMLNumImpData::GetLocaleData( LanguageType nLang )
-{
- if ( !pLocaleData )
- // #110680#
- //pLocaleData = new LocaleDataWrapper(
- // (pFormatter ? pFormatter->GetServiceManager() :
- // ::comphelper::getProcessServiceFactory()),
- // MsLangId::convertLanguageToLocale( nLang ) );
- pLocaleData = new LocaleDataWrapper(
- (pFormatter ? pFormatter->GetServiceManager() :
- mxServiceFactory),
- MsLangId::convertLanguageToLocale( nLang ) );
- else
- pLocaleData->setLocale( MsLangId::convertLanguageToLocale( nLang ) );
- return *pLocaleData;
-}
-
-//-------------------------------------------------------------------------
-
-//
-// SvXMLNumFmtMapContext
-//
-
-SvXMLNumFmtMapContext::SvXMLNumFmtMapContext( SvXMLImport& rImport,
- USHORT nPrfx, const ::rtl::OUString& rLName,
- SvXMLNumFormatContext& rParentContext,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rParent( rParentContext )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString sValue = xAttrList->getValueByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- if ( nPrefix == XML_NAMESPACE_STYLE )
- {
- if ( IsXMLToken( aLocalName, XML_CONDITION) )
- sCondition = sValue;
- else if ( IsXMLToken( aLocalName, XML_APPLY_STYLE_NAME) )
- sName = sValue;
- }
- }
-}
-
-SvXMLNumFmtMapContext::~SvXMLNumFmtMapContext()
-{
-}
-
-SvXMLImportContext* SvXMLNumFmtMapContext::CreateChildContext(
- USHORT nPrfx, const ::rtl::OUString& rLName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList )
-{
- // no elements supported - use default context
- return new SvXMLImportContext( GetImport(), nPrfx, rLName );
-}
-
-void SvXMLNumFmtMapContext::Characters( const ::rtl::OUString& rChars )
-{
-}
-
-void SvXMLNumFmtMapContext::EndElement()
-{
- rParent.AddCondition( sCondition, sName );
-}
-
-//-------------------------------------------------------------------------
-
-//
-// SvXMLNumFmtPropContext
-//
-
-SvXMLNumFmtPropContext::SvXMLNumFmtPropContext( SvXMLImport& rImport,
- USHORT nPrfx, const ::rtl::OUString& rLName,
- SvXMLNumFormatContext& rParentContext,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rParent( rParentContext ),
- bColSet( sal_False )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString sValue = xAttrList->getValueByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- if ( nPrefix == XML_NAMESPACE_FO && IsXMLToken( aLocalName, XML_COLOR ) )
- bColSet = SvXMLUnitConverter::convertColor( aColor, sValue );
- }
-}
-
-SvXMLNumFmtPropContext::~SvXMLNumFmtPropContext()
-{
-}
-
-SvXMLImportContext* SvXMLNumFmtPropContext::CreateChildContext(
- USHORT nPrfx, const ::rtl::OUString& rLName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList )
-{
- // no elements supported - use default context
- return new SvXMLImportContext( GetImport(), nPrfx, rLName );
-}
-
-void SvXMLNumFmtPropContext::Characters( const ::rtl::OUString& rChars )
-{
-}
-
-void SvXMLNumFmtPropContext::EndElement()
-{
- if (bColSet)
- rParent.AddColor( aColor );
-}
-
-//-------------------------------------------------------------------------
-
-//
-// SvXMLNumFmtEmbeddedTextContext
-//
-
-SvXMLNumFmtEmbeddedTextContext::SvXMLNumFmtEmbeddedTextContext( SvXMLImport& rImport,
- USHORT nPrfx, const ::rtl::OUString& rLName,
- SvXMLNumFmtElementContext& rParentContext,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rParent( rParentContext ),
- nTextPosition( 0 )
-{
- sal_Int32 nAttrVal;
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString sValue = xAttrList->getValueByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
- if ( nPrefix == XML_NAMESPACE_NUMBER && IsXMLToken( aLocalName, XML_POSITION ) )
- {
- if ( SvXMLUnitConverter::convertNumber( nAttrVal, sValue, 0 ) )
- nTextPosition = nAttrVal;
- }
- }
-}
-
-SvXMLNumFmtEmbeddedTextContext::~SvXMLNumFmtEmbeddedTextContext()
-{
-}
-
-SvXMLImportContext* SvXMLNumFmtEmbeddedTextContext::CreateChildContext(
- USHORT nPrfx, const ::rtl::OUString& rLName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList )
-{
- // no elements supported - use default context
- return new SvXMLImportContext( GetImport(), nPrfx, rLName );
-}
-
-void SvXMLNumFmtEmbeddedTextContext::Characters( const ::rtl::OUString& rChars )
-{
- aContent.append( rChars );
-}
-
-void SvXMLNumFmtEmbeddedTextContext::EndElement()
-{
- rParent.AddEmbeddedElement( nTextPosition, aContent.makeStringAndClear() );
-}
-
-//-------------------------------------------------------------------------
-
-sal_Bool lcl_ValidChar( sal_Unicode cChar, sal_uInt16 nFormatType )
-{
- // see ImpSvNumberformatScan::Next_Symbol
- if ( cChar == ' ' ||
- cChar == '-' ||
- cChar == '/' ||
- cChar == '.' ||
- cChar == ',' ||
- cChar == ':' ||
- cChar == '\'' )
- return sal_True; // for all format types
-
- // percent sign must be used without quotes for percentage styles only
- if ( nFormatType == XML_TOK_STYLES_PERCENTAGE_STYLE && cChar == '%' )
- return sal_True;
-
- // don't put quotes around single parentheses (often used for negative numbers)
- if ( ( nFormatType == XML_TOK_STYLES_NUMBER_STYLE ||
- nFormatType == XML_TOK_STYLES_CURRENCY_STYLE ||
- nFormatType == XML_TOK_STYLES_PERCENTAGE_STYLE ) &&
- ( cChar == '(' || cChar == ')' ) )
- return sal_True;
-
- return sal_False;
-}
-
-void lcl_EnquoteIfNecessary( ::rtl::OUStringBuffer& rContent, sal_uInt16 nFormatType )
-{
- sal_Bool bQuote = sal_True;
- sal_Int32 nLength = rContent.getLength();
-
- if ( ( nLength == 1 &&
- lcl_ValidChar( rContent.charAt(0), nFormatType ) ) ||
- ( nLength == 2 &&
- lcl_ValidChar( rContent.charAt(0), nFormatType ) &&
- rContent.charAt(1) == ' ' ) )
- {
- // don't quote single separator characters like space or percent,
- // or separator characters followed by space (used in date formats)
- bQuote = sal_False;
- }
- else if ( nFormatType == XML_TOK_STYLES_PERCENTAGE_STYLE && nLength > 1 )
- {
- // the percent character in percentage styles must be left out of quoting
- // (one occurence is enough even if there are several percent characters in the string)
-
- ::rtl::OUString aString( rContent.getStr() );
- sal_Int32 nPos = aString.indexOf( (sal_Unicode) '%' );
- if ( nPos >= 0 )
- {
- if ( nPos + 1 < nLength )
- {
- if ( nPos + 2 == nLength && lcl_ValidChar( rContent.charAt(nPos + 1), nFormatType ) )
- {
- // single character that doesn't need quoting
- }
- else
- {
- // quote text behind percent character
- rContent.insert( nPos + 1, (sal_Unicode) '"' );
- rContent.append( (sal_Unicode) '"' );
- }
- }
- if ( nPos > 0 )
- {
- if ( nPos == 1 && lcl_ValidChar( rContent.charAt(0), nFormatType ) )
- {
- // single character that doesn't need quoting
- }
- else
- {
- // quote text before percent character
- rContent.insert( nPos, (sal_Unicode) '"' );
- rContent.insert( 0, (sal_Unicode) '"' );
- }
- }
- bQuote = sal_False;
- }
- // else: normal quoting (below)
- }
-
- if ( bQuote )
- {
- // #i55469# quotes in the string itself have to be escaped
- rtl::OUString aString( rContent.getStr() );
- bool bEscape = ( aString.indexOf( (sal_Unicode) '"' ) >= 0 );
- if ( bEscape )
- {
- // A quote is turned into "\"" - a quote to end quoted text, an escaped quote,
- // and a quote to resume quoting.
- rtl::OUString aInsert( rtl::OUString::createFromAscii( "\"\\\"" ) );
-
- sal_Int32 nPos = 0;
- while ( nPos < rContent.getLength() )
- {
- if ( rContent.charAt( nPos ) == (sal_Unicode) '"' )
- {
- rContent.insert( nPos, aInsert );
- nPos += aInsert.getLength();
- }
- ++nPos;
- }
- }
-
- // quote string literals
- rContent.insert( 0, (sal_Unicode) '"' );
- rContent.append( (sal_Unicode) '"' );
-
- // remove redundant double quotes at start or end
- if ( bEscape )
- {
- if ( rContent.getLength() > 2 &&
- rContent.charAt(0) == (sal_Unicode) '"' &&
- rContent.charAt(1) == (sal_Unicode) '"' )
- {
- String aTrimmed( rContent.makeStringAndClear().copy(2) );
- rContent = rtl::OUStringBuffer( aTrimmed );
- }
-
- sal_Int32 nLen = rContent.getLength();
- if ( nLen > 2 &&
- rContent.charAt(nLen-1) == (sal_Unicode) '"' &&
- rContent.charAt(nLen-2) == (sal_Unicode) '"' )
- {
- String aTrimmed( rContent.makeStringAndClear().copy( 0, nLen - 2 ) );
- rContent = rtl::OUStringBuffer( aTrimmed );
- }
- }
- }
-}
-
-//
-// SvXMLNumFmtElementContext
-//
-
-SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport,
- USHORT nPrfx, const ::rtl::OUString& rLName,
- SvXMLNumFormatContext& rParentContext, sal_uInt16 nNewType,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rParent( rParentContext ),
- nType( nNewType ),
- nElementLang( LANGUAGE_SYSTEM ),
- bLong( FALSE ),
- bTextual( FALSE )
-{
- OUString sLanguage, sCountry;
- sal_Int32 nAttrVal;
- sal_Bool bAttrBool;
- sal_uInt16 nAttrEnum;
- double fAttrDouble;
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString sValue = xAttrList->getValueByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- const SvXMLTokenMap& rTokenMap = rParent.GetData()->GetStyleElemAttrTokenMap();
- sal_uInt16 nToken = rTokenMap.Get( nPrefix, aLocalName );
-
- switch (nToken)
- {
- case XML_TOK_ELEM_ATTR_DECIMAL_PLACES:
- if ( SvXMLUnitConverter::convertNumber( nAttrVal, sValue, 0 ) )
- aNumInfo.nDecimals = nAttrVal;
- break;
- case XML_TOK_ELEM_ATTR_MIN_INTEGER_DIGITS:
- if ( SvXMLUnitConverter::convertNumber( nAttrVal, sValue, 0 ) )
- aNumInfo.nInteger = nAttrVal;
- break;
- case XML_TOK_ELEM_ATTR_GROUPING:
- if ( SvXMLUnitConverter::convertBool( bAttrBool, sValue ) )
- aNumInfo.bGrouping = bAttrBool;
- break;
- case XML_TOK_ELEM_ATTR_DISPLAY_FACTOR:
- if ( SvXMLUnitConverter::convertDouble( fAttrDouble, sValue ) )
- aNumInfo.fDisplayFactor = fAttrDouble;
- break;
- case XML_TOK_ELEM_ATTR_DECIMAL_REPLACEMENT:
- if ( sValue.getLength() > 0 )
- aNumInfo.bDecReplace = sal_True; // only a default string is supported
- else
- aNumInfo.bVarDecimals = sal_True; // empty replacement string: variable decimals
- break;
- case XML_TOK_ELEM_ATTR_MIN_EXPONENT_DIGITS:
- if ( SvXMLUnitConverter::convertNumber( nAttrVal, sValue, 0 ) )
- aNumInfo.nExpDigits = nAttrVal;
- break;
- case XML_TOK_ELEM_ATTR_MIN_NUMERATOR_DIGITS:
- if ( SvXMLUnitConverter::convertNumber( nAttrVal, sValue, 0 ) )
- aNumInfo.nNumerDigits = nAttrVal;
- break;
- case XML_TOK_ELEM_ATTR_MIN_DENOMINATOR_DIGITS:
- if ( SvXMLUnitConverter::convertNumber( nAttrVal, sValue, 0 ) )
- aNumInfo.nDenomDigits = nAttrVal;
- break;
- case XML_TOK_ELEM_ATTR_LANGUAGE:
- sLanguage = sValue;
- break;
- case XML_TOK_ELEM_ATTR_COUNTRY:
- sCountry = sValue;
- break;
- case XML_TOK_ELEM_ATTR_STYLE:
- if ( SvXMLUnitConverter::convertEnum( nAttrEnum, sValue, aStyleValueMap ) )
- bLong = (sal_Bool) nAttrEnum;
- break;
- case XML_TOK_ELEM_ATTR_TEXTUAL:
- if ( SvXMLUnitConverter::convertBool( bAttrBool, sValue ) )
- bTextual = bAttrBool;
- break;
- case XML_TOK_ELEM_ATTR_CALENDAR:
- sCalendar = sValue;
- break;
- }
- }
-
- if ( sLanguage.getLength() || sCountry.getLength() )
- {
- nElementLang = MsLangId::convertIsoNamesToLanguage( sLanguage, sCountry );
- if ( nElementLang == LANGUAGE_DONTKNOW )
- nElementLang = LANGUAGE_SYSTEM; //! error handling for invalid locales?
- }
-}
-
-SvXMLNumFmtElementContext::~SvXMLNumFmtElementContext()
-{
-}
-
-SvXMLImportContext* SvXMLNumFmtElementContext::CreateChildContext(
- USHORT nPrfx, const ::rtl::OUString& rLName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList )
-{
- // only number:number supports number:embedded-text child element
-
- if ( nType == XML_TOK_STYLE_NUMBER &&
- nPrfx == XML_NAMESPACE_NUMBER && IsXMLToken( rLName, XML_EMBEDDED_TEXT ) )
- {
- return new SvXMLNumFmtEmbeddedTextContext( GetImport(), nPrfx, rLName, *this, xAttrList );
- }
- else
- return new SvXMLImportContext( GetImport(), nPrfx, rLName );
-}
-
-void SvXMLNumFmtElementContext::Characters( const ::rtl::OUString& rChars )
-{
- aContent.append( rChars );
-}
-
-void SvXMLNumFmtElementContext::AddEmbeddedElement( sal_Int32 nFormatPos, const ::rtl::OUString& rContent )
-{
- if ( rContent.getLength() )
- {
- SvXMLEmbeddedElement* pObj = new SvXMLEmbeddedElement( nFormatPos, rContent );
- if ( !aNumInfo.aEmbeddedElements.Insert( pObj ) )
- {
- // there's already an element at this position - append text to existing element
-
- delete pObj;
- USHORT nElementCount = aNumInfo.aEmbeddedElements.Count();
- for (USHORT i=0; i<nElementCount; i++)
- {
- pObj = aNumInfo.aEmbeddedElements[i];
- if ( pObj->nFormatPos == nFormatPos )
- {
- pObj->aText += rContent;
- break;
- }
- }
- }
- }
-}
-
-void SvXMLNumFmtElementContext::EndElement()
-{
- sal_Bool bEffLong = bLong;
- switch (nType)
- {
- case XML_TOK_STYLE_TEXT:
- if ( rParent.HasLongDoW() &&
- rParent.GetLocaleData().getLongDateDayOfWeekSep() ==
- String( aContent.getStr() ) )
- {
- // skip separator constant after long day of week
- // (NF_KEY_NNNN contains the separator)
-
- if ( rParent.ReplaceNfKeyword( NF_KEY_NNN, NF_KEY_NNNN ) )
- {
- //!aContent.setLength(0); //! doesn't work, #76293#
- aContent = OUStringBuffer();
- }
-
- rParent.SetHasLongDoW( sal_False ); // only once
- }
- if ( aContent.getLength() )
- {
- lcl_EnquoteIfNecessary( aContent, rParent.GetType() );
- rParent.AddToCode( aContent.makeStringAndClear() );
- }
- break;
-
- case XML_TOK_STYLE_NUMBER:
- rParent.AddNumber( aNumInfo );
- break;
-
- case XML_TOK_STYLE_CURRENCY_SYMBOL:
- rParent.AddCurrency( aContent.makeStringAndClear(), nElementLang );
- break;
-
- case XML_TOK_STYLE_TEXT_CONTENT:
- rParent.AddToCode( OUString::valueOf((sal_Unicode)'@') );
- break;
- case XML_TOK_STYLE_BOOLEAN:
- // ignored - only default boolean format is supported
- break;
-
- case XML_TOK_STYLE_DAY:
- rParent.UpdateCalendar( sCalendar );
- rParent.AddNfKeyword( bEffLong ? NF_KEY_DD : NF_KEY_D );
- break;
- case XML_TOK_STYLE_MONTH:
- rParent.UpdateCalendar( sCalendar );
- rParent.AddNfKeyword( bTextual ? ( bEffLong ? NF_KEY_MMMM : NF_KEY_MMM ) :
- ( bEffLong ? NF_KEY_MM : NF_KEY_M ) );
- break;
- case XML_TOK_STYLE_YEAR:
- rParent.UpdateCalendar( sCalendar );
- // Y after G (era) is replaced by E
- if ( rParent.HasEra() )
- rParent.AddNfKeyword( bEffLong ? NF_KEY_EEC : NF_KEY_EC );
- else
- rParent.AddNfKeyword( bEffLong ? NF_KEY_YYYY : NF_KEY_YY );
- break;
- case XML_TOK_STYLE_ERA:
- rParent.UpdateCalendar( sCalendar );
-#if 0
-//! I18N doesn't provide SYSTEM or extended date information yet
- if ( rParent.IsFromSystem() )
- bEffLong = SvXMLNumFmtDefaults::IsSystemLongEra( rParent.GetInternational(), bLong );
-#endif
- rParent.AddNfKeyword( bEffLong ? NF_KEY_GGG : NF_KEY_G );
- // HasEra flag is set
- break;
- case XML_TOK_STYLE_DAY_OF_WEEK:
- rParent.UpdateCalendar( sCalendar );
- rParent.AddNfKeyword( bEffLong ? NF_KEY_NNNN : NF_KEY_NN );
- break;
- case XML_TOK_STYLE_WEEK_OF_YEAR:
- rParent.UpdateCalendar( sCalendar );
- rParent.AddNfKeyword( NF_KEY_WW );
- break;
- case XML_TOK_STYLE_QUARTER:
- rParent.UpdateCalendar( sCalendar );
- rParent.AddNfKeyword( bEffLong ? NF_KEY_QQ : NF_KEY_Q );
- break;
- case XML_TOK_STYLE_HOURS:
- rParent.AddNfKeyword( bEffLong ? NF_KEY_HH : NF_KEY_H );
- break;
- case XML_TOK_STYLE_AM_PM:
- //! short/long?
- rParent.AddNfKeyword( NF_KEY_AMPM );
- break;
- case XML_TOK_STYLE_MINUTES:
- rParent.AddNfKeyword( bEffLong ? NF_KEY_MMI : NF_KEY_MI );
- break;
- case XML_TOK_STYLE_SECONDS:
- rParent.AddNfKeyword( bEffLong ? NF_KEY_SS : NF_KEY_S );
- if ( aNumInfo.nDecimals > 0 )
- {
- // manually add the decimal places
- const String& rSep = rParent.GetLocaleData().getNumDecimalSep();
- for ( xub_StrLen j=0; j<rSep.Len(); j++ )
- {
- rParent.AddToCode( OUString::valueOf( rSep.GetChar(j) ) );
- }
- for (sal_Int32 i=0; i<aNumInfo.nDecimals; i++)
- rParent.AddToCode( OUString::valueOf((sal_Unicode)'0') );
- }
- break;
-
- case XML_TOK_STYLE_FRACTION:
- {
- aNumInfo.nDecimals = 0;
- rParent.AddNumber( aNumInfo ); // number without decimals
-
- //! build string and add at once
-
- sal_Int32 i;
- rParent.AddToCode( OUString::valueOf((sal_Unicode)' ') );
- for (i=0; i<aNumInfo.nNumerDigits; i++)
- rParent.AddToCode( OUString::valueOf((sal_Unicode)'?') );
- rParent.AddToCode( OUString::valueOf((sal_Unicode)'/') );
- for (i=0; i<aNumInfo.nDenomDigits; i++)
- rParent.AddToCode( OUString::valueOf((sal_Unicode)'?') );
- }
- break;
-
- case XML_TOK_STYLE_SCIENTIFIC_NUMBER:
- {
- rParent.AddNumber( aNumInfo ); // simple number
-
- rParent.AddToCode( OUString::createFromAscii( "E+" ) );
- for (sal_Int32 i=0; i<aNumInfo.nExpDigits; i++)
- rParent.AddToCode( OUString::valueOf((sal_Unicode)'0') );
- }
- break;
-
- default:
- DBG_ERROR("invalid element ID");
- }
-}
-
-//-------------------------------------------------------------------------
-
-sal_uInt16 SvXMLNumFmtDefaults::GetDefaultDateFormat( SvXMLDateElementAttributes eDOW,
- SvXMLDateElementAttributes eDay, SvXMLDateElementAttributes eMonth,
- SvXMLDateElementAttributes eYear, SvXMLDateElementAttributes eHours,
- SvXMLDateElementAttributes eMins, SvXMLDateElementAttributes eSecs,
- sal_Bool bSystem )
-{
- const sal_uInt16 nCount = sizeof(aDefaultDateFormats) / sizeof(SvXMLDefaultDateFormat);
- for (sal_uInt16 nPos=0; nPos<nCount; nPos++)
- {
- const SvXMLDefaultDateFormat& rEntry = aDefaultDateFormats[nPos];
- if ( bSystem == rEntry.bSystem &&
- ( eDOW == rEntry.eDOW || ( rEntry.eDOW == XML_DEA_ANY && eDOW != XML_DEA_NONE ) ) &&
- ( eDay == rEntry.eDay || ( rEntry.eDay == XML_DEA_ANY && eDay != XML_DEA_NONE ) ) &&
- ( eMonth == rEntry.eMonth || ( rEntry.eMonth == XML_DEA_ANY && eMonth != XML_DEA_NONE ) ) &&
- ( eYear == rEntry.eYear || ( rEntry.eYear == XML_DEA_ANY && eYear != XML_DEA_NONE ) ) &&
- ( eHours == rEntry.eHours || ( rEntry.eHours == XML_DEA_ANY && eHours != XML_DEA_NONE ) ) &&
- ( eMins == rEntry.eMins || ( rEntry.eMins == XML_DEA_ANY && eMins != XML_DEA_NONE ) ) &&
- ( eSecs == rEntry.eSecs || ( rEntry.eSecs == XML_DEA_ANY && eSecs != XML_DEA_NONE ) ) )
- {
- return rEntry.eFormat;
- }
- }
-
- return NF_INDEX_TABLE_ENTRIES; // invalid
-}
-
-//-------------------------------------------------------------------------
-
-//
-// SvXMLNumFormatContext
-//
-
-SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport,
- USHORT nPrfx, const ::rtl::OUString& rLName,
- SvXMLNumImpData* pNewData, sal_uInt16 nNewType,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList,
- SvXMLStylesContext& rStyles ) :
- SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList ),
- pData( pNewData ),
- pStyles( &rStyles ),
- aMyConditions(),
- nType( nNewType ),
- nKey(-1),
- nFormatLang( LANGUAGE_SYSTEM ),
- bAutoOrder( FALSE ),
- bFromSystem( FALSE ),
- bTruncate( TRUE ),
- bAutoDec( FALSE ),
- bAutoInt( FALSE ),
- bHasExtraText( FALSE ),
- bHasLongDoW( FALSE ),
- bHasEra( FALSE ),
- bHasDateTime( FALSE ),
- bRemoveAfterUse( sal_False ),
- eDateDOW( XML_DEA_NONE ),
- eDateDay( XML_DEA_NONE ),
- eDateMonth( XML_DEA_NONE ),
- eDateYear( XML_DEA_NONE ),
- eDateHours( XML_DEA_NONE ),
- eDateMins( XML_DEA_NONE ),
- eDateSecs( XML_DEA_NONE ),
- bDateNoDefault( sal_False )
-{
- OUString sLanguage, sCountry;
- ::com::sun::star::i18n::NativeNumberXmlAttributes aNatNumAttr;
- sal_Bool bAttrBool;
- sal_uInt16 nAttrEnum;
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- OUString sAttrName = xAttrList->getNameByIndex( i );
- OUString sValue = xAttrList->getValueByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- const SvXMLTokenMap& rTokenMap = pData->GetStyleAttrTokenMap();
- sal_uInt16 nToken = rTokenMap.Get( nPrefix, aLocalName );
- switch (nToken)
- {
- case XML_TOK_STYLE_ATTR_NAME:
-// aName = sValue;
- break;
- case XML_TOK_STYLE_ATTR_LANGUAGE:
- sLanguage = sValue;
- break;
- case XML_TOK_STYLE_ATTR_COUNTRY:
- sCountry = sValue;
- break;
- case XML_TOK_STYLE_ATTR_TITLE:
- sFormatTitle = sValue;
- break;
- case XML_TOK_STYLE_ATTR_AUTOMATIC_ORDER:
- if ( SvXMLUnitConverter::convertBool( bAttrBool, sValue ) )
- bAutoOrder = bAttrBool;
- break;
- case XML_TOK_STYLE_ATTR_FORMAT_SOURCE:
- if ( SvXMLUnitConverter::convertEnum( nAttrEnum, sValue, aFormatSourceMap ) )
- bFromSystem = (sal_Bool) nAttrEnum;
- break;
- case XML_TOK_STYLE_ATTR_TRUNCATE_ON_OVERFLOW:
- if ( SvXMLUnitConverter::convertBool( bAttrBool, sValue ) )
- bTruncate = bAttrBool;
- break;
- case XML_TOK_STYLE_ATTR_VOLATILE:
- // volatile formats can be removed after importing
- // if not used in other styles
- if ( SvXMLUnitConverter::convertBool( bAttrBool, sValue ) )
- bRemoveAfterUse = bAttrBool;
- break;
- case XML_TOK_STYLE_ATTR_TRANSL_FORMAT:
- aNatNumAttr.Format = sValue;
- break;
- case XML_TOK_STYLE_ATTR_TRANSL_LANGUAGE:
- aNatNumAttr.Locale.Language = sValue;
- break;
- case XML_TOK_STYLE_ATTR_TRANSL_COUNTRY:
- aNatNumAttr.Locale.Country = sValue;
- break;
- case XML_TOK_STYLE_ATTR_TRANSL_STYLE:
- aNatNumAttr.Style = sValue;
- break;
- }
- }
-
- if ( sLanguage.getLength() || sCountry.getLength() )
- {
- nFormatLang = MsLangId::convertIsoNamesToLanguage( sLanguage, sCountry );
- if ( nFormatLang == LANGUAGE_DONTKNOW )
- nFormatLang = LANGUAGE_SYSTEM; //! error handling for invalid locales?
- }
-
- if ( aNatNumAttr.Format.getLength() )
- {
- SvNumberFormatter* pFormatter = pData->GetNumberFormatter();
- if ( pFormatter )
- {
- sal_Int32 nNatNum = pFormatter->GetNatNum()->convertFromXmlAttributes( aNatNumAttr );
- aFormatCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "[NatNum" ) );
- aFormatCode.append( nNatNum, 10 );
-
- LanguageType eLang = MsLangId::convertIsoNamesToLanguage(
- aNatNumAttr.Locale.Language, aNatNumAttr.Locale.Country );
- if ( eLang == LANGUAGE_DONTKNOW )
- eLang = LANGUAGE_SYSTEM; //! error handling for invalid locales?
- if ( eLang != nFormatLang && eLang != LANGUAGE_SYSTEM )
- {
- aFormatCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "][$-" ) );
- // language code in upper hex:
- aFormatCode.append( String::CreateFromInt32( sal_Int32( eLang ), 16 ).ToUpperAscii() );
- }
- aFormatCode.append( sal_Unicode(']') );
- }
- }
-}
-
-SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport,
- USHORT nPrfx, const ::rtl::OUString& rLName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList,
- const sal_Int32 nTempKey,
- SvXMLStylesContext& rStyles ) :
- SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, XML_STYLE_FAMILY_DATA_STYLE ),
- pData( NULL ),
- pStyles( &rStyles ),
- aMyConditions(),
- nType( 0 ),
- nKey(nTempKey),
- nFormatLang( LANGUAGE_SYSTEM ),
- bAutoOrder( FALSE ),
- bFromSystem( FALSE ),
- bTruncate( TRUE ),
- bAutoDec( FALSE ),
- bAutoInt( FALSE ),
- bHasExtraText( FALSE ),
- bHasLongDoW( FALSE ),
- bHasEra( FALSE ),
- bHasDateTime( FALSE ),
- bRemoveAfterUse( sal_False ),
- eDateDOW( XML_DEA_NONE ),
- eDateDay( XML_DEA_NONE ),
- eDateMonth( XML_DEA_NONE ),
- eDateYear( XML_DEA_NONE ),
- eDateHours( XML_DEA_NONE ),
- eDateMins( XML_DEA_NONE ),
- eDateSecs( XML_DEA_NONE ),
- bDateNoDefault( sal_False )
-{
- SetAttribute(XML_NAMESPACE_STYLE, GetXMLToken(XML_NAME), rLName);
-}
-
-SvXMLNumFormatContext::~SvXMLNumFormatContext()
-{
-}
-
-SvXMLImportContext* SvXMLNumFormatContext::CreateChildContext(
- USHORT nPrfx, const ::rtl::OUString& rLName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
-
- const SvXMLTokenMap& rTokenMap = pData->GetStyleElemTokenMap();
- sal_uInt16 nToken = rTokenMap.Get( nPrfx, rLName );
- switch (nToken)
- {
- case XML_TOK_STYLE_TEXT:
- case XML_TOK_STYLE_NUMBER:
- case XML_TOK_STYLE_SCIENTIFIC_NUMBER:
- case XML_TOK_STYLE_FRACTION:
- case XML_TOK_STYLE_CURRENCY_SYMBOL:
- case XML_TOK_STYLE_DAY:
- case XML_TOK_STYLE_MONTH:
- case XML_TOK_STYLE_YEAR:
- case XML_TOK_STYLE_ERA:
- case XML_TOK_STYLE_DAY_OF_WEEK:
- case XML_TOK_STYLE_WEEK_OF_YEAR:
- case XML_TOK_STYLE_QUARTER:
- case XML_TOK_STYLE_HOURS:
- case XML_TOK_STYLE_AM_PM:
- case XML_TOK_STYLE_MINUTES:
- case XML_TOK_STYLE_SECONDS:
- case XML_TOK_STYLE_BOOLEAN:
- case XML_TOK_STYLE_TEXT_CONTENT:
- pContext = new SvXMLNumFmtElementContext( GetImport(), nPrfx, rLName,
- *this, nToken, xAttrList );
- break;
-
- case XML_TOK_STYLE_PROPERTIES:
- pContext = new SvXMLNumFmtPropContext( GetImport(), nPrfx, rLName,
- *this, xAttrList );
- break;
- case XML_TOK_STYLE_MAP:
- {
- // SvXMLNumFmtMapContext::EndElement adds to aMyConditions,
- // so there's no need for an extra flag
- pContext = new SvXMLNumFmtMapContext( GetImport(), nPrfx, rLName,
- *this, xAttrList );
- }
- break;
- }
-
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrfx, rLName );
- return pContext;
-}
-
-sal_Int32 SvXMLNumFormatContext::GetKey()
-{
- if (nKey > -1)
- {
- if (bRemoveAfterUse)
- {
- // format is used -> don't remove
- bRemoveAfterUse = sal_False;
- if (pData)
- pData->SetUsed(nKey);
-
- // Add to import's list of keys now - CreateAndInsert didn't add
- // the style if bRemoveAfterUse was set.
- GetImport().AddNumberStyle( nKey, GetName() );
- }
- return nKey;
- }
- else
- {
- // reset bRemoveAfterUse before CreateAndInsert, so AddKey is called without bRemoveAfterUse set
- bRemoveAfterUse = sal_False;
- CreateAndInsert(sal_True);
- return nKey;
- }
-}
-
-sal_Int32 SvXMLNumFormatContext::PrivateGetKey()
-{
- // used for map elements in CreateAndInsert - don't reset bRemoveAfterUse flag
-
- if (nKey > -1)
- return nKey;
- else
- {
- CreateAndInsert(sal_True);
- return nKey;
- }
-}
-
-void SvXMLNumFormatContext::GetFormat( ::rtl::OUString& rFormatString, lang::Locale& rLocale)
-{
- //#95893#; remember the created FormatString and Locales
- if (!sFormatString.getLength() &&
- !aLocale.Language.getLength() &&
- !aLocale.Country.getLength())
- {
- if (aMyConditions.size())
- {
- ::rtl::OUString sFormat;
- lang::Locale aLoc;
- for (sal_uInt32 i = 0; i < aMyConditions.size(); i++)
- {
- SvXMLNumFormatContext* pStyle = (SvXMLNumFormatContext *)pStyles->FindStyleChildContext(
- XML_STYLE_FAMILY_DATA_STYLE, aMyConditions[i].sMapName, sal_False);
- if (pStyle)
- {
- pStyle->GetFormat(sFormat, aLoc);
- AddCondition(i, sFormat, pStyle->GetLocaleData());
- }
- }
- }
-
- if ( !aFormatCode.getLength() )
- {
- // insert empty format as empty string (with quotes)
- // #93901# this check has to be done before inserting the conditions
- aFormatCode.appendAscii("\"\""); // ""
- }
-
- aFormatCode.insert( 0, aConditions.makeStringAndClear() );
- sFormatString = aFormatCode.makeStringAndClear();
- MsLangId::convertLanguageToLocale(nFormatLang, aLocale);
- }
- rLocale = aLocale;
- rFormatString = sFormatString;
-}
-
-void SvXMLNumFormatContext::CreateAndInsert(sal_Bool bOverwrite)
-{
- if (!(nKey > -1))
- {
- SvNumberFormatter* pFormatter = pData->GetNumberFormatter();
- if (!pFormatter)
- {
- DBG_ERROR("no number formatter");
- return;
- }
-
- sal_uInt32 nIndex = NUMBERFORMAT_ENTRY_NOT_FOUND;
-
- for (sal_uInt32 i = 0; i < aMyConditions.size(); i++)
- {
- SvXMLNumFormatContext* pStyle = (SvXMLNumFormatContext *)pStyles->FindStyleChildContext(
- XML_STYLE_FAMILY_DATA_STYLE, aMyConditions[i].sMapName, sal_False);
- if (pStyle)
- {
- if ((pStyle->PrivateGetKey() > -1)) // don't reset pStyle's bRemoveAfterUse flag
- AddCondition(i);
- }
- }
-
- if ( !aFormatCode.getLength() )
- {
- // insert empty format as empty string (with quotes)
- // #93901# this check has to be done before inserting the conditions
- aFormatCode.appendAscii("\"\""); // ""
- }
-
- aFormatCode.insert( 0, aConditions.makeStringAndClear() );
- OUString sFormat = aFormatCode.makeStringAndClear();
-
- // test special cases
-
- if ( bAutoDec ) // automatic decimal places
- {
- // #99391# adjust only if the format contains no text elements, no conditions
- // and no color definition (detected by the '[' at the start)
-
- if ( nType == XML_TOK_STYLES_NUMBER_STYLE && !bHasExtraText &&
- aMyConditions.size() == 0 && sFormat.toChar() != (sal_Unicode)'[' )
- nIndex = pFormatter->GetStandardIndex( nFormatLang );
- }
- if ( bAutoInt ) // automatic integer digits
- {
- //! only if two decimal places was set?
-
- if ( nType == XML_TOK_STYLES_NUMBER_STYLE && !bHasExtraText &&
- aMyConditions.size() == 0 && sFormat.toChar() != (sal_Unicode)'[' )
- nIndex = pFormatter->GetFormatIndex( NF_NUMBER_SYSTEM, nFormatLang );
- }
-
- // boolean is always the builtin boolean format
- // (no other boolean formats are implemented)
- if ( nType == XML_TOK_STYLES_BOOLEAN_STYLE )
- nIndex = pFormatter->GetFormatIndex( NF_BOOLEAN, nFormatLang );
-
- // check for default date formats
- if ( nType == XML_TOK_STYLES_DATE_STYLE && bAutoOrder && !bDateNoDefault )
- {
- NfIndexTableOffset eFormat = (NfIndexTableOffset) SvXMLNumFmtDefaults::GetDefaultDateFormat(
- eDateDOW, eDateDay, eDateMonth, eDateYear,
- eDateHours, eDateMins, eDateSecs, bFromSystem );
- if ( eFormat < NF_INDEX_TABLE_ENTRIES )
- {
- // #109651# if a date format has the automatic-order attribute and
- // contains exactly the elements of one of the default date formats,
- // use that default format, with the element order and separators
- // from the current locale settings
-
- nIndex = pFormatter->GetFormatIndex( eFormat, nFormatLang );
- }
- }
-
- if ( nIndex == NUMBERFORMAT_ENTRY_NOT_FOUND && sFormat.getLength() )
- {
- // insert by format string
-
- String aFormatStr( sFormat );
- nIndex = pFormatter->GetEntryKey( aFormatStr, nFormatLang );
- if ( nIndex == NUMBERFORMAT_ENTRY_NOT_FOUND )
- {
- xub_StrLen nErrPos = 0;
- short nType = 0;
- sal_Bool bOk = pFormatter->PutEntry( aFormatStr, nErrPos, nType, nIndex, nFormatLang );
- if ( !bOk && nErrPos == 0 && aFormatStr != String(sFormat) )
- {
- // if the string was modified by PutEntry, look for an existing format
- // with the modified string
- nIndex = pFormatter->GetEntryKey( aFormatStr, nFormatLang );
- if ( nIndex != NUMBERFORMAT_ENTRY_NOT_FOUND )
- bOk = sal_True;
- }
- if (!bOk)
- nIndex = NUMBERFORMAT_ENTRY_NOT_FOUND;
- }
- }
-
-#if 0
-//! I18N doesn't provide SYSTEM or extended date information yet
- if ( nIndex != NUMBERFORMAT_ENTRY_NOT_FOUND && !bFromSystem )
- {
- // instead of automatic date format, use fixed formats if bFromSystem is not set
- //! prevent use of automatic formats in other cases, force user-defined format?
-
- sal_uInt32 nNewIndex = nIndex;
-
- NfIndexTableOffset eOffset = pFormatter->GetIndexTableOffset( nIndex );
- if ( eOffset == NF_DATE_SYSTEM_SHORT )
- {
- const International& rInt = pData->GetInternational( nFormatLang );
- if ( rInt.IsDateDayLeadingZero() && rInt.IsDateMonthLeadingZero() )
- {
- if ( rInt.IsDateCentury() )
- nNewIndex = pFormatter->GetFormatIndex( NF_DATE_SYS_DDMMYYYY, nFormatLang );
- else
- nNewIndex = pFormatter->GetFormatIndex( NF_DATE_SYS_DDMMYY, nFormatLang );
- }
- }
- else if ( eOffset == NF_DATE_SYSTEM_LONG )
- {
- const International& rInt = pData->GetInternational( nFormatLang );
- if ( !rInt.IsLongDateDayLeadingZero() )
- {
- sal_Bool bCentury = rInt.IsLongDateCentury();
- MonthFormat eMonth = rInt.GetLongDateMonthFormat();
- if ( eMonth == MONTH_LONG && bCentury )
- {
- if ( rInt.GetLongDateDayOfWeekFormat() == DAYOFWEEK_LONG )
- nNewIndex = pFormatter->GetFormatIndex( NF_DATE_SYS_NNNNDMMMMYYYY, nFormatLang );
- else
- nNewIndex = pFormatter->GetFormatIndex( NF_DATE_SYS_NNDMMMMYYYY, nFormatLang );
- }
- else if ( eMonth == MONTH_SHORT && !bCentury )
- nNewIndex = pFormatter->GetFormatIndex( NF_DATE_SYS_NNDMMMYY, nFormatLang );
- }
- }
-
- if ( nNewIndex != nIndex )
- {
- // verify the fixed format really matches the format string
- // (not the case with some formats from locale data)
-
- const SvNumberformat* pFixedFormat = pFormatter->GetEntry( nNewIndex );
- if ( pFixedFormat && pFixedFormat->GetFormatstring() == String(sFormat) )
- nIndex = nNewIndex;
- }
- }
-#endif
-
- if ( nIndex != NUMBERFORMAT_ENTRY_NOT_FOUND && !bAutoOrder )
- {
- // use fixed-order formats instead of SYS... if bAutoOrder is false
- // (only if the format strings are equal for the locale)
-
- NfIndexTableOffset eOffset = pFormatter->GetIndexTableOffset( nIndex );
- if ( eOffset == NF_DATE_SYS_DMMMYYYY )
- {
- sal_uInt32 nNewIndex = pFormatter->GetFormatIndex( NF_DATE_DIN_DMMMYYYY, nFormatLang );
- const SvNumberformat* pOldEntry = pFormatter->GetEntry( nIndex );
- const SvNumberformat* pNewEntry = pFormatter->GetEntry( nNewIndex );
- if ( pOldEntry && pNewEntry && pOldEntry->GetFormatstring() == pNewEntry->GetFormatstring() )
- nIndex = nNewIndex;
- }
- else if ( eOffset == NF_DATE_SYS_DMMMMYYYY )
- {
- sal_uInt32 nNewIndex = pFormatter->GetFormatIndex( NF_DATE_DIN_DMMMMYYYY, nFormatLang );
- const SvNumberformat* pOldEntry = pFormatter->GetEntry( nIndex );
- const SvNumberformat* pNewEntry = pFormatter->GetEntry( nNewIndex );
- if ( pOldEntry && pNewEntry && pOldEntry->GetFormatstring() == pNewEntry->GetFormatstring() )
- nIndex = nNewIndex;
- }
- }
-
- if ((nIndex != NUMBERFORMAT_ENTRY_NOT_FOUND) && sFormatTitle.getLength())
- {
- SvNumberformat* pFormat = const_cast<SvNumberformat*>(pFormatter->GetEntry( nIndex ));
- if (pFormat)
- {
- String sTitle (sFormatTitle);
- pFormat->SetComment(sTitle);
- }
- }
-
- if ( nIndex == NUMBERFORMAT_ENTRY_NOT_FOUND )
- {
- DBG_ERROR("invalid number format");
- nIndex = pFormatter->GetStandardIndex( nFormatLang );
- }
-
- pData->AddKey( nIndex, GetName(), bRemoveAfterUse );
- nKey = nIndex;
-
- // Add to import's list of keys (shared between styles and content import)
- // only if not volatile - formats are removed from NumberFormatter at the
- // end of each import (in SvXMLNumFmtHelper dtor).
- // If bRemoveAfterUse is reset later in GetKey, AddNumberStyle is called there.
-
- if (!bRemoveAfterUse)
- GetImport().AddNumberStyle( nKey, GetName() );
-
- #if 0
- ByteString aByte( String(sFormatName), gsl_getSystemTextEncoding() );
- aByte.Append( " | " );
- aByte.Append(ByteString( String(sFormat), gsl_getSystemTextEncoding() ));
- aByte.Append( " | " );
- aByte.Append(ByteString::CreateFromInt32( nIndex ));
-
- // DBG_ERROR(aByte.GetBuffer());
- int xxx=42;
- #endif
- }
-}
-
-void SvXMLNumFormatContext::Finish( sal_Bool bOverwrite )
-{
- SvXMLStyleContext::Finish( bOverwrite );
-// AddCondition();
-}
-
-const LocaleDataWrapper& SvXMLNumFormatContext::GetLocaleData() const
-{
- return pData->GetLocaleData( nFormatLang );
-}
-
-void SvXMLNumFormatContext::AddToCode( const ::rtl::OUString& rString )
-{
- aFormatCode.append( rString );
- bHasExtraText = sal_True;
-}
-
-void SvXMLNumFormatContext::AddNumber( const SvXMLNumberInfo& rInfo )
-{
- SvNumberFormatter* pFormatter = pData->GetNumberFormatter();
- if (!pFormatter)
- return;
-
- // store special conditions
- bAutoDec = ( rInfo.nDecimals < 0 );
- bAutoInt = ( rInfo.nInteger < 0 );
-
- sal_uInt16 nPrec = 0;
- sal_uInt16 nLeading = 0;
- if ( rInfo.nDecimals >= 0 ) // < 0 : Default
- nPrec = (sal_uInt16) rInfo.nDecimals;
- if ( rInfo.nInteger >= 0 ) // < 0 : Default
- nLeading = (sal_uInt16) rInfo.nInteger;
-
- if ( bAutoDec )
- {
- if ( nType == XML_TOK_STYLES_CURRENCY_STYLE )
- {
- // for currency formats, "automatic decimals" is used for the automatic
- // currency format with (fixed) decimals from the locale settings
-
- const LocaleDataWrapper& rLoc = pData->GetLocaleData( nFormatLang );
- nPrec = rLoc.getCurrDigits();
- }
- else
- {
- // for other types, "automatic decimals" means dynamic determination of
- // decimals, as achieved with the "general" keyword
-
- aFormatCode.append( pFormatter->GetStandardName( nFormatLang ) );
- return;
- }
- }
- if ( bAutoInt )
- {
- //!...
- }
-
- sal_uInt16 nGenPrec = nPrec;
- if ( rInfo.bDecReplace || rInfo.bVarDecimals )
- nGenPrec = 0; // generate format without decimals...
-
- sal_Bool bGrouping = rInfo.bGrouping;
- USHORT nEmbeddedCount = rInfo.aEmbeddedElements.Count();
- if ( nEmbeddedCount )
- bGrouping = sal_False; // grouping and embedded characters can't be used together
-
- String aNumStr;
- sal_uInt32 nStdIndex = pFormatter->GetStandardIndex( nFormatLang );
- pFormatter->GenerateFormat( aNumStr, nStdIndex, nFormatLang,
- bGrouping, sal_False, nGenPrec, nLeading );
-
- if ( nEmbeddedCount )
- {
- // insert embedded strings into number string
- // only the integer part is supported
- // nZeroPos is the string position where format position 0 is inserted
-
- xub_StrLen nZeroPos = aNumStr.Search( pData->GetLocaleData( nFormatLang ).getNumDecimalSep() );
- if ( nZeroPos == STRING_NOTFOUND )
- nZeroPos = aNumStr.Len();
-
- // aEmbeddedElements is sorted - last entry has the largest position (leftmost)
- const SvXMLEmbeddedElement* pLastObj = rInfo.aEmbeddedElements[nEmbeddedCount - 1];
- sal_Int32 nLastFormatPos = pLastObj->nFormatPos;
- if ( nLastFormatPos >= nZeroPos )
- {
- // add '#' characters so all embedded texts are really embedded in digits
- // (there always has to be a digit before the leftmost embedded text)
-
- xub_StrLen nAddCount = (xub_StrLen)nLastFormatPos + 1 - nZeroPos;
- String aDigitStr;
- aDigitStr.Fill( nAddCount, (sal_Unicode)'#' );
- aNumStr.Insert( aDigitStr, 0 );
- nZeroPos += nAddCount;
- }
-
- // aEmbeddedElements is sorted with ascending positions - loop is from right to left
- for (USHORT nElement = 0; nElement < nEmbeddedCount; nElement++)
- {
- const SvXMLEmbeddedElement* pObj = rInfo.aEmbeddedElements[nElement];
- sal_Int32 nFormatPos = pObj->nFormatPos;
- sal_Int32 nInsertPos = nZeroPos - nFormatPos;
- if ( nFormatPos >= 0 && nInsertPos >= 0 )
- {
- ::rtl::OUStringBuffer aContent( pObj->aText );
- // #107805# always quote embedded strings - even space would otherwise
- // be recognized as thousands separator in French.
- aContent.insert( 0, (sal_Unicode) '"' );
- aContent.append( (sal_Unicode) '"' );
-
- aNumStr.Insert( String( aContent.makeStringAndClear() ), (xub_StrLen)nInsertPos );
- }
- }
- }
-
- aFormatCode.append( aNumStr );
-
- if ( ( rInfo.bDecReplace || rInfo.bVarDecimals ) && nPrec ) // add decimal replacement (dashes)
- {
- // add dashes for explicit decimal replacement, # for variable decimals
- sal_Unicode cAdd = rInfo.bDecReplace ? '-' : '#';
-
- aFormatCode.append( pData->GetLocaleData( nFormatLang ).getNumDecimalSep() );
- for ( sal_uInt16 i=0; i<nPrec; i++)
- aFormatCode.append( cAdd );
- }
-
- // add extra thousands separators for display factor
-
- if ( rInfo.fDisplayFactor != 1.0 && rInfo.fDisplayFactor > 0.0 )
- {
- // test for 1.0 is just for optimization - nSepCount would be 0
-
- // one separator for each factor of 1000
- sal_Int32 nSepCount = (sal_Int32) ::rtl::math::round( log10(rInfo.fDisplayFactor) / 3.0 );
- if ( nSepCount > 0 )
- {
- OUString aSep = pData->GetLocaleData( nFormatLang ).getNumThousandSep();
- for ( sal_Int32 i=0; i<nSepCount; i++ )
- aFormatCode.append( aSep );
- }
- }
-}
-
-void SvXMLNumFormatContext::AddCurrency( const ::rtl::OUString& rContent, LanguageType nLang )
-{
- sal_Bool bAutomatic = sal_False;
- OUString aSymbol = rContent;
- if ( aSymbol.getLength() == 0 )
- {
- // get currency symbol for language
-
- //aSymbol = pData->GetLocaleData( nFormatLang ).getCurrSymbol();
-
- SvNumberFormatter* pFormatter = pData->GetNumberFormatter();
- if ( pFormatter )
- {
- pFormatter->ChangeIntl( nFormatLang );
- String sCurString, sDummy;
- pFormatter->GetCompatibilityCurrency( sCurString, sDummy );
- aSymbol = sCurString;
-
- bAutomatic = sal_True;
- }
- }
- else if ( nLang == LANGUAGE_SYSTEM && aSymbol.compareToAscii("CCC") == 0 )
- {
- // "CCC" is used for automatic long symbol
- bAutomatic = sal_True;
- }
-
- if ( bAutomatic )
- {
- // remove unnecessary quotes before automatic symbol (formats like "-(0DM)")
- // otherwise the currency symbol isn't recognized (#94048#)
-
- sal_Int32 nLength = aFormatCode.getLength();
- if ( nLength > 1 && aFormatCode.charAt( nLength-1 ) == '"' )
- {
- // find start of quoted string
- // When SvXMLNumFmtElementContext::EndElement creates escaped quotes,
- // they must be handled here, too.
-
- sal_Int32 nFirst = nLength - 2;
- while ( nFirst >= 0 && aFormatCode.charAt( nFirst ) != '"' )
- --nFirst;
- if ( nFirst >= 0 )
- {
- // remove both quotes from aFormatCode
- ::rtl::OUString aOld = aFormatCode.makeStringAndClear();
- if ( nFirst > 0 )
- aFormatCode.append( aOld.copy( 0, nFirst ) );
- if ( nLength > nFirst + 2 )
- aFormatCode.append( aOld.copy( nFirst + 1, nLength - nFirst - 2 ) );
- }
- }
- }
-
- if (!bAutomatic)
- aFormatCode.appendAscii( "[$" ); // intro for "new" currency symbols
-
- aFormatCode.append( aSymbol );
-
- if (!bAutomatic)
- {
- if ( nLang != LANGUAGE_SYSTEM )
- {
- // '-' sign and language code in hex:
- aFormatCode.append( (sal_Unicode) '-' );
- aFormatCode.append( String::CreateFromInt32( sal_Int32( nLang ), 16 ).ToUpperAscii() );
- }
-
- aFormatCode.append( (sal_Unicode) ']' ); // end of "new" currency symbol
- }
-}
-
-void SvXMLNumFormatContext::AddNfKeyword( sal_uInt16 nIndex )
-{
- SvNumberFormatter* pFormatter = pData->GetNumberFormatter();
- if (!pFormatter)
- return;
-
- if ( nIndex == NF_KEY_G || nIndex == NF_KEY_GG || nIndex == NF_KEY_GGG )
- bHasEra = sal_True;
-
- if ( nIndex == NF_KEY_NNNN )
- {
- nIndex = NF_KEY_NNN;
- bHasLongDoW = sal_True; // to remove string constant with separator
- }
-
- String sKeyword = pFormatter->GetKeyword( nFormatLang, nIndex );
-
- if ( nIndex == NF_KEY_H || nIndex == NF_KEY_HH ||
- nIndex == NF_KEY_MI || nIndex == NF_KEY_MMI ||
- nIndex == NF_KEY_S || nIndex == NF_KEY_SS )
- {
- if ( !bTruncate && !bHasDateTime )
- {
- // with truncate-on-overflow = false, add "[]" to first time part
-
- sKeyword.Insert( (sal_Unicode) '[', 0 );
- sKeyword.Append( (sal_Unicode) ']' );
- }
- bHasDateTime = sal_True;
- }
-
- aFormatCode.append( sKeyword );
-
- // collect the date elements that the format contains, to recognize default date formats
- switch ( nIndex )
- {
- case NF_KEY_NN: eDateDOW = XML_DEA_SHORT; break;
- case NF_KEY_NNN:
- case NF_KEY_NNNN: eDateDOW = XML_DEA_LONG; break;
- case NF_KEY_D: eDateDay = XML_DEA_SHORT; break;
- case NF_KEY_DD: eDateDay = XML_DEA_LONG; break;
- case NF_KEY_M: eDateMonth = XML_DEA_SHORT; break;
- case NF_KEY_MM: eDateMonth = XML_DEA_LONG; break;
- case NF_KEY_MMM: eDateMonth = XML_DEA_TEXTSHORT; break;
- case NF_KEY_MMMM: eDateMonth = XML_DEA_TEXTLONG; break;
- case NF_KEY_YY: eDateYear = XML_DEA_SHORT; break;
- case NF_KEY_YYYY: eDateYear = XML_DEA_LONG; break;
- case NF_KEY_H: eDateHours = XML_DEA_SHORT; break;
- case NF_KEY_HH: eDateHours = XML_DEA_LONG; break;
- case NF_KEY_MI: eDateMins = XML_DEA_SHORT; break;
- case NF_KEY_MMI: eDateMins = XML_DEA_LONG; break;
- case NF_KEY_S: eDateSecs = XML_DEA_SHORT; break;
- case NF_KEY_SS: eDateSecs = XML_DEA_LONG; break;
- case NF_KEY_AP:
- case NF_KEY_AMPM: break; // AM/PM may or may not be in date/time formats -> ignore by itself
- default:
- bDateNoDefault = sal_True; // any other element -> no default format
- }
-}
-
-sal_Bool lcl_IsAtEnd( ::rtl::OUStringBuffer& rBuffer, const String& rToken )
-{
- sal_Int32 nBufLen = rBuffer.getLength();
- xub_StrLen nTokLen = rToken.Len();
-
- if ( nTokLen > nBufLen )
- return sal_False;
-
- sal_Int32 nStartPos = nTokLen - nBufLen;
- for ( xub_StrLen nTokPos = 0; nTokPos < nTokLen; nTokPos++ )
- if ( rToken.GetChar( nTokPos ) != rBuffer.charAt( nStartPos + nTokPos ) )
- return sal_False;
-
- return sal_True;
-}
-
-sal_Bool SvXMLNumFormatContext::ReplaceNfKeyword( sal_uInt16 nOld, sal_uInt16 nNew )
-{
- // replaces one keyword with another if it is found at the end of the code
-
- SvNumberFormatter* pFormatter = pData->GetNumberFormatter();
- if (!pFormatter)
- return sal_False;
-
- String sOldStr = pFormatter->GetKeyword( nFormatLang, nOld );
- if ( lcl_IsAtEnd( aFormatCode, sOldStr ) )
- {
- // remove old keyword
- aFormatCode.setLength( aFormatCode.getLength() - sOldStr.Len() );
-
- // add new keyword
- String sNewStr = pFormatter->GetKeyword( nFormatLang, nNew );
- aFormatCode.append( sNewStr );
-
- return sal_True; // changed
- }
- return sal_False; // not found
-}
-
-void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex )
-{
- ::rtl::OUString rApplyName = aMyConditions[nIndex].sMapName;
- ::rtl::OUString rCondition = aMyConditions[nIndex].sCondition;
- SvNumberFormatter* pFormatter = pData->GetNumberFormatter();
- sal_uInt32 nKey = pData->GetKeyForName( rApplyName );
- OUString sValue = OUString::createFromAscii( "value()" ); //! define constant
- sal_Int32 nValLen = sValue.getLength();
-
- if ( pFormatter && nKey != NUMBERFORMAT_ENTRY_NOT_FOUND &&
- rCondition.copy( 0, nValLen ) == sValue )
- {
- //! test for valid conditions
- //! test for default conditions
-
- OUString sRealCond = rCondition.copy( nValLen, rCondition.getLength() - nValLen );
- sal_Bool bDefaultCond = sal_False;
-
- //! collect all conditions first and adjust default to >=0, >0 or <0 depending on count
- //! allow blanks in conditions
- sal_Bool bFirstCond = ( aConditions.getLength() == 0 );
- if ( bFirstCond && aMyConditions.size() == 1 && sRealCond.compareToAscii( ">=0" ) == 0 )
- bDefaultCond = sal_True;
-
- if ( nType == XML_TOK_STYLES_TEXT_STYLE && nIndex == 2 )
- {
- // The third condition in a number format with a text part can only be
- // "all other numbers", the condition string must be empty.
- bDefaultCond = sal_True;
- }
-
- if (!bDefaultCond)
- {
- sal_Int32 nPos = sRealCond.indexOf( '.' );
- if ( nPos >= 0 )
- { // #i8026# #103991# localize decimal separator
- const String& rDecSep = GetLocaleData().getNumDecimalSep();
- if ( rDecSep.Len() > 1 || rDecSep.GetChar(0) != '.' )
- sRealCond = sRealCond.replaceAt( nPos, 1, rDecSep );
- }
- aConditions.append( (sal_Unicode) '[' );
- aConditions.append( sRealCond );
- aConditions.append( (sal_Unicode) ']' );
- }
-
- const SvNumberformat* pFormat = pFormatter->GetEntry(nKey);
- if ( pFormat )
- aConditions.append( OUString( pFormat->GetFormatstring() ) );
-
- aConditions.append( (sal_Unicode) ';' );
- }
-}
-
-void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex, const ::rtl::OUString& rFormat, const LocaleDataWrapper& rData )
-{
- ::rtl::OUString rCondition = aMyConditions[nIndex].sCondition;
- OUString sValue = OUString::createFromAscii( "value()" ); //! define constant
- sal_Int32 nValLen = sValue.getLength();
-
- if ( rCondition.copy( 0, nValLen ) == sValue )
- {
- //! test for valid conditions
- //! test for default conditions
-
- OUString sRealCond = rCondition.copy( nValLen, rCondition.getLength() - nValLen );
- sal_Bool bDefaultCond = sal_False;
-
- //! collect all conditions first and adjust default to >=0, >0 or <0 depending on count
- //! allow blanks in conditions
- sal_Bool bFirstCond = ( aConditions.getLength() == 0 );
- if ( bFirstCond && aMyConditions.size() == 1 && sRealCond.compareToAscii( ">=0" ) == 0 )
- bDefaultCond = sal_True;
-
- if ( nType == XML_TOK_STYLES_TEXT_STYLE && nIndex == 2 )
- {
- // The third condition in a number format with a text part can only be
- // "all other numbers", the condition string must be empty.
- bDefaultCond = sal_True;
- }
-
- if (!bDefaultCond)
- {
- sal_Int32 nPos = sRealCond.indexOf( '.' );
- if ( nPos >= 0 )
- { // #i8026# #103991# localize decimal separator
- const String& rDecSep = rData.getNumDecimalSep();
- if ( rDecSep.Len() > 1 || rDecSep.GetChar(0) != '.' )
- sRealCond = sRealCond.replaceAt( nPos, 1, rDecSep );
- }
- aConditions.append( (sal_Unicode) '[' );
- aConditions.append( sRealCond );
- aConditions.append( (sal_Unicode) ']' );
- }
-
- aConditions.append( rFormat );
-
- aConditions.append( (sal_Unicode) ';' );
- }
-}
-
-void SvXMLNumFormatContext::AddCondition( const ::rtl::OUString& rCondition, const ::rtl::OUString& rApplyName )
-{
- MyCondition aCondition;
- aCondition.sCondition = rCondition;
- aCondition.sMapName = rApplyName;
- aMyConditions.push_back(aCondition);
-}
-
-void SvXMLNumFormatContext::AddColor( const Color& rColor )
-{
- SvNumberFormatter* pFormatter = pData->GetNumberFormatter();
- if (!pFormatter)
- return;
-
- OUStringBuffer aColName;
- for ( sal_uInt16 i=0; i<XML_NUMF_COLORCOUNT; i++ )
- if ( rColor == aNumFmtStdColors[i] )
- {
- aColName = OUString( pFormatter->GetKeyword( nFormatLang, NF_KEY_FIRSTCOLOR + i ) );
- break;
- }
-
- if ( aColName.getLength() )
- {
- aColName.insert( 0, (sal_Unicode) '[' );
- aColName.append( (sal_Unicode) ']' );
- aFormatCode.insert( 0, aColName.makeStringAndClear() );
- }
-}
-
-void SvXMLNumFormatContext::UpdateCalendar( const ::rtl::OUString& rNewCalendar )
-{
- if ( rNewCalendar != sCalendar )
- {
- sCalendar = rNewCalendar;
- if ( sCalendar.getLength() )
- {
- aFormatCode.appendAscii( "[~" ); // intro for calendar code
- aFormatCode.append( sCalendar );
- aFormatCode.append( (sal_Unicode) ']' ); // end of "new" currency symbolcalendar code
- }
- }
-}
-
-sal_Bool SvXMLNumFormatContext::IsSystemLanguage()
-{
- return nFormatLang == LANGUAGE_SYSTEM;
-}
-
-//-------------------------------------------------------------------------
-
-//
-// SvXMLNumFmtHelper
-//
-
-// #110680#
-//SvXMLNumFmtHelper::SvXMLNumFmtHelper(
-// const uno::Reference<util::XNumberFormatsSupplier>& rSupp )
-SvXMLNumFmtHelper::SvXMLNumFmtHelper(
- const uno::Reference<util::XNumberFormatsSupplier>& rSupp,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory )
-: mxServiceFactory(xServiceFactory)
-{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
-
- SvNumberFormatter* pFormatter = NULL;
- SvNumberFormatsSupplierObj* pObj =
- SvNumberFormatsSupplierObj::getImplementation( rSupp );
- if (pObj)
- pFormatter = pObj->GetNumberFormatter();
-
- // #110680#
- // pData = new SvXMLNumImpData( pFormatter );
- pData = new SvXMLNumImpData( pFormatter, mxServiceFactory );
-}
-
-// #110680#
-// SvXMLNumFmtHelper::SvXMLNumFmtHelper( SvNumberFormatter* pNumberFormatter )
-SvXMLNumFmtHelper::SvXMLNumFmtHelper(
- SvNumberFormatter* pNumberFormatter,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory )
-: mxServiceFactory(xServiceFactory)
-{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
-
- // #110680#
- // pData = new SvXMLNumImpData( pNumberFormatter );
- pData = new SvXMLNumImpData( pNumberFormatter, mxServiceFactory );
-}
-
-SvXMLNumFmtHelper::~SvXMLNumFmtHelper()
-{
- // remove temporary (volatile) formats from NumberFormatter
- pData->RemoveVolatileFormats();
-
- delete pData;
-}
-
-SvXMLStyleContext* SvXMLNumFmtHelper::CreateChildContext( SvXMLImport& rImport,
- USHORT nPrefix, const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList,
- SvXMLStylesContext& rStyles )
-{
- SvXMLStyleContext* pContext = NULL;
-
- const SvXMLTokenMap& rTokenMap = pData->GetStylesElemTokenMap();
- sal_uInt16 nToken = rTokenMap.Get( nPrefix, rLocalName );
- switch (nToken)
- {
- case XML_TOK_STYLES_NUMBER_STYLE:
- case XML_TOK_STYLES_CURRENCY_STYLE:
- case XML_TOK_STYLES_PERCENTAGE_STYLE:
- case XML_TOK_STYLES_DATE_STYLE:
- case XML_TOK_STYLES_TIME_STYLE:
- case XML_TOK_STYLES_BOOLEAN_STYLE:
- case XML_TOK_STYLES_TEXT_STYLE:
- pContext = new SvXMLNumFormatContext( rImport, nPrefix, rLocalName,
- pData, nToken, xAttrList, rStyles );
- break;
- }
-
- // return NULL if not a data style, caller must handle other elements
- return pContext;
-}
-
-const SvXMLTokenMap& SvXMLNumFmtHelper::GetStylesElemTokenMap()
-{
- return pData->GetStylesElemTokenMap();
-}
-
-/*sal_uInt32 SvXMLNumFmtHelper::GetKeyForName( const ::rtl::OUString& rName )
-{
- return pData->GetKeyForName( rName );
-}*/
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_xmlnumi.cxx b/binfilter/bf_xmloff/source/style/xmloff_xmlnumi.cxx
deleted file mode 100644
index aca1a198ccf5..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_xmlnumi.cxx
+++ /dev/null
@@ -1,1173 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <rtl/ustrbuf.hxx>
-#include <tools/urlobj.hxx>
-#include <tools/debug.hxx>
-#include <vcl/vclenum.hxx>
-
-#include "nmspmap.hxx"
-#include "xmlnmspe.hxx"
-#include "xmlimp.hxx"
-#include "XMLBase64ImportContext.hxx"
-
-#include <com/sun/star/awt/FontDescriptor.hpp>
-#include <com/sun/star/text/HoriOrientation.hpp>
-#include <com/sun/star/text/VertOrientation.hpp>
-#include <com/sun/star/style/XStyle.hpp>
-
-
-#include "i18nmap.hxx"
-#include "xmluconv.hxx"
-#include "fonthdl.hxx"
-#include "XMLFontStylesContext.hxx"
-#include "maptype.hxx"
-
-
-#include "xmlnumi.hxx"
-
-#define _SVSTDARR_USHORTS
-#include <bf_svtools/svstdarr.hxx>
-namespace binfilter {
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::frame;
-using namespace ::binfilter::xmloff::token;
-using namespace ::com::sun::star::io;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_SYMBOL_TEXT_DISTANCE[] =
- "SymbolTextDistance";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_PARENT_NUMBERING[] =
- "ParentNumbering";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_CHAR_STYLE_NAME[] =
- "CharStyleName";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_CHAR[] ="BulletChar";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_RELSIZE[] = "BulletRelSize";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_GRAPHIC_SIZE[] =
- "GraphicSize";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_VERT_ORIENT[] ="VertOrient";
-
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_NUMBERINGTYPE[] = "NumberingType";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_PREFIX[] = "Prefix";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_SUFFIX[] = "Suffix";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_ADJUST[] = "Adjust";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_LEFT_MARGIN[] = "LeftMargin";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_FIRST_LINE_OFFSET[] =
- "FirstLineOffset";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_FONT[] = "BulletFont";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_GRAPHICURL[] = "GraphicURL";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_START_WITH[] = "StartWith";
-static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_BULLET_COLOR[] = "BulletColor";
-
-// ---------------------------------------------------------------------
-
-class SvxXMLListLevelStyleContext_Impl;
-
-class SvxXMLListLevelStyleAttrContext_Impl : public SvXMLImportContext
-{
- SvxXMLListLevelStyleContext_Impl& rListLevel;
-
-public:
-
- SvxXMLListLevelStyleAttrContext_Impl(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList >& xAttrList,
- SvxXMLListLevelStyleContext_Impl& rLLevel );
- virtual ~SvxXMLListLevelStyleAttrContext_Impl();
-};
-
-// ---------------------------------------------------------------------
-
-enum SvxXMLTextListLevelStyleAttrTokens
-{
- XML_TOK_TEXT_LEVEL_ATTR_LEVEL,
- XML_TOK_TEXT_LEVEL_ATTR_STYLE_NAME,
- XML_TOK_TEXT_LEVEL_ATTR_BULLET_CHAR,
- XML_TOK_TEXT_LEVEL_ATTR_HREF,
- XML_TOK_TEXT_LEVEL_ATTR_TYPE,
- XML_TOK_TEXT_LEVEL_ATTR_SHOW,
- XML_TOK_TEXT_LEVEL_ATTR_ACTUATE,
- XML_TOK_TEXT_LEVEL_ATTR_NUM_FORMAT,
- XML_TOK_TEXT_LEVEL_ATTR_NUM_PREFIX,
- XML_TOK_TEXT_LEVEL_ATTR_NUM_SUFFIX,
- XML_TOK_TEXT_LEVEL_ATTR_NUM_LETTER_SYNC,
- XML_TOK_TEXT_LEVEL_ATTR_START_VALUE,
- XML_TOK_TEXT_LEVEL_ATTR_DISPLAY_LEVELS,
-
- XML_TOK_TEXT_LEVEL_ATTR_END=XML_TOK_UNKNOWN
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aLevelAttrTokenMap[] =
-{
- { XML_NAMESPACE_TEXT, XML_LEVEL, XML_TOK_TEXT_LEVEL_ATTR_LEVEL },
- { XML_NAMESPACE_TEXT, XML_STYLE_NAME, XML_TOK_TEXT_LEVEL_ATTR_STYLE_NAME },
- { XML_NAMESPACE_TEXT, XML_BULLET_CHAR, XML_TOK_TEXT_LEVEL_ATTR_BULLET_CHAR },
- { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_TEXT_LEVEL_ATTR_HREF },
- { XML_NAMESPACE_XLINK, XML_TYPE, XML_TOK_TEXT_LEVEL_ATTR_TYPE },
- { XML_NAMESPACE_XLINK, XML_SHOW, XML_TOK_TEXT_LEVEL_ATTR_SHOW },
- { XML_NAMESPACE_XLINK, XML_ACTUATE, XML_TOK_TEXT_LEVEL_ATTR_ACTUATE },
-
- { XML_NAMESPACE_STYLE, XML_NUM_FORMAT, XML_TOK_TEXT_LEVEL_ATTR_NUM_FORMAT },
- { XML_NAMESPACE_STYLE, XML_NUM_PREFIX, XML_TOK_TEXT_LEVEL_ATTR_NUM_PREFIX },
- { XML_NAMESPACE_STYLE, XML_NUM_SUFFIX, XML_TOK_TEXT_LEVEL_ATTR_NUM_SUFFIX },
- { XML_NAMESPACE_STYLE, XML_NUM_LETTER_SYNC, XML_TOK_TEXT_LEVEL_ATTR_NUM_LETTER_SYNC },
- { XML_NAMESPACE_TEXT, XML_START_VALUE, XML_TOK_TEXT_LEVEL_ATTR_START_VALUE },
- { XML_NAMESPACE_TEXT, XML_DISPLAY_LEVELS, XML_TOK_TEXT_LEVEL_ATTR_DISPLAY_LEVELS },
-
- XML_TOKEN_MAP_END
-};
-
-class SvxXMLListLevelStyleContext_Impl : public SvXMLImportContext
-{
- friend class SvxXMLListLevelStyleAttrContext_Impl;
-#ifdef CONV_STAR_FONTS
- const OUString sStarBats;
- const OUString sStarMath;
-#endif
-
- OUString sPrefix;
- OUString sSuffix;
- OUString sTextStyleName;
- OUString sNumFormat;
- OUString sNumLetterSync;
- OUString sBulletFontName;
- OUString sBulletFontStyleName;
- OUString sImageURL;
-
- Reference < XOutputStream > xBase64Stream;
-
- sal_Int32 nLevel;
- sal_Int32 nSpaceBefore;
- sal_Int32 nMinLabelWidth;
- sal_Int32 nMinLabelDist;
- sal_Int32 nImageWidth;
- sal_Int32 nImageHeight;
- sal_Int16 nNumStartValue;
- sal_Int16 nNumDisplayLevels;
-
- sal_Int16 eAdjust;
- sal_Int16 eBulletFontFamily;
- sal_Int16 eBulletFontPitch;
- rtl_TextEncoding eBulletFontEncoding;
- sal_Int16 eImageVertOrient;
-
- sal_Unicode cBullet;
-
- sal_Int16 nRelSize;
- Color aColor;
-
- sal_Bool bBullet : 1;
- sal_Bool bImage : 1;
- sal_Bool bNum : 1;
- sal_Bool bHasColor : 1;
-
- void SetRelSize( sal_Int16 nRel ) { nRelSize = nRel; }
- void SetColor( sal_Int32 _aColor ) { aColor = _aColor; bHasColor = sal_True; }
- void SetSpaceBefore( sal_Int32 nSet ) { nSpaceBefore = nSet; }
- void SetMinLabelWidth( sal_Int32 nSet ) { nMinLabelWidth = nSet; }
- void SetMinLabelDist( sal_Int32 nSet ) { nMinLabelDist = nSet; }
- void SetAdjust( sal_Int16 eSet ) { eAdjust = eSet; }
-
- void SetBulletFontName( const OUString& rSet ) { sBulletFontName = rSet; }
- void SetBulletFontStyleName( const OUString& rSet )
- { sBulletFontStyleName = rSet; }
- void SetBulletFontFamily( sal_Int16 eSet ) { eBulletFontFamily = eSet; }
- void SetBulletFontPitch( sal_Int16 eSet ) { eBulletFontPitch = eSet; }
- void SetBulletFontEncoding( rtl_TextEncoding eSet )
- { eBulletFontEncoding = eSet; }
-
- void SetImageWidth( sal_Int32 nSet ) { nImageWidth = nSet; }
- void SetImageHeight( sal_Int32 nSet ) { nImageHeight = nSet; }
- void SetImageVertOrient( sal_Int16 eSet )
- { eImageVertOrient = eSet; }
-
-public:
-
- SvxXMLListLevelStyleContext_Impl(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList );
- virtual ~SvxXMLListLevelStyleContext_Impl();
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList );
-
- sal_Int32 GetLevel() const { return nLevel; }
- Sequence<beans::PropertyValue> GetProperties(
- const SvI18NMap *pI18NMap=0 );
-};
-
-SvxXMLListLevelStyleContext_Impl::SvxXMLListLevelStyleContext_Impl(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList ) :
-
- SvXMLImportContext( rImport, nPrfx, rLName ),
- sNumFormat( OUString::createFromAscii( "1" ) ),
- nLevel( -1L ),
- nSpaceBefore( 0L ),
- nMinLabelWidth( 0L ),
- nMinLabelDist( 0L ),
- nImageWidth( 0L ),
- nImageHeight( 0L ),
- nNumStartValue( 1 ),
- nNumDisplayLevels( 1 ),
- eAdjust( HoriOrientation::LEFT ),
- eBulletFontFamily( FAMILY_DONTKNOW ),
- eBulletFontPitch( PITCH_DONTKNOW ),
- eBulletFontEncoding( RTL_TEXTENCODING_DONTKNOW ),
- cBullet( 0 ),
- nRelSize(0),
- bNum( sal_False ),
- bBullet( sal_False ),
- bImage( sal_False ),
- bHasColor( sal_False ),
- aColor( 0 )
-#ifdef CONV_STAR_FONTS
- ,sStarBats( RTL_CONSTASCII_USTRINGPARAM( "StarBats" ) ),
- sStarMath( RTL_CONSTASCII_USTRINGPARAM( "StarMath" ) )
-#endif
-{
- if( IsXMLToken( rLName, XML_LIST_LEVEL_STYLE_NUMBER ) ||
- IsXMLToken( rLName, XML_OUTLINE_LEVEL_STYLE ) )
- bNum = sal_True;
- else if( IsXMLToken( rLName, XML_LIST_LEVEL_STYLE_BULLET ) )
- bBullet = sal_True;
- else if( IsXMLToken( rLName, XML_LIST_LEVEL_STYLE_IMAGE ) )
- bImage = sal_True;
-
- SvXMLTokenMap aTokenMap( aLevelAttrTokenMap );
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- switch( aTokenMap.Get( nPrefix, aLocalName ) )
- {
- case XML_TOK_TEXT_LEVEL_ATTR_LEVEL:
- nLevel = rValue.toInt32();
- if( nLevel >= 1L )
- nLevel--;
- else
- nLevel = 0L;
- break;
- case XML_TOK_TEXT_LEVEL_ATTR_STYLE_NAME:
- sTextStyleName = rValue;
- break;
- case XML_TOK_TEXT_LEVEL_ATTR_BULLET_CHAR:
- cBullet = rValue[0];
- break;
- case XML_TOK_TEXT_LEVEL_ATTR_HREF:
- if( bImage )
- sImageURL = rValue;
- break;
- case XML_TOK_TEXT_LEVEL_ATTR_TYPE:
- case XML_TOK_TEXT_LEVEL_ATTR_SHOW:
- case XML_TOK_TEXT_LEVEL_ATTR_ACTUATE:
- // This properties will be ignored
- break;
- case XML_TOK_TEXT_LEVEL_ATTR_NUM_FORMAT:
- if( bNum )
- sNumFormat = rValue;
- break;
- case XML_TOK_TEXT_LEVEL_ATTR_NUM_PREFIX:
- sPrefix = rValue;
- break;
- case XML_TOK_TEXT_LEVEL_ATTR_NUM_SUFFIX:
- sSuffix = rValue;
- break;
- case XML_TOK_TEXT_LEVEL_ATTR_NUM_LETTER_SYNC:
- if( bNum )
- sNumLetterSync = rValue;
- break;
- case XML_TOK_TEXT_LEVEL_ATTR_START_VALUE:
- if( bNum )
- {
- sal_Int32 nTmp = rValue.toInt32();
- nNumStartValue =
- (nTmp < 0L) ? 1 : ( (nTmp>SHRT_MAX) ? SHRT_MAX
- : (sal_Int16)nTmp );
- }
- break;
- case XML_TOK_TEXT_LEVEL_ATTR_DISPLAY_LEVELS:
- if( bNum )
- {
- sal_Int32 nTmp = rValue.toInt32();
- nNumDisplayLevels =
- (nTmp < 1L) ? 1 : ( (nTmp>SHRT_MAX) ? SHRT_MAX
- : (sal_Int16)nTmp );
- }
- break;
- }
- }
-}
-
-SvxXMLListLevelStyleContext_Impl::~SvxXMLListLevelStyleContext_Impl()
-{
-}
-
-SvXMLImportContext *SvxXMLListLevelStyleContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
- if( XML_NAMESPACE_STYLE == nPrefix &&
- IsXMLToken( rLocalName, XML_PROPERTIES ) )
- {
- pContext = new SvxXMLListLevelStyleAttrContext_Impl( GetImport(),
- nPrefix,
- rLocalName,
- xAttrList,
- *this );
- }
- else if( (XML_NAMESPACE_OFFICE == nPrefix) && xmloff::token::IsXMLToken( rLocalName,
- xmloff::token::XML_BINARY_DATA ) )
- {
- if( bImage && !sImageURL.getLength() && !xBase64Stream.is() )
- {
- xBase64Stream = GetImport().GetStreamForGraphicObjectURLFromBase64();
- if( xBase64Stream.is() )
- pContext = new XMLBase64ImportContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- xBase64Stream );
- }
- }
- if( !pContext )
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
-
- return pContext;
-}
-
-Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties(
- const SvI18NMap *pI18NMap )
-{
- sal_Int16 eType = 0;
-
- sal_Int32 nCount = 0L;
- if( bBullet )
- {
- eType = NumberingType::CHAR_SPECIAL;
- nCount = cBullet ? 10 : 9;
- }
- if( bImage )
- {
- eType = NumberingType::BITMAP;
- nCount = (sal_Int32) 10L;
-
- if( (sImageURL.getLength() > 0L) || xBase64Stream.is() )
- nCount++;
- }
- if( bNum )
- {
- eType = NumberingType::ARABIC;
- GetImport().GetMM100UnitConverter().convertNumFormat(
- eType, sNumFormat, sNumLetterSync, sal_True );
- nCount = (sal_Int32) 10L;
- }
-
- if( ( bBullet || bNum ) && nRelSize )
- nCount++;
-
- if( !bImage && bHasColor )
- {
- nCount++;
- }
-
- Sequence<beans::PropertyValue> aPropSeq( nCount );
- if( nCount > 0 )
- {
- beans::PropertyValue *pProps = aPropSeq.getArray();
- sal_Int32 nPos = 0L;
- pProps[nPos].Name =
- OUString::createFromAscii( XML_UNO_NAME_NRULE_NUMBERINGTYPE );
- pProps[nPos++].Value <<= (sal_Int16)eType ;
-
- pProps[nPos].Name = OUString::createFromAscii( XML_UNO_NAME_NRULE_PREFIX );
- pProps[nPos++].Value <<= sPrefix;
-
- pProps[nPos].Name = OUString::createFromAscii( XML_UNO_NAME_NRULE_SUFFIX );
- pProps[nPos++].Value <<= sSuffix;
-
- pProps[nPos].Name = OUString::createFromAscii( XML_UNO_NAME_NRULE_ADJUST );
- pProps[nPos++].Value <<= eAdjust;
-
- sal_Int32 nLeftMargin = nSpaceBefore + nMinLabelWidth;
- if( nLeftMargin < 0 )
- nLeftMargin = 0;
- pProps[nPos].Name =
- OUString::createFromAscii( XML_UNO_NAME_NRULE_LEFT_MARGIN );
- pProps[nPos++].Value <<= (sal_Int32)nLeftMargin;
-
- sal_Int32 nFirstLineOffset =
- nMinLabelWidth <= nLeftMargin ? -nMinLabelWidth : -nLeftMargin;
-
- pProps[nPos].Name =
- OUString::createFromAscii( XML_UNO_NAME_NRULE_FIRST_LINE_OFFSET );
- pProps[nPos++].Value <<= (sal_Int32)nFirstLineOffset;
-
- pProps[nPos].Name =
- OUString::createFromAscii(XML_UNO_NAME_NRULE_SYMBOL_TEXT_DISTANCE);
- pProps[nPos++].Value <<= (sal_Int16)nMinLabelDist;
-
- OUString sStyleName = sTextStyleName;
- if( sStyleName.getLength() && pI18NMap )
- sStyleName = pI18NMap->Get( SFX_STYLE_FAMILY_CHAR, sStyleName );
- pProps[nPos].Name =
- OUString::createFromAscii( XML_UNO_NAME_NRULE_CHAR_STYLE_NAME );
- pProps[nPos++].Value <<= sTextStyleName;
-
- if( bBullet )
- {
- awt::FontDescriptor aFDesc;
- aFDesc.Name = sBulletFontName;
- if( sBulletFontName.getLength() )
- {
- aFDesc.StyleName = sBulletFontStyleName;
- aFDesc.Family = eBulletFontFamily;
- aFDesc.Pitch = eBulletFontPitch;
- aFDesc.CharSet = eBulletFontEncoding;
- aFDesc.Weight = WEIGHT_DONTKNOW;
- //aFDesc.Transparant = sal_True;
-#ifdef CONV_STAR_FONTS
- sal_Bool bStarSymbol = sal_False;
- if( aFDesc.Name.equalsIgnoreAsciiCase( sStarBats ) )
- {
- cBullet = GetImport().ConvStarBatsCharToStarSymbol( cBullet );
- bStarSymbol = sal_True;
- }
- else if( aFDesc.Name.equalsIgnoreAsciiCase( sStarMath ) )
- {
- cBullet = GetImport().ConvStarMathCharToStarSymbol( cBullet );
- bStarSymbol = sal_True;
- }
- if( bStarSymbol )
- aFDesc.Name =
- OUString( RTL_CONSTASCII_USTRINGPARAM("StarSymbol" ) );
-#endif
- }
-
- if( cBullet )
- {
- OUStringBuffer sTmp(1);
- sTmp.append( cBullet );
- pProps[nPos].Name =
- OUString::createFromAscii( XML_UNO_NAME_NRULE_BULLET_CHAR );
- pProps[nPos++].Value <<= sTmp.makeStringAndClear();
- }
-
- pProps[nPos].Name =
- OUString::createFromAscii( XML_UNO_NAME_NRULE_BULLET_FONT );
- pProps[nPos++].Value <<= aFDesc;
-
- }
-
- if( bImage )
- {
- OUString sStr( sImageURL );
- if( sImageURL.getLength() )
- {
- sStr = GetImport().ResolveGraphicObjectURL( sImageURL,
- sal_False );
- }
- else if( xBase64Stream.is() )
- {
- sStr = GetImport().ResolveGraphicObjectURLFromBase64( xBase64Stream );
-// xBase64Stream = 0;
- }
-
- if( sStr.getLength() )
- {
- pProps[nPos].Name =
- OUString::createFromAscii( XML_UNO_NAME_NRULE_GRAPHICURL );
- pProps[nPos++].Value <<= sStr;
- }
-
- awt::Size aSize( nImageWidth, nImageHeight );
- pProps[nPos].Name =
- OUString::createFromAscii( XML_UNO_NAME_NRULE_GRAPHIC_SIZE );
- pProps[nPos++].Value <<= aSize;
-
- pProps[nPos].Name =
- OUString::createFromAscii( XML_UNO_NAME_NRULE_VERT_ORIENT );
- pProps[nPos++].Value <<= (sal_Int16)eImageVertOrient;
- }
-
- if( bNum )
- {
- pProps[nPos].Name =
- OUString::createFromAscii( XML_UNO_NAME_NRULE_START_WITH );
- pProps[nPos++].Value <<= (sal_Int16)nNumStartValue;
-
- pProps[nPos].Name =
- OUString::createFromAscii(XML_UNO_NAME_NRULE_PARENT_NUMBERING);
- pProps[nPos++].Value <<= (sal_Int16)nNumDisplayLevels;
- }
-
- if( ( bNum || bBullet ) && nRelSize )
- {
- pProps[nPos].Name =
- OUString::createFromAscii( XML_UNO_NAME_NRULE_BULLET_RELSIZE );
- pProps[nPos++].Value <<= nRelSize;
- }
-
- if( !bImage && bHasColor )
- {
- pProps[nPos].Name = OUString::createFromAscii( XML_UNO_NAME_NRULE_BULLET_COLOR );
- pProps[nPos++].Value <<= (sal_Int32)aColor.GetColor();
- }
-
- DBG_ASSERT( nPos == nCount, "array under/overflow" );
- }
-
- return aPropSeq;
-}
-
-// ---------------------------------------------------------------------
-
-enum SvxXMLStyleAttributesAttrTokens
-{
- XML_TOK_STYLE_ATTRIBUTES_ATTR_SPACE_BEFORE,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_MIN_LABEL_WIDTH,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_MIN_LABEL_DIST,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_TEXT_ALIGN,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_NAME,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_FAMILY,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_FAMILY_GENERIC,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_STYLENAME,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_PITCH,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_CHARSET,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_VERTICAL_POS,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_VERTICAL_REL,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_WIDTH,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_HEIGHT,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_COLOR,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_WINDOW_FONT_COLOR,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_SIZE,
-
- XML_TOK_STYLE_ATTRIBUTES_ATTR_END=XML_TOK_UNKNOWN
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aStyleAttributesAttrTokenMap[] =
-{
- { XML_NAMESPACE_TEXT, XML_SPACE_BEFORE,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_SPACE_BEFORE },
- { XML_NAMESPACE_TEXT, XML_MIN_LABEL_WIDTH,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_MIN_LABEL_WIDTH },
- { XML_NAMESPACE_TEXT, XML_MIN_LABEL_DISTANCE,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_MIN_LABEL_DIST },
- { XML_NAMESPACE_FO, XML_TEXT_ALIGN,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_TEXT_ALIGN },
- { XML_NAMESPACE_STYLE, XML_FONT_NAME,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_NAME },
- { XML_NAMESPACE_FO, XML_FONT_FAMILY,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_FAMILY },
- { XML_NAMESPACE_STYLE, XML_FONT_FAMILY_GENERIC,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_FAMILY_GENERIC },
- { XML_NAMESPACE_STYLE, XML_FONT_STYLE_NAME,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_STYLENAME },
- { XML_NAMESPACE_STYLE, XML_FONT_PITCH,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_PITCH },
- { XML_NAMESPACE_STYLE, XML_FONT_CHARSET,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_CHARSET },
- { XML_NAMESPACE_STYLE, XML_VERTICAL_POS,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_VERTICAL_POS },
- { XML_NAMESPACE_STYLE, XML_VERTICAL_REL,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_VERTICAL_REL },
- { XML_NAMESPACE_FO, XML_WIDTH,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_WIDTH },
- { XML_NAMESPACE_FO, XML_HEIGHT,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_HEIGHT },
- { XML_NAMESPACE_FO, XML_COLOR,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_COLOR },
- { XML_NAMESPACE_STYLE, XML_USE_WINDOW_FONT_COLOR,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_WINDOW_FONT_COLOR },
- { XML_NAMESPACE_FO, XML_FONT_SIZE,
- XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_SIZE },
-
- XML_TOKEN_MAP_END
-};
-SvxXMLListLevelStyleAttrContext_Impl::SvxXMLListLevelStyleAttrContext_Impl(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- SvxXMLListLevelStyleContext_Impl& rLLevel ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rListLevel( rLLevel )
-{
- SvXMLTokenMap aTokenMap( aStyleAttributesAttrTokenMap );
- SvXMLUnitConverter& rUnitConv = GetImport().GetMM100UnitConverter();
-
- OUString sFontName, sFontFamily, sFontStyleName, sFontFamilyGeneric,
- sFontPitch, sFontCharset;
- OUString sVerticalPos, sVerticalRel;
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- sal_Int32 nVal;
- switch( aTokenMap.Get( nPrefix, aLocalName ) )
- {
- case XML_TOK_STYLE_ATTRIBUTES_ATTR_SPACE_BEFORE:
- if( rUnitConv.convertMeasure( nVal, rValue, 0, USHRT_MAX ) )
- rListLevel.SetSpaceBefore( nVal );
- break;
- case XML_TOK_STYLE_ATTRIBUTES_ATTR_MIN_LABEL_WIDTH:
- if( rUnitConv.convertMeasure( nVal, rValue, 0, SHRT_MAX ) )
- rListLevel.SetMinLabelWidth( nVal );
- break;
- case XML_TOK_STYLE_ATTRIBUTES_ATTR_MIN_LABEL_DIST:
- if( rUnitConv.convertMeasure( nVal, rValue, 0, USHRT_MAX ) )
- rListLevel.SetMinLabelDist( nVal );
- break;
- case XML_TOK_STYLE_ATTRIBUTES_ATTR_TEXT_ALIGN:
- if( rValue.getLength() )
- {
- sal_Int16 eAdjust = HoriOrientation::LEFT;
- if( IsXMLToken( rValue, XML_CENTER ) )
- eAdjust = HoriOrientation::CENTER;
- else if( IsXMLToken( rValue, XML_END ) )
- eAdjust = HoriOrientation::RIGHT;
- rListLevel.SetAdjust( eAdjust );
- }
- break;
- case XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_NAME:
- sFontName = rValue;
- break;
- case XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_FAMILY:
- sFontFamily = rValue;
- break;
- case XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_FAMILY_GENERIC:
- sFontFamilyGeneric = rValue;
- break;
- case XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_STYLENAME:
- sFontStyleName = rValue;
- break;
- case XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_PITCH:
- sFontPitch = rValue;
- break;
- case XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_CHARSET:
- sFontCharset = rValue;
- break;
- case XML_TOK_STYLE_ATTRIBUTES_ATTR_VERTICAL_POS:
- sVerticalPos = rValue;
- break;
- case XML_TOK_STYLE_ATTRIBUTES_ATTR_VERTICAL_REL:
- sVerticalRel = rValue;
- break;
- case XML_TOK_STYLE_ATTRIBUTES_ATTR_WIDTH:
- if( rUnitConv.convertMeasure( nVal, rValue, 0, SAL_MAX_INT32 ) )
- rListLevel.SetImageWidth( nVal );
- break;
- case XML_TOK_STYLE_ATTRIBUTES_ATTR_HEIGHT:
- if( rUnitConv.convertMeasure( nVal, rValue, 0, SAL_MAX_INT32 ) )
- rListLevel.SetImageHeight( nVal );
- break;
- case XML_TOK_STYLE_ATTRIBUTES_ATTR_COLOR:
- {
- Color aColor;
- if( SvXMLUnitConverter::convertColor( aColor, rValue ) )
- rListLevel.SetColor( (sal_Int32)aColor.GetColor() );
- }
- break;
- case XML_TOK_STYLE_ATTRIBUTES_ATTR_WINDOW_FONT_COLOR:
- {
- if( IsXMLToken( rValue, XML_TRUE ) )
- rListLevel.SetColor( (sal_Int32)0xffffffff );
- }
- break;
- case XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_SIZE:
- if(SvXMLUnitConverter::convertPercent( nVal, rValue ) )
- rListLevel.SetRelSize( (sal_Int16)nVal );
- break;
- }
- }
-
- if( sFontName.getLength() )
- {
- const XMLFontStylesContext *pFontDecls =
- GetImport().GetTextImport()->GetFontDecls();
- if( pFontDecls )
- {
- ::std::vector < XMLPropertyState > aProps;
- if( pFontDecls->FillProperties( sFontName, aProps, 0, 1, 2, 3, 4 ) )
- {
- OUString sTmp;
- sal_Int16 nTmp;
- ::std::vector< XMLPropertyState >::iterator i;
- for( i = aProps.begin(); i != aProps.end(); i++ )
- {
- switch( i->mnIndex )
- {
- case 0:
- i->maValue >>= sTmp;
- rListLevel.SetBulletFontName( sTmp);
- break;
- case 1:
- i->maValue >>= sTmp;
- rListLevel.SetBulletFontStyleName( sTmp );
- break;
- case 2:
- i->maValue >>= nTmp;
- rListLevel.SetBulletFontFamily( nTmp );
- break;
- case 3:
- i->maValue >>= nTmp;
- rListLevel.SetBulletFontPitch( nTmp );
- break;
- case 4:
- i->maValue >>= nTmp;
- rListLevel.SetBulletFontEncoding( nTmp );
- break;
- }
- }
- }
- }
- }
- if( sFontFamily.getLength() )
- {
- String sEmpty;
- Any aAny;
-
- XMLFontFamilyNamePropHdl aFamilyNameHdl;
- if( aFamilyNameHdl.importXML( sFontFamily, aAny, rUnitConv ) )
- {
- OUString sTmp;
- aAny >>= sTmp;
- rListLevel.SetBulletFontName( sTmp);
- }
-
- XMLFontFamilyPropHdl aFamilyHdl;
- if( sFontFamilyGeneric.getLength() &&
- aFamilyHdl.importXML( sFontFamilyGeneric, aAny, rUnitConv ) )
- {
- sal_Int16 nTmp;
- aAny >>= nTmp;
- rListLevel.SetBulletFontFamily( nTmp );
- }
-
- if( sFontStyleName.getLength() )
- rListLevel.SetBulletFontStyleName( sFontStyleName );
-
- XMLFontPitchPropHdl aPitchHdl;
- if( sFontPitch.getLength() &&
- aPitchHdl.importXML( sFontPitch, aAny, rUnitConv ) )
- {
- sal_Int16 nTmp;
- aAny >>= nTmp;
- rListLevel.SetBulletFontPitch( nTmp );
- }
-
- XMLFontEncodingPropHdl aEncHdl;
- if( sFontCharset.getLength() &&
- aEncHdl.importXML( sFontCharset, aAny, rUnitConv ) )
- {
- sal_Int16 nTmp;
- aAny >>= nTmp;
- rListLevel.SetBulletFontEncoding( nTmp );
- }
- }
-
- sal_Int16 eVertOrient = VertOrientation::LINE_CENTER;
- if( sVerticalPos.getLength() )
- {
- if( IsXMLToken( sVerticalPos, XML_TOP ) )
- eVertOrient = VertOrientation::LINE_TOP;
- else if( IsXMLToken( sVerticalPos, XML_BOTTOM ) )
- eVertOrient = VertOrientation::LINE_BOTTOM;
- }
- if( sVerticalRel.getLength() )
- {
- if( IsXMLToken( sVerticalRel, XML_BASELINE ) )
- {
- // TOP and BOTTOM are exchanged for a baseline relation
- switch( eVertOrient )
- {
- case VertOrientation::LINE_TOP:
- eVertOrient = VertOrientation::BOTTOM;
- break;
- case VertOrientation::LINE_CENTER:
- eVertOrient = VertOrientation::CENTER;
- break;
- case VertOrientation::LINE_BOTTOM:
- eVertOrient = VertOrientation::TOP;
- break;
- }
- }
- else if( IsXMLToken( sVerticalRel, XML_CHAR ) )
- {
- switch( eVertOrient )
- {
- case VertOrientation::LINE_TOP:
- eVertOrient = VertOrientation::CHAR_TOP;
- break;
- case VertOrientation::LINE_CENTER:
- eVertOrient = VertOrientation::CHAR_CENTER;
- break;
- case VertOrientation::LINE_BOTTOM:
- eVertOrient = VertOrientation::CHAR_BOTTOM;
- break;
- }
- }
- }
- rListLevel.SetImageVertOrient( eVertOrient );
-}
-
-SvxXMLListLevelStyleAttrContext_Impl::~SvxXMLListLevelStyleAttrContext_Impl()
-{
-}
-
-// ---------------------------------------------------------------------
-
-typedef SvxXMLListLevelStyleContext_Impl *SvxXMLListLevelStyleContext_ImplPtr;
-SV_DECL_PTRARR( SvxXMLListStyle_Impl, SvxXMLListLevelStyleContext_ImplPtr,
- 10, 5 )
-
-void SvxXMLListStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
- const OUString& rLocalName,
- const OUString& rValue )
-{
- if( XML_NAMESPACE_TEXT == nPrefixKey &&
- IsXMLToken( rLocalName, XML_CONSECUTIVE_NUMBERING ) )
- {
- bConsecutive = IsXMLToken( rValue, XML_TRUE );
- }
- else
- {
- SvXMLStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue );
- }
-}
-
-
-SvxXMLListStyleContext::SvxXMLListStyleContext( SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- sal_Bool bOutl ) :
- SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, bOutl ? XML_STYLE_FAMILY_TEXT_OUTLINE : XML_STYLE_FAMILY_TEXT_LIST ),
- pLevelStyles( 0 ),
- nLevels( 0 ),
- bConsecutive( sal_False ),
- bOutline( bOutl ),
-// bUsed( sal_False ),
- sIsPhysical( RTL_CONSTASCII_USTRINGPARAM( "IsPhysical" ) ),
- sNumberingRules( RTL_CONSTASCII_USTRINGPARAM( "NumberingRules" ) ),
- sName( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ),
- sIsContinuousNumbering( RTL_CONSTASCII_USTRINGPARAM( "IsContinuousNumbering" ) )
-{
-}
-
-SvxXMLListStyleContext::~SvxXMLListStyleContext()
-{
- if( pLevelStyles )
- {
- while( pLevelStyles->Count() )
- {
- sal_uInt16 n = pLevelStyles->Count() - 1;
- SvxXMLListLevelStyleContext_Impl *pStyle = (*pLevelStyles)[n];
- pLevelStyles->Remove( n, 1 );
- pStyle->ReleaseRef();
- }
- }
-
- delete pLevelStyles;
-}
-
-TYPEINIT1( SvxXMLListStyleContext, SvXMLStyleContext );
-
-SvXMLImportContext *SvxXMLListStyleContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
-
- if( XML_NAMESPACE_TEXT == nPrefix &&
- ( bOutline
- ? IsXMLToken( rLocalName, XML_OUTLINE_LEVEL_STYLE )
- : ( IsXMLToken( rLocalName, XML_LIST_LEVEL_STYLE_NUMBER ) ||
- IsXMLToken( rLocalName, XML_LIST_LEVEL_STYLE_BULLET ) ||
- IsXMLToken( rLocalName, XML_LIST_LEVEL_STYLE_IMAGE ) ) ) )
- {
- SvxXMLListLevelStyleContext_Impl *pLevelStyle =
- new SvxXMLListLevelStyleContext_Impl( GetImport(), nPrefix,
- rLocalName, xAttrList );
- if( !pLevelStyles )
- pLevelStyles = new SvxXMLListStyle_Impl;
- pLevelStyles->Insert( pLevelStyle, pLevelStyles->Count() );
- pLevelStyle->AddRef();
-
- pContext = pLevelStyle;
- }
- else
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
-
- return pContext;
-}
-
-void SvxXMLListStyleContext::FillUnoNumRule(
- const Reference< container::XIndexReplace > & rNumRule,
- const SvI18NMap *pI18NMap ) const
-{
- if( pLevelStyles )
- {
- sal_uInt16 nCount = pLevelStyles->Count();
- sal_Int32 nLevels = rNumRule->getCount();
- for( sal_uInt16 i=0; i < nCount; i++ )
- {
- SvxXMLListLevelStyleContext_Impl *pLevelStyle =
- (*pLevelStyles)[i];
- sal_Int32 nLevel = pLevelStyle->GetLevel();
- if( nLevel >= 0 && nLevel < nLevels )
- {
- Sequence<beans::PropertyValue> aProps =
- pLevelStyle->GetProperties( pI18NMap );
- Any aAny;
- aAny <<= aProps;
- rNumRule->replaceByIndex( nLevel, aAny );
- }
- }
- }
-
- Reference < XPropertySet > xPropSet( rNumRule, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo;
- if (xPropSet.is())
- xPropSetInfo = xPropSet->getPropertySetInfo();
- if( xPropSetInfo.is() &&
- xPropSetInfo->hasPropertyByName( sIsContinuousNumbering ) )
- {
- Any aAny;
- sal_Bool bTmp = bConsecutive;
- aAny.setValue( &bTmp, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( sIsContinuousNumbering, aAny );
- }
-}
-
-void SvxXMLListStyleContext::CreateAndInsertLate( sal_Bool bOverwrite )
-{
- if( bOutline )
- {
- if( bOverwrite )
- {
- const Reference< XIndexReplace >& rNumRule =
- GetImport().GetTextImport()->GetChapterNumbering();
- // We don't set xNumberingRules here, to avoid using them
- // as numbering rules.
- if( rNumRule.is() )
- FillUnoNumRule( rNumRule, 0 );
- }
- }
- else
- {
- Reference < XStyle > xStyle;
- const OUString& rName = GetName();
- if( 0 == rName.getLength() )
- {
- SetValid( sal_False );
- return;
- }
-
- const Reference < XNameContainer >& rNumStyles =
- GetImport().GetTextImport()->GetNumberingStyles();
- if( !rNumStyles.is() )
- {
- SetValid( sal_False );
- return;
- }
-
- sal_Bool bNew = sal_False;
- if( rNumStyles->hasByName( rName ) )
- {
- Any aAny = rNumStyles->getByName( rName );
- aAny >>= xStyle;
- }
- else
- {
- Reference< XMultiServiceFactory > xFactory( GetImport().GetModel(),
- UNO_QUERY );
- DBG_ASSERT( xFactory.is(), "no factory" );
- if( !xFactory.is() )
- return;
-
- Reference < XInterface > xIfc = xFactory->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.style.NumberingStyle")) );
- if( !xIfc.is() )
- return;
- Reference < XStyle > xTmp( xIfc, UNO_QUERY );
- xStyle = xTmp;
- if( !xStyle.is() )
- return;
-
- Any aAny;
- aAny <<= xStyle;
- rNumStyles->insertByName( rName, aAny );
- bNew = sal_True;
- }
-
- Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
- if( !bNew && xPropSetInfo->hasPropertyByName( sIsPhysical ) )
- {
- Any aAny = xPropSet->getPropertyValue( sIsPhysical );
- bNew = !*(sal_Bool *)aAny.getValue();
- }
-
- Any aAny = xPropSet->getPropertyValue( sNumberingRules );
- aAny >>= xNumRules;
- nLevels = xNumRules->getCount();
- if( bOverwrite || bNew )
- {
- FillUnoNumRule( xNumRules, 0 );
- aAny <<= xNumRules;
- xPropSet->setPropertyValue( sNumberingRules, aAny );
- }
- else
- {
- SetValid( sal_False );
- }
-
- SetNew( bNew );
- }
-}
-
-void SvxXMLListStyleContext::CreateAndInsertAuto() const
-{
- DBG_ASSERT( !bOutline, "Outlines cannot be inserted here" );
- DBG_ASSERT( !xNumRules.is(), "Numbering Rule is existing already" );
-
- const OUString& rName = GetName();
- if( bOutline || xNumRules.is() || 0 == rName.getLength() )
- {
- ((SvxXMLListStyleContext *)this)->SetValid( sal_False );
- return;
- }
-
- ((SvxXMLListStyleContext *)this)->xNumRules = CreateNumRule(
- GetImport().GetModel() );
- ((SvxXMLListStyleContext *)this)->nLevels = xNumRules->getCount();
-
- FillUnoNumRule( xNumRules, 0 );
-}
-
-Reference < XIndexReplace > SvxXMLListStyleContext::CreateNumRule(
- const Reference < XModel > & rModel )
-{
- Reference<XIndexReplace> xNumRule;
-
- Reference< XMultiServiceFactory > xFactory( rModel, UNO_QUERY );
- DBG_ASSERT( xFactory.is(), "no factory" );
- if( !xFactory.is() )
- return xNumRule;
-
- Reference < XInterface > xIfc = xFactory->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.NumberingRules")) );
- if( !xIfc.is() )
- return xNumRule;
-
- xNumRule = Reference<XIndexReplace>( xIfc, UNO_QUERY );
- DBG_ASSERT( xNumRule.is(), "go no numbering rule" );
-
- return xNumRule;
-}
-
-void SvxXMLListStyleContext::SetDefaultStyle(
- const Reference < XIndexReplace > & rNumRule,
- sal_Int16 nLevel,
- sal_Bool bOrdered )
-{
- Sequence<beans::PropertyValue> aPropSeq( bOrdered ? 1 : 4 );
- beans::PropertyValue *pProps = aPropSeq.getArray();
-
- pProps->Name =
- OUString::createFromAscii( XML_UNO_NAME_NRULE_NUMBERINGTYPE );
- (pProps++)->Value <<= (sal_Int16)(bOrdered ? NumberingType::ARABIC
- : NumberingType::CHAR_SPECIAL );
- if( !bOrdered )
- {
- // TODO: Bullet-Font
- //aNumFmt.SetBulletFont( &SwNumRule::GetDefBulletFont() );
- awt::FontDescriptor aFDesc;
- aFDesc.Name = OUString(
-#if defined UNX
- RTL_CONSTASCII_USTRINGPARAM( "starbats" )
-#else
- RTL_CONSTASCII_USTRINGPARAM( "StarBats" )
-#endif
- );
- aFDesc.Family = FAMILY_DONTKNOW ;
- aFDesc.Pitch = PITCH_DONTKNOW ;
- aFDesc.CharSet = RTL_TEXTENCODING_SYMBOL ;
- aFDesc.Weight = WEIGHT_DONTKNOW;
- //aFDesc.Transparant = sal_True;
- pProps->Name =
- OUString::createFromAscii( XML_UNO_NAME_NRULE_BULLET_FONT );
- (pProps++)->Value <<= aFDesc;
-
- OUStringBuffer sTmp(1);
- sTmp.append( (sal_Unicode)(0xF000 + 149) );
- pProps->Name =
- OUString::createFromAscii( XML_UNO_NAME_NRULE_BULLET_CHAR );
- (pProps++)->Value <<= sTmp.makeStringAndClear();
- pProps->Name =
- OUString::createFromAscii( XML_UNO_NAME_NRULE_CHAR_STYLE_NAME );
- (pProps++)->Value <<=
- OUString( RTL_CONSTASCII_USTRINGPARAM( "Numbering Symbols" ) );
- }
-
- Any aAny;
- aAny <<= aPropSeq;
- rNumRule->replaceByIndex( nLevel, aAny );
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_xmlprcon.cxx b/binfilter/bf_xmloff/source/style/xmloff_xmlprcon.cxx
deleted file mode 100644
index c0d99fc2093e..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_xmlprcon.cxx
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "xmlimp.hxx"
-
-
-#include "xmlprcon.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::std;
-
-SvXMLPropertySetContext::SvXMLPropertySetContext(
- SvXMLImport& rImp, USHORT nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList,
- vector< XMLPropertyState > &rProps,
- const UniReference < SvXMLImportPropertyMapper > &rMap,
- sal_Int32 nSIdx, sal_Int32 nEIdx ):
- SvXMLImportContext( rImp, nPrfx, rLName ),
- rProperties( rProps ),
- xMapper ( rMap ),
- nStartIdx( nSIdx ),
- nEndIdx( nEIdx )
-{
- xMapper->importXML( rProperties, xAttrList,
- GetImport().GetMM100UnitConverter(),
- GetImport().GetNamespaceMap(), nStartIdx, nEndIdx );
-}
-
-SvXMLPropertySetContext::~SvXMLPropertySetContext()
-{
-}
-
-SvXMLImportContext *SvXMLPropertySetContext::CreateChildContext(
- USHORT nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- UniReference< XMLPropertySetMapper > aSetMapper(
- xMapper->getPropertySetMapper() );
- sal_Int32 nEntryIndex = aSetMapper->GetEntryIndex( nPrefix, rLocalName,
- nStartIdx );
-
- if( ( nEntryIndex != -1 ) && (-1 == nEndIdx || nEntryIndex < nEndIdx ) &&
- ( 0 != ( aSetMapper->GetEntryFlags( nEntryIndex )
- & MID_FLAG_ELEMENT_ITEM_IMPORT ) ) )
- {
- XMLPropertyState aProp( nEntryIndex );
- return CreateChildContext( nPrefix, rLocalName, xAttrList,
- rProperties, aProp );
- }
- else
- {
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
-}
-
-/** This method is called from this instance implementation of
- CreateChildContext if the element matches an entry in the
- SvXMLImportItemMapper with the mid flag MID_FLAG_ELEMENT
-*/
-SvXMLImportContext *SvXMLPropertySetContext::CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList,
- ::std::vector< XMLPropertyState > &rProperties,
- const XMLPropertyState& rProp )
-{
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_xmlprhdl.cxx b/binfilter/bf_xmloff/source/style/xmloff_xmlprhdl.cxx
deleted file mode 100644
index 4ad22234be07..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_xmlprhdl.cxx
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <xmlprhdl.hxx>
-
-#include <com/sun/star/uno/Any.hxx>
-namespace binfilter {
-
-XMLPropertyHandler::~XMLPropertyHandler()
-{
- // does nothing
-}
-
-sal_Bool XMLPropertyHandler::equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const
-{
- return (r1 == r2);
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_xmlprmap.cxx b/binfilter/bf_xmloff/source/style/xmloff_xmlprmap.cxx
deleted file mode 100644
index 7f2f12be2017..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_xmlprmap.cxx
+++ /dev/null
@@ -1,233 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-
-
-#include "xmlprmap.hxx"
-
-
-
-
-
-namespace binfilter {
-
-
-using namespace ::std;
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using ::binfilter::xmloff::token::GetXMLToken;
-
-XMLPropertySetMapperEntry_Impl::XMLPropertySetMapperEntry_Impl(
- const XMLPropertyMapEntry& rMapEntry,
- const UniReference< XMLPropertyHandlerFactory >& rFactory ) :
- sXMLAttributeName( GetXMLToken(rMapEntry.meXMLName) ),
- sAPIPropertyName( OUString(rMapEntry.msApiName, rMapEntry.nApiNameLength,
- RTL_TEXTENCODING_ASCII_US ) ),
- nXMLNameSpace( rMapEntry.mnNameSpace ),
- nType( rMapEntry.mnType ),
- nContextId( rMapEntry.mnContextId ),
- pHdl( rFactory->GetPropertyHandler( rMapEntry.mnType & MID_FLAG_MASK ) )
-{
-}
-
-XMLPropertySetMapperEntry_Impl::XMLPropertySetMapperEntry_Impl(
- const XMLPropertySetMapperEntry_Impl& rEntry ) :
- sXMLAttributeName( rEntry.sXMLAttributeName),
- sAPIPropertyName( rEntry.sAPIPropertyName),
- nXMLNameSpace( rEntry.nXMLNameSpace),
- nType( rEntry.nType),
- nContextId( rEntry.nContextId),
- pHdl( rEntry.pHdl)
-{
- DBG_ASSERT( pHdl, "Unknown XML property type handler!" );
-}
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Ctor
-//
-XMLPropertySetMapper::XMLPropertySetMapper(
- const XMLPropertyMapEntry* pEntries,
- const UniReference< XMLPropertyHandlerFactory >& rFactory )
-{
- aHdlFactories.push_back( rFactory );
- if( pEntries )
- {
- const XMLPropertyMapEntry* pIter = pEntries;
-
- // count entries
- while( pIter->msApiName )
- {
- XMLPropertySetMapperEntry_Impl aEntry( *pIter, rFactory );
- aMapEntries.push_back( aEntry );
- pIter++;
- }
- }
-}
-
-XMLPropertySetMapper::~XMLPropertySetMapper()
-{
-}
-
-void XMLPropertySetMapper::AddMapperEntry(
- const UniReference < XMLPropertySetMapper >& rMapper )
-{
- for( vector < UniReference < XMLPropertyHandlerFactory > >::iterator
- aFIter = rMapper->aHdlFactories.begin();
- aFIter != rMapper->aHdlFactories.end();
- aFIter++ )
- {
- aHdlFactories.push_back( *aFIter );
- }
-
- for( vector < XMLPropertySetMapperEntry_Impl >::iterator
- aEIter = rMapper->aMapEntries.begin();
- aEIter != rMapper->aMapEntries.end();
- aEIter++ )
- {
- aMapEntries.push_back( *aEIter );
- }
-}
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Export a Property
-//
-sal_Bool XMLPropertySetMapper::exportXML(
- OUString& rStrExpValue,
- const XMLPropertyState& rProperty,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- const XMLPropertyHandler* pHdl = GetPropertyHandler( rProperty.mnIndex );
-
- DBG_ASSERT( pHdl, "Unknown XML Type!" );
- if( pHdl )
- bRet = pHdl->exportXML( rStrExpValue, rProperty.maValue,
- rUnitConverter );
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Import a Property
-//
-sal_Bool XMLPropertySetMapper::importXML(
- const OUString& rStrImpValue,
- XMLPropertyState& rProperty,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
-
- const XMLPropertyHandler* pHdl = GetPropertyHandler( rProperty.mnIndex );
-
- if( pHdl )
- bRet = pHdl->importXML( rStrImpValue, rProperty.maValue,
- rUnitConverter );
-
- return bRet;
-}
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Search for the given name and the namespace in the list and return
-// the index of the entry
-// If there is no matching entry the method returns -1
-//
-sal_Int32 XMLPropertySetMapper::GetEntryIndex(
- sal_uInt16 nNamespace,
- const OUString& rStrName,
- sal_Int32 nStartAt /* = -1 */ ) const
-{
- sal_Int32 nEntries = GetEntryCount();
- sal_Int32 nIndex= nStartAt == - 1? 0 : nStartAt+1;
-
- do
- {
- const XMLPropertySetMapperEntry_Impl& rEntry = aMapEntries[nIndex];
- if( rEntry.nXMLNameSpace == nNamespace &&
- rStrName == rEntry.sXMLAttributeName )
- return nIndex;
- else
- nIndex++;
-
- } while( nIndex<nEntries );
-
- return -1;
-}
-
-
-/** searches for an entry that matches the given api name, namespace and local name or -1 if nothing found */
-sal_Int32 XMLPropertySetMapper::FindEntryIndex(
- const sal_Char* sApiName,
- sal_uInt16 nNameSpace,
- const OUString& sXMLName ) const
-{
- sal_Int32 nIndex = 0;
- sal_Int32 nEntries = GetEntryCount();
-
- do
- {
- const XMLPropertySetMapperEntry_Impl& rEntry = aMapEntries[nIndex];
- if( rEntry.nXMLNameSpace == nNameSpace &&
- rEntry.sXMLAttributeName.equals( sXMLName ) &&
- 0 == rEntry.sAPIPropertyName.compareToAscii( sApiName ) )
- return nIndex;
- else
- nIndex++;
-
- } while( nIndex < nEntries );
-
- return -1;
-}
-
-sal_Int32 XMLPropertySetMapper::FindEntryIndex( const sal_Int16 nContextId ) const
-{
- sal_Int32 nIndex = 0;
- sal_Int32 nEntries = GetEntryCount();
-
- do
- {
- const XMLPropertySetMapperEntry_Impl& rEntry = aMapEntries[nIndex];
- if( rEntry.nContextId == nContextId )
- return nIndex;
- else
- nIndex++;
-
- } while( nIndex < nEntries );
-
- return -1;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_xmlstyle.cxx b/binfilter/bf_xmloff/source/style/xmloff_xmlstyle.cxx
deleted file mode 100644
index b2c091b01234..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_xmlstyle.cxx
+++ /dev/null
@@ -1,1005 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-#include "PageMasterPropMapper.hxx"
-
-#include <tools/urlobj.hxx>
-
-#include <bf_svtools/cntnrsrt.hxx>
-#include <bf_svtools/itemset.hxx>
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-
-#include "xmlnumi.hxx"
-
-#include "txtstyli.hxx"
-#include "xmlnumfi.hxx"
-#include "XMLChartStyleContext.hxx"
-#include "XMLChartPropertySetMapper.hxx"
-
-#include "XMLShapeStyleContext.hxx"
-
-#include "FillStyleContext.hxx"
-
-#include "XMLFootnoteConfigurationImportContext.hxx"
-#include "XMLIndexBibliographyConfigurationContext.hxx"
-#include "XMLLineNumberingImportContext.hxx"
-#include "PageMasterImportContext.hxx"
-#include "PageMasterImportPropMapper.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::style;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-// ---------------------------------------------------------------------
-
-static __FAR_DATA SvXMLTokenMapEntry aStyleStylesElemTokenMap[] =
-{
- { XML_NAMESPACE_STYLE, XML_STYLE, XML_TOK_STYLE_STYLE },
- { XML_NAMESPACE_STYLE, XML_PAGE_MASTER, XML_TOK_STYLE_PAGE_MASTER },
- { XML_NAMESPACE_TEXT, XML_LIST_STYLE, XML_TOK_TEXT_LIST_STYLE },
- { XML_NAMESPACE_TEXT, XML_OUTLINE_STYLE, XML_TOK_TEXT_OUTLINE },
- { XML_NAMESPACE_STYLE, XML_DEFAULT_STYLE, XML_TOK_STYLE_DEFAULT_STYLE },
- { XML_NAMESPACE_DRAW, XML_GRADIENT, XML_TOK_STYLES_GRADIENTSTYLES },
- { XML_NAMESPACE_DRAW, XML_HATCH, XML_TOK_STYLES_HATCHSTYLES },
- { XML_NAMESPACE_DRAW, XML_FILL_IMAGE, XML_TOK_STYLES_BITMAPSTYLES },
- { XML_NAMESPACE_DRAW, XML_TRANSPARENCY, XML_TOK_STYLES_TRANSGRADIENTSTYLES },
- { XML_NAMESPACE_DRAW, XML_MARKER, XML_TOK_STYLES_MARKERSTYLES },
- { XML_NAMESPACE_DRAW, XML_STROKE_DASH, XML_TOK_STYLES_DASHSTYLES },
- { XML_NAMESPACE_TEXT, XML_FOOTNOTES_CONFIGURATION, XML_TOK_TEXT_FOOTNOTE_CONFIG },
- { XML_NAMESPACE_TEXT, XML_ENDNOTES_CONFIGURATION, XML_TOK_TEXT_ENDNOTE_CONFIG },
- { XML_NAMESPACE_TEXT, XML_BIBLIOGRAPHY_CONFIGURATION, XML_TOK_TEXT_BIBLIOGRAPHY_CONFIG },
- { XML_NAMESPACE_TEXT, XML_LINENUMBERING_CONFIGURATION,XML_TOK_TEXT_LINENUMBERING_CONFIG },
- XML_TOKEN_MAP_END
-};
-
-const SvXMLTokenMap& SvXMLStylesContext::GetStyleStylesElemTokenMap()
-{
- if( !pStyleStylesElemTokenMap )
- pStyleStylesElemTokenMap =
- new SvXMLTokenMap( aStyleStylesElemTokenMap );
-
- return *pStyleStylesElemTokenMap;
-}
-
-// ---------------------------------------------------------------------
-
-void SvXMLStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
- const OUString& rLocalName,
- const OUString& rValue )
-{
- // TODO: use a map here
- if( XML_NAMESPACE_STYLE == nPrefixKey )
- {
- if( IsXMLToken( rLocalName, XML_FAMILY ) )
- {
- if( IsXMLToken( rValue, XML_PARAGRAPH ) )
- nFamily = (sal_uInt16)SFX_STYLE_FAMILY_PARA;
- else if( IsXMLToken( rValue, XML_TEXT ) )
- nFamily = (sal_uInt16)SFX_STYLE_FAMILY_CHAR;
- }
- else if( IsXMLToken( rLocalName, XML_NAME ) )
- {
- aName = rValue;
- }
- else if( IsXMLToken( rLocalName, XML_PARENT_STYLE_NAME ) )
- {
- aParent = rValue;
- }
- else if( IsXMLToken( rLocalName, XML_NEXT_STYLE_NAME ) )
- {
- aFollow = rValue;
- }
- else if( IsXMLToken( rLocalName, XML_HELP_FILE_NAME ) )
- {
- aHelpFile = rValue;
- }
- else if( IsXMLToken( rLocalName, XML_HELP_ID ) )
- {
- sal_Int32 nTmp = rValue.toInt32();
- nHelpId =
- (nTmp < 0L) ? 0U : ( (nTmp > USHRT_MAX) ? USHRT_MAX
- : (sal_uInt16)nTmp );
- }
- }
-}
-
-TYPEINIT1( SvXMLStyleContext, SvXMLImportContext );
-
-SvXMLStyleContext::SvXMLStyleContext(
- SvXMLImport& rImp, sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList >&,
- sal_uInt16 nFam, sal_Bool bDefault ) :
- SvXMLImportContext( rImp, nPrfx, rLName ),
- nHelpId( UCHAR_MAX ),
- nFamily( nFam ),
- bValid( sal_True ),
- bNew( sal_True ),
- bDefaultStyle( bDefault )
-{
-}
-
-SvXMLStyleContext::~SvXMLStyleContext()
-{
-}
-
-SvXMLImportContext *SvXMLStyleContext::CreateChildContext( sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList )
-{
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );;
-}
-
-void SvXMLStyleContext::StartElement( const uno::Reference< xml::sax::XAttributeList > & xAttrList )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- SetAttribute( nPrefix, aLocalName, rValue );
- }
-}
-
-void SvXMLStyleContext::SetDefaults()
-{
-}
-
-void SvXMLStyleContext::CreateAndInsert( sal_Bool bOverwrite )
-{
-}
-
-void SvXMLStyleContext::CreateAndInsertLate( sal_Bool bOverwrite )
-{
-}
-
-void SvXMLStyleContext::Finish( sal_Bool bOverwrite )
-{
-}
-
-BOOL SvXMLStyleContext::IsTransient() const
-{
- return sal_False;
-}
-
-// ---------------------------------------------------------------------
-
-class SvXMLStyleIndex_Impl
-{
- OUString sName;
- sal_uInt16 nFamily;
- const SvXMLStyleContext *pStyle;
-
-public:
-
- SvXMLStyleIndex_Impl( sal_uInt16 nFam, const OUString& rName ) :
- sName( rName ),
- nFamily( nFam ),
- pStyle ( 0 )
- {
- }
-
- SvXMLStyleIndex_Impl( const SvXMLStyleContext *pStl ) :
- sName( pStl->GetName() ),
- nFamily( pStl->GetFamily() ),
- pStyle ( pStl )
- {
- }
-
- const OUString& GetName() const { return sName; }
- sal_uInt16 GetFamily() const { return nFamily; }
- const SvXMLStyleContext *GetStyle() const { return pStyle; }
-};
-
-int SvXMLStyleIndexCmp_Impl( const SvXMLStyleIndex_Impl& r1,
- const SvXMLStyleIndex_Impl& r2 )
-{
- int nRet;
- if( (sal_uInt16)r1.GetFamily() < (sal_uInt16)r2.GetFamily() )
- nRet = -1;
- else if( (sal_uInt16)r1.GetFamily() > (sal_uInt16)r2.GetFamily() )
- nRet = 1;
- else
- nRet = (int)r1.GetName().compareTo( r2.GetName() );
-
- return nRet;
-}
-
-// ---------------------------------------------------------------------
-
-typedef SvXMLStyleContext *SvXMLStyleContextPtr;
-DECLARE_LIST( SvXMLStyleContexts_Impl, SvXMLStyleContextPtr )
-
-DECLARE_CONTAINER_SORT_DEL( SvXMLStyleIndices_Impl, SvXMLStyleIndex_Impl )
-IMPL_CONTAINER_SORT( SvXMLStyleIndices_Impl, SvXMLStyleIndex_Impl,
- SvXMLStyleIndexCmp_Impl )
-
-
-class SvXMLStylesContext_Impl
-{
- SvXMLStyleContexts_Impl aStyles;
- SvXMLStyleIndices_Impl *pIndices;
-
- OUString sId;
- OUString sParentHRef;
-
-#ifdef DBG_UTIL
- sal_uInt32 nIndexCreated;
-#endif
-
- void FlushIndex() { delete pIndices; pIndices = 0; }
-
-public:
- SvXMLStylesContext_Impl();
- ~SvXMLStylesContext_Impl();
-
- sal_uInt32 GetStyleCount() const { return aStyles.Count(); }
-
- const SvXMLStyleContext *GetStyle( sal_uInt32 i ) const
- {
- return i < aStyles.Count() ? aStyles.GetObject(i) : 0;
- }
-
- SvXMLStyleContext *GetStyle( sal_uInt32 i )
- {
- return i < aStyles.Count() ? aStyles.GetObject(i) : 0;
- }
-
- inline void AddStyle( SvXMLStyleContext *pStyle );
- void Clear();
-
- const SvXMLStyleContext *FindStyleChildContext( sal_uInt16 nFamily,
- const OUString& rName,
- sal_Bool bCreateIndex ) const;
-
- void SetId( const OUString& rId ) { sId = rId; }
- const OUString& GetId() { return sId; }
-
- void SetParentHRef( const OUString& rHRef ) { sParentHRef = rHRef; }
- const OUString& GetParentHRef() { return sParentHRef; }
-};
-
-SvXMLStylesContext_Impl::SvXMLStylesContext_Impl() :
-#ifdef DBG_UTIL
- nIndexCreated( 0 ),
-#endif
- aStyles( 20, 5 ),
- pIndices( 0 )
-{}
-
-SvXMLStylesContext_Impl::~SvXMLStylesContext_Impl()
-{
- delete pIndices;
-
- while( aStyles.Count() )
- {
- SvXMLStyleContext *pStyle = aStyles.GetObject(0);
- aStyles.Remove( 0UL );
- pStyle->ReleaseRef();
- }
-}
-
-inline void SvXMLStylesContext_Impl::AddStyle( SvXMLStyleContext *pStyle )
-{
- aStyles.Insert( pStyle, aStyles.Count() );
- pStyle->AddRef();
-
- FlushIndex();
-}
-
-void SvXMLStylesContext_Impl::Clear()
-{
- FlushIndex();
-
- while( aStyles.Count() )
- {
- SvXMLStyleContext *pStyle = aStyles.GetObject(0);
- aStyles.Remove( 0UL );
- pStyle->ReleaseRef();
- }
-}
-
-const SvXMLStyleContext *SvXMLStylesContext_Impl::FindStyleChildContext(
- sal_uInt16 nFamily,
- const OUString& rName,
- sal_Bool bCreateIndex ) const
-{
- const SvXMLStyleContext *pStyle = 0;
-
- if( !pIndices && bCreateIndex && aStyles.Count() > 0 )
- {
-#ifdef DBG_UTIL
- DBG_ASSERT( 0==nIndexCreated,
- "Performance warning: sdbcx::Index created multiple times" );
-#endif
- ((SvXMLStylesContext_Impl *)this)->pIndices =
- new SvXMLStyleIndices_Impl( aStyles.Count(), 5 );
- for( sal_uInt32 i=0; i < aStyles.Count(); i++ )
- {
- SvXMLStyleIndex_Impl* pStyleIndex = new SvXMLStyleIndex_Impl( aStyles.GetObject(i));
- if (!pIndices->Insert( pStyleIndex ))
- {
- DBG_ERROR("Here is a double Style");
- delete pStyleIndex;
- }
- }
-#ifdef DBG_UTIL
- ((SvXMLStylesContext_Impl *)this)->nIndexCreated++;
-#endif
- }
-
- if( pIndices )
- {
- SvXMLStyleIndex_Impl aIndex( nFamily, rName );
- ULONG nPos = 0;
- if( pIndices->Seek_Entry( &aIndex, &nPos ) )
- pStyle = pIndices->GetObject( nPos )->GetStyle();
- }
- else
- {
- for( sal_uInt32 i=0; !pStyle && i < aStyles.Count(); i++ )
- {
- const SvXMLStyleContext *pS = aStyles.GetObject( i );
- if( pS->GetFamily() == nFamily &&
- pS->GetName() == rName )
- pStyle = pS;
- }
- }
-
- return pStyle;
-}
-
-// ---------------------------------------------------------------------
-
-TYPEINIT1( SvXMLStylesContext, SvXMLImportContext );
-
-sal_uInt32 SvXMLStylesContext::GetStyleCount() const
-{
- return pImpl->GetStyleCount();
-}
-
-SvXMLStyleContext *SvXMLStylesContext::GetStyle( sal_uInt32 i )
-{
- return pImpl->GetStyle( i );
-}
-
-const SvXMLStyleContext *SvXMLStylesContext::GetStyle( sal_uInt32 i ) const
-{
- return pImpl->GetStyle( i );
-}
-
-SvXMLStyleContext *SvXMLStylesContext::CreateStyleChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLStyleContext *pStyle = NULL;
-
- if(GetImport().GetDataStylesImport())
- {
- pStyle = GetImport().GetDataStylesImport()->CreateChildContext(GetImport(), nPrefix,
- rLocalName, xAttrList, *this);
- }
-
- if (!pStyle)
- {
- const SvXMLTokenMap& rTokenMap = GetStyleStylesElemTokenMap();
- sal_uInt16 nToken = rTokenMap.Get( nPrefix, rLocalName );
- switch( nToken )
- {
- case XML_TOK_STYLE_STYLE:
- case XML_TOK_STYLE_DEFAULT_STYLE:
- {
- sal_uInt16 nFamily = 0;
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- if( XML_NAMESPACE_STYLE == nPrefix &&
- IsXMLToken( aLocalName, XML_FAMILY ) )
- {
- const OUString& rValue = xAttrList->getValueByIndex( i );
- nFamily = GetFamily( rValue );
- break;
- }
- }
- pStyle = XML_TOK_STYLE_STYLE==nToken
- ? CreateStyleStyleChildContext( nFamily, nPrefix,
- rLocalName, xAttrList )
- : CreateDefaultStyleStyleChildContext( nFamily, nPrefix,
- rLocalName, xAttrList );
- }
- break;
- case XML_TOK_STYLE_PAGE_MASTER:
- {
- pStyle = new PageStyleContext( GetImport(), nPrefix,
- rLocalName, xAttrList, *this );
- }
- break;
- case XML_TOK_TEXT_LIST_STYLE:
- pStyle = new SvxXMLListStyleContext( GetImport(), nPrefix,
- rLocalName, xAttrList );
- break;
- case XML_TOK_TEXT_OUTLINE:
- pStyle = new SvxXMLListStyleContext( GetImport(), nPrefix,
- rLocalName, xAttrList, sal_True );
- break;
- case XML_TOK_TEXT_FOOTNOTE_CONFIG:
-#ifndef SVX_LIGHT
- pStyle = new XMLFootnoteConfigurationImportContext(GetImport(),
- nPrefix,
- rLocalName,
- xAttrList,
- sal_False);
-#else
- // create default context to skip content
- pStyle = new SvXMLStyleContext( GetImport(), nPrefix, rLocalName, xAttrList );
-#endif // #ifndef SVX_LIGHT
- break;
-
- case XML_TOK_TEXT_ENDNOTE_CONFIG:
-#ifndef SVX_LIGHT
- pStyle = new XMLFootnoteConfigurationImportContext(GetImport(),
- nPrefix,
- rLocalName,
- xAttrList,
- sal_True);
-#else
- // create default context to skip content
- pStyle = new SvXMLStyleContext( GetImport(), nPrefix, rLocalName, xAttrList );
-#endif // #ifndef SVX_LIGHT
- break;
-
- case XML_TOK_TEXT_BIBLIOGRAPHY_CONFIG:
-#ifndef SVX_LIGHT
- pStyle = new XMLIndexBibliographyConfigurationContext(
- GetImport(), nPrefix, rLocalName, xAttrList);
-#else
- // create default context to skip content
- pStyle = new SvXMLStyleContext( GetImport(), nPrefix, rLocalName, xAttrList );
-#endif // #ifndef SVX_LIGHT
- break;
-
- case XML_TOK_TEXT_LINENUMBERING_CONFIG:
-#ifndef SVX_LIGHT
- pStyle = new XMLLineNumberingImportContext(
- GetImport(), nPrefix, rLocalName, xAttrList);
-#else
- // create default context to skip content
- pStyle = new SvXMLStyleContext( GetImport(), nPrefix, rLocalName, xAttrList );
-#endif // #ifndef SVX_LIGHT
- break;
-
- //
- // FillStyles
- //
- case XML_TOK_STYLES_GRADIENTSTYLES:
- {
- pStyle = new XMLGradientStyleContext( GetImport(), nPrefix, rLocalName, xAttrList );
- break;
- }
- case XML_TOK_STYLES_HATCHSTYLES:
- {
- pStyle = new XMLHatchStyleContext( GetImport(), nPrefix, rLocalName, xAttrList );
- break;
- }
- case XML_TOK_STYLES_BITMAPSTYLES:
- {
- pStyle = new XMLBitmapStyleContext( GetImport(), nPrefix, rLocalName, xAttrList );
- break;
- }
- case XML_TOK_STYLES_TRANSGRADIENTSTYLES:
- {
- pStyle = new XMLTransGradientStyleContext( GetImport(), nPrefix, rLocalName, xAttrList );
- break;
- }
- case XML_TOK_STYLES_MARKERSTYLES:
- {
- pStyle = new XMLMarkerStyleContext( GetImport(), nPrefix, rLocalName, xAttrList );
- break;
- }
- case XML_TOK_STYLES_DASHSTYLES:
- {
- pStyle = new XMLDashStyleContext( GetImport(), nPrefix, rLocalName, xAttrList );
- break;
- }
- }
- }
-
- return pStyle;
-}
-
-SvXMLStyleContext *SvXMLStylesContext::CreateStyleStyleChildContext(
- sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLStyleContext *pStyle = 0;
-
- switch( nFamily )
- {
- case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
- case XML_STYLE_FAMILY_TEXT_TEXT:
- case XML_STYLE_FAMILY_TEXT_SECTION:
- pStyle = new XMLTextStyleContext( GetImport(), nPrefix, rLocalName,
- xAttrList, *this, nFamily );
- break;
-
- case XML_STYLE_FAMILY_CONTROL_ID:
- pStyle = const_cast< SvXMLImport& >( GetImport() ).GetFormImport()->createControlStyleContext(
- nPrefix, rLocalName, xAttrList, *this, nFamily );
- break;
-
- case XML_STYLE_FAMILY_TEXT_RUBY:
- pStyle = new XMLPropStyleContext( GetImport(), nPrefix, rLocalName,
- xAttrList, *this, nFamily );
- break;
- case XML_STYLE_FAMILY_SCH_CHART_ID:
-#ifndef SVX_LIGHT
- pStyle = new XMLChartStyleContext( GetImport(), nPrefix, rLocalName,
- xAttrList, *this, nFamily );
-#else
- // create default context to skip content
- pStyle = new SvXMLStyleContext( GetImport(), nPrefix, rLocalName, xAttrList, nFamily );
-#endif
- break;
-
- case XML_STYLE_FAMILY_SD_GRAPHICS_ID:
- case XML_STYLE_FAMILY_SD_PRESENTATION_ID:
- case XML_STYLE_FAMILY_SD_POOL_ID:
- pStyle = new XMLShapeStyleContext( GetImport(), nPrefix, rLocalName,
- xAttrList, *this, nFamily );
- }
-
- return pStyle;
-}
-
-SvXMLStyleContext *SvXMLStylesContext::CreateDefaultStyleStyleChildContext(
- sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList )
-{
- return 0;
-}
-
-
-sal_Bool SvXMLStylesContext::InsertStyleFamily( sal_uInt16 ) const
-{
- return sal_True;
-}
-
-sal_uInt16 SvXMLStylesContext::GetFamily(
- const ::rtl::OUString& rValue ) const
-{
- sal_uInt16 nFamily = 0U;
- if( IsXMLToken( rValue, XML_PARAGRAPH ) )
- {
- nFamily = XML_STYLE_FAMILY_TEXT_PARAGRAPH;
- }
- else if( IsXMLToken( rValue, XML_TEXT ) )
- {
- nFamily = XML_STYLE_FAMILY_TEXT_TEXT;
- }
- else if( IsXMLToken( rValue, XML_DATA_STYLE ) )
- {
- nFamily = XML_STYLE_FAMILY_DATA_STYLE;
- }
- else if ( IsXMLToken( rValue, XML_SECTION ) )
- {
- nFamily = XML_STYLE_FAMILY_TEXT_SECTION;
- }
- else if( IsXMLToken( rValue, XML_TABLE ) )
- {
- nFamily = XML_STYLE_FAMILY_TABLE_TABLE;
- }
- else if( IsXMLToken( rValue, XML_TABLE_COLUMN ) )
- nFamily = XML_STYLE_FAMILY_TABLE_COLUMN;
- else if( IsXMLToken( rValue, XML_TABLE_ROW ) )
- nFamily = XML_STYLE_FAMILY_TABLE_ROW;
- else if( IsXMLToken( rValue, XML_TABLE_CELL ) )
- nFamily = XML_STYLE_FAMILY_TABLE_CELL;
- else if( rValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)))
- {
- nFamily = XML_STYLE_FAMILY_SD_GRAPHICS_ID;
- }
- else if( rValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME)))
- {
- nFamily = XML_STYLE_FAMILY_SD_PRESENTATION_ID;
- }
- else if( rValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(XML_STYLE_FAMILY_SD_POOL_NAME)))
- {
- nFamily = XML_STYLE_FAMILY_SD_POOL_ID;
- }
- else if( rValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)))
- {
- nFamily = XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID;
- }
- else if( rValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( XML_STYLE_FAMILY_SCH_CHART_NAME )))
- {
- nFamily = XML_STYLE_FAMILY_SCH_CHART_ID;
- }
- else if ( IsXMLToken( rValue, XML_RUBY ) )
- {
- nFamily = XML_STYLE_FAMILY_TEXT_RUBY;
- }
- else if ( rValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(XML_STYLE_FAMILY_CONTROL_NAME) ) )
- {
- nFamily = XML_STYLE_FAMILY_CONTROL_ID;
- }
-
- return nFamily;
-}
-
-UniReference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportPropertyMapper(
- sal_uInt16 nFamily ) const
-{
- UniReference < SvXMLImportPropertyMapper > xMapper;
-
- switch( nFamily )
- {
- case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
- if( !xParaImpPropMapper.is() )
- {
- SvXMLStylesContext * pThis = (SvXMLStylesContext *)this;
- pThis->xParaImpPropMapper =
- pThis->GetImport().GetTextImport()
- ->GetParaImportPropertySetMapper();
- }
- xMapper = xParaImpPropMapper;
- break;
- case XML_STYLE_FAMILY_TEXT_TEXT:
- if( !xTextImpPropMapper.is() )
- {
- SvXMLStylesContext * pThis = (SvXMLStylesContext *)this;
- pThis->xTextImpPropMapper =
- pThis->GetImport().GetTextImport()
- ->GetTextImportPropertySetMapper();
- }
- xMapper = xTextImpPropMapper;
- break;
-
- case XML_STYLE_FAMILY_TEXT_SECTION:
- // don't cache section mapper, as it's rarely used
- // *sigh*, cast to non-const, because this is a const method,
- // but SvXMLImport::GetTextImport() isn't.
- xMapper = ((SvXMLStylesContext*)this)->GetImport().GetTextImport()->
- GetSectionImportPropertySetMapper();
- break;
-
- case XML_STYLE_FAMILY_TEXT_RUBY:
- // don't cache section mapper, as it's rarely used
- // *sigh*, cast to non-const, because this is a const method,
- // but SvXMLImport::GetTextImport() isn't.
- xMapper = ((SvXMLStylesContext*)this)->GetImport().GetTextImport()->
- GetRubyImportPropertySetMapper();
- break;
-
- case XML_STYLE_FAMILY_SD_GRAPHICS_ID:
- case XML_STYLE_FAMILY_SD_PRESENTATION_ID:
- case XML_STYLE_FAMILY_SD_POOL_ID:
- if(!xShapeImpPropMapper.is())
- {
- UniReference< XMLShapeImportHelper > aImpHelper = ((SvXMLImport&)GetImport()).GetShapeImport();
- ((SvXMLStylesContext*)this)->xShapeImpPropMapper =
- aImpHelper->GetPropertySetMapper();
- }
- xMapper = xShapeImpPropMapper;
- break;
-#ifndef SVX_LIGHT
- case XML_STYLE_FAMILY_SCH_CHART_ID:
- if( ! xChartImpPropMapper.is() )
- {
- XMLPropertySetMapper *pPropMapper = new XMLChartPropertySetMapper();
- xChartImpPropMapper = new XMLChartImportPropertyMapper( pPropMapper, GetImport() );
- }
- xMapper = xChartImpPropMapper;
- break;
-#endif
- case XML_STYLE_FAMILY_PAGE_MASTER:
- if( ! xPageImpPropMapper.is() )
- {
- XMLPropertySetMapper *pPropMapper =
- new XMLPageMasterPropSetMapper();
- xPageImpPropMapper =
- new PageMasterImportPropertyMapper( pPropMapper,
- ((SvXMLStylesContext*)this)->GetImport() );
- }
- xMapper = xPageImpPropMapper;
- break;
-#ifndef SVX_LIGHT
- case XML_STYLE_FAMILY_CONTROL_ID:
- xMapper = const_cast<SvXMLImport&>(GetImport()).GetFormImport()->getStylePropertyMapper().get();
- break;
-#endif // #ifndef SVX_LIGHT
- }
-
- return xMapper;
-}
-
-Reference < XNameContainer > SvXMLStylesContext::GetStylesContainer(
- sal_uInt16 nFamily ) const
-{
- Reference < XNameContainer > xStyles;
- OUString sName;
- switch( nFamily )
- {
- case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
- if( xParaStyles.is() )
- xStyles = xParaStyles;
- else
- sName =
- OUString( RTL_CONSTASCII_USTRINGPARAM( "ParagraphStyles" ) );
- break;
-
- case XML_STYLE_FAMILY_TEXT_TEXT:
- if( xTextStyles.is() )
- xStyles = xTextStyles;
- else
- sName =
- OUString( RTL_CONSTASCII_USTRINGPARAM( "CharacterStyles" ) );
- break;
- }
- if( !xStyles.is() && sName.getLength() )
- {
- Reference< XStyleFamiliesSupplier > xFamiliesSupp(
- GetImport().GetModel(), UNO_QUERY );
- Reference< XNameAccess > xFamilies = xFamiliesSupp->getStyleFamilies();
- if (xFamilies->hasByName(sName))
- {
- Any aAny = xFamilies->getByName( sName );
-
- xStyles = *(Reference<XNameContainer>*)aAny.getValue();
- switch( nFamily )
- {
- case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
- ((SvXMLStylesContext *)this)->xParaStyles = xStyles;
- break;
-
- case XML_STYLE_FAMILY_TEXT_TEXT:
- ((SvXMLStylesContext *)this)->xTextStyles = xStyles;
- break;
- }
- }
- }
-
- return xStyles;
-}
-
-OUString SvXMLStylesContext::GetServiceName( sal_uInt16 nFamily ) const
-{
- String sServiceName;
- switch( nFamily )
- {
- case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
- sServiceName = sParaStyleServiceName;
- break;
- case XML_STYLE_FAMILY_TEXT_TEXT:
- sServiceName = sTextStyleServiceName;
- break;
- }
-
- return sServiceName;
-}
-
-
-SvXMLStylesContext::SvXMLStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- pImpl( new SvXMLStylesContext_Impl ),
- pStyleStylesElemTokenMap( 0 ),
- sParaStyleServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.style.ParagraphStyle" ) ),
- sTextStyleServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.style.CharacterStyle" ) )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- if( XML_NAMESPACE_NONE == nPrefix &&
- IsXMLToken( aLocalName, XML_ID ) )
- {
- pImpl->SetId( xAttrList->getValueByIndex( i ) );
- }
- }
-}
-
-
-SvXMLStylesContext::~SvXMLStylesContext()
-{
- delete pStyleStylesElemTokenMap;
- delete pImpl;
-}
-
-SvXMLImportContext *SvXMLStylesContext::CreateChildContext( sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
-
- if( XML_NAMESPACE_OFFICE == nPrefix &&
- IsXMLToken( rLocalName, XML_USE_STYLES ) )
- {
- OUString sHRef;
- pContext = new SvXMLUseStylesContext( GetImport(), nPrefix, rLocalName,
- xAttrList, sHRef );
- pImpl->SetParentHRef( sHRef );
- }
- else
- {
- SvXMLStyleContext *pStyle =
- CreateStyleChildContext( nPrefix, rLocalName, xAttrList );
-// DBG_ASSERT( pStyle->GetFamily(), "Style without a family" );
- if( pStyle )
- {
- if( !pStyle->IsTransient() )
- pImpl->AddStyle( pStyle );
- pContext = pStyle;
- }
- else
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix,
- rLocalName );
- }
- }
-
- return pContext;
-}
-
-void SvXMLStylesContext::EndElement()
-{
-}
-
-void SvXMLStylesContext::AddStyle(SvXMLStyleContext& rNew)
-{
- pImpl->AddStyle( &rNew );
-}
-
-void SvXMLStylesContext::Clear()
-{
- pImpl->Clear();
-}
-
-void SvXMLStylesContext::CopyStylesToDoc( sal_Bool bOverwrite,
- sal_Bool bFinish )
-{
- // pass 1: create text, paragraph and frame styles
- sal_uInt32 nCount = GetStyleCount();
- sal_uInt32 i;
-
- for( i=0; i<nCount; i++ )
- {
- SvXMLStyleContext *pStyle = GetStyle( i );
- if( !pStyle )
- continue;
-
- if (pStyle->IsDefaultStyle())
- pStyle->SetDefaults();
- else if( InsertStyleFamily( pStyle->GetFamily() ) )
- pStyle->CreateAndInsert( bOverwrite );
- }
-
- // pass 2: create list styles (they require char styles)
- for( i=0; i<nCount; i++ )
- {
- SvXMLStyleContext *pStyle = GetStyle( i );
- if( !pStyle || pStyle->IsDefaultStyle())
- continue;
-
- if( InsertStyleFamily( pStyle->GetFamily() ) )
- pStyle->CreateAndInsertLate( bOverwrite );
- }
-
- // pass3: finish creation of styles
- if( bFinish )
- FinishStyles( bOverwrite );
-}
-
-void SvXMLStylesContext::FinishStyles( sal_Bool bOverwrite )
-{
- sal_uInt32 nCount = GetStyleCount();
- for( sal_uInt32 i=0; i<nCount; i++ )
- {
- SvXMLStyleContext *pStyle = GetStyle( i );
- if( !pStyle || !pStyle->IsValid() || pStyle->IsDefaultStyle() )
- continue;
-
- if( InsertStyleFamily( pStyle->GetFamily() ) )
- pStyle->Finish( bOverwrite );
- }
-}
-
-
-const SvXMLStyleContext *SvXMLStylesContext::FindStyleChildContext(
- sal_uInt16 nFamily,
- const OUString& rName,
- sal_Bool bCreateIndex ) const
-{
- return pImpl->FindStyleChildContext( nFamily, rName, bCreateIndex );
-}
-
-// ---------------------------------------------------------------------
-
-SvXMLUseStylesContext::SvXMLUseStylesContext(
- SvXMLImport& rImp, sal_uInt16 nPrfx, const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList,
- OUString& rHRef ) :
- SvXMLImportContext( rImp, nPrfx, rLName )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- if( XML_NAMESPACE_XLINK == nPrefix &&
- IsXMLToken( aLocalName, XML_HREF ) )
- {
- rHRef = xAttrList->getValueByIndex( i );
- // TODO: Hack!
- if( rImp.GetLocator().is() )
- {
- // RelToAbs leaves "#foo" util::URL's untouched
- INetURLObject aBaseURL( rImp.GetLocator()->getSystemId() );
- INetURLObject aURL;
- if( aBaseURL.GetNewAbsURL( rHRef, &aURL ) )
- rHRef = aURL.GetMainURL(INetURLObject::DECODE_TO_IURI);
- }
- }
- }
-}
-
-SvXMLUseStylesContext::~SvXMLUseStylesContext()
-{
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_xmltabe.cxx b/binfilter/bf_xmloff/source/style/xmloff_xmltabe.cxx
deleted file mode 100644
index 23d54ea987cd..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_xmltabe.cxx
+++ /dev/null
@@ -1,138 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include <com/sun/star/style/TabStop.hpp>
-
-
-#include "xmlnmspe.hxx"
-#include "xmluconv.hxx"
-#include "xmlexp.hxx"
-
-#include "xmltabe.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-SvXMLEnumMapEntry pXML_tabstop_style[] =
-{
- { XML_LEFT, style::TabAlign_LEFT },
- { XML_CENTER, style::TabAlign_CENTER },
- { XML_RIGHT, style::TabAlign_RIGHT },
- { XML_CHAR, style::TabAlign_DECIMAL },
- { XML_DEFAULT, style::TabAlign_DEFAULT }, // ?????????????????????????????????????
- { XML_TOKEN_INVALID, 0 }
-};
-
-void SvxXMLTabStopExport::exportTabStop( const ::com::sun::star::style::TabStop* pTabStop )
-{
- SvXMLUnitConverter& rUnitConv = rExport.GetMM100UnitConverter();
-
- // text:level
- OUStringBuffer sBuffer;
-
- // position attribute
- rUnitConv.convertMeasure( sBuffer, pTabStop->Position );
- rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_POSITION,
- sBuffer.makeStringAndClear() );
-
- // type attribute
- if( style::TabAlign_LEFT != pTabStop->Alignment )
- {
- rUnitConv.convertEnum( sBuffer, pTabStop->Alignment,
- pXML_tabstop_style );
- rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_TYPE,
- sBuffer.makeStringAndClear() );
- }
-
- // char
- if( style::TabAlign_DECIMAL == pTabStop->Alignment &&
- pTabStop->DecimalChar != 0 )
- {
- sBuffer.append( pTabStop->DecimalChar );
- rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_CHAR,
- sBuffer.makeStringAndClear() );
- }
-
- // leader-char
- if( ' ' != pTabStop->FillChar && 0 != pTabStop->FillChar )
- {
- sBuffer.append( pTabStop->FillChar );
- rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_LEADER_CHAR,
- sBuffer.makeStringAndClear() );
- }
-
- SvXMLElementExport rElem( rExport, XML_NAMESPACE_STYLE, XML_TAB_STOP,
- sal_True, sal_True );
-}
-
-
-SvxXMLTabStopExport::SvxXMLTabStopExport(
- SvXMLExport& rExp)
- : rExport( rExp )
-{
-}
-
-SvxXMLTabStopExport::~SvxXMLTabStopExport()
-{
-}
-
-void SvxXMLTabStopExport::Export( const uno::Any& rAny )
-{
- uno::Sequence< ::com::sun::star::style::TabStop> aSeq;
- if(!(rAny >>= aSeq))
- {
- DBG_ERROR( "SvxXMLTabStopExport needs a Sequence ::com::sun::star::style::TabStop>" );
- }
- else
- {
- const ::com::sun::star::style::TabStop* pTabs = aSeq.getConstArray();
- const sal_Int32 nTabs = aSeq.getLength();
-
- // ignore default tab stop here
- //if( 1 == nTabs && style::TabAlign_DEFAULT == pTabs[0].Alignment )
- // return;
-
- SvXMLElementExport rElem( rExport, XML_NAMESPACE_STYLE, XML_TAB_STOPS,
- sal_True, sal_True );
-
- for( sal_Int32 nIndex = 0; nIndex < nTabs; nIndex++ )
- {
- if( style::TabAlign_DEFAULT != pTabs[nIndex].Alignment )
- exportTabStop( &(pTabs[nIndex]) );
- }
- }
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/style/xmloff_xmltabi.cxx b/binfilter/bf_xmloff/source/style/xmloff_xmltabi.cxx
deleted file mode 100644
index 6ed6ca5b47b4..000000000000
--- a/binfilter/bf_xmloff/source/style/xmloff_xmltabi.cxx
+++ /dev/null
@@ -1,279 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-
-#include "nmspmap.hxx"
-#include "xmlnmspe.hxx"
-#include "xmlimp.hxx"
-
-#include <com/sun/star/style/TabStop.hpp>
-
-#include "xmluconv.hxx"
-
-#include "xmltabi.hxx"
-
-#define _SVSTDARR_USHORTS
-#include <bf_svtools/svstdarr.hxx>
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-// ---
-
-enum SvXMLTokenMapAttrs
-{
- XML_TOK_TABSTOP_POSITION,
- XML_TOK_TABSTOP_TYPE,
- XML_TOK_TABSTOP_CHAR,
- XML_TOK_TABSTOP_LEADER,
- XML_TOK_TABSTOP_END=XML_TOK_UNKNOWN
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aTabsAttributesAttrTokenMap[] =
-{
- { XML_NAMESPACE_STYLE, XML_POSITION, XML_TOK_TABSTOP_POSITION },
- { XML_NAMESPACE_STYLE, XML_TYPE, XML_TOK_TABSTOP_TYPE },
- { XML_NAMESPACE_STYLE, XML_CHAR, XML_TOK_TABSTOP_CHAR },
- { XML_NAMESPACE_STYLE, XML_LEADER_CHAR, XML_TOK_TABSTOP_LEADER },
- XML_TOKEN_MAP_END
-};
-
-// ---
-
-class SvxXMLTabStopContext_Impl : public SvXMLImportContext
-{
-private:
- style::TabStop aTabStop;
-
-public:
- TYPEINFO();
-
- SvxXMLTabStopContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList );
-
- virtual ~SvxXMLTabStopContext_Impl();
-
- virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList );
-
- const style::TabStop& getTabStop() const { return aTabStop; }
-};
-
-TYPEINIT1( SvxXMLTabStopContext_Impl, SvXMLImportContext );
-
-SvxXMLTabStopContext_Impl::SvxXMLTabStopContext_Impl(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList )
-: SvXMLImportContext( rImport, nPrfx, rLName )
-{
- aTabStop.Position = 0;
- aTabStop.Alignment = style::TabAlign_LEFT;
- aTabStop.DecimalChar = sal_Unicode( ',' );
- aTabStop.FillChar = sal_Unicode( ' ' );
-
- SvXMLTokenMap aTokenMap( aTabsAttributesAttrTokenMap );
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- sal_Int32 nVal;
- switch( aTokenMap.Get( nPrefix, aLocalName ) )
- {
- case XML_TOK_TABSTOP_POSITION:
- if( GetImport().GetMM100UnitConverter().convertMeasure( nVal,
- rValue ) )
- aTabStop.Position = nVal;
- break;
- case XML_TOK_TABSTOP_TYPE:
- if( IsXMLToken( rValue, XML_LEFT ) )
- {
- aTabStop.Alignment = style::TabAlign_LEFT;
- }
- else if( IsXMLToken( rValue, XML_RIGHT ) )
- {
- aTabStop.Alignment = style::TabAlign_RIGHT;
- }
- else if( IsXMLToken( rValue, XML_CENTER ) )
- {
- aTabStop.Alignment = style::TabAlign_CENTER;
- }
- else if( IsXMLToken( rValue, XML_CHAR ) )
- {
- aTabStop.Alignment = style::TabAlign_DECIMAL;
- }
- else if( IsXMLToken( rValue, XML_DEFAULT ) )
- {
- aTabStop.Alignment = style::TabAlign_DEFAULT;
- }
- break;
- case XML_TOK_TABSTOP_CHAR:
- if( 0 != rValue.getLength() )
- aTabStop.DecimalChar = rValue[0];
- break;
- case XML_TOK_TABSTOP_LEADER:
- if( 0 != rValue.getLength() )
- aTabStop.FillChar = rValue[0];
- break;
- }
- }
-}
-
-SvxXMLTabStopContext_Impl::~SvxXMLTabStopContext_Impl()
-{
-}
-
-SvXMLImportContext *SvxXMLTabStopContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList )
-{
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-}
-
-
-
-
-typedef SvxXMLTabStopContext_Impl *SvxXMLTabStopContext_Impl_ImplPtr;
-SV_DECL_PTRARR( SvxXMLTabStopArray_Impl, SvxXMLTabStopContext_Impl_ImplPtr, 20, 5 )
-
-
-// ---
-
-TYPEINIT1( SvxXMLTabStopImportContext, XMLElementPropertyContext );
-
-SvxXMLTabStopImportContext::SvxXMLTabStopImportContext(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const XMLPropertyState& rProp,
- ::std::vector< XMLPropertyState > &rProps )
-: XMLElementPropertyContext( rImport, nPrfx, rLName, rProp, rProps ),
- mpTabStops( NULL )
-{
-}
-
-SvxXMLTabStopImportContext::~SvxXMLTabStopImportContext()
-{
- if( mpTabStops )
- {
- sal_uInt16 nCount = mpTabStops->Count();
- while( nCount )
- {
- nCount--;
- SvxXMLTabStopContext_Impl *pTabStop = (*mpTabStops)[nCount];
- mpTabStops->Remove( nCount, 1 );
- pTabStop->ReleaseRef();
- }
- }
-
- delete mpTabStops;
-}
-
-SvXMLImportContext *SvxXMLTabStopImportContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
-
- if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken( rLocalName, XML_TAB_STOP ) )
- {
- // create new tabstop import context
- SvxXMLTabStopContext_Impl *pTabStopContext =
- new SvxXMLTabStopContext_Impl( GetImport(), nPrefix, rLocalName,
- xAttrList );
-
- // add new tabstop to array of tabstops
- if( !mpTabStops )
- mpTabStops = new SvxXMLTabStopArray_Impl;
-
- mpTabStops->Insert( pTabStopContext, mpTabStops->Count() );
- pTabStopContext->AddRef();
-
- pContext = pTabStopContext;
- }
- else
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
-
- return pContext;
-}
-
-void SvxXMLTabStopImportContext::EndElement( )
-{
- sal_uInt16 nCount = mpTabStops ? mpTabStops->Count() : 0;
- uno::Sequence< style::TabStop> aSeq( nCount );
-
- if( mpTabStops )
- {
- sal_uInt16 nNewCount = 0;
-
- style::TabStop* pTabStops = aSeq.getArray();
- for( sal_uInt16 i=0; i < nCount; i++ )
- {
- SvxXMLTabStopContext_Impl *pTabStopContext = (*mpTabStops)[i];
- const style::TabStop& rTabStop = pTabStopContext->getTabStop();
- sal_Bool bDflt = style::TabAlign_DEFAULT == rTabStop.Alignment;
- if( !bDflt || 0==i )
- {
- *pTabStops++ = pTabStopContext->getTabStop();
- nNewCount++;
- }
- if( bDflt && 0==i )
- break;
- }
-
- if( nCount != nNewCount )
- aSeq.realloc( nNewCount );
- }
- aProp.maValue <<= aSeq;
-
- SetInsert( sal_True );
- XMLElementPropertyContext::EndElement();
-
-}
-
-
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLAnchorTypePropHdl.hxx b/binfilter/bf_xmloff/source/text/XMLAnchorTypePropHdl.hxx
deleted file mode 100644
index f4b37c53734a..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLAnchorTypePropHdl.hxx
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLANCHORTYPEPROPHDL_HXX
-#define _XMLOFF_XMLANCHORTYPEPROPHDL_HXX
-
-#include <com/sun/star/text/TextContentAnchorType.hpp>
-
-#include "xmlprhdl.hxx"
-namespace binfilter {
-
-
-class XMLAnchorTypePropHdl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLAnchorTypePropHdl ();
-
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
- static sal_Bool convert( const ::rtl::OUString& rStrImpValue,
- const SvXMLUnitConverter& rUnitConverter,
- ::com::sun::star::text::TextContentAnchorType& rType );
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_XMLANCHORTYPEPROPHDL_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLAutoMarkFileContext.hxx b/binfilter/bf_xmloff/source/text/XMLAutoMarkFileContext.hxx
deleted file mode 100644
index 9126a37a948c..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLAutoMarkFileContext.hxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLAUTOMARKFILECONTEXT_HXX_
-#define _XMLOFF_XMLAUTOMARKFILECONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-namespace com { namespace sun { namespace star {
- namespace uno { template<class X> class Reference; }
- namespace beans { class XPropertySet; }
- namespace xml { namespace sax { class XAttributeList; } }
-} } }
-namespace rtl { class OUString; }
-
-namespace binfilter {
-
-
-
-class XMLAutoMarkFileContext : public SvXMLImportContext
-{
- const ::rtl::OUString sIndexAutoMarkFileURL;
-
-public:
-
- TYPEINFO();
-
- XMLAutoMarkFileContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName);
-
- ~XMLAutoMarkFileContext();
-
-protected:
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLCalculationSettingsContext.hxx b/binfilter/bf_xmloff/source/text/XMLCalculationSettingsContext.hxx
deleted file mode 100644
index 2d05ae6e3ee8..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLCalculationSettingsContext.hxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLCALCULATIONSETTINGSCONTEXT_HXX
-#define _XMLOFF_XMLCALCULATIONSETTINGSCONTEXT_HXX
-
-#include "xmlictxt.hxx"
-namespace binfilter {
-
-class XMLCalculationSettingsContext : public SvXMLImportContext
-{
- sal_Int16 nYear;
-public:
- XMLCalculationSettingsContext( SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
- virtual ~XMLCalculationSettingsContext();
- virtual void EndElement();
-
-};
-
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLChangeElementImportContext.hxx b/binfilter/bf_xmloff/source/text/XMLChangeElementImportContext.hxx
deleted file mode 100644
index 5f029fd68835..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLChangeElementImportContext.hxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _XMLOFF_XMLCHANGEELEMENTIMPORTCONTEXT_HXX
-#define _XMLOFF_XMLCHANGEELEMENTIMPORTCONTEXT_HXX
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax {
- class XAttributeList;
- } }
-} } }
-namespace rtl {
- class OUString;
-}
-namespace binfilter {
-
-class XMLChangedRegionImportContext;
-
-
-
-/**
- * Import <text:deletion> and <text:insertion> elements contained in a
- * <text:changed-region> element.
- */
-class XMLChangeElementImportContext : public SvXMLImportContext
-{
- sal_Bool bAcceptContent;
- XMLChangedRegionImportContext& rChangedRegion;
-
-public:
-
- TYPEINFO();
-
- XMLChangeElementImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- /// accept text content (paragraphs) in element as redline content?
- sal_Bool bAcceptContent,
- /// context of enclosing <text:changed-region> element
- XMLChangedRegionImportContext& rParent);
-
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- // #107848#
- // Start- and EndElement are needed here to set the inside_deleted_section
- // flag at the corresponding TextImportHelper
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
- // #107848#
- virtual void EndElement();
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLChangeImportContext.hxx b/binfilter/bf_xmloff/source/text/XMLChangeImportContext.hxx
deleted file mode 100644
index 74786588c8c6..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLChangeImportContext.hxx
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLCHANGEIMPORTCONTEXT_HXX
-#define _XMLOFF_XMLCHANGEIMPORTCONTEXT_HXX
-
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax {
- class XAttributeList;
- } }
-} } }
-namespace rtl {
- class OUString;
-}
-
-namespace binfilter {
-
-
-/**
- * import change tracking/redlining markers
- * <text:change>, <text:change-start>, <text:change-end>
- */
-class XMLChangeImportContext : public SvXMLImportContext
-{
- sal_Bool bIsStart;
- sal_Bool bIsEnd;
- sal_Bool bIsOutsideOfParagraph;
-
-public:
-
- TYPEINFO();
-
- /**
- * import a change mark
- * (<text:change>, <text:change-start>, <text:change-end>)
- * Note: a <text:change> mark denotes start and end of a change
- * simultaniously, so both bIsStart and bIsEnd parameters would
- * be set true.
- */
- XMLChangeImportContext(
- SvXMLImport& rImport,
- sal_Int16 nPrefix,
- const ::rtl::OUString& rLocalName,
- sal_Bool bIsStart, /// mark start of a change
- sal_Bool bIsEnd, /// mark end of a change
- /// true if change mark is encountered outside of a paragraph
- /// (usually before a section or table)
- sal_Bool bIsOutsideOfParagraph = sal_False);
-
- ~XMLChangeImportContext();
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLChangeInfoContext.hxx b/binfilter/bf_xmloff/source/text/XMLChangeInfoContext.hxx
deleted file mode 100644
index 200324e5e84c..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLChangeInfoContext.hxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _XMLOFF_XMLCHANGEINFOCONTEXT_HXX
-#define _XMLOFF_XMLCHANGEINFOCONTEXT_HXX
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-#include <rtl/ustring.hxx>
-
-#include <rtl/ustrbuf.hxx>
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
-} } }
-namespace binfilter {
-class XMLChangedRegionImportContext;
-
-
-
-/**
- * Import <office:change-info> elements as children of <text:changed-region>
- * elements. The attribute values will be passed to the enclosing
- * XMLChangedRegionImportContext (which has to be passed down in the
- * constructor).
- */
-class XMLChangeInfoContext : public SvXMLImportContext
-{
- const ::rtl::OUString& rType;
-
- ::rtl::OUString sAuthor;
- ::rtl::OUString sDateTime;
- ::rtl::OUStringBuffer sCommentBuffer;
-
- XMLChangedRegionImportContext& rChangedRegion;
-
-public:
-
- TYPEINFO();
-
- XMLChangeInfoContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- XMLChangedRegionImportContext& rChangedRegion,
- const ::rtl::OUString& rChangeType);
-
- ~XMLChangeInfoContext();
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- virtual SvXMLImportContext *CreateChildContext(
- USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
- virtual void EndElement();
-
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLChangedRegionImportContext.hxx b/binfilter/bf_xmloff/source/text/XMLChangedRegionImportContext.hxx
deleted file mode 100644
index 86e4eda9e5c3..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLChangedRegionImportContext.hxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _XMLOFF_XMLCHANGEDREGIONIMPORTCONTEXT_HXX
-#define _XMLOFF_XMLCHANGEDREGIONIMPORTCONTEXT_HXX
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-namespace com { namespace sun { namespace star {
- namespace text {
- class XTextCursor;
- }
- namespace xml { namespace sax {
- class XAttributeList;
- } }
-} } }
-namespace rtl {
- class OUString;
-}
-namespace binfilter {
-
-
-class XMLChangedRegionImportContext : public SvXMLImportContext
-{
- const ::rtl::OUString sEmpty;
-
- /// if we replace the current XTextCursor/XText by the ones for
- /// the redline, we remeber the old cursor here.
- ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XTextCursor> xOldCursor;
-
- ::rtl::OUString sID; /// redline-ID
-
- sal_Bool bMergeLastPara; /// merge-last-paragraph flag
-
-public:
-
- TYPEINFO();
-
- XMLChangedRegionImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName);
-
- ~XMLChangedRegionImportContext();
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- virtual void EndElement();
-
-
- /// change info: To be called from change-info context
- void SetChangeInfo(const ::rtl::OUString& rType,
- const ::rtl::OUString& rAuthor,
- const ::rtl::OUString& rComment,
- const ::rtl::OUString& rDate);
-
- /// create redline XText/XTextCursor on demand and register with
- /// XMLTextImportHelper
- void UseRedlineText();
-};
-
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLFootnoteBodyImportContext.hxx b/binfilter/bf_xmloff/source/text/XMLFootnoteBodyImportContext.hxx
deleted file mode 100644
index 327b14434c12..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLFootnoteBodyImportContext.hxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLFOOTNOTEBODYIMPORTCONTEXT_HXX_
-#define _XMLOFF_XMLFOOTNOTEBODYIMPORTCONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax {
- class XAttributeList;
- } }
-} } }
-namespace rtl {
- class OUString;
-}
-
-namespace binfilter {
-
-/// import foot- and endnote body elements (<text:footnote-body>)
-class XMLFootnoteBodyImportContext : public SvXMLImportContext
-{
-
-public:
-
- TYPEINFO();
-
- XMLFootnoteBodyImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName );
-
-protected:
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLFootnoteImportContext.hxx b/binfilter/bf_xmloff/source/text/XMLFootnoteImportContext.hxx
deleted file mode 100644
index 62540bb16fab..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLFootnoteImportContext.hxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLFOOTNOTEIMPORTCONTEXT_HXX_
-#define _XMLOFF_XMLFOOTNOTEIMPORTCONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-namespace com { namespace sun { namespace star {
- namespace text {
- class XTextCursor;
- class XFootnote;
- }
- namespace xml { namespace sax {
- class XAttributeList;
- } }
-} } }
-namespace rtl {
- class OUString;
-}
-namespace binfilter {
-class XMLTextImportHelper;
-
-/// import footnote elements (<text:footnote>)
-class XMLFootnoteImportContext : public SvXMLImportContext
-{
- const ::rtl::OUString sPropertyReferenceId;
-
- /// old document cursor
- ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XTextCursor> xOldCursor;
-
- /// old list item and block (#89891#)
- SvXMLImportContextRef xListBlock;
- SvXMLImportContextRef xListItem;
-
- /// text import helper; holds current XTextCursor (and XText)
- XMLTextImportHelper& rHelper;
-
- /// the footnote
- ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XFootnote> xFootnote;
-
-public:
-
- TYPEINFO();
-
- XMLFootnoteImportContext(
- SvXMLImport& rImport,
- XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName );
-
-protected:
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- virtual void Characters(
- const ::rtl::OUString& rChars);
-
- virtual void EndElement();
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx
deleted file mode 100644
index 960db2d5ae8d..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx
+++ /dev/null
@@ -1,110 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXALPHABETICALSOURCECONTEXT_HXX_
-#define _XMLOFF_XMLINDEXALPHABETICALSOURCECONTEXT_HXX_
-
-#include "XMLIndexSourceBaseContext.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-#include <com/sun/star/lang/Locale.hpp>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
- namespace beans { class XPropertySet; }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-
-
-/**
- * Import alphabetical (keyword) index source element
- */
-class XMLIndexAlphabeticalSourceContext : public XMLIndexSourceBaseContext
-{
- const ::rtl::OUString sMainEntryCharacterStyleName;
- const ::rtl::OUString sUseAlphabeticalSeparators;
- const ::rtl::OUString sUseCombinedEntries;
- const ::rtl::OUString sIsCaseSensitive;
- const ::rtl::OUString sUseKeyAsEntry;
- const ::rtl::OUString sUseUpperCase;
- const ::rtl::OUString sUseDash;
- const ::rtl::OUString sUsePP;
- const ::rtl::OUString sIsCommaSeparated;
- const ::rtl::OUString sSortAlgorithm;
- const ::rtl::OUString sLocale;
-
- ::com::sun::star::lang::Locale aLocale;
- ::rtl::OUString sAlgorithm;
-
- ::rtl::OUString sMainEntryStyleName;
- sal_Bool bMainEntryStyleNameOK;
-
- sal_Bool bSeparators;
- sal_Bool bCombineEntries;
- sal_Bool bCaseSensitive;
- sal_Bool bEntry;
- sal_Bool bUpperCase;
- sal_Bool bCombineDash;
- sal_Bool bCombinePP;
- sal_Bool bCommaSeparated;
-
-public:
-
- TYPEINFO();
-
- XMLIndexAlphabeticalSourceContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet);
-
- ~XMLIndexAlphabeticalSourceContext();
-
-protected:
-
- virtual void ProcessAttribute(
- enum IndexSourceParamEnum eParam,
- const ::rtl::OUString& rValue);
-
- virtual void EndElement();
-
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexBibliographyEntryContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexBibliographyEntryContext.hxx
deleted file mode 100644
index 43cb9c982722..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexBibliographyEntryContext.hxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXBIBLIOGRAPHYENTRYCONTEXT_HXX_
-#define _XMLOFF_XMLINDEXBIBLIOGRAPHYENTRYCONTEXT_HXX_
-
-#include "XMLIndexSimpleEntryContext.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-#include <com/sun/star/uno/Sequence.h>
-
-#include <com/sun/star/beans/PropertyValue.hpp>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-class XMLIndexTemplateContext;
-struct SvXMLEnumMapEntry;
-
-extern const SvXMLEnumMapEntry aBibliographyDataFieldMap[];
-
-/**
- * Import bibliography index entry templates
- */
-class XMLIndexBibliographyEntryContext : public XMLIndexSimpleEntryContext
-{
- // bibliography info
- sal_Int16 nBibliographyInfo;
- sal_Bool bBibliographyInfoOK;
-
-public:
-
- TYPEINFO();
-
- XMLIndexBibliographyEntryContext(
- SvXMLImport& rImport,
- XMLIndexTemplateContext& rTemplate,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName );
-
- ~XMLIndexBibliographyEntryContext();
-
-protected:
-
- /** process parameters */
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- /** call FillPropertyValues and insert into template */
- virtual void EndElement();
-
- /** fill property values for this template entry */
- virtual void FillPropertyValues(
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::beans::PropertyValue> & rValues);
-
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexBibliographySourceContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexBibliographySourceContext.hxx
deleted file mode 100644
index 35d8c6d25c2d..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexBibliographySourceContext.hxx
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXBIBLIOGRAPHYSOURCECONTEXT_HXX_
-#define _XMLOFF_XMLINDEXBIBLIOGRAPHYSOURCECONTEXT_HXX_
-
-#include "XMLIndexSourceBaseContext.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
- namespace beans { class XPropertySet; }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-
-
-/**
- * Import bibliography source element
- */
-class XMLIndexBibliographySourceContext : public XMLIndexSourceBaseContext
-{
-
-public:
-
- TYPEINFO();
-
- XMLIndexBibliographySourceContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet);
-
- ~XMLIndexBibliographySourceContext();
-
-protected:
-
- virtual void ProcessAttribute(
- enum IndexSourceParamEnum eParam,
- const ::rtl::OUString& rValue);
-
- virtual void EndElement();
-
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexBodyContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexBodyContext.hxx
deleted file mode 100644
index ce0175f02830..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexBodyContext.hxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXBODYCONTEXT_HXX_
-#define _XMLOFF_XMLINDEXBODYCONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
- namespace beans { class XPropertySet; }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-
-/**
- * Import index body.
- *
- * This class basically delegates all CreateChildContext() calls to
- * the text import and doesn't do much else.
- */
-class XMLIndexBodyContext : public SvXMLImportContext
-{
- sal_Bool bHasContent;
-
-public:
-
- TYPEINFO();
-
- XMLIndexBodyContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName );
-
- ~XMLIndexBodyContext();
-
- /// return whether any content elements were encountered
- inline sal_Bool HasContent();
-
-protected:
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-};
-
-inline sal_Bool XMLIndexBodyContext::HasContent()
-{
- return bHasContent;
-}
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx
deleted file mode 100644
index 2d34a52f1df5..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXCHAPTERINFOENTRYCONTEXT_HXX_
-#define _XMLOFF_XMLINDEXCHAPTERINFOENTRYCONTEXT_HXX_
-
-#include "XMLIndexSimpleEntryContext.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-#include <com/sun/star/uno/Sequence.h>
-
-#include <com/sun/star/beans/PropertyValue.hpp>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-class XMLIndexTemplateContext;
-
-/**
- * Import chapter info index entry templates
- */
-class XMLIndexChapterInfoEntryContext : public XMLIndexSimpleEntryContext
-{
- // chapter format
- sal_Int16 nChapterInfo;
- sal_Bool bChapterInfoOK;
-
-public:
-
- TYPEINFO();
-
- XMLIndexChapterInfoEntryContext(
- SvXMLImport& rImport,
- XMLIndexTemplateContext& rTemplate,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName );
-
- ~XMLIndexChapterInfoEntryContext();
-
-protected:
-
- /** process parameters */
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- /** fill property values for this template entry */
- virtual void FillPropertyValues(
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::beans::PropertyValue> & rValues);
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexIllustrationSourceContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexIllustrationSourceContext.hxx
deleted file mode 100644
index 115d035d4cfb..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexIllustrationSourceContext.hxx
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXILLUSTRATIONSOURCECONTEXT_HXX_
-#define _XMLOFF_XMLINDEXILLUSTRATIONSOURCECONTEXT_HXX_
-
-#include "XMLIndexTableSourceContext.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
- namespace beans { class XPropertySet; }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-
-
-/**
- * Import illustration index source element;
- *
- * All logic is inherited from table source context. The only difference is
- * the different child context (illustration entry template).
- */
-class XMLIndexIllustrationSourceContext : public XMLIndexTableSourceContext
-{
-public:
-
- TYPEINFO();
-
- XMLIndexIllustrationSourceContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet);
-
- ~XMLIndexIllustrationSourceContext();
-
-protected:
-
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexMarkExport.hxx b/binfilter/bf_xmloff/source/text/XMLIndexMarkExport.hxx
deleted file mode 100644
index 88535e1b6787..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexMarkExport.hxx
+++ /dev/null
@@ -1,121 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXMARKEXPORT_HXX_
-#define _XMLOFF_XMLINDEXMARKEXPORT_HXX_
-
-#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Sequence.h>
-
-namespace com { namespace sun { namespace star {
- namespace beans { class XPropertySet; }
- } } }
-namespace rtl {
- class OUString;
- class OUStringBuffer;
-}
-namespace binfilter {
-class SvXMLExport;
-class XMLTextParagraphExport;
-
-
-/**
- * This class handles the export of index marks for table of content,
- * alphabetical and user index.
- *
- * Marks for bibliography indices are internally modelled as text
- * fields and thus handled in txtparae.cxx
- */
-class XMLIndexMarkExport
-{
- ::rtl::OUString sLevel;
- ::rtl::OUString sUserIndexName;
- ::rtl::OUString sPrimaryKey;
- ::rtl::OUString sSecondaryKey;
- ::rtl::OUString sDocumentIndexMark;
- ::rtl::OUString sIsStart;
- ::rtl::OUString sIsCollapsed;
- ::rtl::OUString sAlternativeText;
- ::rtl::OUString sTextReading;
- ::rtl::OUString sPrimaryKeyReading;
- ::rtl::OUString sSecondaryKeyReading;
- ::rtl::OUString sMainEntry;
-
-
- SvXMLExport& rExport;
- XMLTextParagraphExport& rParaExport;
-
-public:
- XMLIndexMarkExport(SvXMLExport& rExp,
- XMLTextParagraphExport& rParaExp);
-
- ~XMLIndexMarkExport();
-
- /**
- * export by the property set of its *text* *portion*.
- *
- * The text portion supplies us with the properties of the index
- * mark itself, as well as the information whether we are at the
- * start or end of an index mark, or whether the index mark is
- * collapsed.
- */
- void ExportIndexMark(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet,
- sal_Bool bAutoStyles);
-
-protected:
-
- /// export attributes of table-of-content index marks
- void ExportTOCMarkAttributes(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet);
-
- /// export attributes of user index marks
- void ExportUserIndexMarkAttributes(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet);
-
- /// export attributes of alphabetical index marks
- void ExportAlphabeticalIndexMarkAttributes(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet);
-
- /// create a numerical ID for this index mark
- /// (represented by its properties)
- void GetID(
- ::rtl::OUStringBuffer& sBuffer,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet);
-
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexObjectSourceContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexObjectSourceContext.hxx
deleted file mode 100644
index 3908b3ba01a7..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexObjectSourceContext.hxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXOBJECTSOURCECONTEXT_HXX_
-#define _XMLOFF_XMLINDEXOBJECTSOURCECONTEXT_HXX_
-
-#include "XMLIndexSourceBaseContext.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
- namespace beans { class XPropertySet; }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-
-
-/**
- * Import object index source element
- */
-class XMLIndexObjectSourceContext : public XMLIndexSourceBaseContext
-{
- const ::rtl::OUString sCreateFromStarCalc;
- const ::rtl::OUString sCreateFromStarChart;
- const ::rtl::OUString sCreateFromStarDraw;
- const ::rtl::OUString sCreateFromStarMath;
- const ::rtl::OUString sCreateFromOtherEmbeddedObjects;
-
- sal_Bool bUseCalc;
- sal_Bool bUseChart;
- sal_Bool bUseDraw;
- sal_Bool bUseMath;
- sal_Bool bUseOtherObjects;
-
-public:
-
- TYPEINFO();
-
- XMLIndexObjectSourceContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet);
-
- ~XMLIndexObjectSourceContext();
-
-protected:
-
- virtual void ProcessAttribute(
- enum IndexSourceParamEnum eParam,
- const ::rtl::OUString& rValue);
-
- virtual void EndElement();
-
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexSimpleEntryContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexSimpleEntryContext.hxx
deleted file mode 100644
index 18389793bbce..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexSimpleEntryContext.hxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXSIMPLEENTRYCONTEXT_HXX_
-#define _XMLOFF_XMLINDEXSIMPLEENTRYCONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-#include <com/sun/star/uno/Sequence.h>
-
-#include <com/sun/star/beans/PropertyValue.hpp>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-class XMLIndexTemplateContext;
-
-/**
- * Import index entry templates
- */
-class XMLIndexSimpleEntryContext : public SvXMLImportContext
-{
-
- // entry type
- const ::rtl::OUString& rEntryType;
-
-protected:
- // character style
- ::rtl::OUString sCharStyleName;
- sal_Bool bCharStyleNameOK;
-
- // surrounding template
- XMLIndexTemplateContext& rTemplateContext;
-
- // number of values for PropertyValues
- sal_Int32 nValues;
-
-public:
-
- TYPEINFO();
-
- XMLIndexSimpleEntryContext(
- SvXMLImport& rImport,
- const ::rtl::OUString& rEntry,
- XMLIndexTemplateContext& rTemplate,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName );
-
- ~XMLIndexSimpleEntryContext();
-
-protected:
-
- /** process parameters */
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- /** call FillPropertyValues and insert into template */
- virtual void EndElement();
-
- /** fill property values for this template entry */
- virtual void FillPropertyValues(
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::beans::PropertyValue> & rValues);
-
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexSourceBaseContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexSourceBaseContext.hxx
deleted file mode 100644
index 11d037a30ba8..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexSourceBaseContext.hxx
+++ /dev/null
@@ -1,138 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXSOURCEBASECONTEXT_HXX_
-#define _XMLOFF_XMLINDEXSOURCEBASECONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-#include <rtl/ustring.hxx>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
- namespace beans { class XPropertySet; }
-} } }
-namespace binfilter {
-
-enum IndexSourceParamEnum
-{
- XML_TOK_INDEXSOURCE_OUTLINE_LEVEL,
- XML_TOK_INDEXSOURCE_USE_INDEX_MARKS,
- XML_TOK_INDEXSOURCE_INDEX_SCOPE,
- XML_TOK_INDEXSOURCE_RELATIVE_TABS,
- XML_TOK_INDEXSOURCE_USE_OTHER_OBJECTS,
- XML_TOK_INDEXSOURCE_USE_SHEET,
- XML_TOK_INDEXSOURCE_USE_CHART,
- XML_TOK_INDEXSOURCE_USE_DRAW,
- XML_TOK_INDEXSOURCE_USE_IMAGE,
- XML_TOK_INDEXSOURCE_USE_MATH,
- XML_TOK_INDEXSOURCE_MAIN_ENTRY_STYLE,
- XML_TOK_INDEXSOURCE_IGNORE_CASE,
- XML_TOK_INDEXSOURCE_SEPARATORS,
- XML_TOK_INDEXSOURCE_COMBINE_ENTRIES,
- XML_TOK_INDEXSOURCE_COMBINE_WITH_DASH,
- XML_TOK_INDEXSOURCE_KEYS_AS_ENTRIES,
- XML_TOK_INDEXSOURCE_COMBINE_WITH_PP,
- XML_TOK_INDEXSOURCE_CAPITALIZE,
- XML_TOK_INDEXSOURCE_USE_OBJECTS,
- XML_TOK_INDEXSOURCE_USE_GRAPHICS,
- XML_TOK_INDEXSOURCE_USE_TABLES,
- XML_TOK_INDEXSOURCE_USE_FRAMES,
- XML_TOK_INDEXSOURCE_COPY_OUTLINE_LEVELS,
- XML_TOK_INDEXSOURCE_USE_CAPTION,
- XML_TOK_INDEXSOURCE_SEQUENCE_NAME,
- XML_TOK_INDEXSOURCE_SEQUENCE_FORMAT,
- XML_TOK_INDEXSOURCE_COMMA_SEPARATED,
- XML_TOK_INDEXSOURCE_USE_INDEX_SOURCE_STYLES,
- XML_TOK_INDEXSOURCE_SORT_ALGORITHM,
- XML_TOK_INDEXSOURCE_LANGUAGE,
- XML_TOK_INDEXSOURCE_COUNTRY,
- XML_TOK_INDEXSOURCE_USER_INDEX_NAME,
- XML_TOK_INDEXSOURCE_USE_OUTLINE_LEVEL
-};
-
-
-/**
- * Superclass for index source elements
- */
-class XMLIndexSourceBaseContext : public SvXMLImportContext
-{
- const ::rtl::OUString sCreateFromChapter;
- const ::rtl::OUString sIsRelativeTabstops;
-
- sal_Bool bUseLevelFormats;
-
- sal_Bool bChapterIndex; /// chapter-wise or document index?
- sal_Bool bRelativeTabs; /// tab stops relative to margin or indent?
-
-protected:
-
- /// property set of index; must be accessible to subclasses
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rIndexPropertySet;
-
-public:
-
- TYPEINFO();
-
- XMLIndexSourceBaseContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet,
- sal_Bool bLevelFormats);
-
- ~XMLIndexSourceBaseContext();
-
-protected:
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- virtual void ProcessAttribute(
- enum IndexSourceParamEnum eParam,
- const ::rtl::OUString& rValue);
-
- virtual void EndElement();
-
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexSpanEntryContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexSpanEntryContext.hxx
deleted file mode 100644
index 20e1acedf4d1..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexSpanEntryContext.hxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXSPANENTRYCONTEXT_HXX_
-#define _XMLOFF_XMLINDEXSPANENTRYCONTEXT_HXX_
-
-#include "XMLIndexSimpleEntryContext.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-#include <com/sun/star/uno/Sequence.h>
-
-#include <com/sun/star/beans/PropertyValue.hpp>
-
-#include <rtl/ustrbuf.hxx>
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-
-/**
- * Import index entry templates
- */
-class XMLIndexSpanEntryContext : public XMLIndexSimpleEntryContext
-{
- ::rtl::OUStringBuffer sContent;
-
-public:
-
- TYPEINFO();
-
- XMLIndexSpanEntryContext(
- SvXMLImport& rImport,
- XMLIndexTemplateContext& rTemplate,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName );
-
- ~XMLIndexSpanEntryContext();
-
-protected:
-
- /// Collect element contents
- virtual void Characters(const ::rtl::OUString& sString);
-
- /// add Text PropertyValue
- virtual void FillPropertyValues(
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::beans::PropertyValue> & rValues);
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexTOCContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexTOCContext.hxx
deleted file mode 100644
index 286db4b11b37..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexTOCContext.hxx
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXTOCCONTEXT_HXX_
-#define _XMLOFF_XMLINDEXTOCCONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
- namespace beans { class XPropertySet; }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-
-
-enum IndexTypeEnum
-{
- TEXT_INDEX_TOC,
- TEXT_INDEX_ALPHABETICAL,
- TEXT_INDEX_TABLE,
- TEXT_INDEX_OBJECT,
- TEXT_INDEX_BIBLIOGRAPHY,
- TEXT_INDEX_USER,
- TEXT_INDEX_ILLUSTRATION,
-
- TEXT_INDEX_UNKNOWN
-};
-
-
-/**
- * Import all indices.
- *
- * Originally, this class would import only the TOC (table of
- * content), but now it's role has been expanded to handle all
- * indices, and hence is named inappropriately. Depending on the
- * element name it decides which index source element context to create.
- */
-class XMLIndexTOCContext : public SvXMLImportContext
-{
- const ::rtl::OUString sTitle;
- const ::rtl::OUString sIsProtected;
- const ::rtl::OUString sName;
-
- /** XPropertySet of the index */
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> xTOCPropertySet;
-
- enum IndexTypeEnum eIndexType;
-
- /** source element name (for CreateChildContext) */
- const sal_Char* pSourceElementName;
-
- sal_Bool bValid;
-
- SvXMLImportContextRef xBodyContextRef;
-
-public:
-
- TYPEINFO();
-
- XMLIndexTOCContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName );
-
- ~XMLIndexTOCContext();
-
-protected:
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- virtual void EndElement();
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexTOCSourceContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexTOCSourceContext.hxx
deleted file mode 100644
index 819f3c7e0cc1..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexTOCSourceContext.hxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXTOCSOURCECONTEXT_HXX_
-#define _XMLOFF_XMLINDEXTOCSOURCECONTEXT_HXX_
-
-#include "XMLIndexSourceBaseContext.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
- namespace beans { class XPropertySet; }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-
-
-/**
- * Import table of context source element
- */
-class XMLIndexTOCSourceContext : public XMLIndexSourceBaseContext
-{
- const ::rtl::OUString sCreateFromMarks;
- const ::rtl::OUString sLevel;
- const ::rtl::OUString sCreateFromChapter;
- const ::rtl::OUString sCreateFromOutline;
- const ::rtl::OUString sCreateFromLevelParagraphStyles;
-
- sal_Int32 nOutlineLevel;
- sal_Bool bUseOutline;
- sal_Bool bUseMarks;
- sal_Bool bUseParagraphStyles;
-
-public:
-
- TYPEINFO();
-
- XMLIndexTOCSourceContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet);
-
- ~XMLIndexTOCSourceContext();
-
-protected:
-
- virtual void ProcessAttribute(
- enum IndexSourceParamEnum eParam,
- const ::rtl::OUString& rValue);
-
- virtual void EndElement();
-
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexTOCStylesContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexTOCStylesContext.hxx
deleted file mode 100644
index f6fe873c18fd..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexTOCStylesContext.hxx
+++ /dev/null
@@ -1,103 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXTOCSTYLESCONTEXT_HXX_
-#define _XMLOFF_XMLINDEXTOCSTYLESCONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-#ifndef __SGI_STL_VECTOR
-#include <vector>
-#endif
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
- namespace beans { class XPropertySet; }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-
-
-/**
- * Import <test:index-source-styles> elements and their children
- *
- * (Small hackery here: Because there's only one type of child
- * elements with only one interesting attribute, we completely handle
- * them inside the CreateChildContext method, rather than creating a
- * new import class for them. This must be changed if children become
- * more complex in future versions.)
- */
-class XMLIndexTOCStylesContext : public SvXMLImportContext
-{
- const ::rtl::OUString sLevelParagraphStyles;
-
- /// XPropertySet of the index
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rTOCPropertySet;
-
- /// style names for this level
- ::std::vector< ::rtl::OUString > aStyleNames;
-
- /// outline level
- sal_Int32 nOutlineLevel;
-
-public:
-
- TYPEINFO();
-
- XMLIndexTOCStylesContext(
- SvXMLImport& rImport,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName );
-
- ~XMLIndexTOCStylesContext();
-
-protected:
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- virtual void EndElement();
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexTabStopEntryContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexTabStopEntryContext.hxx
deleted file mode 100644
index f67955da80bd..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexTabStopEntryContext.hxx
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXTABSTOPENTRYCONTEXT_HXX_
-#define _XMLOFF_XMLINDEXTABSTOPENTRYCONTEXT_HXX_
-
-#include "XMLIndexSimpleEntryContext.hxx"
-
-#include "rtl/ustring.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-#include <com/sun/star/uno/Sequence.h>
-
-#include <com/sun/star/beans/PropertyValue.hpp>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
-} } }
-namespace binfilter {
-class XMLIndexTemplateContext;
-
-/**
- * Import index entry templates
- */
-class XMLIndexTabStopEntryContext : public XMLIndexSimpleEntryContext
-{
- ::rtl::OUString sLeaderChar; /// fill ("leader") character
- sal_Int32 nTabPosition; /// tab position
- sal_Bool bTabPositionOK; /// is tab right aligned?
- sal_Bool bTabRightAligned; /// is nTabPosition valid?
- sal_Bool bLeaderCharOK; /// is sLeaderChar valid?
-
-public:
-
- TYPEINFO();
-
- XMLIndexTabStopEntryContext(
- SvXMLImport& rImport,
- XMLIndexTemplateContext& rTemplate,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName );
-
- ~XMLIndexTabStopEntryContext();
-
-protected:
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- /** fill property values for this template entry */
- virtual void FillPropertyValues(
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::beans::PropertyValue> & rValues);
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexTableSourceContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexTableSourceContext.hxx
deleted file mode 100644
index f5de4a794882..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexTableSourceContext.hxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXTABLESOURCECONTEXT_HXX_
-#define _XMLOFF_XMLINDEXTABLESOURCECONTEXT_HXX_
-
-#include "XMLIndexSourceBaseContext.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
- namespace beans { class XPropertySet; }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-
-
-/**
- * Import table index source element
- */
-class XMLIndexTableSourceContext : public XMLIndexSourceBaseContext
-{
- const ::rtl::OUString sCreateFromLabels;
- const ::rtl::OUString sLabelCategory;
- const ::rtl::OUString sLabelDisplayType;
-
- ::rtl::OUString sSequence;
- sal_Int16 nDisplayFormat;
-
- sal_Bool bSequenceOK;
- sal_Bool bDisplayFormatOK;
- sal_Bool bUseCaption;
-
-public:
-
- TYPEINFO();
-
- XMLIndexTableSourceContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet);
-
- ~XMLIndexTableSourceContext();
-
-protected:
-
- virtual void ProcessAttribute(
- enum IndexSourceParamEnum eParam,
- const ::rtl::OUString& rValue);
-
- virtual void EndElement();
-
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexTemplateContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexTemplateContext.hxx
deleted file mode 100644
index 1eaf4876cfe4..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexTemplateContext.hxx
+++ /dev/null
@@ -1,165 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXTEMPLATECONTEXT_HXX_
-#define _XMLOFF_XMLINDEXTEMPLATECONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-
-#include "xmltoken.hxx"
-
-#include <vector>
-
-#include <com/sun/star/uno/Reference.h>
-
-#include <com/sun/star/uno/Sequence.h>
-
-#include <com/sun/star/beans/PropertyValues.hpp>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
- namespace beans { class XPropertySet; }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-struct SvXMLEnumMapEntry;
-
-
-// constants for the XMLIndexTemplateContext constructor
-
-// TOC and user defined index:
-extern const SvXMLEnumMapEntry aLevelNameTOCMap[];
-extern const sal_Char* aLevelStylePropNameTOCMap[];
-extern const sal_Bool aAllowedTokenTypesTOC[];
-extern const sal_Bool aAllowedTokenTypesUser[];
-
-// alphabetical index:
-extern const SvXMLEnumMapEntry aLevelNameAlphaMap[];
-extern const sal_Char* aLevelStylePropNameAlphaMap[];
-extern const sal_Bool aAllowedTokenTypesAlpha[];
-
-// bibliography:
-extern const SvXMLEnumMapEntry aLevelNameBibliographyMap[];
-extern const sal_Char* aLevelStylePropNameBibliographyMap[];
-extern const sal_Bool aAllowedTokenTypesBibliography[];
-
-// table, illustration and object tables:
-extern const SvXMLEnumMapEntry* aLevelNameTableMap; // NULL: no outline-level
-extern const sal_Char* aLevelStylePropNameTableMap[];
-extern const sal_Bool aAllowedTokenTypesTable[];
-
-
-/**
- * Import index entry templates
- */
-class XMLIndexTemplateContext : public SvXMLImportContext
-{
- // pick up PropertyValues to be turned into a sequence.
- ::std::vector< ::com::sun::star::beans::PropertyValues > aValueVector;
-
- ::rtl::OUString sStyleName;
-
- const SvXMLEnumMapEntry* pOutlineLevelNameMap;
- enum ::binfilter::xmloff::token::XMLTokenEnum eOutlineLevelAttrName;
- const sal_Char** pOutlineLevelStylePropMap;
- const sal_Bool* pAllowedTokenTypesMap;
-
- sal_Int32 nOutlineLevel;
- sal_Bool bStyleNameOK;
- sal_Bool bOutlineLevelOK;
-
- // PropertySet of current index
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropertySet;
-
-public:
-
- // constants made available to other contexts (template entry
- // contexts, in particular)
- const ::rtl::OUString sTokenEntryNumber;
- const ::rtl::OUString sTokenEntryText;
- const ::rtl::OUString sTokenTabStop;
- const ::rtl::OUString sTokenText;
- const ::rtl::OUString sTokenPageNumber;
- const ::rtl::OUString sTokenChapterInfo;
- const ::rtl::OUString sTokenHyperlinkStart;
- const ::rtl::OUString sTokenHyperlinkEnd;
- const ::rtl::OUString sTokenBibliographyDataField;
-
- const ::rtl::OUString sCharacterStyleName;
- const ::rtl::OUString sTokenType;
- const ::rtl::OUString sText;
- const ::rtl::OUString sTabStopRightAligned;
- const ::rtl::OUString sTabStopPosition;
- const ::rtl::OUString sTabStopFillCharacter;
- const ::rtl::OUString sBibliographyDataField;
- const ::rtl::OUString sChapterFormat;
-
- const ::rtl::OUString sLevelFormat;
- const ::rtl::OUString sParaStyleLevel;
-
-
- TYPEINFO();
-
- XMLIndexTemplateContext(
- SvXMLImport& rImport,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- const SvXMLEnumMapEntry* aLevelNameMap,
- enum ::binfilter::xmloff::token::XMLTokenEnum eLevelAttrName,
- const sal_Char** aLevelStylePropNameMap,
- const sal_Bool* aAllowedTokenTypes);
-
- ~XMLIndexTemplateContext();
-
- /** add template; to be called by child template entry contexts */
- void addTemplateEntry(
- const ::com::sun::star::beans::PropertyValues& aValues);
-
-protected:
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- virtual void EndElement();
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexTitleTemplateContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexTitleTemplateContext.hxx
deleted file mode 100644
index 46e8bd741b63..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexTitleTemplateContext.hxx
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXTITLETEMPLATECONTEXT_HXX_
-#define _XMLOFF_XMLINDEXTITLETEMPLATECONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-#include "rtl/ustring.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-
-namespace com { namespace sun { namespace star {
- namespace beans { class XPropertySet; }
- namespace xml { namespace sax { class XAttributeList; } }
-} } }
-namespace binfilter {
-
-
-/**
- * Import index title templates
- */
-class XMLIndexTitleTemplateContext : public SvXMLImportContext
-{
-
- const ::rtl::OUString sTitle;
- const ::rtl::OUString sParaStyleHeading;
-
- // paragraph style
- ::rtl::OUString sStyleName;
- sal_Bool bStyleNameOK;
-
- // content
- ::rtl::OUStringBuffer sContent;
-
- // TOC property set
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rTOCPropertySet;
-
-public:
-
- TYPEINFO();
-
- XMLIndexTitleTemplateContext(
- SvXMLImport& rImport,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName);
-
- ~XMLIndexTitleTemplateContext();
-
-protected:
-
- /** process parameters */
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- /** set values */
- virtual void EndElement();
-
- /** pick up title characters */
- virtual void Characters(const ::rtl::OUString& sString);
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLIndexUserSourceContext.hxx b/binfilter/bf_xmloff/source/text/XMLIndexUserSourceContext.hxx
deleted file mode 100644
index c3ee9f933d85..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLIndexUserSourceContext.hxx
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLINDEXUSERSOURCECONTEXT_HXX_
-#define _XMLOFF_XMLINDEXUSERSOURCECONTEXT_HXX_
-
-#include "XMLIndexSourceBaseContext.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
- namespace beans { class XPropertySet; }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-
-
-/**
- * Import user defined index source element
- */
-class XMLIndexUserSourceContext : public XMLIndexSourceBaseContext
-{
- const ::rtl::OUString sCreateFromEmbeddedObjects;
- const ::rtl::OUString sCreateFromGraphicObjects;
- const ::rtl::OUString sCreateFromMarks;
- const ::rtl::OUString sCreateFromTables;
- const ::rtl::OUString sCreateFromTextFrames;
- const ::rtl::OUString sUseLevelFromSource;
- const ::rtl::OUString sCreateFromLevelParagraphStyles;
- const ::rtl::OUString sUserIndexName;
-
- sal_Bool bUseObjects;
- sal_Bool bUseGraphic;
- sal_Bool bUseMarks;
- sal_Bool bUseTables;
- sal_Bool bUseFrames;
- sal_Bool bUseLevelFromSource;
- sal_Bool bUseLevelParagraphStyles;
- ::rtl::OUString sIndexName;
-
-public:
-
- TYPEINFO();
-
- XMLIndexUserSourceContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet);
-
- ~XMLIndexUserSourceContext();
-
-protected:
-
- virtual void ProcessAttribute(
- enum IndexSourceParamEnum eParam,
- const ::rtl::OUString& rValue);
-
- virtual void EndElement();
-
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLLineNumberingExport.hxx b/binfilter/bf_xmloff/source/text/XMLLineNumberingExport.hxx
deleted file mode 100644
index 0a28edcdddb2..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLLineNumberingExport.hxx
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLLINENUMBERINGEXPORT_HXX_
-#define _XMLOFF_XMLLINENUMBERINGEXPORT_HXX_
-
-
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Reference.h>
-namespace binfilter {
-
-class SvXMLExport;
-
-/** export <text:linenumbering-configuration> and it's child elements */
-class XMLLineNumberingExport
-{
- const ::rtl::OUString sCharStyleName;
- const ::rtl::OUString sCountEmptyLines;
- const ::rtl::OUString sCountLinesInFrames;
- const ::rtl::OUString sDistance;
- const ::rtl::OUString sInterval;
- const ::rtl::OUString sSeparatorText;
- const ::rtl::OUString sNumberPosition;
- const ::rtl::OUString sNumberingType;
- const ::rtl::OUString sIsOn;
- const ::rtl::OUString sRestartAtEachPage;
- const ::rtl::OUString sSeparatorInterval;
-
- SvXMLExport& rExport;
-
-public:
- XMLLineNumberingExport(SvXMLExport& rExp);
-
- void Export();
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLLineNumberingSeparatorImportContext.hxx b/binfilter/bf_xmloff/source/text/XMLLineNumberingSeparatorImportContext.hxx
deleted file mode 100644
index 9f810863f1e1..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLLineNumberingSeparatorImportContext.hxx
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLLINENUMBERINGSEPARATORIMPORTCONTEXT_HXX_
-#define _XMLOFF_XMLLINENUMBERINGSEPARATORIMPORTCONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-
-#include <rtl/ustring.hxx>
-
-#include <rtl/ustrbuf.hxx>
-
-#include <com/sun/star/uno/Reference.h>
-
-
-namespace com { namespace sun { namespace star {
- namespace xml { namespace sax { class XAttributeList; } }
-} } }
-namespace binfilter {
-class XMLLineNumberingImportContext;
-
-
-/** import <text:linenumbering-separator> elements */
-class XMLLineNumberingSeparatorImportContext : public SvXMLImportContext
-{
- ::rtl::OUStringBuffer sSeparatorBuf;
- XMLLineNumberingImportContext& rLineNumberingContext;
-
-public:
-
- TYPEINFO();
-
- XMLLineNumberingSeparatorImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- XMLLineNumberingImportContext& rLineNumbering);
-
- ~XMLLineNumberingSeparatorImportContext();
-
-protected:
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- virtual void Characters( const ::rtl::OUString& rChars );
-
- virtual void EndElement();
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLPropertyBackpatcher.hxx b/binfilter/bf_xmloff/source/text/XMLPropertyBackpatcher.hxx
deleted file mode 100644
index f1d3bfd29fb4..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLPropertyBackpatcher.hxx
+++ /dev/null
@@ -1,147 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _XMLOFF_XMLPROPERTYBACKPATCHER_HXX
-#define _XMLOFF_XMLPROPERTYBACKPATCHER_HXX
-
-#ifndef __SGI_STL_MAP
-#include <map>
-#endif
-
-#ifndef __SGI_STL_VECTOR
-#include <vector>
-#endif
-
-#include <comphelper/stl_types.hxx>
-
-namespace rtl { class OUString; }
-namespace com { namespace sun { namespace star {
- namespace beans { class XPropertySet; }
- namespace uno { template<class A> class Reference; }
-} } }
-namespace binfilter {
-
-
-/** This class maintains an OUString->sal_Int16 mapping for cases in
- * which an XPropertySet needs to be filled with values that are not
- * yet known.
- *
- * A good example for appropriate use are footnotes and references to
- * footnoes. Internally, the StarOffice API numbers footnotes, and
- * references to footnotes refer to that internal numbering. In the
- * XML file format, these numbers are replaced with name strings. Now
- * if during import of a document a reference to a footnote is
- * encountered, two things can happen: 1) The footnote already
- * appeared in the document. In this case the name is already known
- * and the proper ID can be requested from the footnote. 2) The
- * footnote will appear later in the document. In this case the ID is
- * not yet known, and the reference-ID property of the reference
- * cannot be determined. Hence, the reference has to be stored and the
- * ID needs to bet set later, when the footnote is eventually found in
- * the document.
- *
- * This class simplifies this process: If the footnote is found,
- * ResolveId with the XML name and the ID is called. When a reference
- * is encountered, SetProperty gets called with the reference's
- * XPropertySet and the XML name. All remaining tasks are handled by
- * the class.
- */
-template <class A>
-class XMLPropertyBackpatcher
-{
-
- /// name of property that gets set or backpatched
- ::rtl::OUString sPropertyName;
-
- /// should a default value be set for unresolved properties
- sal_Bool bDefaultHandling;
-
- /// should the sPreservePropertyName be preserved
- sal_Bool bPreserveProperty;
-
- /// name of the property to preserve
- ::rtl::OUString sPreservePropertyName;
-
- /// default value for unresolved properties (if bDefaultHandling)
- A aDefault;
-
- /// backpatch list type
- typedef ::std::vector<
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> > BackpatchListType;
-
- /* use void* instead of BackpatchListType to avoid linker problems
- with long typenames. The real typename (commented out) contains
- >1200 chars. */
-
- /// backpatch list for unresolved IDs
- //::std::map<const ::rtl::OUString, BackpatchListType*> aBackpatchListMap;
- ::std::map<const ::rtl::OUString, void*, ::comphelper::UStringLess> aBackpatchListMap;
-
- /// mapping of names -> IDs
- ::std::map<const ::rtl::OUString, A, ::comphelper::UStringLess> aIDMap;
-
-public:
-
- XMLPropertyBackpatcher(
- const ::rtl::OUString& sPropertyName);
-
- ~XMLPropertyBackpatcher();
-
- /// resolve a known ID.
- /// Call this as soon as the value for a particular name is known.
- void ResolveId(
- const ::rtl::OUString& sName,
- A aValue);
-
- /// Set property with the proper value for this name. If the value
- /// is not yet known, store the XPropertySet in the backpatch list.
- /// Use this whenever the value should be set, even if it is not yet known.
- /// const version
- void SetProperty(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & xPropSet,
- const ::rtl::OUString& sName);
-
- /// non-const version of SetProperty
- void SetProperty(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & xPropSet,
- const ::rtl::OUString& sName);
-
- /// set default (if bDefaultHandling) for unresolved names
- /// called by destructor
- void SetDefault();
-
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLRedlineExport.hxx b/binfilter/bf_xmloff/source/text/XMLRedlineExport.hxx
deleted file mode 100644
index 673484d19a29..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLRedlineExport.hxx
+++ /dev/null
@@ -1,216 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLREDLINEEXPORT_HXX
-#define _XMLOFF_XMLREDLINEEXPORT_HXX
-
-#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Sequence.h>
-
-#include <list>
-#include <map>
-#include <set>
-
-namespace com { namespace sun { namespace star {
- namespace beans { class XPropertySet; }
- namespace beans { struct PropertyValue; }
- namespace text { class XText; }
- namespace text { class XTextContent; }
- namespace text { class XTextSection; }
- } } }
-namespace rtl {
- class OUString;
- class OUStringBuffer;
-}
-namespace binfilter {
-class SvXMLExport;
-
-// store a list of redline properties
-typedef ::std::list<
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> > ChangesListType;
-
-// store a list of redline properties for each XText
-typedef ::std::map<
- ::com::sun::star::uno::Reference< ::com::sun::star::text::XText>,
- ChangesListType* > ChangesMapType;
-
-
-/**
- * This class handles the export of redline portions.
- * It is to be called from XMLTextParagraphExport.
- */
-class XMLRedlineExport
-{
- const ::rtl::OUString sDelete;
- const ::rtl::OUString sDeletion;
- const ::rtl::OUString sFormat;
- const ::rtl::OUString sFormatChange;
- const ::rtl::OUString sInsert;
- const ::rtl::OUString sInsertion;
- const ::rtl::OUString sIsCollapsed;
- const ::rtl::OUString sIsStart;
- const ::rtl::OUString sRedlineAuthor;
- const ::rtl::OUString sRedlineComment;
- const ::rtl::OUString sRedlineDateTime;
- const ::rtl::OUString sRedlineSuccessorData;
- const ::rtl::OUString sRedlineText;
- const ::rtl::OUString sRedlineType;
- const ::rtl::OUString sStyle;
- const ::rtl::OUString sTextTable;
- const ::rtl::OUString sUnknownChange;
- const ::rtl::OUString sStartRedline;
- const ::rtl::OUString sEndRedline;
- const ::rtl::OUString sRedlineIdentifier;
- const ::rtl::OUString sIsInHeaderFooter;
- const ::rtl::OUString sRedlineProtectionKey;
- const ::rtl::OUString sRecordChanges;
- const ::rtl::OUString sMergeLastPara;
-
- const ::rtl::OUString sChangePrefix;
-
- SvXMLExport& rExport;
-
-
- // handling of change recording:
-
- // To support change tracking in headers and footers we need to
- // write these changes separately. To do this, we record the
- // changes for headers and footers. For the main document body, we
- // get the complete list of changes from the document, which
- // should be much more efficient than recording all of those.
-
- ChangesMapType aChangeMap; /// map of recorded changes
-
- /// list of current changes; is NULL or points to member of aChangeMap
- ChangesListType* pCurrentChangesList;
-
-
-public:
- XMLRedlineExport(SvXMLExport& rExp);
-
- ~XMLRedlineExport();
-
- /// export a change
- void ExportChange(
- /// PropertySet of RedlinePortion
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet,
- sal_Bool bAutoStyle);
-
- /// export the list of changes (complete list minus recorded changed)
- void ExportChangesList(sal_Bool bAutoStyles);
-
- /// export the list of changes (recorded changes for this XText only)
- void ExportChangesList(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XText> & rText,
- sal_Bool bAutoStyles);
-
- /// set the current XText for which changes should be recorded.
- /// An empty XText means: don't record changes
- void SetCurrentXText(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XText> & rText);
-
- /// Do not record changes.
- /// Same as SetCurrentXText(Reference<XText>) with empty argument.
- void SetCurrentXText();
-
- /// export redline marks which start or end at start nodes,
- /// i.e. that include the complete paragraph/table/section
- void ExportStartOrEndRedline(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet,
- sal_Bool bStart); /// start or end of text entity (e.g. paragraph)?
-
- /// convenience method, calls XPropertySet-version of this method
- void ExportStartOrEndRedline(
- /// XTextContent; must also be an XPropertySet
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XTextContent> & rContent,
- sal_Bool bStart);
-
- /// convenience method, calls XPropertySet-version of this method
- void ExportStartOrEndRedline(
- /// XTextSection; must also be an XPropertySet
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XTextSection> & rSection,
- sal_Bool bStart);
-
-private:
-
- /// export the change mark contained in the text body
- void ExportChangeInline(
- /// PropertySet of RedlinePortion
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet);
-
- /// export the auto styles used in this change
- void ExportChangeAutoStyle(
- /// PropertySet of RedlinePortion
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet);
-
- /// export the changes list (<text:tracked-changes>)
- void ExportChangesListElements();
-
- /// export the auto styles needed by the changes list
- void ExportChangesListAutoStyles();
-
- /// export the changed-region element
- void ExportChangedRegion(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet);
-
- /// export an change-info element (from a PropertySet)
- void ExportChangeInfo(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet);
-
- /// export an change-info element (from PropertyValues)
- void ExportChangeInfo(
- const ::com::sun::star::uno::Sequence<
- ::com::sun::star::beans::PropertyValue> & rValues);
-
- /// convert the change type from API to XML names
- const ::rtl::OUString ConvertTypeName(const ::rtl::OUString& sApiName);
-
- /// Get ID string!
- const ::rtl::OUString GetRedlineID(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet);
-
- /// write a comment string as sequence of <text:p> elements
- void WriteComment(const ::rtl::OUString& rComment);
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLSectionExport.hxx b/binfilter/bf_xmloff/source/text/XMLSectionExport.hxx
deleted file mode 100644
index 81a03f7fae42..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLSectionExport.hxx
+++ /dev/null
@@ -1,370 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLSECTIONEXPORT_HXX_
-#define _XMLOFF_XMLSECTIONEXPORT_HXX_
-
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include "xmltoken.hxx"
-namespace com { namespace sun { namespace star {
- namespace text
- {
- class XTextSection;
- class XDocumentIndex;
- class XTextContent;
- }
- namespace beans
- {
- class XPropertySet;
- }
- namespace container
- {
- class XIndexReplace;
- }
-} } }
-namespace binfilter {
-
-class SvXMLExport;
-class XMLTextParagraphExport;
-
-
-enum SectionTypeEnum
-{
- TEXT_SECTION_TYPE_SECTION,
-
- // indices: keep index valued together and do not change order,
- // because they are used to index into array
- TEXT_SECTION_TYPE_TOC,
- TEXT_SECTION_TYPE_TABLE,
- TEXT_SECTION_TYPE_ILLUSTRATION,
- TEXT_SECTION_TYPE_OBJECT,
- TEXT_SECTION_TYPE_USER,
- TEXT_SECTION_TYPE_ALPHABETICAL,
- TEXT_SECTION_TYPE_BIBLIOGRAPHY,
-
- // index header sections:
- TEXT_SECTION_TYPE_HEADER,
-
- TEXT_SECTION_TYPE_UNKNOWN
-};
-
-
-/**
- * This class handles the export of sections and indices (which are,
- * internally, just sections). It is intended to be used only from
- * within the XMLTextParagraphExport class.
- */
-class XMLSectionExport
-{
- const ::rtl::OUString sCondition;
- const ::rtl::OUString sCreateFromChapter;
- const ::rtl::OUString sCreateFromEmbeddedObjects;
- const ::rtl::OUString sCreateFromGraphicObjects;
- const ::rtl::OUString sCreateFromLabels;
- const ::rtl::OUString sCreateFromMarks;
- const ::rtl::OUString sCreateFromOtherEmbeddedObjects;
- const ::rtl::OUString sCreateFromOutline;
- const ::rtl::OUString sCreateFromStarCalc;
- const ::rtl::OUString sCreateFromStarChart;
- const ::rtl::OUString sCreateFromStarDraw;
- const ::rtl::OUString sCreateFromStarImage;
- const ::rtl::OUString sCreateFromStarMath;
- const ::rtl::OUString sCreateFromTables;
- const ::rtl::OUString sCreateFromTextFrames;
- const ::rtl::OUString sDdeCommandElement;
- const ::rtl::OUString sDdeCommandFile;
- const ::rtl::OUString sDdeCommandType;
- const ::rtl::OUString sFileLink;
- const ::rtl::OUString sIsCaseSensitive;
- const ::rtl::OUString sIsProtected;
- const ::rtl::OUString sIsVisible;
- const ::rtl::OUString sLabelCategory;
- const ::rtl::OUString sLabelDisplayType;
- const ::rtl::OUString sLevel;
- const ::rtl::OUString sLevelFormat;
- const ::rtl::OUString sLevelParagraphStyles;
- const ::rtl::OUString sLinkRegion;
- const ::rtl::OUString sMainEntryCharacterStyleName;
- const ::rtl::OUString sParaStyleHeading;
- const ::rtl::OUString sParaStyleLevel;
- const ::rtl::OUString sTitle;
- const ::rtl::OUString sName;
- const ::rtl::OUString sUseAlphabeticalSeparators;
- const ::rtl::OUString sUseCombinedEntries;
- const ::rtl::OUString sUseDash;
- const ::rtl::OUString sUseKeyAsEntry;
- const ::rtl::OUString sUseLevelFromSource;
- const ::rtl::OUString sUsePP;
- const ::rtl::OUString sUseUpperCase;
- const ::rtl::OUString sIsCommaSeparated;
- const ::rtl::OUString sIsAutomaticUpdate;
- const ::rtl::OUString sIsRelativeTabstops;
- const ::rtl::OUString sCreateFromLevelParagraphStyles;
- const ::rtl::OUString sDocumentIndex;
- const ::rtl::OUString sContentSection;
- const ::rtl::OUString sHeaderSection;
-
- const ::rtl::OUString sTextSection;
- const ::rtl::OUString sIsGlobalDocumentSection;
- const ::rtl::OUString sProtectionKey;
- const ::rtl::OUString sSortAlgorithm;
- const ::rtl::OUString sLocale;
- const ::rtl::OUString sUserIndexName;
-
- const ::rtl::OUString sIsCurrentlyVisible;
- const ::rtl::OUString sHeadingStyleName;
-
- const ::rtl::OUString sEmpty;
-
- SvXMLExport& rExport;
- XMLTextParagraphExport& rParaExport;
-
- sal_Bool bHeadingDummiesExported;
-
-public:
- XMLSectionExport(SvXMLExport& rExp,
- XMLTextParagraphExport& rParaExp);
-
- /**
- * export section or index start and source elements. This
- * method handles the section styles, and delegates to the
- * appropriate section or index method.
- */
- void ExportSectionStart(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextSection > & rSection,
- sal_Bool bAutoStyles);
-
- /**
- * export section or index end elements
- */
- void ExportSectionEnd(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextSection > & rSection,
- sal_Bool bAutoStyles);
-
- /**
- * Should the content of this section be exported?
- * (E.g. linked sections in global documents are not always exported)
- */
- sal_Bool IsMuteSection(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextSection > & rSection) const;
-
- /**
- * XTextContent-version of IsMuteSection(Reference<XTextSection>&)
- * returns *true* for all non-section elements
- */
- sal_Bool IsMuteSection(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextContent > & rSection,
- /// return value if this content doesn't support the section property
- sal_Bool bDefault) const;
-
- /**
- * Determine whether rContent is contained in rEnclosingSection. If the
- * current section of rContent can not be determined, return bDefault.
- */
- sal_Bool IsInSection(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextSection > & rEnclosingSection,
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextContent > & rContent,
- /// return value if this content doesn't support the section property
- sal_Bool bDefault);
-
- /**
- * Export the configuration element for bibliography indices.
- *
- * (This is part of XMLSectionExport because all section- and
- * index-related items are handled here.)
- */
- static void ExportBibliographyConfiguration(SvXMLExport& rExport);
-
- /** export a heading for every level. This is used by master documents
- * to not loose the heading information if master documents are exported
- * without section contents
- */
- void ExportMasterDocHeadingDummies();
-
-
-
-protected:
-
- inline SvXMLExport& GetExport() { return rExport; }
- inline XMLTextParagraphExport& GetParaExport() { return rParaExport; }
-
- // export methods for section and index start:
-
- /// export an index start element.
- void ExportIndexStart(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XDocumentIndex > & rSection);
-
- /// export an index header start element.
- void ExportIndexHeaderStart(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextSection > & rSection);
-
- /// export a proper section (and source elements)
- void ExportRegularSectionStart(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextSection > & rSection);
-
- /// export a table of content (and source element)
- void ExportTableOfContentStart(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::beans::XPropertySet > & rSection);
-
- /// export a table index (and source element)
- void ExportTableIndexStart(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::beans::XPropertySet > & rSection);
-
- /// export an object index (and source element)
- void ExportObjectIndexStart(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::beans::XPropertySet > & rSection);
-
- /// export an illustration index (and source element)
- void ExportIllustrationIndexStart(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::beans::XPropertySet > & rSection);
-
- /// export an alphabetical/keyword index (and source element)
- void ExportAlphabeticalIndexStart(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::beans::XPropertySet > & rSection);
-
- /// export a user index (and source element)
- void ExportUserIndexStart(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::beans::XPropertySet > & rSection);
-
- /// export the bibliography (and source element)
- void ExportBibliographyStart(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::beans::XPropertySet > & rIndex);
-
- // helper methods:
-
- /**
- * If this section is an index, the index is written in the
- * rIndex parameter. The return value is sal_True for all "special"
- * sections.
- *
- * Thus we have:
- * return sal_False: regular section
- * return sal_True, xIndex is empty: index header section
- * return sal_True, xIndex is set: index section */
- sal_Bool GetIndex(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextSection > & rSection,
- ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XDocumentIndex > & rIndex) const;
-
- /// map service name to section type
- enum SectionTypeEnum MapSectionType(const ::rtl::OUString& rSectionName);
-
- /**
- * Export the index element start (for all index types).
- *
- * All additional attributes (usually none) for the index element
- * should have been set at GetExport() before calling this method.
- */
- void ExportBaseIndexStart(
- ::binfilter::xmloff::token::XMLTokenEnum eElement,
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::beans::XPropertySet > & rSection);
-
- /**
- * Export the index source element (common for all index types).
- *
- * All additional attributes for the source element should have
- * been set at the GetExport() before calling this method.
- */
- void ExportBaseIndexSource(
- SectionTypeEnum eType, /// index type
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::beans::XPropertySet > & rSection);
-
- /**
- * Export the index body (common for all index types).
- */
- void ExportBaseIndexBody(
- SectionTypeEnum eType, /// index type
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::beans::XPropertySet > & rSection);
-
-
- /**
- * Helper method to export common attributes for table and
- * illustration indices
- */
- void ExportTableAndIllustrationIndexSourceAttributes(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::beans::XPropertySet > & rSection);
-
- /// export one template for the specific index type
- sal_Bool ExportIndexTemplate(
- SectionTypeEnum eType, /// index type
- sal_Int32 nLevel, /// outline level (if applicable)
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet,
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::beans::PropertyValue> > & rValues);
-
- /// export a single template element (e.g. span or tab-stop)
- void ExportIndexTemplateElement(
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::beans::PropertyValue> & rValues);
-
- /// export level paragraph styles
- void ExportLevelParagraphStyles(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XIndexReplace> & xStyles);
-
-
- /// helper to export boolean properties
- void ExportBoolean(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropSet,
- const ::rtl::OUString& sPropertyName,
- enum ::binfilter::xmloff::token::XMLTokenEnum eAttributeName,
- sal_Bool bDefault,
- sal_Bool bInvert = sal_False);
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLSectionFootnoteConfigExport.hxx b/binfilter/bf_xmloff/source/text/XMLSectionFootnoteConfigExport.hxx
deleted file mode 100644
index fd16d0636b78..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLSectionFootnoteConfigExport.hxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _XMLOFF_XMLSECTIONFOOTNOTECONFIGEXPORT_HXX
-#define _XMLOFF_XMLSECTIONFOOTNOTECONFIGEXPORT_HXX
-
-#include <sal/types.h>
-
-#include <vector>
-namespace binfilter {
-
-class SvXMLExport;
-class XMLPropertySetMapper;
-struct XMLPropertyState;
-template<class X> class UniReference;
-
-/**
- * Export the footnote-/endnote-configuration element in section styles.
- *
- * Because this class contains only one method, and all information is
- * available during that method call, we simply make it static.
- */
-class XMLSectionFootnoteConfigExport
-{
-
-public:
- static void exportXML(
- SvXMLExport& rExport,
- sal_Bool bEndnote,
- const ::std::vector<XMLPropertyState> * pProperties,
- sal_uInt32 nIdx,
- const UniReference<XMLPropertySetMapper> & rMapper); /// used only for debugging
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLSectionFootnoteConfigImport.hxx b/binfilter/bf_xmloff/source/text/XMLSectionFootnoteConfigImport.hxx
deleted file mode 100644
index 6c5e37ab4c8c..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLSectionFootnoteConfigImport.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _XMLOFF_XMLSECTIONFOOTNOTECONFIGIMPORT_HXX
-#define _XMLOFF_XMLSECTIONFOOTNOTECONFIGIMPORT_HXX
-
-
-#include "xmlictxt.hxx"
-
-#include "uniref.hxx"
-
-#include <vector>
-
-
-namespace rtl { class OUString; }
-namespace com { namespace sun { namespace star {
- namespace uno { template<class X> class Reference; }
- namespace xml { namespace sax { class XAttributeList; } }
-} } }
-
-namespace binfilter {
-class SvXMLImport;
-struct XMLPropertyState;
-class XMLPropertySetMapper;
-
-/**
- * Import the footnote-/endnote-configuration element in section styles.
- */
-class XMLSectionFootnoteConfigImport : public SvXMLImportContext
-{
- ::std::vector<XMLPropertyState> & rProperties;
- UniReference<XMLPropertySetMapper> rMapper;
- sal_Int32 nPropIndex;
-
-public:
-
- TYPEINFO();
-
- XMLSectionFootnoteConfigImport(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- ::std::vector<XMLPropertyState> & rProperties,
- const UniReference<XMLPropertySetMapper> & rMapperRef,
- sal_Int32 nIndex);
-
- ~XMLSectionFootnoteConfigImport();
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLSectionImportContext.hxx b/binfilter/bf_xmloff/source/text/XMLSectionImportContext.hxx
deleted file mode 100644
index 469754ef3107..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLSectionImportContext.hxx
+++ /dev/null
@@ -1,124 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLSECTIONIMPORTCONTEXT_HXX_
-#define _XMLOFF_XMLSECTIONIMPORTCONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-#include <com/sun/star/uno/Sequence.h>
-
-namespace com { namespace sun { namespace star {
- namespace text { class XTextRange; }
- namespace beans { class XPropertySet; }
- namespace xml { namespace sax { class XAttributeList; } }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-class XMLTextImportHelper;
-
-
-/**
- * Import text sections.
- *
- * This context may *also* be used for index header sections. The
- * differentiates its behaviour based on GetLocalName().
- */
-class XMLSectionImportContext : public SvXMLImportContext
-{
- /// start position; ranges aquired via getStart(),getEnd() don't move
- ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XTextRange> xStartRange;
-
- /// end position
- ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XTextRange> xEndRange;
-
- /// TextSection (as XPropertySet) for passing down to data source elements
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> xSectionPropertySet;
-
- const ::rtl::OUString sTextSection;
- const ::rtl::OUString sIndexHeaderSection;
- const ::rtl::OUString sCondition;
- const ::rtl::OUString sIsVisible;
- const ::rtl::OUString sProtectionKey;
- const ::rtl::OUString sIsProtected;
- const ::rtl::OUString sIsCurrentlyVisible;
- const ::rtl::OUString sEmpty;
-
- ::rtl::OUString sStyleName;
- ::rtl::OUString sName;
- ::rtl::OUString sCond;
- ::com::sun::star::uno::Sequence<sal_Int8> aSequence;
- sal_Bool bProtect;
- sal_Bool bCondOK;
- sal_Bool bIsVisible;
- sal_Bool bValid;
- sal_Bool bSequenceOK;
- sal_Bool bIsCurrentlyVisible;
- sal_Bool bIsCurrentlyVisibleOK;
-
- sal_Bool bHasContent;
-
-public:
-
- TYPEINFO();
-
- XMLSectionImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName );
-
- ~XMLSectionImportContext();
-
-protected:
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- virtual void EndElement();
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-
- void ProcessAttributes(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLSectionSourceDDEImportContext.hxx b/binfilter/bf_xmloff/source/text/XMLSectionSourceDDEImportContext.hxx
deleted file mode 100644
index 79939e9ec0b7..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLSectionSourceDDEImportContext.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLSECTIONSOURCEDDEIMPORTCONTEXT_HXX_
-#define _XMLOFF_XMLSECTIONSOURCEDDEIMPORTCONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-namespace com { namespace sun { namespace star {
- namespace beans { class XPropertySet; }
- namespace xml { namespace sax { class XAttributeList; } }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-
-class XMLSectionSourceDDEImportContext : public SvXMLImportContext
-{
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rSectionPropertySet;
-
- const ::rtl::OUString sDdeCommandFile;
- const ::rtl::OUString sDdeCommandType;
- const ::rtl::OUString sDdeCommandElement;
- const ::rtl::OUString sIsAutomaticUpdate;
-
-public:
-
- TYPEINFO();
-
- XMLSectionSourceDDEImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rSectPropSet);
-
- ~XMLSectionSourceDDEImportContext();
-
-protected:
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- virtual void EndElement();
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLSectionSourceImportContext.hxx b/binfilter/bf_xmloff/source/text/XMLSectionSourceImportContext.hxx
deleted file mode 100644
index 3688219b83dd..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLSectionSourceImportContext.hxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLSECTIONSOURCEIMPORTCONTEXT_HXX_
-#define _XMLOFF_XMLSECTIONSOURCEIMPORTCONTEXT_HXX_
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-namespace com { namespace sun { namespace star {
- namespace beans { class XPropertySet; }
- namespace xml { namespace sax { class XAttributeList; } }
-} } }
-namespace rtl { class OUString; }
-namespace binfilter {
-
-class XMLSectionSourceImportContext : public SvXMLImportContext
-{
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rSectionPropertySet;
-
-public:
-
- TYPEINFO();
-
- XMLSectionSourceImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rSectPropSet);
-
- ~XMLSectionSourceImportContext();
-
-protected:
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
- virtual void EndElement();
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLTextCharStyleNamesElementExport.hxx b/binfilter/bf_xmloff/source/text/XMLTextCharStyleNamesElementExport.hxx
deleted file mode 100644
index 8a4b8e9ba70e..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLTextCharStyleNamesElementExport.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _XMLOFF_XMLTEXTCHARSTYLENAMESELEMENTEXPORT_HXX
-#define _XMLOFF_XMLTEXTCHARSTYLENAMESELEMENTEXPORT_HXX
-
-#include <com/sun/star/uno/Reference.hxx>
-
-
-namespace com { namespace sun { namespace star {
- namespace beans { class XPropertySet; }
-} } }
-namespace binfilter {
-
-class SvXMLExport;
-
-class XMLTextCharStyleNamesElementExport
-{
- SvXMLExport& rExport;
- ::rtl::OUString aName;
- sal_Int32 nCount;
-
-public:
-
- XMLTextCharStyleNamesElementExport(
- SvXMLExport& rExp, sal_Bool bDoSomething,
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::beans::XPropertySet > & rPropSet,
- const ::rtl::OUString& rPropName );
- ~XMLTextCharStyleNamesElementExport();
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLTextFrameContext.hxx b/binfilter/bf_xmloff/source/text/XMLTextFrameContext.hxx
deleted file mode 100644
index 2de6249f6817..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLTextFrameContext.hxx
+++ /dev/null
@@ -1,177 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLTEXTFRAMECONTEXT_HXX
-#define _XMLTEXTFRAMECONTEXT_HXX
-
-#ifndef __SGI_STL_MAP
-#include <map>
-#endif
-
-#include <com/sun/star/text/TextContentAnchorType.hpp>
-
-#include "xmlictxt.hxx"
-
-#include <comphelper/stl_types.hxx>
-
-
-namespace com { namespace sun { namespace star {
- namespace text { class XTextCursor; class XTextContent; }
- namespace beans { class XPropertySet; }
- namespace io { class XOutputStream; }
-} } }
-namespace binfilter {
-
-#define XML_TEXT_FRAME_TEXTBOX 1
-#define XML_TEXT_FRAME_GRAPHIC 2
-#define XML_TEXT_FRAME_OBJECT 3
-#define XML_TEXT_FRAME_OBJECT_OLE 4
-#define XML_TEXT_FRAME_APPLET 5
-#define XML_TEXT_FRAME_PLUGIN 6
-#define XML_TEXT_FRAME_FLOATING_FRAME 7
-
-typedef ::std::map < const ::rtl::OUString, ::rtl::OUString, ::comphelper::UStringLess> ParamMap;
-
-class XMLTextFrameContextHyperlink_Impl;
-
-class XMLTextFrameContext : public SvXMLImportContext
-{
- ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextCursor > xOldTextCursor;
- ::com::sun::star::uno::Reference <
- ::com::sun::star::beans::XPropertySet > xPropSet;
- ::com::sun::star::uno::Reference <
- ::com::sun::star::io::XOutputStream > xBase64Stream;
-
- /// old list item and block (#89891#)
- SvXMLImportContextRef xListBlock;
- SvXMLImportContextRef xListItem;
-
- const ::rtl::OUString sWidth;
- const ::rtl::OUString sRelativeWidth;
- const ::rtl::OUString sHeight;
- const ::rtl::OUString sRelativeHeight;
- const ::rtl::OUString sSizeType;
- const ::rtl::OUString sIsSyncWidthToHeight;
- const ::rtl::OUString sIsSyncHeightToWidth;
- const ::rtl::OUString sHoriOrient;
- const ::rtl::OUString sHoriOrientPosition;
- const ::rtl::OUString sVertOrient;
- const ::rtl::OUString sVertOrientPosition;
- const ::rtl::OUString sChainNextName;
- const ::rtl::OUString sAnchorType;
- const ::rtl::OUString sAnchorPageNo;
- const ::rtl::OUString sGraphicURL;
- const ::rtl::OUString sGraphicFilter;
- const ::rtl::OUString sAlternativeText;
- const ::rtl::OUString sFrameStyleName;
- const ::rtl::OUString sGraphicRotation;
- const ::rtl::OUString sTextBoxServiceName;
- const ::rtl::OUString sGraphicServiceName;
-
- ::rtl::OUString sName;
- ::rtl::OUString sStyleName;
- ::rtl::OUString sNextName;
- ::rtl::OUString sHRef;
- ::rtl::OUString sFilterName;
- ::rtl::OUString sCode;
- ::rtl::OUString sObject;
- ::rtl::OUString sArchive;
- ::rtl::OUString sMimeType;
- ::rtl::OUString sFrameName;
- ::rtl::OUString sAppletName;
- ::rtl::OUString sDesc;
- ::rtl::OUString sFilterService;
- ::rtl::OUString sBase64CharsLeft;
- ::rtl::OUString sTblName;
-
- ParamMap aParamMap;
-
- XMLTextFrameContextHyperlink_Impl *pHyperlink;
-
- sal_Int32 nX;
- sal_Int32 nY;
- sal_Int32 nWidth;
- sal_Int32 nHeight;
- sal_Int32 nZIndex;
- sal_Int16 nPage;
- sal_Int16 nRotation;
- sal_Int16 nRelWidth;
- sal_Int16 nRelHeight;
-
- sal_uInt16 nType;
- ::com::sun::star::text::TextContentAnchorType eAnchorType;
-
- sal_Bool bMayScript : 1;
- sal_Bool bMinHeight : 1;
- sal_Bool bSyncWidth : 1;
- sal_Bool bSyncHeight : 1;
- sal_Bool bCreateFailed : 1;
- sal_Bool bOwnBase64Stream : 1;
-
- void Create( sal_Bool bHRefOrBase64 );
- sal_Bool CreateIfNotThere();
-
-public:
-
- TYPEINFO();
-
- XMLTextFrameContext( SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- ::com::sun::star::text::TextContentAnchorType eAnchorType,
- sal_uInt16 nType );
- virtual ~XMLTextFrameContext();
-
- virtual void EndElement();
-
- virtual void Characters( const ::rtl::OUString& rChars );
-
- SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
-
- void SetHyperlink( const ::rtl::OUString& rHRef,
- const ::rtl::OUString& rName,
- const ::rtl::OUString& rTargetFrameName,
- sal_Bool bMap );
-
- ::com::sun::star::text::TextContentAnchorType GetAnchorType() const { return eAnchorType; }
-
- ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextContent > GetTextContent() const;
-};
-
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLTextFrameHyperlinkContext.hxx b/binfilter/bf_xmloff/source/text/XMLTextFrameHyperlinkContext.hxx
deleted file mode 100644
index fe6675afc533..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLTextFrameHyperlinkContext.hxx
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLTEXTFRAMEHYPERLINKCONTEXT_HXX
-#define _XMLTEXTFRAMEHYPERLINKCONTEXT_HXX
-
-#include <com/sun/star/text/TextContentAnchorType.hpp>
-#include <com/sun/star/text/XTextFrame.hpp>
-
-#include "xmlictxt.hxx"
-
-namespace com { namespace sun { namespace star {
- namespace text { class XTextCursor; class XTextFrame; }
- namespace beans { class XPropertySet; }
-} } }
-
-namespace binfilter {
-
-class XMLTextFrameHyperlinkContext : public SvXMLImportContext
-{
- ::rtl::OUString sHRef;
- ::rtl::OUString sName;
- ::rtl::OUString sTargetFrameName;
- ::com::sun::star::text::TextContentAnchorType eAnchorType;
- ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextContent> *pTextContent;
- ::com::sun::star::text::TextContentAnchorType *pAnchorType;
- sal_Bool bMap;
-
-public:
-
- TYPEINFO();
-
- XMLTextFrameHyperlinkContext( SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- ::com::sun::star::text::TextContentAnchorType eAnchorType,
- ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextContent> *pTxtCntnt = 0 ,
- ::com::sun::star::text::TextContentAnchorType *pAnchrType = 0 );
- virtual ~XMLTextFrameHyperlinkContext();
-
- virtual void EndElement();
-
- SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
-
-};
-
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLTextListBlockContext.hxx b/binfilter/bf_xmloff/source/text/XMLTextListBlockContext.hxx
deleted file mode 100644
index 55ee2c86680b..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLTextListBlockContext.hxx
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLTEXTLISTBLOCKCONTEXT_HXX
-#define _XMLTEXTLISTBLOCKCONTEXT_HXX
-
-#include <com/sun/star/container/XIndexReplace.hpp>
-
-#include "xmlictxt.hxx"
-namespace binfilter {
-
-class XMLTextImportHelper;
-
-class XMLTextListBlockContext : public SvXMLImportContext
-{
- XMLTextImportHelper& rTxtImport;
-
- ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XIndexReplace > xNumRules;
-
- const ::rtl::OUString sNumberingRules;
- ::rtl::OUString sStyleName;
- SvXMLImportContextRef xParentListBlock;
- sal_Int16 nLevel;
- sal_Int16 nLevels;
- sal_Bool bOrdered : 1;
- sal_Bool bRestartNumbering : 1;
- sal_Bool bSetDefaults : 1;
-
-
-public:
-
- TYPEINFO();
-
- XMLTextListBlockContext( SvXMLImport& rImport,
- XMLTextImportHelper& rTxtImp, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- sal_Bool bOrdered );
- virtual ~XMLTextListBlockContext();
-
- virtual void EndElement();
-
- SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
-
- const ::rtl::OUString& GetStyleName() const { return sStyleName; }
- sal_Int16 GetLevel() const { return nLevel; }
- sal_Bool IsRestartNumbering() const { return bRestartNumbering; }
- void ResetRestartNumbering() { bRestartNumbering = sal_False; }
-
-// sal_Bool HasGeneratedStyle() const { return xGenNumRule.is(); }
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::container::XIndexReplace >& GetNumRules() const
- { return xNumRules; }
-};
-
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLTextListItemContext.hxx b/binfilter/bf_xmloff/source/text/XMLTextListItemContext.hxx
deleted file mode 100644
index d661550a76cb..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLTextListItemContext.hxx
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLTEXTLISTITEMCONTEXT_HXX
-#define _XMLTEXTLISTITEMCONTEXT_HXX
-
-#include "xmlictxt.hxx"
-namespace binfilter {
-
-class XMLTextImportHelper;
-
-class XMLTextListItemContext : public SvXMLImportContext
-{
- XMLTextImportHelper& rTxtImport;
-
- sal_Int16 nStartValue;
-
-// SwXMLImport& GetSwImport() { return (SwXMLImport&)GetImport(); }
-
-public:
-
- TYPEINFO();
-
- XMLTextListItemContext(
- SvXMLImport& rImport,
- XMLTextImportHelper& rTxtImp, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- sal_Bool bIsHeader = sal_False );
- virtual ~XMLTextListItemContext();
-
- virtual void EndElement();
-
- SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
-
- sal_Bool HasStartValue() const { return -1 != nStartValue; }
- sal_Int16 GetStartValue() const { return nStartValue; }
-};
-
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLTextMarkImportContext.hxx b/binfilter/bf_xmloff/source/text/XMLTextMarkImportContext.hxx
deleted file mode 100644
index c724c5134bfe..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLTextMarkImportContext.hxx
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _XMLOFF_XMLTEXTMARKIMPORTCONTEXT_HXX
-#define _XMLOFF_XMLTEXTMARKIMPORTCONTEXT_HXX
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-namespace com { namespace sun { namespace star {
- namespace text {
- class XTextRange;
- }
- namespace xml { namespace sax {
- class XAttributeList;
- } }
-} } }
-namespace rtl {
- class OUString;
-}
-namespace binfilter {
-class XMLTextImportHelper;
-
-
-/**
- * import bookmarks and reference marks
- * ( <bookmark>, <bookmark-start>, <bookmark-end>,
- * <reference>, <reference-start>, <reference-end> )
- *
- * All elements are handled by the same class due to their similarities.
- */
-class XMLTextMarkImportContext : public SvXMLImportContext
-{
-
- XMLTextImportHelper& rHelper;
-
-public:
-
- TYPEINFO();
-
- XMLTextMarkImportContext(
- SvXMLImport& rImport,
- XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName );
-
-protected:
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-
-public:
- static void CreateAndInsertMark(
- SvXMLImport& rImport,
- const ::rtl::OUString& sServiceName,
- const ::rtl::OUString& sMarkName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XTextRange> & rRange);
-
- static sal_Bool FindName(
- SvXMLImport& rImport,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList,
- ::rtl::OUString& sName);
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLTextNumRuleInfo.hxx b/binfilter/bf_xmloff/source/text/XMLTextNumRuleInfo.hxx
deleted file mode 100644
index 57fb858b08d6..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLTextNumRuleInfo.hxx
+++ /dev/null
@@ -1,125 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLTEXTNUMRULEINFO_HXX
-#define _XMLOFF_XMLTEXTNUMRULEINFO_HXX
-
-#include <com/sun/star/container/XIndexReplace.hpp>
-
-namespace com { namespace sun { namespace star {
- namespace text { class XTextContent; }
-} } }
-
-#include <sal/types.h>
-namespace binfilter {
-
-class XMLTextNumRuleInfo
-{
- const ::rtl::OUString sNumberingRules;
- const ::rtl::OUString sNumberingLevel;
- const ::rtl::OUString sNumberingStartValue;
- const ::rtl::OUString sParaIsNumberingRestart;
- const ::rtl::OUString sNumberingType;
- const ::rtl::OUString sIsNumbering;
- const ::rtl::OUString sNumberingIsNumber;
-
- ::com::sun::star::uno::Reference <
- ::com::sun::star::container::XIndexReplace > xNumRules;
-
- ::rtl::OUString sName;
- sal_Int16 nStartValue;
- sal_Int16 nLevel;
-
- sal_Bool bIsNumbered : 1;
- sal_Bool bIsOrdered : 1;
- sal_Bool bIsRestart : 1;
- sal_Bool bIsNamed : 1;
-
-public:
-
- XMLTextNumRuleInfo();
-
- inline XMLTextNumRuleInfo& operator=( const XMLTextNumRuleInfo& rInfo );
-
- void Set(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextContent > & rTextContnt );
- inline void Reset();
-
- const ::rtl::OUString& GetName() const { return sName; }
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::container::XIndexReplace >& GetNumRules() const
- { return xNumRules; }
- sal_Int16 GetLevel() const { return nLevel; }
-
- sal_Bool HasStartValue() const { return nStartValue != -1; }
- sal_uInt32 GetStartValue() const { return nStartValue; }
-
- sal_Bool IsNumbered() const { return bIsNumbered; }
- sal_Bool IsOrdered() const { return bIsOrdered; }
- sal_Bool IsRestart() const { return bIsRestart; }
- sal_Bool IsNamed() const { return bIsNamed; }
-
- inline sal_Bool HasSameNumRules( const XMLTextNumRuleInfo& rCmp ) const;
-};
-
-inline XMLTextNumRuleInfo& XMLTextNumRuleInfo::operator=(
- const XMLTextNumRuleInfo& rInfo )
-{
- sName = rInfo.sName;
- xNumRules = rInfo.xNumRules;
- nStartValue = rInfo.nStartValue;
- nLevel = rInfo.nLevel;
- bIsNumbered = rInfo.bIsNumbered;
- bIsOrdered = rInfo.bIsOrdered;
- bIsRestart = rInfo.bIsRestart;
- bIsNamed = rInfo.bIsNamed;
-
- return *this;
-}
-
-inline void XMLTextNumRuleInfo::Reset()
-{
- sName = ::rtl::OUString();
- xNumRules = 0;
- nStartValue = -1;
- nLevel = 0;
- bIsNumbered = bIsOrdered = bIsRestart = bIsNamed = sal_False;
-}
-
-inline sal_Bool XMLTextNumRuleInfo::HasSameNumRules(
- const XMLTextNumRuleInfo& rCmp ) const
-{
- return (bIsNamed && rCmp.bIsNamed) ? (rCmp.sName == sName)
- : (rCmp.xNumRules == xNumRules);
-}
-
-}//end of namespace binfilter
-#endif // _XMLOFF_XMLTEXTNUMRULEINFO_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLTextPropertySetContext.hxx b/binfilter/bf_xmloff/source/text/XMLTextPropertySetContext.hxx
deleted file mode 100644
index f93cf41fe364..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLTextPropertySetContext.hxx
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLOFF_XMLTEXTPROPERTYSETCONTEXT_HXX
-#define _XMLOFF_XMLTEXTPROPERTYSETCONTEXT_HXX
-
-#include "xmlprcon.hxx"
-namespace binfilter {
-
-
-class XMLTextPropertySetContext : public SvXMLPropertySetContext
-{
-// SvXMLImportContextRef xTabStop;
-// SvXMLImportContextRef xBackground;
-// SvXMLImportContextRef xDropCap;
- ::rtl::OUString& rDropCapTextStyleName;
-
-public:
- XMLTextPropertySetContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
- ::std::vector< XMLPropertyState > &rProps,
- const UniReference < SvXMLImportPropertyMapper > &rMap,
- ::rtl::OUString& rDopCapTextStyleName );
-
- virtual ~XMLTextPropertySetContext();
-
- virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
- ::std::vector< XMLPropertyState > &rProperties,
- const XMLPropertyState& rProp);
-};
-
-
-}//end of namespace binfilter
-#endif // _XMLOFF_XMLTEXTPROPERTYSETCONTEXT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLTextShapeImportHelper.hxx b/binfilter/bf_xmloff/source/text/XMLTextShapeImportHelper.hxx
deleted file mode 100644
index 0b8aae51cd40..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLTextShapeImportHelper.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _XMLTEXTSHAPEIMPORTHELPER_HXX
-#define _XMLTEXTSHAPEIMPORTHELPER_HXX
-
-#include "shapeimport.hxx"
-namespace binfilter {
-
-class XMLTextShapeImportHelper : public XMLShapeImportHelper
-{
- SvXMLImport& rImport;
-
- const ::rtl::OUString sAnchorType;
- const ::rtl::OUString sAnchorPageNo;
- const ::rtl::OUString sVertOrientPosition;
-
-public:
-
- XMLTextShapeImportHelper( SvXMLImport& rImp );
- ~XMLTextShapeImportHelper();
-
- virtual void addShape(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape >& rShape,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShapes >& rShapes );
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/XMLTrackedChangesImportContext.hxx b/binfilter/bf_xmloff/source/text/XMLTrackedChangesImportContext.hxx
deleted file mode 100644
index c97a28721c33..000000000000
--- a/binfilter/bf_xmloff/source/text/XMLTrackedChangesImportContext.hxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _XMLOFF_XMLTRACKEDCHANGESIMPORTCONTEXT_HXX
-#define _XMLOFF_XMLTRACKEDCHANGESIMPORTCONTEXT_HXX
-
-#include "xmlictxt.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-namespace com { namespace sun { namespace star {
- namespace text {
- class XTextRange;
- }
- namespace xml { namespace sax {
- class XAttributeList;
- } }
-} } }
-namespace rtl {
- class OUString;
-}
-namespace binfilter {
-class XMLTextImportHelper;
-
-/**
- */
-class XMLTrackedChangesImportContext : public SvXMLImportContext
-{
-public:
-
- TYPEINFO();
-
- XMLTrackedChangesImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName);
-
- ~XMLTrackedChangesImportContext();
-
- virtual void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-
- virtual SvXMLImportContext* CreateChildContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
-};
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/makefile.mk b/binfilter/bf_xmloff/source/text/makefile.mk
deleted file mode 100644
index f862e000ba41..000000000000
--- a/binfilter/bf_xmloff/source/text/makefile.mk
+++ /dev/null
@@ -1,127 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
-
-PRJ=..$/..$/..
-
-PRJNAME=binfilter
-TARGET=xmloff_text
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-CDEFS += -DCONV_STAR_FONTS
-
-INC+= -I$(PRJ)$/inc$/bf_xmloff
-
-# --- Files --------------------------------------------------------
-
-
-SLOFILES = \
- $(SLO)$/xmloff_txtdrope.obj \
- $(SLO)$/xmloff_txtdropi.obj \
- $(SLO)$/xmloff_txtexppr.obj \
- $(SLO)$/xmloff_txtflde.obj \
- $(SLO)$/xmloff_txtfldi.obj \
- $(SLO)$/xmloff_txtftne.obj \
- $(SLO)$/xmloff_txtimp.obj \
- $(SLO)$/xmloff_txtimppr.obj \
- $(SLO)$/xmloff_txtparae.obj \
- $(SLO)$/xmloff_txtparai.obj \
- $(SLO)$/xmloff_txtprhdl.obj \
- $(SLO)$/xmloff_txtprmap.obj \
- $(SLO)$/xmloff_txtsecte.obj \
- $(SLO)$/xmloff_txtstyle.obj \
- $(SLO)$/xmloff_txtstyli.obj \
- $(SLO)$/xmloff_txtvfldi.obj \
- $(SLO)$/xmloff_XMLAutoMarkFileContext.obj \
- $(SLO)$/xmloff_XMLChangedRegionImportContext.obj \
- $(SLO)$/xmloff_XMLChangeElementImportContext.obj \
- $(SLO)$/xmloff_XMLChangeInfoContext.obj \
- $(SLO)$/xmloff_XMLFootnoteBodyImportContext.obj \
- $(SLO)$/xmloff_XMLFootnoteConfigurationImportContext.obj \
- $(SLO)$/xmloff_XMLFootnoteImportContext.obj \
- $(SLO)$/xmloff_XMLIndexAlphabeticalSourceContext.obj \
- $(SLO)$/xmloff_XMLIndexBodyContext.obj \
- $(SLO)$/xmloff_XMLIndexBibliographyConfigurationContext.obj \
- $(SLO)$/xmloff_XMLIndexBibliographyEntryContext.obj \
- $(SLO)$/xmloff_XMLIndexBibliographySourceContext.obj \
- $(SLO)$/xmloff_XMLIndexChapterInfoEntryContext.obj \
- $(SLO)$/xmloff_XMLIndexIllustrationSourceContext.obj \
- $(SLO)$/xmloff_XMLIndexMarkExport.obj \
- $(SLO)$/xmloff_XMLIndexObjectSourceContext.obj \
- $(SLO)$/xmloff_XMLIndexSimpleEntryContext.obj \
- $(SLO)$/xmloff_XMLIndexSpanEntryContext.obj \
- $(SLO)$/xmloff_XMLIndexSourceBaseContext.obj \
- $(SLO)$/xmloff_XMLIndexTOCContext.obj \
- $(SLO)$/xmloff_XMLIndexTOCSourceContext.obj \
- $(SLO)$/xmloff_XMLIndexTOCStylesContext.obj \
- $(SLO)$/xmloff_XMLIndexTableSourceContext.obj \
- $(SLO)$/xmloff_XMLIndexTabStopEntryContext.obj \
- $(SLO)$/xmloff_XMLIndexTemplateContext.obj \
- $(SLO)$/xmloff_XMLIndexTitleTemplateContext.obj \
- $(SLO)$/xmloff_XMLIndexUserSourceContext.obj \
- $(SLO)$/xmloff_XMLLineNumberingExport.obj \
- $(SLO)$/xmloff_XMLLineNumberingImportContext.obj \
- $(SLO)$/xmloff_XMLLineNumberingSeparatorImportContext.obj \
- $(SLO)$/xmloff_XMLPropertyBackpatcher.obj \
- $(SLO)$/xmloff_XMLRedlineExport.obj \
- $(SLO)$/xmloff_XMLSectionExport.obj \
- $(SLO)$/xmloff_XMLSectionFootnoteConfigExport.obj \
- $(SLO)$/xmloff_XMLSectionFootnoteConfigImport.obj \
- $(SLO)$/xmloff_XMLSectionImportContext.obj \
- $(SLO)$/xmloff_XMLSectionSourceDDEImportContext.obj \
- $(SLO)$/xmloff_XMLSectionSourceImportContext.obj \
- $(SLO)$/xmloff_XMLTextCharStyleNamesElementExport.obj \
- $(SLO)$/xmloff_XMLTextColumnsContext.obj \
- $(SLO)$/xmloff_XMLTextColumnsExport.obj \
- $(SLO)$/xmloff_XMLTextFrameContext.obj \
- $(SLO)$/xmloff_XMLTextFrameHyperlinkContext.obj \
- $(SLO)$/xmloff_XMLTextHeaderFooterContext.obj \
- $(SLO)$/xmloff_XMLTextListAutoStylePool.obj \
- $(SLO)$/xmloff_XMLTextListBlockContext.obj \
- $(SLO)$/xmloff_XMLTextListItemContext.obj \
- $(SLO)$/xmloff_XMLTextMarkImportContext.obj \
- $(SLO)$/xmloff_XMLTextMasterPageContext.obj \
- $(SLO)$/xmloff_XMLTextMasterPageExport.obj \
- $(SLO)$/xmloff_XMLTextMasterStylesContext.obj \
- $(SLO)$/xmloff_XMLTextNumRuleInfo.obj \
- $(SLO)$/xmloff_XMLTextPropertySetContext.obj \
- $(SLO)$/xmloff_XMLTextShapeImportHelper.obj \
- $(SLO)$/xmloff_XMLTextShapeStyleContext.obj \
- $(SLO)$/xmloff_XMLTextTableContext.obj \
- $(SLO)$/xmloff_XMLChangeImportContext.obj \
- $(SLO)$/xmloff_XMLStringBufferImportContext.obj \
- $(SLO)$/xmloff_XMLTrackedChangesImportContext.obj \
- $(SLO)$/xmloff_XMLCalculationSettingsContext.obj
-
-# --- Tagets -------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/binfilter/bf_xmloff/source/text/txtdrope.hxx b/binfilter/bf_xmloff/source/text/txtdrope.hxx
deleted file mode 100644
index 7c2677defee4..000000000000
--- a/binfilter/bf_xmloff/source/text/txtdrope.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _XMLOFF_TXTDROPE_HXX
-#define _XMLOFF_TXTDROPE_HXX
-namespace com { namespace sun { namespace star { namespace uno {
- class Any; } } } }
-namespace rtl { class OUString; }
-namespace binfilter {
-
-
-class SvXMLExport;
-
-class XMLTextDropCapExport
-{
- SvXMLExport& rExport;
-
-public:
-
- XMLTextDropCapExport( SvXMLExport& rExport );
- ~XMLTextDropCapExport();
-
- void exportXML( const ::com::sun::star::uno::Any& rAny,
- sal_Bool bWholeWord,
- const ::rtl::OUString& rStyleName );
-};
-
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/txtdropi.hxx b/binfilter/bf_xmloff/source/text/txtdropi.hxx
deleted file mode 100644
index 5bc1b468167b..000000000000
--- a/binfilter/bf_xmloff/source/text/txtdropi.hxx
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _TXTDROPI_HXX
-#define _TXTDROPI_HXX
-
-#include "XMLElementPropertyContext.hxx"
-namespace rtl { class OUString; }
-namespace binfilter {
-
-
-
-class XMLTextDropCapImportContext :public XMLElementPropertyContext
-{
- XMLPropertyState aWholeWordProp;
- ::rtl::OUString sStyleName;
-
-private:
- void ProcessAttrs(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
-
-public:
- TYPEINFO();
-
- XMLTextDropCapImportContext(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- const XMLPropertyState& rProp,
- sal_Int32 nWholeWOrdIdx,
- ::std::vector< XMLPropertyState > &rProps );
-
- virtual ~XMLTextDropCapImportContext();
-
- virtual void EndElement();
-
- const ::rtl::OUString& GetStyleName() const { return sStyleName; }
-};
-
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/txtexppr.hxx b/binfilter/bf_xmloff/source/text/txtexppr.hxx
deleted file mode 100644
index d58e306a4acb..000000000000
--- a/binfilter/bf_xmloff/source/text/txtexppr.hxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _XMLOFF_TXTEXPPR_HXX
-#define _XMLOFF_TXTEXPPR_HXX
-
-
-#include "xmlexppr.hxx"
-#include "txtdrope.hxx"
-#include "xmltabe.hxx"
-#include "XMLTextColumnsExport.hxx"
-#include "XMLBackgroundImageExport.hxx"
-namespace binfilter {
-
-class SvXMLExport;
-class XMLTextExportPropertySetMapper: public SvXMLExportPropertyMapper
-{
- SvXMLExport& rExport;
-
- ::rtl::OUString sDropCharStyle;
- sal_Bool bDropWholeWord;
-
- void ContextFontFilter(
- XMLPropertyState *pFontNameState,
- XMLPropertyState *pFontFamilyNameState,
- XMLPropertyState *pFontStyleNameState,
- XMLPropertyState *pFontFamilyState,
- XMLPropertyState *pFontPitchState,
- XMLPropertyState *pFontCharsetState ) const;
- void ContextFontHeightFilter(
- XMLPropertyState* pCharHeightState,
- XMLPropertyState* pCharPropHeightState,
- XMLPropertyState* pCharDiffHeightState ) const;
-
-protected:
-// SvXMLUnitConverter& mrUnitConverter;
-// const Reference< xml::sax::XDocumentHandler > & mrHandler;
- XMLTextDropCapExport maDropCapExport;
- SvxXMLTabStopExport maTabStopExport;
- XMLTextColumnsExport maTextColumnsExport;
- XMLBackgroundImageExport maBackgroundImageExport;
-
- /** Application-specific filter. By default do nothing. */
- virtual void ContextFilter(
- ::std::vector< XMLPropertyState >& rProperties,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet > rPropSet ) const;
- const SvXMLExport& GetExport() const { return rExport; }
-
-public:
-
- XMLTextExportPropertySetMapper(
- const UniReference< XMLPropertySetMapper >& rMapper,
- SvXMLExport& rExt );
- virtual ~XMLTextExportPropertySetMapper();
-
- virtual void handleElementItem(
- SvXMLExport& rExport,
- const XMLPropertyState& rProperty,
- sal_uInt16 nFlags,
- const ::std::vector< XMLPropertyState > *pProperties = 0,
- sal_uInt32 nIdx = 0 ) const;
-
- virtual void handleSpecialItem(
- SvXMLAttributeList& rAttrList,
- const XMLPropertyState& rProperty,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap,
- const ::std::vector< XMLPropertyState > *pProperties = 0,
- sal_uInt32 nIdx = 0 ) const;
-};
-
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/txtimppr.hxx b/binfilter/bf_xmloff/source/text/txtimppr.hxx
deleted file mode 100644
index 7ed9434a3c6f..000000000000
--- a/binfilter/bf_xmloff/source/text/txtimppr.hxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _XMLOFF_TXTIMPPR_HXX
-#define _XMLOFF_TXTIMPPR_HXX
-
-#include "xmlimppr.hxx"
-#include "xmlictxt.hxx"
-namespace binfilter {
-
-class XMLFontStylesContext;
-
-class XMLTextImportPropertyMapper : public SvXMLImportPropertyMapper
-{
- sal_Int32 nSizeTypeIndex;
- SvXMLImportContextRef xFontDecls;
-
- void FontFinished(
- XMLPropertyState *pFontFamilyNameState,
- XMLPropertyState *pFontStyleNameState,
- XMLPropertyState *pFontFamilyState,
- XMLPropertyState *pFontPitchState,
- XMLPropertyState *pFontCharsetState ) const;
-
- void FontDefaultsCheck(
- XMLPropertyState*pFontFamilyName,
- XMLPropertyState* pFontStyleName,
- XMLPropertyState* pFontFamily,
- XMLPropertyState* pFontPitch,
- XMLPropertyState* pFontCharSet,
- XMLPropertyState** ppNewFontStyleName,
- XMLPropertyState** ppNewFontFamily,
- XMLPropertyState** ppNewFontPitch,
- XMLPropertyState** ppNewFontCharSet ) const;
-
-protected:
- virtual sal_Bool handleSpecialItem(
- XMLPropertyState& rProperty,
- ::std::vector< XMLPropertyState >& rProperties,
- const ::rtl::OUString& rValue,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap ) const;
-public:
- XMLTextImportPropertyMapper(
- const UniReference< XMLPropertySetMapper >& rMapper,
- SvXMLImport& rImport,
- XMLFontStylesContext *pFontDecls = 0 );
- virtual ~XMLTextImportPropertyMapper();
-
- void SetFontDecls( XMLFontStylesContext *pFontDecls );
-
- /** This method is called when all attributes have benn processed. It may be used to remove items that are incomplete */
- virtual void finished(
- ::std::vector< XMLPropertyState >& rProperties,
- sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const;
-};
-
-}//end of namespace binfilter
-#endif // _XMLOFF_XMLIMPPR_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/txtparai.hxx b/binfilter/bf_xmloff/source/text/txtparai.hxx
deleted file mode 100644
index 07037de142f8..000000000000
--- a/binfilter/bf_xmloff/source/text/txtparai.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _XMLOFF_TEXTPARAI_HXX_
-#define _XMLOFF_TEXTPARAI_HXX_
-
-
-#include <com/sun/star/uno/Reference.h>
-
-#include "xmlictxt.hxx"
-namespace com { namespace sun { namespace star {
-namespace text { class XTextRange; }
-namespace xml { namespace sax { class XAttributeList; } }
-} } }
-namespace binfilter {
-
-class XMLHints_Impl;
-
-#ifdef CONV_STAR_FONTS
-#define CONV_FROM_STAR_BATS 1
-#define CONV_FROM_STAR_MATH 2
-#define CONV_STAR_FONT_FLAGS_VALID 4
-#endif
-
-class XMLParaContext : public SvXMLImportContext
-{
- ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextRange > xStart; // xub_StrLen nStart;
- ::rtl::OUString sStyleName;
- sal_Int8 nOutlineLevel;
- XMLHints_Impl *pHints;
- sal_Bool bIgnoreLeadingSpace;
- sal_Bool bHeading;
-#ifdef CONV_STAR_FONTS
- sal_uInt8 nStarFontsConvFlags;
-#endif
-
-public:
-
- TYPEINFO();
-
- XMLParaContext( SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- sal_Bool bHeading );
-
- virtual ~XMLParaContext();
-
- virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
-
- virtual void Characters( const ::rtl::OUString& rChars );
-
-};
-
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/txtprhdl.hxx b/binfilter/bf_xmloff/source/text/txtprhdl.hxx
deleted file mode 100644
index c2f3d3bf9c45..000000000000
--- a/binfilter/bf_xmloff/source/text/txtprhdl.hxx
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _XMLOFF_TEXTPRHDL_HXX_
-#define _XMLOFF_TEXTPRHDL_HXX_
-
-
-#include "prhdlfac.hxx"
-namespace binfilter {
-
-class XMLTextPropertyHandlerFactory_Impl;
-
-class XMLTextPropertyHandlerFactory : public XMLPropertyHandlerFactory
-{
- XMLTextPropertyHandlerFactory_Impl *pImpl;
-
-public:
-
- XMLTextPropertyHandlerFactory();
- virtual ~XMLTextPropertyHandlerFactory();
-
- virtual const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nType ) const ;
-};
-
-
-}//end of namespace binfilter
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLAutoMarkFileContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLAutoMarkFileContext.cxx
deleted file mode 100644
index 9c6d6ab04979..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLAutoMarkFileContext.cxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLAutoMarkFileContext.hxx"
-
-#include "xmlimp.hxx"
-
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-
-
-namespace binfilter {
-
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::com::sun::star::beans::XPropertySet;
-
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_HREF;
-
-
-TYPEINIT1( XMLAutoMarkFileContext, SvXMLImportContext );
-
-XMLAutoMarkFileContext::XMLAutoMarkFileContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName) :
- SvXMLImportContext(rImport, nPrefix, rLocalName),
- sIndexAutoMarkFileURL(
- RTL_CONSTASCII_USTRINGPARAM("IndexAutoMarkFileURL"))
-{
-}
-
-XMLAutoMarkFileContext::~XMLAutoMarkFileContext()
-{
-}
-
-
-void XMLAutoMarkFileContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- // scan for text:alphabetical-index-auto-mark-file attribute, and if
- // found set value with the document
-
- sal_Int16 nLength = xAttrList->getLength();
- for( sal_Int16 i = 0; i < nLength; i++ )
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(i), &sLocalName );
-
- if ( ( XML_NAMESPACE_XLINK == nPrefix ) &&
- IsXMLToken(sLocalName, XML_HREF) )
- {
- Any aAny;
- aAny <<= GetImport().GetAbsoluteReference( xAttrList->getValueByIndex(i) );
- Reference<XPropertySet> xPropertySet(
- GetImport().GetModel(), UNO_QUERY );
- if (xPropertySet.is())
- {
- xPropertySet->setPropertyValue( sIndexAutoMarkFileURL, aAny );
- }
- }
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLCalculationSettingsContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLCalculationSettingsContext.cxx
deleted file mode 100644
index 1eb4b649a2ee..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLCalculationSettingsContext.cxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <XMLCalculationSettingsContext.hxx>
-#include <com/sun/star/text/XTextDocument.hpp>
-#include "xmlimp.hxx"
-#include "nmspmap.hxx"
-#include "xmlnmspe.hxx"
-#include "xmluconv.hxx"
-namespace binfilter {
-
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::text;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-XMLCalculationSettingsContext::XMLCalculationSettingsContext( SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList >& xAttrList )
-: nYear( 1930 )
-, SvXMLImportContext ( rImport, nPrefix, rLocalName )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- ::rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- ::rtl::OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName(
- sAttrName, &aLocalName );
- ::rtl::OUString sValue = xAttrList->getValueByIndex( i );
-
- if (nPrefix == XML_NAMESPACE_TABLE)
- {
- if ( IsXMLToken( aLocalName, XML_NULL_YEAR ) )
- {
- sal_Int32 nTemp;
- GetImport().GetMM100UnitConverter().convertNumber(nTemp, sValue);
- nYear= static_cast <sal_Int16> (nTemp);
- }
- }
- }
-}
-
-XMLCalculationSettingsContext::~XMLCalculationSettingsContext()
-{
-}
-void XMLCalculationSettingsContext::EndElement()
-{
- if (nYear != 1930 )
- {
- Reference < XTextDocument > xTextDoc ( GetImport().GetModel(), UNO_QUERY);
- if (xTextDoc.is())
- {
- Reference < XPropertySet > xPropSet ( xTextDoc, UNO_QUERY );
- OUString sTwoDigitYear ( RTL_CONSTASCII_USTRINGPARAM ( "TwoDigitYear" ) );
- Any aAny;
- aAny <<= nYear;
- xPropSet->setPropertyValue ( sTwoDigitYear, aAny );
- }
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLChangeElementImportContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLChangeElementImportContext.cxx
deleted file mode 100644
index ac2c60a851f5..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLChangeElementImportContext.cxx
+++ /dev/null
@@ -1,121 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLChangeElementImportContext.hxx"
-
-#include "XMLChangedRegionImportContext.hxx"
-
-#include "XMLChangeInfoContext.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-#include "xmlimp.hxx"
-
-#include "xmlnmspe.hxx"
-
-namespace binfilter {
-
-
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_P;
-using ::binfilter::xmloff::token::XML_CHANGE_INFO;
-
-TYPEINIT1( XMLChangeElementImportContext, SvXMLImportContext );
-
-XMLChangeElementImportContext::XMLChangeElementImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- sal_Bool bAccContent,
- XMLChangedRegionImportContext& rParent) :
- SvXMLImportContext(rImport, nPrefix, rLocalName),
- bAcceptContent(bAccContent),
- rChangedRegion(rParent)
-{
-}
-
-SvXMLImportContext* XMLChangeElementImportContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList)
-{
- SvXMLImportContext* pContext = NULL;
-
- if ( (XML_NAMESPACE_OFFICE == nPrefix) &&
- IsXMLToken( rLocalName, XML_CHANGE_INFO) )
- {
- pContext = new XMLChangeInfoContext(GetImport(), nPrefix, rLocalName,
- rChangedRegion, GetLocalName());
- }
- else
- {
- // import into redline -> create XText
- rChangedRegion.UseRedlineText();
-
- pContext = GetImport().GetTextImport()->CreateTextChildContext(
- GetImport(), nPrefix, rLocalName, xAttrList,
- XML_TEXT_TYPE_CHANGED_REGION);
-
- if (NULL == pContext)
- {
- // no text element -> use default
- pContext = SvXMLImportContext::CreateChildContext(
- nPrefix, rLocalName, xAttrList);
-
- // illegal element content! TODO: discard this redline!
- }
- }
-
-
- return pContext;
-}
-
-// #107848#
-void XMLChangeElementImportContext::StartElement( const Reference< XAttributeList >& xAttrList )
-{
- if(bAcceptContent)
- {
- GetImport().GetTextImport()->SetInsideDeleteContext(sal_True);
- }
-}
-
-// #107848#
-void XMLChangeElementImportContext::EndElement()
-{
- if(bAcceptContent)
- {
- GetImport().GetTextImport()->SetInsideDeleteContext(sal_False);
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLChangeImportContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLChangeImportContext.cxx
deleted file mode 100644
index 176bd44e5089..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLChangeImportContext.cxx
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLChangeImportContext.hxx"
-
-
-#include <tools/debug.hxx>
-
-#include "xmlimp.hxx"
-
-#include "xmlnmspe.hxx"
-
-#include "nmspmap.hxx"
-
-namespace binfilter {
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::text::XTextRange;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_CHANGE_ID;
-
-TYPEINIT1( XMLChangeImportContext, SvXMLImportContext );
-
-XMLChangeImportContext::XMLChangeImportContext(
- SvXMLImport& rImport,
- sal_Int16 nPrefix,
- const OUString& rLocalName,
- sal_Bool bStart,
- sal_Bool bEnd,
- sal_Bool bOutsideOfParagraph) :
- SvXMLImportContext(rImport, nPrefix, rLocalName),
- bIsStart(bStart),
- bIsEnd(bEnd),
- bIsOutsideOfParagraph(bOutsideOfParagraph)
-{
- DBG_ASSERT(bStart || bEnd, "Must be either start, end, or both!");
-}
-
-XMLChangeImportContext::~XMLChangeImportContext()
-{
-}
-
-void XMLChangeImportContext::StartElement(
- const Reference<XAttributeList>& xAttrList)
-{
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
- if ( (XML_NAMESPACE_TEXT == nPrefix) &&
- IsXMLToken( sLocalName, XML_CHANGE_ID ) )
- {
- // Id found! Now call RedlineImportHelper
-
- // prepare parameters
- UniReference<XMLTextImportHelper> rHelper =
- GetImport().GetTextImport();
- OUString sID = xAttrList->getValueByIndex(nAttr);
-
- // call for bStart and bEnd (may both be true)
- if (bIsStart)
- rHelper->RedlineSetCursor(sID,sal_True,bIsOutsideOfParagraph);
- if (bIsEnd)
- rHelper->RedlineSetCursor(sID,sal_False,bIsOutsideOfParagraph);
-
- // outside of paragraph and still open? set open redline ID
- if (bIsOutsideOfParagraph)
- {
- rHelper->SetOpenRedlineId(sID);
- }
- }
- // else: ignore
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLChangeInfoContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLChangeInfoContext.cxx
deleted file mode 100644
index 571436f18dcb..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLChangeInfoContext.cxx
+++ /dev/null
@@ -1,132 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLChangeInfoContext.hxx"
-
-#include "XMLChangedRegionImportContext.hxx"
-
-#include "XMLStringBufferImportContext.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-#include "xmlnmspe.hxx"
-
-#include "nmspmap.hxx"
-
-
-#include "xmlimp.hxx"
-namespace binfilter {
-
-
-
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::xml::sax::XAttributeList;
-
-
-TYPEINIT1(XMLChangeInfoContext, SvXMLImportContext);
-
-XMLChangeInfoContext::XMLChangeInfoContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- XMLChangedRegionImportContext& rPParent,
- const OUString& rChangeType) :
- SvXMLImportContext(rImport, nPrefix, rLocalName),
- rChangedRegion(rPParent),
- rType(rChangeType)
-{
-}
-
-XMLChangeInfoContext::~XMLChangeInfoContext()
-{
-}
-
-void XMLChangeInfoContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- // process attributes: chg-author, chg-date-time
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
- OUString sValue = xAttrList->getValueByIndex(nAttr);
- if (XML_NAMESPACE_OFFICE == nPrefix)
- {
- if ( IsXMLToken( sLocalName, XML_CHG_AUTHOR ) )
- {
- sAuthor = sValue;
- }
- else if ( IsXMLToken( sLocalName, XML_CHG_DATE_TIME ) )
- {
- sDateTime = sValue;
- }
- // else: unknown attribute
- }
- // else: unknown namespace
- }
-
-}
-
-SvXMLImportContext* XMLChangeInfoContext::CreateChildContext(
- USHORT nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
-
- if ( ( XML_NAMESPACE_TEXT == nPrefix ) &&
- IsXMLToken( rLocalName, XML_P ) )
- {
- pContext = new XMLStringBufferImportContext(GetImport(), nPrefix,
- rLocalName, sCommentBuffer);
- }
- else
- {
- pContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName,
- xAttrList);
- }
-
- return pContext;
-}
-
-void XMLChangeInfoContext::EndElement()
-{
- // set values at changed region context
- rChangedRegion.SetChangeInfo(rType, sAuthor,
- sCommentBuffer.makeStringAndClear(),
- sDateTime);
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLChangedRegionImportContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLChangedRegionImportContext.cxx
deleted file mode 100644
index f3c4335c2733..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLChangedRegionImportContext.cxx
+++ /dev/null
@@ -1,197 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLChangedRegionImportContext.hxx"
-
-#include "XMLChangeElementImportContext.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-#include <com/sun/star/util/DateTime.hpp>
-
-
-#include "xmlimp.hxx"
-
-#include "xmlnmspe.hxx"
-
-#include "nmspmap.hxx"
-
-
-#include "xmluconv.hxx"
-namespace binfilter {
-
-
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::text::XTextCursor;
-using ::com::sun::star::util::DateTime;
-using ::com::sun::star::xml::sax::XAttributeList;
-
-
-
-TYPEINIT1(XMLChangedRegionImportContext, SvXMLImportContext);
-
-XMLChangedRegionImportContext::XMLChangedRegionImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName) :
- SvXMLImportContext(rImport, nPrefix, rLocalName),
- bMergeLastPara(sal_True)
-{
-}
-
-XMLChangedRegionImportContext::~XMLChangedRegionImportContext()
-{
-}
-
-void XMLChangedRegionImportContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- // process attributes: id
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
-
- const OUString sValue = xAttrList->getValueByIndex(nAttr);
- if ( XML_NAMESPACE_TEXT == nPrefix )
- {
- if( IsXMLToken( sLocalName, XML_ID ) )
- {
- sID = sValue;
- }
- else if( IsXMLToken( sLocalName, XML_MERGE_LAST_PARAGRAPH ) )
- {
- sal_Bool bTmp;
- if( SvXMLUnitConverter::convertBool(bTmp, sValue) )
- {
- bMergeLastPara = bTmp;
- }
- }
- }
- }
-}
-
-SvXMLImportContext* XMLChangedRegionImportContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList)
-{
- SvXMLImportContext* pContext = NULL;
-
- if (XML_NAMESPACE_TEXT == nPrefix)
- {
- if ( IsXMLToken( rLocalName, XML_INSERTION ) ||
- IsXMLToken( rLocalName, XML_DELETION ) ||
- IsXMLToken( rLocalName, XML_FORMAT_CHANGE ) )
- {
- // create XMLChangeElementImportContext for all kinds of changes
- pContext = new XMLChangeElementImportContext(
- GetImport(), nPrefix, rLocalName,
- IsXMLToken( rLocalName, XML_DELETION ),
- *this);
- }
- // else: it may be a text element, see below
- }
-
- if (NULL == pContext)
- {
- pContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName,
- xAttrList);
-
- // was it a text element? If not, use default!
- if (NULL == pContext)
- {
- pContext = SvXMLImportContext::CreateChildContext(
- nPrefix, rLocalName, xAttrList);
- }
- }
-
- return pContext;
-}
-
-void XMLChangedRegionImportContext::EndElement()
-{
- // restore old XCursor (if necessary)
- if (xOldCursor.is())
- {
- // delete last paragraph
- // (one extra paragraph was inserted in the beginning)
- UniReference<XMLTextImportHelper> rHelper =
- GetImport().GetTextImport();
- rHelper->DeleteParagraph();
-
- GetImport().GetTextImport()->SetCursor(xOldCursor);
- xOldCursor = NULL;
- }
-}
-
-void XMLChangedRegionImportContext::SetChangeInfo(
- const OUString& rType,
- const OUString& rAuthor,
- const OUString& rComment,
- const OUString& rDate)
-{
- DateTime aDateTime;
- if (SvXMLUnitConverter::convertDateTime(aDateTime, rDate))
- {
- GetImport().GetTextImport()->RedlineAdd(
- rType, sID, rAuthor, rComment, aDateTime, bMergeLastPara);
- }
-}
-
-void XMLChangedRegionImportContext::UseRedlineText()
-{
- // if we haven't already installed the redline cursor, do it now
- if (! xOldCursor.is())
- {
- // get TextImportHelper and old Cursor
- UniReference<XMLTextImportHelper> rHelper(GetImport().GetTextImport());
- Reference<XTextCursor> xCursor( rHelper->GetCursor() );
-
- // create Redline and new Cursor
- Reference<XTextCursor> xNewCursor =
- rHelper->RedlineCreateText(xCursor, sID);
-
- if (xNewCursor.is())
- {
- // save old cursor and install new one
- xOldCursor = xCursor;
- rHelper->SetCursor( xNewCursor );
- }
- // else: leave as is
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLFootnoteBodyImportContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLFootnoteBodyImportContext.cxx
deleted file mode 100644
index a9973aef5aa2..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLFootnoteBodyImportContext.cxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLFootnoteBodyImportContext.hxx"
-
-#include "rtl/ustring.hxx"
-
-
-#include "xmlimp.hxx"
-
-
-
-
-namespace binfilter {
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::xml::sax::XAttributeList;
-
-
-TYPEINIT1( XMLFootnoteBodyImportContext, SvXMLImportContext );
-
-XMLFootnoteBodyImportContext::XMLFootnoteBodyImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName ) :
- SvXMLImportContext(rImport, nPrfx, rLocalName)
-{
-}
-
-SvXMLImportContext* XMLFootnoteBodyImportContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- // return text context
- SvXMLImportContext *pContext =
- GetImport().GetTextImport()->CreateTextChildContext(GetImport(),
- nPrefix,
- rLocalName,
- xAttrList,
- XML_TEXT_TYPE_FOOTNOTE);
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
- return pContext;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLFootnoteConfigurationImportContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLFootnoteConfigurationImportContext.cxx
deleted file mode 100644
index 569626f471ee..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLFootnoteConfigurationImportContext.cxx
+++ /dev/null
@@ -1,449 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLFootnoteConfigurationImportContext.hxx"
-
-#include "rtl/ustring.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-
-#include "xmluconv.hxx"
-
-#include "xmlimp.hxx"
-
-
-
-
-
-#include <com/sun/star/text/XFootnotesSupplier.hpp>
-
-#include <com/sun/star/text/XEndnotesSupplier.hpp>
-
-#include <com/sun/star/text/FootnoteNumbering.hpp>
-#include <com/sun/star/style/NumberingType.hpp>
-namespace binfilter {
-
-
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-//
-// XMLFootnoteConfigHelper
-//
-
-/// local helper class for import of quo-vadis and ergo-sum elements
-class XMLFootnoteConfigHelper : public SvXMLImportContext
-{
- OUStringBuffer sBuffer;
- XMLFootnoteConfigurationImportContext& rConfig;
- sal_Bool bIsBegin;
-
-public:
- TYPEINFO();
-
- XMLFootnoteConfigHelper(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- XMLFootnoteConfigurationImportContext& rConfigImport,
- sal_Bool bBegin);
-
- virtual void EndElement();
-
- virtual void Characters( const OUString& rChars );
-};
-
-TYPEINIT1( XMLFootnoteConfigHelper, SvXMLImportContext );
-
-XMLFootnoteConfigHelper::XMLFootnoteConfigHelper(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- XMLFootnoteConfigurationImportContext& rConfigImport,
- sal_Bool bBegin) :
- SvXMLImportContext(rImport, nPrfx, rLName),
- rConfig(rConfigImport),
- sBuffer(),
- bIsBegin(bBegin)
-{
-}
-
-void XMLFootnoteConfigHelper::EndElement()
-{
- if (bIsBegin)
- {
- rConfig.SetBeginNotice(sBuffer.makeStringAndClear());
- }
- else
- {
- rConfig.SetEndNotice(sBuffer.makeStringAndClear());
- }
-// rConfig = NULL; // import contexts are ref-counted
-}
-
-void XMLFootnoteConfigHelper::Characters( const OUString& rChars )
-{
- sBuffer.append(rChars);
-}
-
-
-//
-// XMLFootnoteConfigurationImportContext
-//
-
-
-TYPEINIT1( XMLFootnoteConfigurationImportContext, SvXMLStyleContext );
-
-XMLFootnoteConfigurationImportContext::XMLFootnoteConfigurationImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList,
- sal_Bool bEnd) :
- SvXMLStyleContext(rImport, nPrfx, rLocalName, xAttrList, bEnd ?
- XML_STYLE_FAMILY_TEXT_ENDNOTECONFIG :
- XML_STYLE_FAMILY_TEXT_FOOTNOTECONFIG),
- bIsEndnote(bEnd),
- pAttrTokenMap(NULL),
- sCitationStyle(),
- sAnchorStyle(),
- sDefaultStyle(),
- sPageStyle(),
- sPrefix(),
- sSuffix(),
- sBeginNotice(),
- sEndNotice(),
- sNumFormat(RTL_CONSTASCII_USTRINGPARAM("1")),
- sNumSync(RTL_CONSTASCII_USTRINGPARAM("false")),
- nOffset(0),
- nNumbering(FootnoteNumbering::PER_PAGE),
- bPosition(sal_False),
- sPropertyCharStyleName(RTL_CONSTASCII_USTRINGPARAM("CharStyleName")),
- sPropertyAnchorCharStyleName(
- RTL_CONSTASCII_USTRINGPARAM("AnchorCharStyleName")),
- sPropertyNumberingType(RTL_CONSTASCII_USTRINGPARAM("NumberingType")),
- sPropertyPageStyleName(RTL_CONSTASCII_USTRINGPARAM("PageStyleName")),
- sPropertyParagraphStyleName(
- RTL_CONSTASCII_USTRINGPARAM("ParaStyleName")),
- sPropertyPrefix(RTL_CONSTASCII_USTRINGPARAM("Prefix")),
- sPropertyStartAt(RTL_CONSTASCII_USTRINGPARAM("StartAt")),
- sPropertySuffix(RTL_CONSTASCII_USTRINGPARAM("Suffix")),
- sPropertyPositionEndOfDoc(
- RTL_CONSTASCII_USTRINGPARAM("PositionEndOfDoc")),
- sPropertyFootnoteCounting(
- RTL_CONSTASCII_USTRINGPARAM("FootnoteCounting")),
- sPropertyEndNotice(RTL_CONSTASCII_USTRINGPARAM("EndNotice")),
- sPropertyBeginNotice(RTL_CONSTASCII_USTRINGPARAM("BeginNotice"))
-{
-}
-XMLFootnoteConfigurationImportContext::~XMLFootnoteConfigurationImportContext()
-{
- delete pAttrTokenMap;
-}
-
-enum XMLFtnConfigToken
-{
- XML_TOK_FTNCONFIG_CITATION_STYLENAME,
- XML_TOK_FTNCONFIG_ANCHOR_STYLENAME,
- XML_TOK_FTNCONFIG_DEFAULT_STYLENAME,
- XML_TOK_FTNCONFIG_PAGE_STYLENAME,
- XML_TOK_FTNCONFIG_OFFSET,
- XML_TOK_FTNCONFIG_NUM_PREFIX,
- XML_TOK_FTNCONFIG_NUM_SUFFIX,
- XML_TOK_FTNCONFIG_NUM_FORMAT,
- XML_TOK_FTNCONFIG_NUM_SYNC,
- XML_TOK_FTNCONFIG_START_AT,
- XML_TOK_FTNCONFIG_POSITION
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aTextFieldAttrTokenMap[] =
-{
- { XML_NAMESPACE_TEXT, XML_CITATION_STYLE_NAME, XML_TOK_FTNCONFIG_CITATION_STYLENAME },
- { XML_NAMESPACE_TEXT, XML_CITATION_BODY_STYLE_NAME, XML_TOK_FTNCONFIG_ANCHOR_STYLENAME },
- { XML_NAMESPACE_TEXT, XML_DEFAULT_STYLE_NAME, XML_TOK_FTNCONFIG_DEFAULT_STYLENAME },
- { XML_NAMESPACE_TEXT, XML_MASTER_PAGE_NAME, XML_TOK_FTNCONFIG_PAGE_STYLENAME },
- { XML_NAMESPACE_TEXT, XML_START_VALUE, XML_TOK_FTNCONFIG_OFFSET },
- { XML_NAMESPACE_STYLE, XML_NUM_PREFIX, XML_TOK_FTNCONFIG_NUM_PREFIX },
- { XML_NAMESPACE_STYLE, XML_NUM_SUFFIX, XML_TOK_FTNCONFIG_NUM_SUFFIX },
- { XML_NAMESPACE_STYLE, XML_NUM_FORMAT, XML_TOK_FTNCONFIG_NUM_FORMAT },
- { XML_NAMESPACE_STYLE, XML_NUM_LETTER_SYNC, XML_TOK_FTNCONFIG_NUM_SYNC },
- { XML_NAMESPACE_TEXT, XML_START_NUMBERING_AT, XML_TOK_FTNCONFIG_START_AT},
- { XML_NAMESPACE_TEXT, XML_FOOTNOTES_POSITION, XML_TOK_FTNCONFIG_POSITION},
-
- // for backwards compatibility with SRC630 & earlier
- { XML_NAMESPACE_TEXT, XML_NUM_PREFIX, XML_TOK_FTNCONFIG_NUM_PREFIX },
- { XML_NAMESPACE_TEXT, XML_NUM_SUFFIX, XML_TOK_FTNCONFIG_NUM_SUFFIX },
- { XML_NAMESPACE_TEXT, XML_OFFSET, XML_TOK_FTNCONFIG_OFFSET },
- XML_TOKEN_MAP_END
-};
-
-const SvXMLTokenMap&
- XMLFootnoteConfigurationImportContext::GetFtnConfigAttrTokenMap()
-{
- if (NULL == pAttrTokenMap)
- {
- pAttrTokenMap = new SvXMLTokenMap(aTextFieldAttrTokenMap);
- }
-
- return *pAttrTokenMap;
-}
-
-static SvXMLEnumMapEntry __READONLY_DATA aFootnoteNumberingMap[] =
-{
- { XML_PAGE, FootnoteNumbering::PER_PAGE },
- { XML_CHAPTER, FootnoteNumbering::PER_CHAPTER },
- { XML_DOCUMENT, FootnoteNumbering::PER_DOCUMENT },
- { XML_TOKEN_INVALID, 0 },
-};
-
-void XMLFootnoteConfigurationImportContext::StartElement(
- const Reference<XAttributeList> & xAttrList )
-{
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
- OUString sValue = xAttrList->getValueByIndex(nAttr);
- switch (GetFtnConfigAttrTokenMap().Get(nPrefix, sLocalName))
- {
- case XML_TOK_FTNCONFIG_CITATION_STYLENAME:
- sCitationStyle = sValue;
- break;
- case XML_TOK_FTNCONFIG_ANCHOR_STYLENAME:
- sAnchorStyle = sValue;
- break;
- case XML_TOK_FTNCONFIG_DEFAULT_STYLENAME:
- sDefaultStyle = sValue;
- break;
- case XML_TOK_FTNCONFIG_PAGE_STYLENAME:
- sPageStyle = sValue;
- break;
- case XML_TOK_FTNCONFIG_OFFSET:
- {
- sal_Int32 nTmp;
- if (SvXMLUnitConverter::convertNumber(nTmp, sValue))
- {
- nOffset = (sal_uInt16)nTmp;
- }
- break;
- }
- case XML_TOK_FTNCONFIG_NUM_PREFIX:
- sPrefix = sValue;
- break;
- case XML_TOK_FTNCONFIG_NUM_SUFFIX:
- sSuffix = sValue;
- break;
- case XML_TOK_FTNCONFIG_NUM_FORMAT:
- sNumFormat = sValue;
- break;
- case XML_TOK_FTNCONFIG_NUM_SYNC:
- sNumSync = sValue;
- break;
- case XML_TOK_FTNCONFIG_START_AT:
- {
- sal_uInt16 nTmp;
- if (SvXMLUnitConverter::convertEnum(nTmp, sValue,
- aFootnoteNumberingMap))
- {
- nNumbering = nTmp;
- }
- break;
- }
- case XML_TOK_FTNCONFIG_POSITION:
- bPosition = IsXMLToken( sValue, XML_DOCUMENT );
- break;
- default:
- ; // ignore
- }
- }
-}
-
-SvXMLImportContext *XMLFootnoteConfigurationImportContext::CreateChildContext(
- USHORT nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
-
- if (!bIsEndnote)
- {
- if (XML_NAMESPACE_TEXT == nPrefix)
- {
- if ( IsXMLToken( rLocalName,
- XML_FOOTNOTE_CONTINUATION_NOTICE_FORWARD ) )
- {
- pContext = new XMLFootnoteConfigHelper(GetImport(),
- nPrefix, rLocalName,
- *this, sal_False);
- }
- else if ( IsXMLToken( rLocalName,
- XML_FOOTNOTE_CONTINUATION_NOTICE_BACKWARD ) )
- {
- pContext = new XMLFootnoteConfigHelper(GetImport(),
- nPrefix, rLocalName,
- *this, sal_True);
- }
- // else: default context
- }
- // else: unknown namespace -> default context
- }
- // else: endnote -> default context
-
- if (pContext == NULL)
- {
- // default: delegate to super class
- pContext = SvXMLStyleContext::CreateChildContext(nPrefix,
- rLocalName,
- xAttrList);
- }
-
- return pContext;
-}
-
-
-void XMLFootnoteConfigurationImportContext::CreateAndInsertLate(
- sal_Bool bOverwrite )
-{
-
- if (bOverwrite)
- {
- if (bIsEndnote)
- {
- Reference<XEndnotesSupplier> xSupplier(
- GetImport().GetModel(), UNO_QUERY);
- if (xSupplier.is())
- {
- ProcessSettings(xSupplier->getEndnoteSettings());
- }
- }
- else
- {
- Reference<XFootnotesSupplier> xSupplier(
- GetImport().GetModel(), UNO_QUERY);
- if (xSupplier.is())
- {
- ProcessSettings(xSupplier->getFootnoteSettings());
- }
- }
- }
- // else: ignore (there's only one configuration, so we can only overwrite)
-}
-
-void XMLFootnoteConfigurationImportContext::ProcessSettings(
- const Reference<XPropertySet> & rConfig)
-{
- Any aAny;
-
- if (sCitationStyle.getLength() > 0)
- {
- aAny <<= sCitationStyle;
- rConfig->setPropertyValue(sPropertyCharStyleName, aAny);
- }
-
- if (sAnchorStyle.getLength() > 0)
- {
- aAny <<= sAnchorStyle;
- rConfig->setPropertyValue(sPropertyAnchorCharStyleName, aAny);
- }
-
- if (sPageStyle.getLength() > 0)
- {
- aAny <<= sPageStyle;
- rConfig->setPropertyValue(sPropertyPageStyleName, aAny);
- }
-
- if (sDefaultStyle.getLength() > 0)
- {
- aAny <<= sDefaultStyle;
- rConfig->setPropertyValue(sPropertyParagraphStyleName, aAny);
- }
-
- aAny <<= sPrefix;
- rConfig->setPropertyValue(sPropertyPrefix, aAny);
-
- aAny <<= sSuffix;
- rConfig->setPropertyValue(sPropertySuffix, aAny);
-
- sal_Int16 nNumType = NumberingType::ARABIC;
- GetImport().GetMM100UnitConverter().convertNumFormat( nNumType, sNumFormat,
- sNumSync );
- aAny <<= nNumType;
- rConfig->setPropertyValue(sPropertyNumberingType, aAny);
-
- aAny <<= nOffset;
- rConfig->setPropertyValue(sPropertyStartAt, aAny);
-
- if (!bIsEndnote)
- {
- aAny.setValue(&bPosition, ::getBooleanCppuType());
- rConfig->setPropertyValue(sPropertyPositionEndOfDoc, aAny);
-
- aAny <<= nNumbering;
- rConfig->setPropertyValue(sPropertyFootnoteCounting, aAny);
-
- aAny <<= sEndNotice;
- rConfig->setPropertyValue(sPropertyEndNotice, aAny);
-
- aAny <<= sBeginNotice;
- rConfig->setPropertyValue(sPropertyBeginNotice, aAny);
- }
-}
-
-void XMLFootnoteConfigurationImportContext::SetBeginNotice(
- OUString sText)
-{
- sBeginNotice = sText;
-}
-
-void XMLFootnoteConfigurationImportContext::SetEndNotice(
- OUString sText)
-{
- sEndNotice = sText;
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLFootnoteImportContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLFootnoteImportContext.cxx
deleted file mode 100644
index 7c0eaa252c33..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLFootnoteImportContext.cxx
+++ /dev/null
@@ -1,243 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLFootnoteImportContext.hxx"
-
-#include "rtl/ustring.hxx"
-
-
-#include "xmlimp.hxx"
-
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "XMLFootnoteBodyImportContext.hxx"
-
-#include "XMLTextListBlockContext.hxx"
-
-#include "XMLTextListItemContext.hxx"
-
-
-
-
-
-#include <com/sun/star/text/XFootnote.hpp>
-namespace binfilter {
-
-
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-TYPEINIT1(XMLFootnoteImportContext, SvXMLImportContext);
-
-const sal_Char sAPI_service_footnote[] = "com.sun.star.text.Footnote";
-const sal_Char sAPI_service_endnote[] = "com.sun.star.text.Endnote";
-
-enum XMLFootnoteChildToken {
- XML_TOK_FTN_FOOTNOTE_CITATION,
- XML_TOK_FTN_ENDNOTE_CITATION,
- XML_TOK_FTN_FOOTNOTE_BODY,
- XML_TOK_FTN_ENDNOTE_BODY
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aFootnoteChildTokenMap[] =
-{
- { XML_NAMESPACE_TEXT, XML_FOOTNOTE_CITATION,
- XML_TOK_FTN_FOOTNOTE_CITATION },
- { XML_NAMESPACE_TEXT, XML_ENDNOTE_CITATION,
- XML_TOK_FTN_ENDNOTE_CITATION },
- { XML_NAMESPACE_TEXT, XML_FOOTNOTE_BODY, XML_TOK_FTN_FOOTNOTE_BODY },
- { XML_NAMESPACE_TEXT, XML_ENDNOTE_BODY, XML_TOK_FTN_ENDNOTE_BODY },
- XML_TOKEN_MAP_END
-};
-
-
-XMLFootnoteImportContext::XMLFootnoteImportContext(
- SvXMLImport& rImport,
- XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx,
- const OUString& rLocalName ) :
- SvXMLImportContext(rImport, nPrfx, rLocalName),
- rHelper(rHlp),
- xFootnote(),
- sPropertyReferenceId(RTL_CONSTASCII_USTRINGPARAM("ReferenceId"))
-{
-}
-
-void XMLFootnoteImportContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- // create footnote
- Reference<XMultiServiceFactory> xFactory(GetImport().GetModel(),
- UNO_QUERY);
- if( xFactory.is() )
- {
- // create endnote or footnote
- sal_Bool bIsEndnote = IsXMLToken( GetLocalName(), XML_ENDNOTE );
- Reference<XInterface> xIfc = xFactory->createInstance(
- bIsEndnote ?
- OUString(RTL_CONSTASCII_USTRINGPARAM(sAPI_service_endnote)) :
- OUString(RTL_CONSTASCII_USTRINGPARAM(sAPI_service_footnote)) );
-
- // attach footnote to document
- Reference<XTextContent> xTextContent(xIfc, UNO_QUERY);
- rHelper.InsertTextContent(xTextContent);
-
- // process id attribute
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
-
- if ( (XML_NAMESPACE_TEXT == nPrefix) &&
- IsXMLToken( sLocalName, XML_ID ) )
- {
- // get ID ...
- Reference<XPropertySet> xPropertySet(xTextContent, UNO_QUERY);
- Any aAny =xPropertySet->getPropertyValue(sPropertyReferenceId);
- sal_Int16 nID;
- aAny >>= nID;
-
- // ... and insert into map
- rHelper.InsertFootnoteID(
- xAttrList->getValueByIndex(nAttr),
- nID);
- }
- }
-
- // save old cursor and install new one
- xOldCursor = rHelper.GetCursor();
- Reference<XText> xText(xTextContent, UNO_QUERY);
- rHelper.SetCursor(xText->createTextCursor());
-
- // remember old list item and block (#89891#) and reset them
- // for the footnote
- xListBlock = rHelper.GetListBlock();
- xListItem = rHelper.GetListItem();
- rHelper.SetListBlock( NULL );
- rHelper.SetListItem( NULL );
-
- // remember footnote (for CreateChildContext)
- Reference<XFootnote> xNote(xTextContent, UNO_QUERY);
- xFootnote = xNote;
- }
- // else: ignore footnote! Content will be merged into document.
-}
-
-void XMLFootnoteImportContext::Characters(
- const OUString& rString)
-{
- // ignore characters! Text must be contained in paragraphs!
- // rHelper.InsertString(rString);
-}
-
-void XMLFootnoteImportContext::EndElement()
-{
- // get rid of last dummy paragraph
- rHelper.DeleteParagraph();
-
- // reinstall old cursor
- rHelper.SetCursor(xOldCursor);
-
- // reinstall old list item
- rHelper.SetListBlock( (XMLTextListBlockContext*)&xListBlock );
- rHelper.SetListItem( (XMLTextListItemContext*)&xListItem );
-}
-
-
-SvXMLImportContext *XMLFootnoteImportContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
-
- SvXMLTokenMap aTokenMap(aFootnoteChildTokenMap);
-
- switch(aTokenMap.Get(nPrefix, rLocalName))
- {
- case XML_TOK_FTN_FOOTNOTE_CITATION:
- case XML_TOK_FTN_ENDNOTE_CITATION:
- {
- // little hack: we only care for one attribute of the citation
- // element. We handle that here, and then return a
- // default context.
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
-
- if ( (nPrefix == XML_NAMESPACE_TEXT) &&
- IsXMLToken( sLocalName, XML_LABEL ) )
- {
- xFootnote->setLabel(xAttrList->getValueByIndex(nAttr));
- }
- }
-
- // ignore content: return default context
- pContext = new SvXMLImportContext(GetImport(),
- nPrefix, rLocalName);
- break;
- }
-
- case XML_TOK_FTN_FOOTNOTE_BODY:
- case XML_TOK_FTN_ENDNOTE_BODY:
- // return footnote body
- pContext = new XMLFootnoteBodyImportContext(GetImport(),
- nPrefix, rLocalName);
- break;
- default:
- // default:
- pContext = SvXMLImportContext::CreateChildContext(nPrefix,
- rLocalName,
- xAttrList);
- break;
- }
-
- return pContext;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexAlphabeticalSourceContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexAlphabeticalSourceContext.cxx
deleted file mode 100644
index 27a27e506207..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexAlphabeticalSourceContext.cxx
+++ /dev/null
@@ -1,274 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLIndexAlphabeticalSourceContext.hxx"
-
-
-
-#include "XMLIndexTemplateContext.hxx"
-
-
-
-
-
-
-#include "xmlnmspe.hxx"
-
-
-
-#include "xmluconv.hxx"
-
-
-namespace binfilter {
-
-
-
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_ALPHABETICAL_INDEX_ENTRY_TEMPLATE;
-using ::binfilter::xmloff::token::XML_OUTLINE_LEVEL;
-
-const sal_Char sAPI_MainEntryCharacterStyleName[] = "MainEntryCharacterStyleName";
-const sal_Char sAPI_UseAlphabeticalSeparators[] = "UseAlphabeticalSeparators";
-const sal_Char sAPI_UseCombinedEntries[] = "UseCombinedEntries";
-const sal_Char sAPI_IsCaseSensitive[] = "IsCaseSensitive";
-const sal_Char sAPI_UseKeyAsEntry[] = "UseKeyAsEntry";
-const sal_Char sAPI_UseUpperCase[] = "UseUpperCase";
-const sal_Char sAPI_UseDash[] = "UseDash";
-const sal_Char sAPI_UsePP[] = "UsePP";
-const sal_Char sAPI_SortAlgorithm[] = "SortAlgorithm";
-const sal_Char sAPI_Locale[] = "Locale";
-
-
-TYPEINIT1( XMLIndexAlphabeticalSourceContext, XMLIndexSourceBaseContext );
-
-XMLIndexAlphabeticalSourceContext::XMLIndexAlphabeticalSourceContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- Reference<XPropertySet> & rPropSet) :
- XMLIndexSourceBaseContext(rImport, nPrfx, rLocalName,
- rPropSet, sal_False),
- sMainEntryStyleName(),
- bMainEntryStyleNameOK(sal_False),
- bSeparators(sal_False),
- bCombineEntries(sal_True),
- bCaseSensitive(sal_True),
- bEntry(sal_False),
- bUpperCase(sal_False),
- bCombineDash(sal_False),
- bCombinePP(sal_True),
- bCommaSeparated(sal_False),
- sMainEntryCharacterStyleName(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_MainEntryCharacterStyleName)),
- sUseAlphabeticalSeparators(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_UseAlphabeticalSeparators)),
- sUseCombinedEntries(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_UseCombinedEntries)),
- sIsCaseSensitive(RTL_CONSTASCII_USTRINGPARAM(sAPI_IsCaseSensitive)),
- sUseKeyAsEntry(RTL_CONSTASCII_USTRINGPARAM(sAPI_UseKeyAsEntry)),
- sUseUpperCase(RTL_CONSTASCII_USTRINGPARAM(sAPI_UseUpperCase)),
- sUseDash(RTL_CONSTASCII_USTRINGPARAM(sAPI_UseDash)),
- sUsePP(RTL_CONSTASCII_USTRINGPARAM(sAPI_UsePP)),
- sSortAlgorithm(RTL_CONSTASCII_USTRINGPARAM(sAPI_SortAlgorithm)),
- sLocale(RTL_CONSTASCII_USTRINGPARAM(sAPI_Locale)),
- sIsCommaSeparated(RTL_CONSTASCII_USTRINGPARAM("IsCommaSeparated"))
-{
-}
-
-XMLIndexAlphabeticalSourceContext::~XMLIndexAlphabeticalSourceContext()
-{
-}
-
-void XMLIndexAlphabeticalSourceContext::ProcessAttribute(
- enum IndexSourceParamEnum eParam,
- const OUString& rValue)
-{
- sal_Bool bTmp;
-
- switch (eParam)
- {
- case XML_TOK_INDEXSOURCE_MAIN_ENTRY_STYLE:
- sMainEntryStyleName = rValue;
- bMainEntryStyleNameOK = sal_True;
- break;
-
- case XML_TOK_INDEXSOURCE_IGNORE_CASE:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bCaseSensitive = !bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_SEPARATORS:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bSeparators = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_COMBINE_ENTRIES:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bCombineEntries = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_COMBINE_WITH_DASH:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bCombineDash = bTmp;
- }
- break;
- case XML_TOK_INDEXSOURCE_KEYS_AS_ENTRIES:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bEntry = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_COMBINE_WITH_PP:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bCombinePP = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_CAPITALIZE:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bUpperCase = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_COMMA_SEPARATED:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bCommaSeparated = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_SORT_ALGORITHM:
- sAlgorithm = rValue;
- break;
- case XML_TOK_INDEXSOURCE_LANGUAGE:
- aLocale.Language = rValue;
- break;
- case XML_TOK_INDEXSOURCE_COUNTRY:
- aLocale.Country = rValue;
- break;
-
- default:
- XMLIndexSourceBaseContext::ProcessAttribute(eParam, rValue);
- break;
- }
-}
-
-void XMLIndexAlphabeticalSourceContext::EndElement()
-{
-
- Any aAny;
-
- if (bMainEntryStyleNameOK)
- {
- aAny <<= sMainEntryStyleName;
- rIndexPropertySet->setPropertyValue(sMainEntryCharacterStyleName,aAny);
- }
-
- aAny.setValue(&bSeparators, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sUseAlphabeticalSeparators, aAny);
-
- aAny.setValue(&bCombineEntries, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sUseCombinedEntries, aAny);
-
- aAny.setValue(&bCaseSensitive, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sIsCaseSensitive, aAny);
-
- aAny.setValue(&bEntry, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sUseKeyAsEntry, aAny);
-
- aAny.setValue(&bUpperCase, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sUseUpperCase, aAny);
-
- aAny.setValue(&bCombineDash, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sUseDash, aAny);
-
- aAny.setValue(&bCombinePP, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sUsePP, aAny);
-
- aAny.setValue(&bCommaSeparated, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sIsCommaSeparated, aAny);
-
-
- if (sAlgorithm.getLength() > 0)
- {
- aAny <<= sAlgorithm;
- rIndexPropertySet->setPropertyValue(sSortAlgorithm, aAny);
- }
-
- if ( (aLocale.Language.getLength() > 0) &&
- (aLocale.Country.getLength() > 0) )
- {
- aAny <<= aLocale;
- rIndexPropertySet->setPropertyValue(sLocale, aAny);
- }
-
- XMLIndexSourceBaseContext::EndElement();
-}
-
-SvXMLImportContext* XMLIndexAlphabeticalSourceContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- if ( (XML_NAMESPACE_TEXT == nPrefix) &&
- IsXMLToken( rLocalName, XML_ALPHABETICAL_INDEX_ENTRY_TEMPLATE ) )
- {
- return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet,
- nPrefix, rLocalName,
- aLevelNameAlphaMap,
- XML_OUTLINE_LEVEL,
- aLevelStylePropNameAlphaMap,
- aAllowedTokenTypesAlpha);
- }
- else
- {
- return XMLIndexSourceBaseContext::CreateChildContext(nPrefix,
- rLocalName,
- xAttrList);
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexBibliographyConfigurationContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexBibliographyConfigurationContext.cxx
deleted file mode 100644
index 2f4d081c2a9d..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexBibliographyConfigurationContext.cxx
+++ /dev/null
@@ -1,305 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLIndexBibliographyConfigurationContext.hxx"
-
-#include "XMLIndexBibliographyEntryContext.hxx"
-
-
-#include "xmlimp.hxx"
-
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "xmluconv.hxx"
-
-
-
-
-namespace binfilter {
-
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::uno;
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::lang::XMultiServiceFactory;
-
-const sal_Char sAPI_FieldMaster_Bibliography[] =
- "com.sun.star.text.FieldMaster.Bibliography";
-
-
-TYPEINIT1( XMLIndexBibliographyConfigurationContext, SvXMLStyleContext );
-
-XMLIndexBibliographyConfigurationContext::XMLIndexBibliographyConfigurationContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList) :
- SvXMLStyleContext(rImport, nPrfx, rLocalName, xAttrList, XML_STYLE_FAMILY_TEXT_BIBLIOGRAPHYCONFIG),
- sFieldMaster_Bibliography(
- RTL_CONSTASCII_USTRINGPARAM(sAPI_FieldMaster_Bibliography)),
- sBracketBefore(RTL_CONSTASCII_USTRINGPARAM("BracketBefore")),
- sBracketAfter(RTL_CONSTASCII_USTRINGPARAM("BracketAfter")),
- sIsNumberEntries(RTL_CONSTASCII_USTRINGPARAM("IsNumberEntries")),
- sIsSortByPosition(RTL_CONSTASCII_USTRINGPARAM("IsSortByPosition")),
- sSortKeys(RTL_CONSTASCII_USTRINGPARAM("SortKeys")),
- sSortKey(RTL_CONSTASCII_USTRINGPARAM("SortKey")),
- sIsSortAscending(RTL_CONSTASCII_USTRINGPARAM("IsSortAscending")),
- sSortAlgorithm(RTL_CONSTASCII_USTRINGPARAM("SortAlgorithm")),
- sLocale(RTL_CONSTASCII_USTRINGPARAM("Locale")),
- sSuffix(),
- sPrefix(),
- sAlgorithm(),
- aLocale(),
- bNumberedEntries(sal_False),
- bSortByPosition(sal_True)
-{
-}
-
-XMLIndexBibliographyConfigurationContext::~XMLIndexBibliographyConfigurationContext()
-{
-}
-
-void XMLIndexBibliographyConfigurationContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
-
- ProcessAttribute(nPrefix, sLocalName,
- xAttrList->getValueByIndex(nAttr));
- // else: ignore
- }
-}
-
-void XMLIndexBibliographyConfigurationContext::ProcessAttribute(
- sal_uInt16 nPrefix,
- OUString sLocalName,
- OUString sValue)
-{
- if( XML_NAMESPACE_TEXT == nPrefix )
- {
- if( IsXMLToken(sLocalName, XML_PREFIX) )
- {
- sPrefix = sValue;
- }
- else if( IsXMLToken(sLocalName, XML_SUFFIX) )
- {
- sSuffix = sValue;
- }
- else if( IsXMLToken(sLocalName, XML_NUMBERED_ENTRIES) )
- {
- sal_Bool bTmp;
- if( SvXMLUnitConverter::convertBool(bTmp, sValue) )
- {
- bNumberedEntries = bTmp;
- }
- }
- else if( IsXMLToken(sLocalName, XML_SORT_BY_POSITION) )
- {
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(bTmp, sValue))
- {
- bSortByPosition = bTmp;
- }
- }
- else if( IsXMLToken(sLocalName, XML_SORT_ALGORITHM) )
- {
- sAlgorithm = sValue;
- }
- }
- else if( XML_NAMESPACE_FO == nPrefix )
- {
- if( IsXMLToken(sLocalName, XML_LANGUAGE) )
- {
- aLocale.Language = sValue;
- }
- else if( IsXMLToken(sLocalName, XML_COUNTRY) )
- {
- aLocale.Country = sValue;
- }
- }
-}
-
-
-SvXMLImportContext *XMLIndexBibliographyConfigurationContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- OUString sKey;
- sal_Bool bSort(sal_True);
-
- // process children here and use default context!
- if ( ( nPrefix == XML_NAMESPACE_TEXT ) &&
- IsXMLToken( rLocalName, XML_SORT_KEY ) )
- {
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrfx = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
-
- if (nPrfx == XML_NAMESPACE_TEXT)
- {
- if ( IsXMLToken( sLocalName, XML_KEY ) )
- {
- sKey = xAttrList->getValueByIndex(nAttr);
- }
- else if ( IsXMLToken( sLocalName, XML_SORT_ASCENDING ) )
- {
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(
- bTmp, xAttrList->getValueByIndex(nAttr)))
- {
- bSort = bTmp;
- }
- }
- }
- }
-
- // valid data?
- sal_uInt16 nKey;
- if (SvXMLUnitConverter::convertEnum(nKey, sKey,
- aBibliographyDataFieldMap))
- {
-
- Any aAny;
- Sequence<PropertyValue> aKey(2);
-
- PropertyValue aNameValue;
- aNameValue.Name = sSortKey;
- aAny <<= (sal_Int16)nKey;
- aNameValue.Value = aAny;
- aKey[0] = aNameValue;
-
- PropertyValue aSortValue;
- aSortValue.Name = sIsSortAscending;
- aAny.setValue(&bSort, ::getBooleanCppuType());
- aSortValue.Value = aAny;
- aKey[1] = aSortValue;
-
- aSortKeys.push_back(aKey);
- }
- }
-
- return SvXMLImportContext::CreateChildContext(nPrefix, rLocalName,
- xAttrList);
-}
-
-void XMLIndexBibliographyConfigurationContext::CreateAndInsert(
- sal_Bool bOverwrite)
-{
- // (code almost the same as export...)
-
- // insert and block mode is handled in insertStyleFamily
-
- // first: get field master
- // (we'll create one, and get the only master for this type)
- Reference<XMultiServiceFactory> xFactory(GetImport().GetModel(),UNO_QUERY);
- if( xFactory.is() )
- {
- Sequence<rtl::OUString> aServices = xFactory->getAvailableServiceNames();
- sal_Bool bFound(sal_False);
- sal_Int32 i(0);
- sal_Int32 nCount(aServices.getLength());
- while (i < nCount && !bFound)
- {
- if (aServices[i].equals(sFieldMaster_Bibliography))
- // here we should use a methode which compares in reverse order if available
- // #85282#
- bFound = sal_True;
- else
- i++;
- }
- if (bFound)
- {
- Reference<XInterface> xIfc =
- xFactory->createInstance(sFieldMaster_Bibliography);
- if( xIfc.is() )
- {
- Reference<XPropertySet> xPropSet( xIfc, UNO_QUERY );
- Any aAny;
-
- aAny <<= sSuffix;
- xPropSet->setPropertyValue(sBracketAfter, aAny);
-
- aAny <<= sPrefix;
- xPropSet->setPropertyValue(sBracketBefore, aAny);
-
- aAny.setValue(&bNumberedEntries, ::getBooleanCppuType());
- xPropSet->setPropertyValue(sIsNumberEntries, aAny);
-
- aAny.setValue(&bSortByPosition, ::getBooleanCppuType());
- xPropSet->setPropertyValue(sIsSortByPosition, aAny);
-
- if( (aLocale.Language.getLength() > 0) &&
- (aLocale.Country.getLength() > 0) )
- {
- aAny <<= aLocale;
- xPropSet->setPropertyValue(sLocale, aAny);
- }
-
- if( sAlgorithm.getLength() > 0 )
- {
- aAny <<= sAlgorithm;
- xPropSet->setPropertyValue(sSortAlgorithm, aAny);
- }
-
- sal_Int32 nCount = aSortKeys.size();
- Sequence<Sequence<PropertyValue> > aKeysSeq(nCount);
- for(sal_Int32 i = 0; i < nCount; i++)
- {
- aKeysSeq[i] = aSortKeys[i];
- }
- aAny <<= aKeysSeq;
- xPropSet->setPropertyValue(sSortKeys, aAny);
- }
- // else: can't get FieldMaster -> ignore
- }
- }
- // else: can't even get Factory -> ignore
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexBibliographyEntryContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexBibliographyEntryContext.cxx
deleted file mode 100644
index 125d7a5c7c58..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexBibliographyEntryContext.cxx
+++ /dev/null
@@ -1,189 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLIndexBibliographyEntryContext.hxx"
-
-#include "XMLIndexTemplateContext.hxx"
-
-
-#include "xmlimp.hxx"
-
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "xmluconv.hxx"
-
-#include <com/sun/star/text/BibliographyDataField.hpp>
-namespace binfilter {
-
-
-using namespace ::com::sun::star::text;
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::beans::PropertyValues;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::xml::sax::XAttributeList;
-
-
-const sal_Char sAPI_TokenType[] = "TokenType";
-const sal_Char sAPI_CharacterStyleName[] = "CharacterStyleName";
-
-TYPEINIT1( XMLIndexBibliographyEntryContext, XMLIndexSimpleEntryContext);
-
-XMLIndexBibliographyEntryContext::XMLIndexBibliographyEntryContext(
- SvXMLImport& rImport,
- XMLIndexTemplateContext& rTemplate,
- sal_uInt16 nPrfx,
- const OUString& rLocalName ) :
- XMLIndexSimpleEntryContext(rImport,
- rTemplate.sTokenBibliographyDataField,
- rTemplate,
- nPrfx, rLocalName),
- nBibliographyInfo(BibliographyDataField::IDENTIFIER),
- bBibliographyInfoOK(sal_False)
-{
-}
-
-XMLIndexBibliographyEntryContext::~XMLIndexBibliographyEntryContext()
-{
-}
-
-const SvXMLEnumMapEntry aBibliographyDataFieldMap[] =
-{
- { XML_ADDRESS, BibliographyDataField::ADDRESS },
- { XML_ANNOTE, BibliographyDataField::ANNOTE },
- { XML_AUTHOR, BibliographyDataField::AUTHOR },
- { XML_BIBLIOGRAPHY_TYPE, BibliographyDataField::BIBILIOGRAPHIC_TYPE },
- // #96658#: also read old documents (bib*i*liographic...)
- { XML_BIBILIOGRAPHIC_TYPE, BibliographyDataField::BIBILIOGRAPHIC_TYPE },
- { XML_BOOKTITLE, BibliographyDataField::BOOKTITLE },
- { XML_CHAPTER, BibliographyDataField::CHAPTER },
- { XML_CUSTOM1, BibliographyDataField::CUSTOM1 },
- { XML_CUSTOM2, BibliographyDataField::CUSTOM2 },
- { XML_CUSTOM3, BibliographyDataField::CUSTOM3 },
- { XML_CUSTOM4, BibliographyDataField::CUSTOM4 },
- { XML_CUSTOM5, BibliographyDataField::CUSTOM5 },
- { XML_EDITION, BibliographyDataField::EDITION },
- { XML_EDITOR, BibliographyDataField::EDITOR },
- { XML_HOWPUBLISHED, BibliographyDataField::HOWPUBLISHED },
- { XML_IDENTIFIER, BibliographyDataField::IDENTIFIER },
- { XML_INSTITUTION, BibliographyDataField::INSTITUTION },
- { XML_ISBN, BibliographyDataField::ISBN },
- { XML_JOURNAL, BibliographyDataField::JOURNAL },
- { XML_MONTH, BibliographyDataField::MONTH },
- { XML_NOTE, BibliographyDataField::NOTE },
- { XML_NUMBER, BibliographyDataField::NUMBER },
- { XML_ORGANIZATIONS, BibliographyDataField::ORGANIZATIONS },
- { XML_PAGES, BibliographyDataField::PAGES },
- { XML_PUBLISHER, BibliographyDataField::PUBLISHER },
- { XML_REPORT_TYPE, BibliographyDataField::REPORT_TYPE },
- { XML_SCHOOL, BibliographyDataField::SCHOOL },
- { XML_SERIES, BibliographyDataField::SERIES },
- { XML_TITLE, BibliographyDataField::TITLE },
- { XML_URL, BibliographyDataField::URL },
- { XML_VOLUME, BibliographyDataField::VOLUME },
- { XML_YEAR, BibliographyDataField::YEAR },
- { XML_TOKEN_INVALID, 0 }
-};
-
-void XMLIndexBibliographyEntryContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- // handle both, style name and bibliography info
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
- if (XML_NAMESPACE_TEXT == nPrefix)
- {
- if ( IsXMLToken( sLocalName, XML_STYLE_NAME ) )
- {
- sCharStyleName = xAttrList->getValueByIndex(nAttr);
- bCharStyleNameOK = sal_True;
- }
- else if ( IsXMLToken( sLocalName, XML_BIBLIOGRAPHY_DATA_FIELD ) )
- {
- sal_uInt16 nTmp;
- if (SvXMLUnitConverter::convertEnum(
- nTmp, xAttrList->getValueByIndex(nAttr),
- aBibliographyDataFieldMap))
- {
- nBibliographyInfo = nTmp;
- bBibliographyInfoOK = sal_True;
- }
- }
- }
- }
-
- // if we have a style name, set it!
- if (bCharStyleNameOK)
- {
- nValues++;
- }
-
- // always bibliography; else element is not valid
- nValues++;
-}
-
-void XMLIndexBibliographyEntryContext::EndElement()
-{
- // only valid, if we have bibliography info
- if (bBibliographyInfoOK)
- {
- XMLIndexSimpleEntryContext::EndElement();
- }
-}
-
-void XMLIndexBibliographyEntryContext::FillPropertyValues(
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::beans::PropertyValue> & rValues)
-{
- // entry name and (optionally) style name in parent class
- XMLIndexSimpleEntryContext::FillPropertyValues(rValues);
-
- // bibliography data field
- sal_Int32 nIndex = bCharStyleNameOK ? 2 : 1;
- rValues[nIndex].Name = rTemplateContext.sBibliographyDataField;
- Any aAny;
- aAny <<= nBibliographyInfo;
- rValues[nIndex].Value = aAny;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexBibliographySourceContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexBibliographySourceContext.cxx
deleted file mode 100644
index 27038b267890..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexBibliographySourceContext.cxx
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLIndexBibliographySourceContext.hxx"
-
-
-
-#include "XMLIndexTemplateContext.hxx"
-
-
-
-
-
-
-#include "xmlnmspe.hxx"
-
-
-
-
-
-namespace binfilter {
-
-
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::xml::sax::XAttributeList;
-
-
-TYPEINIT1(XMLIndexBibliographySourceContext, XMLIndexSourceBaseContext);
-
-
-XMLIndexBibliographySourceContext::XMLIndexBibliographySourceContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- Reference<XPropertySet> & rPropSet) :
- XMLIndexSourceBaseContext(rImport, nPrfx, rLocalName,
- rPropSet, sal_False)
-{
-}
-
-XMLIndexBibliographySourceContext::~XMLIndexBibliographySourceContext()
-{
-}
-
-void XMLIndexBibliographySourceContext::ProcessAttribute(
- enum IndexSourceParamEnum eParam,
- const OUString& rValue)
-{
- // We have no attributes. Who wants attributes, anyway?
-}
-
-
-void XMLIndexBibliographySourceContext::EndElement()
-{
- // No attributes, no properties.
-}
-
-
-SvXMLImportContext* XMLIndexBibliographySourceContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- if ( ( XML_NAMESPACE_TEXT == nPrefix ) &&
- ( IsXMLToken( rLocalName, XML_BIBLIOGRAPHY_ENTRY_TEMPLATE ) ) )
- {
- return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet,
- nPrefix, rLocalName,
- aLevelNameBibliographyMap,
- XML_BIBLIOGRAPHY_TYPE,
- aLevelStylePropNameBibliographyMap,
- aAllowedTokenTypesBibliography);
- }
- else
- {
- return XMLIndexSourceBaseContext::CreateChildContext(nPrefix,
- rLocalName,
- xAttrList);
- }
-
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexBodyContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexBodyContext.cxx
deleted file mode 100644
index 659b343b4b99..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexBodyContext.cxx
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLIndexBodyContext.hxx"
-
-
-#include "xmlimp.hxx"
-
-
-
-namespace binfilter {
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::xml::sax::XAttributeList;
-
-
-TYPEINIT1( XMLIndexBodyContext, SvXMLImportContext);
-
-XMLIndexBodyContext::XMLIndexBodyContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& rLocalName ) :
- SvXMLImportContext(rImport, nPrfx, rLocalName),
- bHasContent(sal_False)
-{
-}
-
-XMLIndexBodyContext::~XMLIndexBodyContext()
-{
-}
-
-SvXMLImportContext* XMLIndexBodyContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList)
-{
- SvXMLImportContext* pContext = NULL;
-
- // return text content (if possible)
- pContext = GetImport().GetTextImport()->CreateTextChildContext(
- GetImport(), nPrefix, rLocalName, xAttrList, XML_TEXT_TYPE_SECTION );
- if (NULL == pContext)
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
- else
- bHasContent = sal_True;
-
- return pContext;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexChapterInfoEntryContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexChapterInfoEntryContext.cxx
deleted file mode 100644
index 95756169263a..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexChapterInfoEntryContext.cxx
+++ /dev/null
@@ -1,152 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLIndexChapterInfoEntryContext.hxx"
-
-#include "XMLIndexTemplateContext.hxx"
-
-
-#include "xmlimp.hxx"
-
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "xmluconv.hxx"
-
-#include <com/sun/star/text/ChapterFormat.hpp>
-namespace binfilter {
-
-
-using namespace ::com::sun::star::text;
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::beans::PropertyValues;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::xml::sax::XAttributeList;
-
-
-
-TYPEINIT1( XMLIndexChapterInfoEntryContext, XMLIndexSimpleEntryContext);
-
-XMLIndexChapterInfoEntryContext::XMLIndexChapterInfoEntryContext(
- SvXMLImport& rImport,
- XMLIndexTemplateContext& rTemplate,
- sal_uInt16 nPrfx,
- const OUString& rLocalName ) :
- XMLIndexSimpleEntryContext(rImport, rTemplate.sTokenChapterInfo,
- rTemplate, nPrfx, rLocalName),
- nChapterInfo(ChapterFormat::NAME_NUMBER),
- bChapterInfoOK(sal_False)
-{
-}
-
-XMLIndexChapterInfoEntryContext::~XMLIndexChapterInfoEntryContext()
-{
-}
-
-static const SvXMLEnumMapEntry aChapterDisplayMap[] =
-{
- { XML_NAME, ChapterFormat::NAME },
- { XML_NUMBER, ChapterFormat::NUMBER },
- { XML_NUMBER_AND_NAME, ChapterFormat::NAME_NUMBER },
-// not supported by the template:
-// { XML_PLAIN_NUMBER_AND_NAME, ChapterFormat::NO_PREFIX_SUFFIX },
-// { XML_PLAIN_NUMBER, ChapterFormat::DIGIT },
- { XML_TOKEN_INVALID, 0 }
-};
-
-void XMLIndexChapterInfoEntryContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- // handle both, style name and bibliography info
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
- if (XML_NAMESPACE_TEXT == nPrefix)
- {
- if ( IsXMLToken( sLocalName, XML_STYLE_NAME ) )
- {
- sCharStyleName = xAttrList->getValueByIndex(nAttr);
- bCharStyleNameOK = sal_True;
- }
- else if ( IsXMLToken( sLocalName, XML_DISPLAY ) )
- {
- sal_uInt16 nTmp;
- if (SvXMLUnitConverter::convertEnum(
- nTmp, xAttrList->getValueByIndex(nAttr),
- aChapterDisplayMap))
- {
- nChapterInfo = nTmp;
- bChapterInfoOK = sal_True;
- }
- }
- }
- }
-
- // if we have a style name, set it!
- if (bCharStyleNameOK)
- {
- nValues++;
- }
-
- // if we have chaper info, set it!
- if (bChapterInfoOK)
- {
- nValues++;
- }
-}
-
-void XMLIndexChapterInfoEntryContext::FillPropertyValues(
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::beans::PropertyValue> & rValues)
-{
- // entry name and (optionally) style name in parent class
- XMLIndexSimpleEntryContext::FillPropertyValues(rValues);
-
- // chapter info field
- sal_Int32 nIndex = bCharStyleNameOK ? 2 : 1;
- rValues[nIndex].Name = rTemplateContext.sChapterFormat;
- Any aAny;
- aAny <<= nChapterInfo;
- rValues[nIndex].Value = aAny;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexIllustrationSourceContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexIllustrationSourceContext.cxx
deleted file mode 100644
index 827e2b4b44ba..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexIllustrationSourceContext.cxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLIndexIllustrationSourceContext.hxx"
-
-
-#include "XMLIndexTemplateContext.hxx"
-
-
-
-
-#include "xmlnmspe.hxx"
-
-
-
-
-
-namespace binfilter {
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_ILLUSTRATION_INDEX_ENTRY_TEMPLATE;
-using ::binfilter::xmloff::token::XML_TOKEN_INVALID;
-
-TYPEINIT1(XMLIndexIllustrationSourceContext, XMLIndexTableSourceContext);
-
-
-XMLIndexIllustrationSourceContext::XMLIndexIllustrationSourceContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- Reference<XPropertySet> & rPropSet) :
- XMLIndexTableSourceContext(rImport, nPrfx, rLocalName, rPropSet)
-{
-}
-
-XMLIndexIllustrationSourceContext::~XMLIndexIllustrationSourceContext()
-{
-}
-
-SvXMLImportContext* XMLIndexIllustrationSourceContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- if ( ( XML_NAMESPACE_TEXT == nPrefix ) &&
- ( IsXMLToken( rLocalName, XML_ILLUSTRATION_INDEX_ENTRY_TEMPLATE ) ) )
- {
- return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet,
- nPrefix, rLocalName,
- aLevelNameTableMap,
- XML_TOKEN_INVALID, // no outline-level attr
- aLevelStylePropNameTableMap,
- aAllowedTokenTypesTable);
- }
- else
- {
- return XMLIndexSourceBaseContext::CreateChildContext(nPrefix,
- rLocalName,
- xAttrList);
- }
-
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexMarkExport.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexMarkExport.cxx
deleted file mode 100644
index 367b2ee89749..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexMarkExport.cxx
+++ /dev/null
@@ -1,275 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLIndexMarkExport.hxx"
-
-#include <tools/debug.hxx>
-
-
-
-
-
-
-#include "xmlnmspe.hxx"
-
-#include "xmlexp.hxx"
-
-#include "xmluconv.hxx"
-namespace binfilter {
-
-
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::beans::XPropertySetInfo;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Any;
-
-
-
-XMLIndexMarkExport::XMLIndexMarkExport(
- SvXMLExport& rExp,
- XMLTextParagraphExport& rParaExp) :
- rExport(rExp),
- rParaExport(rParaExp),
- sLevel(RTL_CONSTASCII_USTRINGPARAM("Level")),
- sUserIndexName(RTL_CONSTASCII_USTRINGPARAM("UserIndexName")),
- sPrimaryKey(RTL_CONSTASCII_USTRINGPARAM("PrimaryKey")),
- sSecondaryKey(RTL_CONSTASCII_USTRINGPARAM("SecondaryKey")),
- sDocumentIndexMark(RTL_CONSTASCII_USTRINGPARAM("DocumentIndexMark")),
- sIsStart(RTL_CONSTASCII_USTRINGPARAM("IsStart")),
- sIsCollapsed(RTL_CONSTASCII_USTRINGPARAM("IsCollapsed")),
- sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText")),
- sTextReading(RTL_CONSTASCII_USTRINGPARAM("TextReading")),
- sPrimaryKeyReading(RTL_CONSTASCII_USTRINGPARAM("PrimaryKeyReading")),
- sSecondaryKeyReading(RTL_CONSTASCII_USTRINGPARAM
- ("SecondaryKeyReading")),
- sMainEntry(RTL_CONSTASCII_USTRINGPARAM("IsMainEntry"))
-{
-}
-
-const enum XMLTokenEnum lcl_pTocMarkNames[] =
- { XML_TOC_MARK, XML_TOC_MARK_START, XML_TOC_MARK_END };
-const enum XMLTokenEnum lcl_pUserIndexMarkName[] =
- { XML_USER_INDEX_MARK,
- XML_USER_INDEX_MARK_START, XML_USER_INDEX_MARK_END };
-const enum XMLTokenEnum lcl_pAlphaIndexMarkName[] =
- { XML_ALPHABETICAL_INDEX_MARK,
- XML_ALPHABETICAL_INDEX_MARK_START,
- XML_ALPHABETICAL_INDEX_MARK_END };
-
-
-XMLIndexMarkExport::~XMLIndexMarkExport()
-{
-}
-
-void XMLIndexMarkExport::ExportIndexMark(
- const Reference<XPropertySet> & rPropSet,
- sal_Bool bAutoStyles)
-{
- /// index marks have no styles!
- if (!bAutoStyles)
- {
- const enum XMLTokenEnum * pElements = NULL;
- sal_Int8 nElementNo = -1;
-
- // get index mark
- Any aAny;
- aAny = rPropSet->getPropertyValue(sDocumentIndexMark);
- Reference<XPropertySet> xIndexMarkPropSet;
- aAny >>= xIndexMarkPropSet;
-
- // common: handling of start, end, collapsed entries and
- // alternative text
-
- // collapsed/alternative text entry?
- aAny = rPropSet->getPropertyValue(sIsCollapsed);
- if (*(sal_Bool *)aAny.getValue())
- {
- // collapsed entry: needs alternative text
- nElementNo = 0;
-
- aAny = xIndexMarkPropSet->getPropertyValue(sAlternativeText);
- OUString sTmp;
- aAny >>= sTmp;
- DBG_ASSERT(sTmp.getLength() > 0,
- "collapsed index mark without alternative text");
- rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_STRING_VALUE, sTmp);
- }
- else
- {
- // start and end entries: has ID
- aAny = rPropSet->getPropertyValue(sIsStart);
- nElementNo = *(sal_Bool *)aAny.getValue() ? 1 : 2;
-
- // generate ID
- OUStringBuffer sBuf;
- GetID(sBuf, xIndexMarkPropSet);
- rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_ID,
- sBuf.makeStringAndClear());
- }
-
- // distinguish between TOC, user, alphab. index marks by
- // asking for specific properties
- // Export attributes for -mark-start and -mark elements,
- // but not for -mark-end
- Reference<XPropertySetInfo> xPropertySetInfo =
- xIndexMarkPropSet->getPropertySetInfo();
- if (xPropertySetInfo->hasPropertyByName(sUserIndexName))
- {
- // user index mark
- pElements = lcl_pUserIndexMarkName;
- if (nElementNo != 2)
- {
- ExportUserIndexMarkAttributes(xIndexMarkPropSet);
- }
- }
- else if (xPropertySetInfo->hasPropertyByName(sPrimaryKey))
- {
- // alphabetical index mark
- pElements = lcl_pAlphaIndexMarkName;
- if (nElementNo != 2)
- {
- ExportAlphabeticalIndexMarkAttributes(xIndexMarkPropSet);
- }
- }
- else
- {
- // table of content:
- pElements = lcl_pTocMarkNames;
- if (nElementNo != 2)
- {
- ExportTOCMarkAttributes(xIndexMarkPropSet);
- }
- }
-
- // export element
- DBG_ASSERT(pElements != NULL, "illegal element array");
- DBG_ASSERT(nElementNo >= 0, "illegal name array index");
- DBG_ASSERT(nElementNo <= 2, "illegal name array index");
-
- if ((pElements != NULL) && (nElementNo != -1))
- {
- SvXMLElementExport aElem(rExport,
- XML_NAMESPACE_TEXT,
- pElements[nElementNo],
- sal_False, sal_False);
- }
- }
-}
-
-void XMLIndexMarkExport::ExportTOCMarkAttributes(
- const Reference<XPropertySet> & rPropSet)
-{
- // outline level
- sal_Int16 nLevel;
- Any aAny = rPropSet->getPropertyValue(sLevel);
- aAny >>= nLevel;
- OUStringBuffer sBuf;
- SvXMLUnitConverter::convertNumber(sBuf, (sal_Int32)nLevel);
- rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_OUTLINE_LEVEL,
- sBuf.makeStringAndClear());
-}
-
-void lcl_ExportPropertyString( SvXMLExport& rExport,
- const Reference<XPropertySet> & rPropSet,
- const OUString sProperty,
- XMLTokenEnum eToken,
- Any& rAny )
-{
- rAny = rPropSet->getPropertyValue( sProperty );
-
- OUString sValue;
- if( rAny >>= sValue )
- {
- if( sValue.getLength() > 0 )
- {
- rExport.AddAttribute( XML_NAMESPACE_TEXT, eToken, sValue );
- }
- }
-}
-
-void lcl_ExportPropertyBool( SvXMLExport& rExport,
- const Reference<XPropertySet> & rPropSet,
- const OUString sProperty,
- XMLTokenEnum eToken,
- Any& rAny )
-{
- rAny = rPropSet->getPropertyValue( sProperty );
-
- sal_Bool bValue;
- if( rAny >>= bValue )
- {
- if( bValue )
- {
- rExport.AddAttribute( XML_NAMESPACE_TEXT, eToken, XML_TRUE );
- }
- }
-}
-
-void XMLIndexMarkExport::ExportUserIndexMarkAttributes(
- const Reference<XPropertySet> & rPropSet)
-{
- // name of user index
- // (unless it's the default index; then it has no name)
- Any aAny;
- lcl_ExportPropertyString( rExport, rPropSet, sUserIndexName, XML_INDEX_NAME, aAny );
-
- // additionally export outline level; just reuse ExportTOCMarkAttributes
- ExportTOCMarkAttributes( rPropSet );
-}
-
-void XMLIndexMarkExport::ExportAlphabeticalIndexMarkAttributes(
- const Reference<XPropertySet> & rPropSet)
-{
- // primary and secondary keys (if available)
- Any aAny;
- lcl_ExportPropertyString( rExport, rPropSet, sTextReading, XML_STRING_VALUE_PHONETIC, aAny );
- lcl_ExportPropertyString( rExport, rPropSet, sPrimaryKey, XML_KEY1, aAny );
- lcl_ExportPropertyString( rExport, rPropSet, sPrimaryKeyReading, XML_KEY1_PHONETIC, aAny );
- lcl_ExportPropertyString( rExport, rPropSet, sSecondaryKey, XML_KEY2, aAny );
- lcl_ExportPropertyString( rExport, rPropSet, sSecondaryKeyReading, XML_KEY2_PHONETIC, aAny );
- lcl_ExportPropertyBool( rExport, rPropSet, sMainEntry, XML_MAIN_ENTRY, aAny );
-}
-
-void XMLIndexMarkExport::GetID(
- OUStringBuffer& sBuf,
- const Reference<XPropertySet> & rPropSet)
-{
- static const sal_Char sPrefix[] = "IMark";
-
- // HACK: use address of object to form identifier
- sal_Int64 nId = (sal_Int64)rPropSet.get();
- sBuf.appendAscii(sPrefix, sizeof(sPrefix)-1);
- sBuf.append(nId);
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexObjectSourceContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexObjectSourceContext.cxx
deleted file mode 100644
index 7090d2d0fcdf..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexObjectSourceContext.cxx
+++ /dev/null
@@ -1,195 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLIndexObjectSourceContext.hxx"
-
-
-
-#include "XMLIndexTemplateContext.hxx"
-
-
-
-
-
-
-#include "xmlnmspe.hxx"
-
-
-
-#include "xmluconv.hxx"
-
-
-namespace binfilter {
-
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_OBJECT_INDEX_ENTRY_TEMPLATE;
-using ::binfilter::xmloff::token::XML_TOKEN_INVALID;
-
-const sal_Char sAPI_CreateFromStarCalc[] = "CreateFromStarCalc";
-const sal_Char sAPI_CreateFromStarChart[] = "CreateFromStarChart";
-const sal_Char sAPI_CreateFromStarDraw[] = "CreateFromStarDraw";
-const sal_Char sAPI_CreateFromStarImage[] = "CreateFromStarImage";
-const sal_Char sAPI_CreateFromStarMath[] = "CreateFromStarMath";
-const sal_Char sAPI_CreateFromOtherEmbeddedObjects[] = "CreateFromOtherEmbeddedObjects";
-
-
-TYPEINIT1( XMLIndexObjectSourceContext, XMLIndexSourceBaseContext );
-
-XMLIndexObjectSourceContext::XMLIndexObjectSourceContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- Reference<XPropertySet> & rPropSet) :
- XMLIndexSourceBaseContext(rImport, nPrfx, rLocalName,
- rPropSet, sal_False),
- sCreateFromStarCalc(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_CreateFromStarCalc)),
- sCreateFromStarChart(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_CreateFromStarChart)),
- sCreateFromStarDraw(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_CreateFromStarDraw)),
- sCreateFromStarMath(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_CreateFromStarMath)),
- sCreateFromOtherEmbeddedObjects(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_CreateFromOtherEmbeddedObjects)),
- bUseCalc(sal_False),
- bUseChart(sal_False),
- bUseDraw(sal_False),
- bUseMath(sal_False),
- bUseOtherObjects(sal_False)
-{
-}
-
-XMLIndexObjectSourceContext::~XMLIndexObjectSourceContext()
-{
-}
-
-void XMLIndexObjectSourceContext::ProcessAttribute(
- enum IndexSourceParamEnum eParam,
- const OUString& rValue)
-{
- switch (eParam)
- {
- sal_Bool bTmp;
-
- case XML_TOK_INDEXSOURCE_USE_OTHER_OBJECTS:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bUseOtherObjects = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_USE_SHEET:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bUseCalc = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_USE_CHART:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bUseChart = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_USE_DRAW:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bUseDraw = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_USE_MATH:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bUseMath = bTmp;
- }
- break;
-
- default:
- XMLIndexSourceBaseContext::ProcessAttribute(eParam, rValue);
- break;
- }
-}
-
-void XMLIndexObjectSourceContext::EndElement()
-{
- Any aAny;
-
- aAny.setValue(&bUseCalc, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sCreateFromStarCalc, aAny);
-
- aAny.setValue(&bUseChart, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sCreateFromStarChart, aAny);
-
- aAny.setValue(&bUseDraw, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sCreateFromStarDraw, aAny);
-
- aAny.setValue(&bUseMath, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sCreateFromStarMath, aAny);
-
- aAny.setValue(&bUseOtherObjects, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sCreateFromOtherEmbeddedObjects, aAny);
-
- XMLIndexSourceBaseContext::EndElement();
-}
-
-SvXMLImportContext* XMLIndexObjectSourceContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- if ( (XML_NAMESPACE_TEXT == nPrefix) &&
- (IsXMLToken(rLocalName, XML_OBJECT_INDEX_ENTRY_TEMPLATE)) )
- {
- return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet,
- nPrefix, rLocalName,
- aLevelNameTableMap,
- XML_TOKEN_INVALID, // no outline-level attr
- aLevelStylePropNameTableMap,
- aAllowedTokenTypesTable);
- }
- else
- {
- return XMLIndexSourceBaseContext::CreateChildContext(nPrefix,
- rLocalName,
- xAttrList);
- }
-
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexSimpleEntryContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexSimpleEntryContext.cxx
deleted file mode 100644
index dd464482ff56..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexSimpleEntryContext.cxx
+++ /dev/null
@@ -1,143 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLIndexSimpleEntryContext.hxx"
-
-#include "XMLIndexTemplateContext.hxx"
-
-
-#include "xmlimp.hxx"
-
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-namespace binfilter {
-
-
-//using namespace ::com::sun::star::text;
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::beans::PropertyValues;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_STYLE_NAME;
-
-const sal_Char sAPI_TokenType[] = "TokenType";
-const sal_Char sAPI_CharacterStyleName[] = "CharacterStyleName";
-
-TYPEINIT1( XMLIndexSimpleEntryContext, SvXMLImportContext);
-
-XMLIndexSimpleEntryContext::XMLIndexSimpleEntryContext(
- SvXMLImport& rImport,
- const OUString& rEntry,
- XMLIndexTemplateContext& rTemplate,
- sal_uInt16 nPrfx,
- const OUString& rLocalName ) :
- SvXMLImportContext(rImport, nPrfx, rLocalName),
- rTemplateContext(rTemplate),
- rEntryType(rEntry),
- sCharStyleName(),
- bCharStyleNameOK(sal_False),
- nValues(1)
-{
-}
-
-XMLIndexSimpleEntryContext::~XMLIndexSimpleEntryContext()
-{
-}
-
-void XMLIndexSimpleEntryContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- // we know only one attribute: style-name
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
- if ( (XML_NAMESPACE_TEXT == nPrefix) &&
- IsXMLToken(sLocalName, XML_STYLE_NAME) )
- {
- sCharStyleName = xAttrList->getValueByIndex(nAttr);
- bCharStyleNameOK = sal_True;
- }
- }
-
- // if we have a style name, set it!
- if (bCharStyleNameOK)
- {
- nValues++;
- }
-
-}
-
-void XMLIndexSimpleEntryContext::EndElement()
-{
- Sequence<PropertyValue> aValues(nValues);
-
- FillPropertyValues(aValues);
- rTemplateContext.addTemplateEntry(aValues);
-}
-
-void XMLIndexSimpleEntryContext::FillPropertyValues(
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::beans::PropertyValue> & rValues)
-{
- // due to the limited number of subclasses, we fill the values
- // directly into the slots. Subclasses will have to know they can
- // only use slot so-and-so.
-
- Any aAny;
-
- // token type
- rValues[0].Name = rTemplateContext.sTokenType;
- aAny <<= rEntryType;
- rValues[0].Value = aAny;
-
- // char style
- if (bCharStyleNameOK)
- {
- rValues[1].Name = rTemplateContext.sCharacterStyleName;
- aAny <<= sCharStyleName;
- rValues[1].Value = aAny;
- }
-
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexSourceBaseContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexSourceBaseContext.cxx
deleted file mode 100644
index 92c62feddcf6..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexSourceBaseContext.cxx
+++ /dev/null
@@ -1,285 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLIndexSourceBaseContext.hxx"
-
-
-
-
-#include "XMLIndexTitleTemplateContext.hxx"
-
-#include "XMLIndexTOCStylesContext.hxx"
-
-
-#include "xmlimp.hxx"
-
-
-#include "xmlnmspe.hxx"
-
-#include "nmspmap.hxx"
-
-
-#include "xmluconv.hxx"
-
-
-namespace binfilter {
-
-
-
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::xml::sax::XAttributeList;
-
-const sal_Char sAPI_CreateFromChapter[] = "CreateFromChapter";
-const sal_Char sAPI_IsRelativeTabstops[] = "IsRelativeTabstops";
-
-static __FAR_DATA SvXMLTokenMapEntry aIndexSourceTokenMap[] =
-{
- { XML_NAMESPACE_TEXT,
- XML_OUTLINE_LEVEL,
- XML_TOK_INDEXSOURCE_OUTLINE_LEVEL},
- { XML_NAMESPACE_TEXT,
- XML_USE_INDEX_MARKS,
- XML_TOK_INDEXSOURCE_USE_INDEX_MARKS },
- { XML_NAMESPACE_TEXT,
- XML_INDEX_SCOPE,
- XML_TOK_INDEXSOURCE_INDEX_SCOPE },
- { XML_NAMESPACE_TEXT,
- XML_RELATIVE_TAB_STOP_POSITION,
- XML_TOK_INDEXSOURCE_RELATIVE_TABS } ,
- { XML_NAMESPACE_TEXT,
- XML_USE_OTHER_OBJECTS,
- XML_TOK_INDEXSOURCE_USE_OTHER_OBJECTS },
- { XML_NAMESPACE_TEXT,
- XML_USE_SPREADSHEET_OBJECTS,
- XML_TOK_INDEXSOURCE_USE_SHEET },
- { XML_NAMESPACE_TEXT,
- XML_USE_CHART_OBJECTS,
- XML_TOK_INDEXSOURCE_USE_CHART },
- { XML_NAMESPACE_TEXT,
- XML_USE_DRAW_OBJECTS,
- XML_TOK_INDEXSOURCE_USE_DRAW },
- { XML_NAMESPACE_TEXT,
- XML_USE_IMAGE_OBJECTS,
- XML_TOK_INDEXSOURCE_USE_IMAGE },
- { XML_NAMESPACE_TEXT,
- XML_USE_MATH_OBJECTS,
- XML_TOK_INDEXSOURCE_USE_MATH },
- { XML_NAMESPACE_TEXT,
- XML_MAIN_ENTRY_STYLE_NAME,
- XML_TOK_INDEXSOURCE_MAIN_ENTRY_STYLE },
- { XML_NAMESPACE_TEXT,
- XML_IGNORE_CASE,
- XML_TOK_INDEXSOURCE_IGNORE_CASE },
- { XML_NAMESPACE_TEXT,
- XML_ALPHABETICAL_SEPARATORS,
- XML_TOK_INDEXSOURCE_SEPARATORS },
- { XML_NAMESPACE_TEXT,
- XML_COMBINE_ENTRIES,
- XML_TOK_INDEXSOURCE_COMBINE_ENTRIES },
- { XML_NAMESPACE_TEXT,
- XML_COMBINE_ENTRIES_WITH_DASH,
- XML_TOK_INDEXSOURCE_COMBINE_WITH_DASH },
- { XML_NAMESPACE_TEXT,
- XML_USE_KEYS_AS_ENTRIES,
- XML_TOK_INDEXSOURCE_KEYS_AS_ENTRIES },
- { XML_NAMESPACE_TEXT,
- XML_COMBINE_ENTRIES_WITH_PP,
- XML_TOK_INDEXSOURCE_COMBINE_WITH_PP },
- { XML_NAMESPACE_TEXT,
- XML_CAPITALIZE_ENTRIES,
- XML_TOK_INDEXSOURCE_CAPITALIZE },
- { XML_NAMESPACE_TEXT,
- XML_USE_OBJECTS,
- XML_TOK_INDEXSOURCE_USE_OBJECTS },
- { XML_NAMESPACE_TEXT,
- XML_USE_GRAPHICS,
- XML_TOK_INDEXSOURCE_USE_GRAPHICS },
- { XML_NAMESPACE_TEXT,
- XML_USE_TABLES,
- XML_TOK_INDEXSOURCE_USE_TABLES },
- { XML_NAMESPACE_TEXT,
- XML_USE_FLOATING_FRAMES,
- XML_TOK_INDEXSOURCE_USE_FRAMES },
- { XML_NAMESPACE_TEXT,
- XML_COPY_OUTLINE_LEVELS,
- XML_TOK_INDEXSOURCE_COPY_OUTLINE_LEVELS },
- { XML_NAMESPACE_TEXT,
- XML_USE_CAPTION,
- XML_TOK_INDEXSOURCE_USE_CAPTION },
- { XML_NAMESPACE_TEXT,
- XML_CAPTION_SEQUENCE_NAME,
- XML_TOK_INDEXSOURCE_SEQUENCE_NAME },
- { XML_NAMESPACE_TEXT,
- XML_CAPTION_SEQUENCE_FORMAT,
- XML_TOK_INDEXSOURCE_SEQUENCE_FORMAT },
- { XML_NAMESPACE_TEXT,
- XML_COMMA_SEPARATED,
- XML_TOK_INDEXSOURCE_COMMA_SEPARATED },
- { XML_NAMESPACE_TEXT,
- XML_USE_INDEX_SOURCE_STYLES,
- XML_TOK_INDEXSOURCE_USE_INDEX_SOURCE_STYLES },
- { XML_NAMESPACE_TEXT, XML_SORT_ALGORITHM,
- XML_TOK_INDEXSOURCE_SORT_ALGORITHM },
- { XML_NAMESPACE_FO, XML_LANGUAGE, XML_TOK_INDEXSOURCE_LANGUAGE },
- { XML_NAMESPACE_FO, XML_COUNTRY, XML_TOK_INDEXSOURCE_COUNTRY },
- { XML_NAMESPACE_TEXT, XML_INDEX_NAME, XML_TOK_INDEXSOURCE_USER_INDEX_NAME },
- { XML_NAMESPACE_TEXT,
- XML_USE_OUTLINE_LEVEL,
- XML_TOK_INDEXSOURCE_USE_OUTLINE_LEVEL},
-
- XML_TOKEN_MAP_END
-};
-
-
-TYPEINIT1( XMLIndexSourceBaseContext, SvXMLImportContext );
-
-XMLIndexSourceBaseContext::XMLIndexSourceBaseContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- Reference<XPropertySet> & rPropSet,
- sal_Bool bLevelFormats) :
- SvXMLImportContext(rImport, nPrfx, rLocalName),
- rIndexPropertySet(rPropSet),
- bChapterIndex(sal_False),
- bRelativeTabs(sal_True),
- bUseLevelFormats(bLevelFormats),
- sCreateFromChapter(RTL_CONSTASCII_USTRINGPARAM(sAPI_CreateFromChapter)),
- sIsRelativeTabstops(RTL_CONSTASCII_USTRINGPARAM(sAPI_IsRelativeTabstops))
-{
-}
-
-XMLIndexSourceBaseContext::~XMLIndexSourceBaseContext()
-{
-}
-
-void XMLIndexSourceBaseContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- SvXMLTokenMap aTokenMap(aIndexSourceTokenMap);
-
- // process attributes
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 i=0; i<nLength; i++)
- {
- // map to IndexSourceParamEnum
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(i), &sLocalName );
- sal_uInt16 nToken = aTokenMap.Get(nPrefix, sLocalName);
-
- // process attribute
- ProcessAttribute((enum IndexSourceParamEnum)nToken,
- xAttrList->getValueByIndex(i));
- }
-}
-
-void XMLIndexSourceBaseContext::ProcessAttribute(
- enum IndexSourceParamEnum eParam,
- const OUString& rValue)
-{
- switch (eParam)
- {
- case XML_TOK_INDEXSOURCE_INDEX_SCOPE:
- if ( IsXMLToken( rValue, XML_CHAPTER ) )
- {
- bChapterIndex = sal_True;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_RELATIVE_TABS:
- {
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bRelativeTabs = bTmp;
- }
- break;
- }
-
- default:
- // unknown attribute -> ignore
- break;
- }
-}
-
-void XMLIndexSourceBaseContext::EndElement()
-{
- Any aAny;
-
- aAny.setValue(&bRelativeTabs, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sIsRelativeTabstops, aAny);
-
- aAny.setValue(&bChapterIndex, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sCreateFromChapter, aAny);
-}
-
-SvXMLImportContext* XMLIndexSourceBaseContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
-
- if (XML_NAMESPACE_TEXT == nPrefix)
- {
- if ( IsXMLToken( rLocalName, XML_INDEX_TITLE_TEMPLATE ) )
- {
- pContext = new XMLIndexTitleTemplateContext(GetImport(),
- rIndexPropertySet,
- nPrefix, rLocalName);
- }
- else if ( bUseLevelFormats &&
- IsXMLToken( rLocalName, XML_INDEX_SOURCE_STYLES ) )
- {
- pContext = new XMLIndexTOCStylesContext(GetImport(),
- rIndexPropertySet,
- nPrefix, rLocalName);
- }
- // else: unknown element in text namespace -> ignore
- }
- // else: unknown namespace -> ignore
-
- // use default context
- if (pContext == NULL)
- {
- pContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName,
- xAttrList);
- }
-
- return pContext;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexSpanEntryContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexSpanEntryContext.cxx
deleted file mode 100644
index 3396e41af1b7..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexSpanEntryContext.cxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLIndexSpanEntryContext.hxx"
-
-#include "rtl/ustring.hxx"
-
-#include "XMLIndexTemplateContext.hxx"
-
-namespace binfilter {
-
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::beans::PropertyValue;
-
-
-TYPEINIT1( XMLIndexSpanEntryContext, XMLIndexSimpleEntryContext);
-
-XMLIndexSpanEntryContext::XMLIndexSpanEntryContext(
- SvXMLImport& rImport,
- XMLIndexTemplateContext& rTemplate,
- sal_uInt16 nPrfx,
- const OUString& rLocalName ) :
- XMLIndexSimpleEntryContext(rImport, rTemplate.sTokenText,
- rTemplate, nPrfx, rLocalName)
-{
- nValues++; // one more for the text string
-}
-
-XMLIndexSpanEntryContext::~XMLIndexSpanEntryContext()
-{
-}
-
-void XMLIndexSpanEntryContext::Characters(const OUString& sString)
-{
- sContent.append(sString);
-}
-
-void XMLIndexSpanEntryContext::FillPropertyValues(
- Sequence<PropertyValue> & rValues)
-{
- // call superclass for token type, stylename,
- XMLIndexSimpleEntryContext::FillPropertyValues(rValues);
-
- // content
- Any aAny;
- aAny <<= sContent.makeStringAndClear();
- rValues[nValues-1].Name = rTemplateContext.sText;
- rValues[nValues-1].Value = aAny;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTOCContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTOCContext.cxx
deleted file mode 100644
index 3e55c745a2b1..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTOCContext.cxx
+++ /dev/null
@@ -1,395 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLIndexTOCContext.hxx"
-
-
-
-
-
-
-#include <com/sun/star/text/XRelativeTextContentInsert.hpp>
-
-
-#include "XMLIndexTOCSourceContext.hxx"
-
-#include "XMLIndexObjectSourceContext.hxx"
-
-#include "XMLIndexAlphabeticalSourceContext.hxx"
-
-#include "XMLIndexUserSourceContext.hxx"
-
-#include "XMLIndexBibliographySourceContext.hxx"
-
-
-#include "XMLIndexIllustrationSourceContext.hxx"
-
-#include "XMLIndexBodyContext.hxx"
-
-
-#include "xmlimp.hxx"
-
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-#include "xmlkywd.hxx"
-
-
-#include "prstylei.hxx"
-
-#include "xmlerror.hxx"
-
-#include "xmluconv.hxx"
-
-
-
-#include <tools/debug.hxx>
-namespace binfilter {
-
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::text;
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::lang::IllegalArgumentException;
-
-
-TYPEINIT1(XMLIndexTOCContext, SvXMLImportContext);
-
-static const sal_Char* aIndexServiceMap[] =
-{
- "com.sun.star.text.ContentIndex",
- "com.sun.star.text.DocumentIndex",
- "com.sun.star.text.TableIndex",
- "com.sun.star.text.ObjectIndex",
- "com.sun.star.text.Bibliography",
- "com.sun.star.text.UserIndex",
- "com.sun.star.text.IllustrationsIndex"
-};
-
-static const sal_Char* aIndexSourceElementMap[] =
-{
- sXML_table_of_content_source,
- sXML_alphabetical_index_source,
- sXML_table_index_source,
- sXML_object_index_source,
- sXML_bibliography_source,
- sXML_user_index_source,
- sXML_illustration_index_source
-};
-
-SvXMLEnumMapEntry __READONLY_DATA aIndexTypeMap[] =
-{
- { XML_TABLE_OF_CONTENT, TEXT_INDEX_TOC },
- { XML_ALPHABETICAL_INDEX, TEXT_INDEX_ALPHABETICAL },
- { XML_TABLE_INDEX, TEXT_INDEX_TABLE },
- { XML_OBJECT_INDEX, TEXT_INDEX_OBJECT },
- { XML_BIBLIOGRAPHY, TEXT_INDEX_BIBLIOGRAPHY },
- { XML_USER_INDEX, TEXT_INDEX_USER },
- { XML_ILLUSTRATION_INDEX, TEXT_INDEX_ILLUSTRATION },
- { XML_TOKEN_INVALID, 0 }
-};
-
-
-XMLIndexTOCContext::XMLIndexTOCContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName ) :
- SvXMLImportContext(rImport, nPrfx, rLocalName),
- pSourceElementName(NULL),
- bValid(sal_False),
- xBodyContextRef(),
- sTitle(RTL_CONSTASCII_USTRINGPARAM("Title")),
- sIsProtected(RTL_CONSTASCII_USTRINGPARAM("IsProtected")),
- sName(RTL_CONSTASCII_USTRINGPARAM("Name"))
-{
- if (XML_NAMESPACE_TEXT == nPrfx)
- {
- sal_uInt16 nTmp;
- if (SvXMLUnitConverter::convertEnum(nTmp, rLocalName, aIndexTypeMap))
- {
- // check for array index:
- DBG_ASSERT(nTmp >= 0, "index too low");
- DBG_ASSERT(nTmp < (sizeof(aIndexServiceMap)/sizeof(sal_Char*)),
- "index too high");
- DBG_ASSERT(sizeof(aIndexServiceMap) ==
- sizeof(aIndexSourceElementMap),
- "service and source element maps must be same size");
-
- eIndexType = (enum IndexTypeEnum)nTmp;
- pSourceElementName = aIndexSourceElementMap[eIndexType];
- bValid = sal_True;
- }
- }
-}
-
-XMLIndexTOCContext::~XMLIndexTOCContext()
-{
-}
-
-void XMLIndexTOCContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- if (bValid)
- {
- // create table of content (via MultiServiceFactory)
- Reference<XMultiServiceFactory> xFactory(GetImport().GetModel(),
- UNO_QUERY);
- if( xFactory.is() )
- {
- Reference<XInterface> xIfc =
- xFactory->createInstance(
- OUString::createFromAscii(aIndexServiceMap[eIndexType]));
- if( xIfc.is() )
- {
- // get Property set
- Reference<XPropertySet> xPropSet(xIfc, UNO_QUERY);
- xTOCPropertySet = xPropSet;
-
- // insert section
- // a) insert section
- // The inserted index consists of an empty paragraph
- // only, as well as an empty paragraph *after* the index
- // b) insert marker after index, and put Cursor inside of the
- // index
-
- // preliminaries
-#ifndef DBG_UTIL
- OUString sMarker(RTL_CONSTASCII_USTRINGPARAM(" "));
-#else
- OUString sMarker(RTL_CONSTASCII_USTRINGPARAM("Y"));
-#endif
- UniReference<XMLTextImportHelper> rImport =
- GetImport().GetTextImport();
-
- // a) insert index
- Reference<XTextContent> xTextContent(xIfc, UNO_QUERY);
- try
- {
- GetImport().GetTextImport()->InsertTextContent(
- xTextContent);
- }
- catch( IllegalArgumentException e )
- {
- // illegal argument? Then we can't accept indices here!
- Sequence<OUString> aSeq(1);
- aSeq[0] = GetLocalName();
- GetImport().SetError(
- XMLERROR_FLAG_ERROR | XMLERROR_NO_INDEX_ALLOWED_HERE,
- aSeq, e.Message, NULL );
-
- // set bValid to false, and return prematurely
- bValid = false;
- return;
- }
-
- // b) insert marker and move cursor
- rImport->InsertString(sMarker);
- rImport->GetCursor()->goLeft(2, sal_False);
- }
- }
-
- // finally, check for redlines that should start at
- // the section start node
- if( bValid )
- GetImport().GetTextImport()->
- RedlineAdjustStartNodeCursor(sal_True);
-
- // find text:style-name attribute and set section style
- // find text:protected and set value
- // find text:name and set value (if not empty)
- sal_Int16 nCount = xAttrList->getLength();
- sal_Bool bProtected = sal_False;
- OUString sIndexName;
- for(sal_Int16 nAttr = 0; nAttr < nCount; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
- if ( XML_NAMESPACE_TEXT == nPrefix)
- {
- if ( IsXMLToken( sLocalName, XML_STYLE_NAME ) )
- {
- XMLPropStyleContext* pStyle =
- GetImport().GetTextImport()->FindSectionStyle(
- xAttrList->getValueByIndex(nAttr));
- if (pStyle != NULL)
- {
- pStyle->FillPropertySet( xTOCPropertySet );
- }
- }
- else if ( IsXMLToken( sLocalName, XML_PROTECTED ) )
- {
- sal_Bool bTmp;
- if ( SvXMLUnitConverter::convertBool(
- bTmp, xAttrList->getValueByIndex(nAttr) ) )
- {
- bProtected = bTmp;
- }
- }
- else if ( IsXMLToken( sLocalName, XML_NAME ) )
- {
- sIndexName = xAttrList->getValueByIndex(nAttr);
- }
- }
- }
- Any aAny;
- aAny.setValue( &bProtected, ::getBooleanCppuType() );
- xTOCPropertySet->setPropertyValue( sIsProtected, aAny );
-
- if (sIndexName.getLength() > 0)
- {
- aAny <<= sIndexName;
- xTOCPropertySet->setPropertyValue( sName, aAny );
- }
- }
-}
-
-void XMLIndexTOCContext::EndElement()
-{
- // complete import of index by removing the markers (if the index
- // was actually inserted, that is)
- if( bValid )
- {
- // preliminaries
- OUString sEmpty;
- UniReference<XMLTextImportHelper> rHelper= GetImport().GetTextImport();
-
- // get rid of last paragraph (unless it's the only paragraph)
- rHelper->GetCursor()->goRight(1, sal_False);
- if( xBodyContextRef.Is() &&
- ((XMLIndexBodyContext*)&xBodyContextRef)->HasContent() )
- {
- rHelper->GetCursor()->goLeft(1, sal_True);
- rHelper->GetText()->insertString(rHelper->GetCursorAsRange(),
- sEmpty, sal_True);
- }
-
- // and delete second marker
- rHelper->GetCursor()->goRight(1, sal_True);
- rHelper->GetText()->insertString(rHelper->GetCursorAsRange(),
- sEmpty, sal_True);
-
- // check for Redlines on our end node
- GetImport().GetTextImport()->RedlineAdjustStartNodeCursor(sal_False);
- }
-}
-
-SvXMLImportContext* XMLIndexTOCContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
-
- if (bValid)
- {
- if (XML_NAMESPACE_TEXT == nPrefix)
- {
- if ( IsXMLToken( rLocalName, XML_INDEX_BODY ) )
- {
- pContext = new XMLIndexBodyContext(GetImport(), nPrefix,
- rLocalName);
- if ( !xBodyContextRef.Is() ||
- !((XMLIndexBodyContext*)&xBodyContextRef)->HasContent() )
- {
- xBodyContextRef = pContext;
- }
- }
- else if (0 == rLocalName.compareToAscii(pSourceElementName))
- {
- // instantiate source context for the appropriate index type
- switch (eIndexType)
- {
- case TEXT_INDEX_TOC:
- pContext = new XMLIndexTOCSourceContext(
- GetImport(), nPrefix, rLocalName, xTOCPropertySet);
- break;
-
- case TEXT_INDEX_OBJECT:
- pContext = new XMLIndexObjectSourceContext(
- GetImport(), nPrefix, rLocalName, xTOCPropertySet);
- break;
-
- case TEXT_INDEX_ALPHABETICAL:
- pContext = new XMLIndexAlphabeticalSourceContext(
- GetImport(), nPrefix, rLocalName, xTOCPropertySet);
- break;
-
- case TEXT_INDEX_USER:
- pContext = new XMLIndexUserSourceContext(
- GetImport(), nPrefix, rLocalName, xTOCPropertySet);
- break;
-
- case TEXT_INDEX_BIBLIOGRAPHY:
- pContext = new XMLIndexBibliographySourceContext(
- GetImport(), nPrefix, rLocalName, xTOCPropertySet);
- break;
-
- case TEXT_INDEX_TABLE:
- pContext = new XMLIndexTableSourceContext(
- GetImport(), nPrefix, rLocalName, xTOCPropertySet);
- break;
-
- case TEXT_INDEX_ILLUSTRATION:
- pContext = new XMLIndexIllustrationSourceContext(
- GetImport(), nPrefix, rLocalName, xTOCPropertySet);
- break;
-
- default:
- DBG_ERROR("index type not implemented");
- break;
- }
- }
- // else: ignore
- }
- // else: no text: namespace -> ignore
- }
- // else: not valid -> ignore
-
- // default: ignore
- if (pContext == NULL)
- {
- pContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName,
- xAttrList);
- }
-
- return pContext;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTOCSourceContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTOCSourceContext.cxx
deleted file mode 100644
index a12e820c29b3..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTOCSourceContext.cxx
+++ /dev/null
@@ -1,206 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLIndexTOCSourceContext.hxx"
-
-
-#include <com/sun/star/container/XIndexReplace.hpp>
-
-#include "XMLIndexTemplateContext.hxx"
-
-
-
-
-#include "xmlimp.hxx"
-
-
-#include "xmlnmspe.hxx"
-
-
-
-#include "xmluconv.hxx"
-
-
-namespace binfilter {
-
-
-
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::xml::sax::XAttributeList;
-
-const sal_Char sAPI_CreateFromChapter[] = "CreateFromChapter";
-const sal_Char sAPI_CreateFromOutline[] = "CreateFromOutline";
-const sal_Char sAPI_CreateFromMarks[] = "CreateFromMarks";
-const sal_Char sAPI_Level[] = "Level";
-const sal_Char sAPI_CreateFromLevelParagraphStyles[] = "CreateFromLevelParagraphStyles";
-
-
-TYPEINIT1( XMLIndexTOCSourceContext, XMLIndexSourceBaseContext );
-
-XMLIndexTOCSourceContext::XMLIndexTOCSourceContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- Reference<XPropertySet> & rPropSet) :
- XMLIndexSourceBaseContext(rImport, nPrfx, rLocalName,
- rPropSet, sal_True),
- // use all chapters by default
- nOutlineLevel(rImport.GetTextImport()->GetChapterNumbering()->
- getCount()),
- bUseOutline(sal_True),
- bUseMarks(sal_True),
- sCreateFromMarks(RTL_CONSTASCII_USTRINGPARAM(sAPI_CreateFromMarks)),
- sLevel(RTL_CONSTASCII_USTRINGPARAM(sAPI_Level)),
- sCreateFromOutline(RTL_CONSTASCII_USTRINGPARAM(sAPI_CreateFromOutline)),
- sCreateFromLevelParagraphStyles(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_CreateFromLevelParagraphStyles)),
- bUseParagraphStyles(sal_False)
-{
-}
-
-XMLIndexTOCSourceContext::~XMLIndexTOCSourceContext()
-{
-}
-
-void XMLIndexTOCSourceContext::ProcessAttribute(
- enum IndexSourceParamEnum eParam,
- const OUString& rValue)
-{
- switch (eParam)
- {
- case XML_TOK_INDEXSOURCE_OUTLINE_LEVEL:
- if ( IsXMLToken( rValue, XML_NONE ) )
- {
- // #104651# use OUTLINE_LEVEL and USE_OUTLINE_LEVEL instead of
- // OUTLINE_LEVEL with values none|1..10. For backwards
- // compatibility, 'none' must still be read.
- bUseOutline = sal_False;
- }
- else
- {
- sal_Int32 nTmp;
- if (SvXMLUnitConverter::convertNumber(
- nTmp, rValue, 1, GetImport().GetTextImport()->
- GetChapterNumbering()->getCount()))
- {
- bUseOutline = sal_True;
- nOutlineLevel = nTmp;
- }
- }
- break;
-
- case XML_TOK_INDEXSOURCE_USE_OUTLINE_LEVEL:
- {
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bUseOutline = bTmp;
- }
- break;
- }
-
-
- case XML_TOK_INDEXSOURCE_USE_INDEX_MARKS:
- {
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bUseMarks = bTmp;
- }
- break;
- }
-
- case XML_TOK_INDEXSOURCE_USE_INDEX_SOURCE_STYLES:
- {
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bUseParagraphStyles = bTmp;
- }
- break;
- }
-
- default:
- // default: ask superclass
- XMLIndexSourceBaseContext::ProcessAttribute(eParam, rValue);
- break;
- }
-}
-
-void XMLIndexTOCSourceContext::EndElement()
-{
- Any aAny;
-
- aAny.setValue(&bUseMarks, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sCreateFromMarks, aAny);
-
- aAny.setValue(&bUseOutline, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sCreateFromOutline, aAny);
-
- aAny.setValue(&bUseParagraphStyles, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sCreateFromLevelParagraphStyles, aAny);
-
- aAny <<= (sal_Int16)nOutlineLevel;
- rIndexPropertySet->setPropertyValue(sLevel, aAny);
-
- // process common attributes
- XMLIndexSourceBaseContext::EndElement();
-}
-
-
-SvXMLImportContext* XMLIndexTOCSourceContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- if ( (XML_NAMESPACE_TEXT == nPrefix) &&
- IsXMLToken(rLocalName, XML_TABLE_OF_CONTENT_ENTRY_TEMPLATE) )
- {
- return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet,
- nPrefix, rLocalName,
- aLevelNameTOCMap,
- XML_OUTLINE_LEVEL,
- aLevelStylePropNameTOCMap,
- aAllowedTokenTypesTOC);
- }
- else
- {
- return XMLIndexSourceBaseContext::CreateChildContext(nPrefix,
- rLocalName,
- xAttrList);
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTOCStylesContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTOCStylesContext.cxx
deleted file mode 100644
index 32e08bc5e157..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTOCStylesContext.cxx
+++ /dev/null
@@ -1,168 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-
-#include "XMLIndexTOCStylesContext.hxx"
-
-
-#include <com/sun/star/container/XIndexReplace.hpp>
-
-
-#include "xmlimp.hxx"
-
-
-#include "xmlnmspe.hxx"
-
-#include "nmspmap.hxx"
-
-
-#include "xmluconv.hxx"
-
-
-
-namespace binfilter {
-
-
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::container::XIndexReplace;
-using ::com::sun::star::xml::sax::XAttributeList;
-
-
-const sal_Char sAPI_LevelParagraphStyles[] = "LevelParagraphStyles";
-
-TYPEINIT1( XMLIndexTOCStylesContext, SvXMLImportContext );
-
-
-XMLIndexTOCStylesContext::XMLIndexTOCStylesContext(
- SvXMLImport& rImport,
- Reference<XPropertySet> & rPropSet,
- sal_uInt16 nPrfx,
- const OUString& rLocalName ) :
- SvXMLImportContext(rImport, nPrfx, rLocalName),
- rTOCPropertySet(rPropSet),
- aStyleNames(),
- nOutlineLevel(-1),
- sLevelParagraphStyles(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_LevelParagraphStyles))
-{
-}
-
-XMLIndexTOCStylesContext::~XMLIndexTOCStylesContext()
-{
-}
-
-void XMLIndexTOCStylesContext::StartElement(
- const Reference<XAttributeList> & xAttrList )
-{
- // find text:outline-level attribute
- sal_Int16 nCount = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nCount; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
- if ( (XML_NAMESPACE_TEXT == nPrefix) &&
- (IsXMLToken(sLocalName, XML_OUTLINE_LEVEL)) )
- {
- sal_Int32 nTmp;
- if (SvXMLUnitConverter::convertNumber(
- nTmp, xAttrList->getValueByIndex(nAttr), 1,
- GetImport().GetTextImport()->GetChapterNumbering()->
- getCount()))
- {
- // API numbers 0..9, we number 1..10
- nOutlineLevel = nTmp-1;
- }
- }
- }
-}
-
-void XMLIndexTOCStylesContext::EndElement()
-{
- // if valid...
- if (nOutlineLevel >= 0)
- {
- // copy vector into sequence
- sal_Int32 nCount = aStyleNames.size();
- Sequence<OUString> aStyleNamesSequence(nCount);
- for(sal_Int32 i = 0; i < nCount; i++)
- {
- aStyleNamesSequence[i] = aStyleNames[i];
- }
-
- // get index replace
- Any aAny = rTOCPropertySet->getPropertyValue(sLevelParagraphStyles);
- Reference<XIndexReplace> xIndexReplace;
- aAny >>= xIndexReplace;
-
- // set style names
- aAny <<= aStyleNamesSequence;
- xIndexReplace->replaceByIndex(nOutlineLevel, aAny);
- }
-}
-
-SvXMLImportContext *XMLIndexTOCStylesContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- // check for index-source-style
- if ( (XML_NAMESPACE_TEXT == nPrefix) &&
- IsXMLToken( rLocalName, XML_INDEX_SOURCE_STYLE ) )
- {
- // find text:style-name attribute and record in aStyleNames
- sal_Int16 nCount = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nCount; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
- if ( (XML_NAMESPACE_TEXT == nPrefix) &&
- IsXMLToken( sLocalName, XML_STYLE_NAME ) )
- {
- aStyleNames.push_back(xAttrList->getValueByIndex(nAttr));
- }
- }
- }
-
- // always return default context; we already got the interesting info
- return SvXMLImportContext::CreateChildContext(nPrefix, rLocalName,
- xAttrList);
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTabStopEntryContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTabStopEntryContext.cxx
deleted file mode 100644
index a5e5fa54730b..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTabStopEntryContext.cxx
+++ /dev/null
@@ -1,168 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLIndexTabStopEntryContext.hxx"
-
-#include "XMLIndexTemplateContext.hxx"
-
-
-#include "xmlimp.hxx"
-
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "xmluconv.hxx"
-
-
-#include <tools/debug.hxx>
-namespace binfilter {
-
-
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::xml::sax::XAttributeList;
-
-
-TYPEINIT1( XMLIndexTabStopEntryContext, XMLIndexSimpleEntryContext );
-
-XMLIndexTabStopEntryContext::XMLIndexTabStopEntryContext(
- SvXMLImport& rImport,
- XMLIndexTemplateContext& rTemplate,
- sal_uInt16 nPrfx,
- const OUString& rLocalName ) :
- XMLIndexSimpleEntryContext(rImport, rTemplate.sTokenTabStop,
- rTemplate, nPrfx, rLocalName),
- sLeaderChar(),
- nTabPosition(0),
- bTabPositionOK(sal_False),
- bTabRightAligned(sal_False),
- bLeaderCharOK(sal_False)
-{
-}
-
-XMLIndexTabStopEntryContext::~XMLIndexTabStopEntryContext()
-{
-}
-
-void XMLIndexTabStopEntryContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- // process three attributes: type, position, leader char
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
- OUString sAttr = xAttrList->getValueByIndex(nAttr);
- if (XML_NAMESPACE_STYLE == nPrefix)
- {
- if ( IsXMLToken( sLocalName, XML_TYPE ) )
- {
- // if it's neither left nor right, value is
- // ignored. Since left is default, we only need to
- // check for right
- bTabRightAligned = IsXMLToken( sAttr, XML_RIGHT );
- }
- else if ( IsXMLToken( sLocalName, XML_POSITION ) )
- {
- sal_Int32 nTmp;
- if (GetImport().GetMM100UnitConverter().
- convertMeasure(nTmp, sAttr))
- {
- nTabPosition = nTmp;
- bTabPositionOK = sal_True;
- }
- }
- else if ( IsXMLToken( sLocalName, XML_LEADER_CHAR ) )
- {
- sLeaderChar = sAttr;
- // valid only, if we have a char!
- bLeaderCharOK = (sAttr.getLength() > 0);
- }
- // else: unknown style: attribute -> ignore
- }
- // else: no style attribute -> ignore
- }
-
- // how many entries?
- nValues += 1 + (bTabPositionOK ? 1 : 0) + (bLeaderCharOK ? 1 : 0);
-
- // now try parent class (for character style)
- XMLIndexSimpleEntryContext::StartElement( xAttrList );
-}
-
-void XMLIndexTabStopEntryContext::FillPropertyValues(
- Sequence<PropertyValue> & rValues)
-{
- // fill vlues from parent class (type + style name)
- XMLIndexSimpleEntryContext::FillPropertyValues(rValues);
-
- // get values array and next entry to be written;
- sal_Int32 nNextEntry = bCharStyleNameOK ? 2 : 1;
- PropertyValue* pValues = rValues.getArray();
-
- // right aligned?
- pValues[nNextEntry].Name = rTemplateContext.sTabStopRightAligned;
- pValues[nNextEntry].Value.setValue( &bTabRightAligned,
- ::getBooleanCppuType());
- nNextEntry++;
-
- // position
- if (bTabPositionOK)
- {
- pValues[nNextEntry].Name = rTemplateContext.sTabStopPosition;
- pValues[nNextEntry].Value <<= nTabPosition;
- nNextEntry++;
- }
-
- // leader char
- if (bLeaderCharOK)
- {
- pValues[nNextEntry].Name = rTemplateContext.sTabStopFillCharacter;
- pValues[nNextEntry].Value <<= sLeaderChar;
- nNextEntry++;
- }
-
- // check whether we really filled all elements of the sequence
- DBG_ASSERT( nNextEntry == rValues.getLength(),
- "length incorrectly precumputed!" );
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTableSourceContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTableSourceContext.cxx
deleted file mode 100644
index 369e3398029b..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTableSourceContext.cxx
+++ /dev/null
@@ -1,191 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLIndexTableSourceContext.hxx"
-
-
-
-#include <com/sun/star/text/ReferenceFieldPart.hpp>
-
-#include "XMLIndexTemplateContext.hxx"
-
-
-
-
-
-
-#include "xmlnmspe.hxx"
-
-
-
-#include "xmluconv.hxx"
-
-
-namespace binfilter {
-
-
-using namespace ::com::sun::star::text;
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::xml::sax::XAttributeList;
-
-const sal_Char sAPI_CreateFromLabels[] = "CreateFromLabels";
-const sal_Char sAPI_LabelCategory[] = "LabelCategory";
-const sal_Char sAPI_LabelDisplayType[] = "LabelDisplayType";
-
-
-TYPEINIT1(XMLIndexTableSourceContext, XMLIndexSourceBaseContext);
-
-
-XMLIndexTableSourceContext::XMLIndexTableSourceContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- Reference<XPropertySet> & rPropSet) :
- XMLIndexSourceBaseContext(rImport, nPrfx, rLocalName,
- rPropSet, sal_False),
- sCreateFromLabels(RTL_CONSTASCII_USTRINGPARAM(sAPI_CreateFromLabels)),
- sLabelCategory(RTL_CONSTASCII_USTRINGPARAM(sAPI_LabelCategory)),
- sLabelDisplayType(RTL_CONSTASCII_USTRINGPARAM(sAPI_LabelDisplayType)),
- bSequenceOK(sal_False),
- bDisplayFormatOK(sal_False),
- bUseCaption(sal_True)
-{
-}
-
-XMLIndexTableSourceContext::~XMLIndexTableSourceContext()
-{
-}
-
-static SvXMLEnumMapEntry __READONLY_DATA lcl_aReferenceTypeTokenMap[] =
-{
-
- { XML_TEXT, ReferenceFieldPart::TEXT },
- { XML_CATEGORY_AND_VALUE, ReferenceFieldPart::CATEGORY_AND_NUMBER },
- { XML_CAPTION, ReferenceFieldPart::ONLY_CAPTION },
-
- // wrong values that previous versions wrote:
- { XML_CHAPTER, ReferenceFieldPart::CATEGORY_AND_NUMBER },
- { XML_PAGE, ReferenceFieldPart::ONLY_CAPTION },
-
- { XML_TOKEN_INVALID, 0 }
-};
-
-void XMLIndexTableSourceContext::ProcessAttribute(
- enum IndexSourceParamEnum eParam,
- const OUString& rValue)
-{
- sal_Bool bTmp;
-
- switch (eParam)
- {
- case XML_TOK_INDEXSOURCE_USE_CAPTION:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bUseCaption = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_SEQUENCE_NAME:
- sSequence = rValue;
- bSequenceOK = sal_True;
- break;
-
- case XML_TOK_INDEXSOURCE_SEQUENCE_FORMAT:
- {
- sal_uInt16 nTmp;
- if (SvXMLUnitConverter::convertEnum(nTmp, rValue,
- lcl_aReferenceTypeTokenMap))
- {
- nDisplayFormat = nTmp;
- bDisplayFormatOK = sal_True;
- }
- break;
- }
-
- default:
- XMLIndexSourceBaseContext::ProcessAttribute(eParam, rValue);
- break;
- }
-}
-
-
-void XMLIndexTableSourceContext::EndElement()
-{
- Any aAny;
-
- aAny.setValue(&bUseCaption, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sCreateFromLabels, aAny);
-
- if (bSequenceOK)
- {
- aAny <<= sSequence;
- rIndexPropertySet->setPropertyValue(sLabelCategory, aAny);
- }
-
- if (bDisplayFormatOK)
- {
- aAny <<= nDisplayFormat;
- rIndexPropertySet->setPropertyValue(sLabelDisplayType, aAny);
- }
-
- XMLIndexSourceBaseContext::EndElement();
-}
-
-
-SvXMLImportContext* XMLIndexTableSourceContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- if ( ( XML_NAMESPACE_TEXT == nPrefix ) &&
- ( IsXMLToken( rLocalName, XML_TABLE_INDEX_ENTRY_TEMPLATE ) ) )
- {
- return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet,
- nPrefix, rLocalName,
- aLevelNameTableMap,
- XML_TOKEN_INVALID, // no outline-level attr
- aLevelStylePropNameTableMap,
- aAllowedTokenTypesTable);
- }
- else
- {
- return XMLIndexSourceBaseContext::CreateChildContext(nPrefix,
- rLocalName,
- xAttrList);
- }
-
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTemplateContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTemplateContext.cxx
deleted file mode 100644
index 3f66d1ea98d2..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTemplateContext.cxx
+++ /dev/null
@@ -1,521 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLIndexTemplateContext.hxx"
-
-
-#include "XMLIndexSpanEntryContext.hxx"
-
-#include "XMLIndexTabStopEntryContext.hxx"
-
-#include "XMLIndexBibliographyEntryContext.hxx"
-
-#include "XMLIndexChapterInfoEntryContext.hxx"
-
-
-#include "xmlimp.hxx"
-
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "xmluconv.hxx"
-
-#include <tools/debug.hxx>
-
-
-
-#include <com/sun/star/container/XIndexReplace.hpp>
-namespace binfilter {
-
-
-using namespace ::std;
-//using namespace ::com::sun::star::text;
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::beans::PropertyValues;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::com::sun::star::container::XIndexReplace;
-
-const sal_Char sAPI_TokenEntryNumber[] = "TokenEntryNumber";
-const sal_Char sAPI_TokenEntryText[] = "TokenEntryText";
-const sal_Char sAPI_TokenTabStop[] = "TokenTabStop";
-const sal_Char sAPI_TokenText[] = "TokenText";
-const sal_Char sAPI_TokenPageNumber[] = "TokenPageNumber";
-const sal_Char sAPI_TokenChapterInfo[] = "TokenChapterInfo";
-const sal_Char sAPI_TokenHyperlinkStart[] = "TokenHyperlinkStart";
-const sal_Char sAPI_TokenHyperlinkEnd[] = "TokenHyperlinkEnd";
-const sal_Char sAPI_TokenBibliographyDataField[] =
- "TokenBibliographyDataField";
-
-
-TYPEINIT1( XMLIndexTemplateContext, SvXMLImportContext);
-
-XMLIndexTemplateContext::XMLIndexTemplateContext(
- SvXMLImport& rImport,
- Reference<XPropertySet> & rPropSet,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const SvXMLEnumMapEntry* pLevelNameMap,
- enum XMLTokenEnum eLevelAttrName,
- const sal_Char** pLevelStylePropMap,
- const sal_Bool* pAllowedTokenTypes) :
- SvXMLImportContext(rImport, nPrfx, rLocalName),
- rPropertySet(rPropSet),
- sStyleName(),
- nOutlineLevel(1), // all indices have level 1 (0 is for header)
- bStyleNameOK(sal_False),
- bOutlineLevelOK(sal_False),
- eOutlineLevelAttrName(eLevelAttrName),
- pOutlineLevelNameMap(pLevelNameMap),
- pOutlineLevelStylePropMap(pLevelStylePropMap),
- pAllowedTokenTypesMap(pAllowedTokenTypes),
- sTokenEntryNumber(RTL_CONSTASCII_USTRINGPARAM(sAPI_TokenEntryNumber)),
- sTokenEntryText(RTL_CONSTASCII_USTRINGPARAM(sAPI_TokenEntryText)),
- sTokenTabStop(RTL_CONSTASCII_USTRINGPARAM(sAPI_TokenTabStop)),
- sTokenText(RTL_CONSTASCII_USTRINGPARAM(sAPI_TokenText)),
- sTokenPageNumber(RTL_CONSTASCII_USTRINGPARAM(sAPI_TokenPageNumber)),
- sTokenChapterInfo(RTL_CONSTASCII_USTRINGPARAM(sAPI_TokenChapterInfo)),
- sTokenHyperlinkStart(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_TokenHyperlinkStart)),
- sTokenHyperlinkEnd(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_TokenHyperlinkEnd)),
- sTokenBibliographyDataField(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_TokenBibliographyDataField)),
- sLevelFormat(RTL_CONSTASCII_USTRINGPARAM("LevelFormat")),
- sParaStyleLevel(RTL_CONSTASCII_USTRINGPARAM("ParaStyleLevel")),
- sTabStopRightAligned(RTL_CONSTASCII_USTRINGPARAM(
- "TabStopRightAligned")),
- sTabStopPosition(RTL_CONSTASCII_USTRINGPARAM("TabStopPosition")),
- sTabStopFillCharacter(RTL_CONSTASCII_USTRINGPARAM(
- "TabStopFillCharacter")),
- sCharacterStyleName(RTL_CONSTASCII_USTRINGPARAM("CharacterStyleName")),
- sTokenType(RTL_CONSTASCII_USTRINGPARAM("TokenType")),
- sText(RTL_CONSTASCII_USTRINGPARAM("Text")),
- sBibliographyDataField(RTL_CONSTASCII_USTRINGPARAM(
- "BibliographyDataField")),
- sChapterFormat(RTL_CONSTASCII_USTRINGPARAM("ChapterFormat"))
-{
- DBG_ASSERT( ((XML_TOKEN_INVALID != eLevelAttrName) && (NULL != pLevelNameMap))
- || ((XML_TOKEN_INVALID == eLevelAttrName) && (NULL == pLevelNameMap)),
- "need both, attribute name and value map, or neither" );
- DBG_ASSERT( NULL != pOutlineLevelStylePropMap, "need property name map" );
- DBG_ASSERT( NULL != pAllowedTokenTypes, "need allowed tokens map" );
-
- // no map for outline-level? then use 1
- if (NULL == pLevelNameMap)
- {
- nOutlineLevel = 1;
- bOutlineLevelOK = sal_True;
- }
-}
-
-XMLIndexTemplateContext::~XMLIndexTemplateContext()
-{
-}
-
-
-void XMLIndexTemplateContext::addTemplateEntry(
- const PropertyValues& aValues)
-{
- aValueVector.push_back(aValues);
-}
-
-
-void XMLIndexTemplateContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- // process two attributes: style-name, outline-level
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
- if (XML_NAMESPACE_TEXT == nPrefix)
- {
- if ( IsXMLToken( sLocalName, XML_STYLE_NAME ) )
- {
- // style name
- sStyleName = xAttrList->getValueByIndex(nAttr);
- bStyleNameOK = sal_True;
- }
- else if (eOutlineLevelAttrName != XML_TOKEN_INVALID)
- {
- // we have an attr name! Then see if we have the attr, too.
- if (IsXMLToken(sLocalName, eOutlineLevelAttrName))
- {
- // outline level
- sal_uInt16 nTmp;
- if (SvXMLUnitConverter::convertEnum(
- nTmp, xAttrList->getValueByIndex(nAttr),
- pOutlineLevelNameMap))
- {
- nOutlineLevel = nTmp;
- bOutlineLevelOK = sal_True;
- }
- // else: illegal value -> ignore
- }
- // else: unknown attribute -> ignore
- }
- // else: we don't care about outline-level -> ignore
- }
- // else: attribute not in text namespace -> ignore
- }
-}
-
-void XMLIndexTemplateContext::EndElement()
-{
- if (bOutlineLevelOK)
- {
- sal_Int32 nCount = aValueVector.size();
- Sequence<PropertyValues> aValueSequence(nCount);
- for(sal_Int32 i = 0; i<nCount; i++)
- {
- aValueSequence[i] = aValueVector[i];
- }
-
- // get LevelFormat IndexReplace ...
- Any aAny = rPropertySet->getPropertyValue(sLevelFormat);
- Reference<XIndexReplace> xIndexReplace;
- aAny >>= xIndexReplace;
-
- // ... and insert
- aAny <<= aValueSequence;
- xIndexReplace->replaceByIndex(nOutlineLevel, aAny);
-
- if (bStyleNameOK)
- {
- const sal_Char* pStyleProperty =
- pOutlineLevelStylePropMap[nOutlineLevel];
-
- DBG_ASSERT(NULL != pStyleProperty, "need property name");
- if (NULL != pStyleProperty)
- {
- aAny <<= sStyleName;
- rPropertySet->setPropertyValue(
- OUString::createFromAscii(pStyleProperty), aAny);
- }
- }
- }
-}
-
-
-
-/// template token types; used for aTokenTypeMap parameter
-enum TemplateTokenType
-{
- XML_TOK_INDEX_TYPE_ENTRY_TEXT = 0,
- XML_TOK_INDEX_TYPE_TAB_STOP,
- XML_TOK_INDEX_TYPE_TEXT,
- XML_TOK_INDEX_TYPE_PAGE_NUMBER,
- XML_TOK_INDEX_TYPE_CHAPTER,
- XML_TOK_INDEX_TYPE_CHAPTER_NUMBER,
- XML_TOK_INDEX_TYPE_LINK_START,
- XML_TOK_INDEX_TYPE_LINK_END,
- XML_TOK_INDEX_TYPE_BIBLIOGRAPHY
-};
-
-
-SvXMLEnumMapEntry aTemplateTokenTypeMap[] =
-{
- { XML_INDEX_ENTRY_CHAPTER, XML_TOK_INDEX_TYPE_CHAPTER },
- { XML_INDEX_ENTRY_TEXT, XML_TOK_INDEX_TYPE_ENTRY_TEXT },
- { XML_INDEX_ENTRY_TAB_STOP, XML_TOK_INDEX_TYPE_TAB_STOP },
- { XML_INDEX_ENTRY_SPAN, XML_TOK_INDEX_TYPE_TEXT },
- { XML_INDEX_ENTRY_PAGE_NUMBER, XML_TOK_INDEX_TYPE_PAGE_NUMBER },
- { XML_INDEX_ENTRY_CHAPTER_NUMBER, XML_TOK_INDEX_TYPE_CHAPTER_NUMBER },
- { XML_INDEX_ENTRY_CHAPTER, XML_TOK_INDEX_TYPE_CHAPTER },
- { XML_INDEX_ENTRY_LINK_START, XML_TOK_INDEX_TYPE_LINK_START },
- { XML_INDEX_ENTRY_LINK_END, XML_TOK_INDEX_TYPE_LINK_END },
- { XML_INDEX_ENTRY_BIBLIOGRAPHY, XML_TOK_INDEX_TYPE_BIBLIOGRAPHY },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLImportContext *XMLIndexTemplateContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
-
- if (XML_NAMESPACE_TEXT == nPrefix)
- {
- sal_uInt16 nToken;
- if (SvXMLUnitConverter::convertEnum(nToken, rLocalName,
- aTemplateTokenTypeMap))
- {
- // can this index accept this kind of token?
- if (pAllowedTokenTypesMap[nToken])
- {
- switch ((TemplateTokenType)nToken)
- {
- case XML_TOK_INDEX_TYPE_ENTRY_TEXT:
- pContext = new XMLIndexSimpleEntryContext(
- GetImport(), sTokenEntryText, *this,
- nPrefix, rLocalName);
- break;
-
- case XML_TOK_INDEX_TYPE_PAGE_NUMBER:
- pContext = new XMLIndexSimpleEntryContext(
- GetImport(), sTokenPageNumber, *this,
- nPrefix, rLocalName);
- break;
-
- case XML_TOK_INDEX_TYPE_LINK_START:
- pContext = new XMLIndexSimpleEntryContext(
- GetImport(), sTokenHyperlinkStart, *this,
- nPrefix, rLocalName);
- break;
-
- case XML_TOK_INDEX_TYPE_LINK_END:
- pContext = new XMLIndexSimpleEntryContext(
- GetImport(), sTokenHyperlinkEnd, *this,
- nPrefix, rLocalName);
- break;
-
- case XML_TOK_INDEX_TYPE_TEXT:
- pContext = new XMLIndexSpanEntryContext(
- GetImport(), *this, nPrefix, rLocalName);
- break;
-
- case XML_TOK_INDEX_TYPE_TAB_STOP:
- pContext = new XMLIndexTabStopEntryContext(
- GetImport(), *this, nPrefix, rLocalName);
- break;
-
- case XML_TOK_INDEX_TYPE_CHAPTER_NUMBER:
- pContext = new XMLIndexSimpleEntryContext(
- GetImport(), sTokenEntryNumber, *this,
- nPrefix, rLocalName);
- break;
-
- case XML_TOK_INDEX_TYPE_BIBLIOGRAPHY:
- pContext = new XMLIndexBibliographyEntryContext(
- GetImport(), *this, nPrefix, rLocalName);
- break;
-
- case XML_TOK_INDEX_TYPE_CHAPTER:
- pContext = new XMLIndexChapterInfoEntryContext(
- GetImport(), *this, nPrefix, rLocalName);
- break;
-
- default:
- // ignore!
- break;
- }
- }
- }
- }
-
- // ignore unknown
- if (NULL == pContext)
- {
- return SvXMLImportContext::CreateChildContext(nPrefix, rLocalName,
- xAttrList);
- }
-
- return pContext;
-}
-
-
-
-//
-// maps for the XMLIndexTemplateContext constructor
-//
-
-
-// table of content and user defined index:
-
-const SvXMLEnumMapEntry aLevelNameTOCMap[] =
-{
- { XML_1, 1 },
- { XML_2, 2 },
- { XML_3, 3 },
- { XML_4, 4 },
- { XML_5, 5 },
- { XML_6, 6 },
- { XML_7, 7 },
- { XML_8, 8 },
- { XML_9, 9 },
- { XML_10, 10 },
- { XML_TOKEN_INVALID, NULL }
-};
-
-const sal_Char* aLevelStylePropNameTOCMap[] =
- { NULL, "ParaStyleLevel1", "ParaStyleLevel2", "ParaStyleLevel3",
- "ParaStyleLevel4", "ParaStyleLevel5", "ParaStyleLevel6",
- "ParaStyleLevel7", "ParaStyleLevel8", "ParaStyleLevel9",
- "ParaStyleLevel10", NULL };
-
-const sal_Bool aAllowedTokenTypesTOC[] =
-{
- sal_True, // XML_TOK_INDEX_TYPE_ENTRY_TEXT =
- sal_True, // XML_TOK_INDEX_TYPE_TAB_STOP,
- sal_True, // XML_TOK_INDEX_TYPE_TEXT,
- sal_True, // XML_TOK_INDEX_TYPE_PAGE_NUMBER,
- sal_False, // XML_TOK_INDEX_TYPE_CHAPTER,
- sal_True, // XML_TOK_INDEX_TYPE_CHAPTER_NUMBER
- sal_True, // XML_TOK_INDEX_TYPE_LINK_START,
- sal_True, // XML_TOK_INDEX_TYPE_LINK_END,
- sal_False // XML_TOK_INDEX_TYPE_BIBLIOGRAPHY
-};
-
-const sal_Bool aAllowedTokenTypesUser[] =
-{
- sal_True, // XML_TOK_INDEX_TYPE_ENTRY_TEXT =
- sal_True, // XML_TOK_INDEX_TYPE_TAB_STOP,
- sal_True, // XML_TOK_INDEX_TYPE_TEXT,
- sal_True, // XML_TOK_INDEX_TYPE_PAGE_NUMBER,
- sal_False, // XML_TOK_INDEX_TYPE_CHAPTER,
- sal_True, // XML_TOK_INDEX_TYPE_CHAPTER_NUMBER
- sal_False, // XML_TOK_INDEX_TYPE_LINK_START,
- sal_False, // XML_TOK_INDEX_TYPE_LINK_END,
- sal_False // XML_TOK_INDEX_TYPE_BIBLIOGRAPHY
-};
-
-
-// alphabetical index
-
-const SvXMLEnumMapEntry aLevelNameAlphaMap[] =
-{
- { XML_SEPARATOR, 1 },
- { XML_1, 2 },
- { XML_2, 3 },
- { XML_3, 4 },
- { XML_TOKEN_INVALID, 0 }
-};
-
-const sal_Char* aLevelStylePropNameAlphaMap[] =
- { NULL, "ParaStyleSeparator", "ParaStyleLevel1", "ParaStyleLevel2",
- "ParaStyleLevel3", NULL };
-
-const sal_Bool aAllowedTokenTypesAlpha[] =
-{
- sal_True, // XML_TOK_INDEX_TYPE_ENTRY_TEXT =
- sal_True, // XML_TOK_INDEX_TYPE_TAB_STOP,
- sal_True, // XML_TOK_INDEX_TYPE_TEXT,
- sal_True, // XML_TOK_INDEX_TYPE_PAGE_NUMBER,
- sal_True, // XML_TOK_INDEX_TYPE_CHAPTER,
- sal_False, // XML_TOK_INDEX_TYPE_CHAPTER_NUMBER
- sal_False, // XML_TOK_INDEX_TYPE_LINK_START,
- sal_False, // XML_TOK_INDEX_TYPE_LINK_END,
- sal_False // XML_TOK_INDEX_TYPE_BIBLIOGRAPHY
-};
-
-
-// bibliography index:
-
-const SvXMLEnumMapEntry aLevelNameBibliographyMap[] =
-{
- { XML_ARTICLE, 1 },
- { XML_BOOK, 2 },
- { XML_BOOKLET, 3 },
- { XML_CONFERENCE, 4 },
- { XML_CUSTOM1, 5 },
- { XML_CUSTOM2, 6 },
- { XML_CUSTOM3, 7 },
- { XML_CUSTOM4, 8 },
- { XML_CUSTOM5, 9 },
- { XML_EMAIL, 10 },
- { XML_INBOOK, 11 },
- { XML_INCOLLECTION, 12 },
- { XML_INPROCEEDINGS, 13 },
- { XML_JOURNAL, 14 },
- { XML_MANUAL, 15 },
- { XML_MASTERSTHESIS, 16 },
- { XML_MISC, 17 },
- { XML_PHDTHESIS, 18 },
- { XML_PROCEEDINGS, 19 },
- { XML_TECHREPORT, 20 },
- { XML_UNPUBLISHED, 21 },
- { XML_WWW, 22 },
- { XML_TOKEN_INVALID, 0 }
-};
-
-// TODO: replace with real property names, when available
-const sal_Char* aLevelStylePropNameBibliographyMap[] =
-{
- NULL, "ParaStyleLevel1", "ParaStyleLevel1", "ParaStyleLevel1",
- "ParaStyleLevel1", "ParaStyleLevel1", "ParaStyleLevel1",
- "ParaStyleLevel1", "ParaStyleLevel1", "ParaStyleLevel1",
- "ParaStyleLevel1", "ParaStyleLevel1", "ParaStyleLevel1",
- "ParaStyleLevel1", "ParaStyleLevel1", "ParaStyleLevel1",
- "ParaStyleLevel1", "ParaStyleLevel1", "ParaStyleLevel1",
- "ParaStyleLevel1", "ParaStyleLevel1", "ParaStyleLevel1",
- "ParaStyleLevel1", NULL };
-
-const sal_Bool aAllowedTokenTypesBibliography[] =
-{
- sal_True, // XML_TOK_INDEX_TYPE_ENTRY_TEXT =
- sal_True, // XML_TOK_INDEX_TYPE_TAB_STOP,
- sal_True, // XML_TOK_INDEX_TYPE_TEXT,
- sal_True, // XML_TOK_INDEX_TYPE_PAGE_NUMBER,
- sal_False, // XML_TOK_INDEX_TYPE_CHAPTER,
- sal_False, // XML_TOK_INDEX_TYPE_CHAPTER_NUMBER
- sal_False, // XML_TOK_INDEX_TYPE_LINK_START,
- sal_False, // XML_TOK_INDEX_TYPE_LINK_END,
- sal_True // XML_TOK_INDEX_TYPE_BIBLIOGRAPHY
-};
-
-
-// table, illustration and object index
-
-// no name map
-const SvXMLEnumMapEntry* aLevelNameTableMap = NULL;
-
-const sal_Char* aLevelStylePropNameTableMap[] =
- { NULL, "ParaStyleLevel1", NULL };
-
-const sal_Bool aAllowedTokenTypesTable[] =
-{
- sal_True, // XML_TOK_INDEX_TYPE_ENTRY_TEXT =
- sal_True, // XML_TOK_INDEX_TYPE_TAB_STOP,
- sal_True, // XML_TOK_INDEX_TYPE_TEXT,
- sal_True, // XML_TOK_INDEX_TYPE_PAGE_NUMBER,
- sal_True, // XML_TOK_INDEX_TYPE_CHAPTER,
- sal_False, // XML_TOK_INDEX_TYPE_CHAPTER_NUMBER
- sal_False, // XML_TOK_INDEX_TYPE_LINK_START,
- sal_False, // XML_TOK_INDEX_TYPE_LINK_END,
- sal_False // XML_TOK_INDEX_TYPE_BIBLIOGRAPHY
-};
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTitleTemplateContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTitleTemplateContext.cxx
deleted file mode 100644
index e10a6fa6a3fc..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexTitleTemplateContext.cxx
+++ /dev/null
@@ -1,118 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLIndexTitleTemplateContext.hxx"
-
-
-#include "xmlimp.hxx"
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-namespace binfilter {
-
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_STYLE_NAME;
-
-
-const sal_Char sAPI_Title[] = "Title";
-const sal_Char sAPI_ParaStyleHeading[] = "ParaStyleHeading";
-
-
-TYPEINIT1( XMLIndexTitleTemplateContext, SvXMLImportContext );
-
-XMLIndexTitleTemplateContext::XMLIndexTitleTemplateContext(
- SvXMLImport& rImport,
- Reference<XPropertySet> & rPropSet,
- sal_uInt16 nPrfx,
- const OUString& rLocalName) :
- SvXMLImportContext(rImport, nPrfx, rLocalName),
- sStyleName(),
- bStyleNameOK(sal_False),
- sContent(),
- rTOCPropertySet(rPropSet),
- sTitle(RTL_CONSTASCII_USTRINGPARAM(sAPI_Title)),
- sParaStyleHeading(RTL_CONSTASCII_USTRINGPARAM(sAPI_ParaStyleHeading))
-{
-}
-
-
-XMLIndexTitleTemplateContext::~XMLIndexTitleTemplateContext()
-{
-}
-
-void XMLIndexTitleTemplateContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- // there's only one attribute: style-name
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
- if ( (XML_NAMESPACE_TEXT == nPrefix) &&
- (IsXMLToken(sLocalName, XML_STYLE_NAME)) )
- {
- sStyleName = xAttrList->getValueByIndex(nAttr);
- bStyleNameOK = sal_True;
- }
- }
-}
-
-void XMLIndexTitleTemplateContext::EndElement()
-{
- Any aAny;
-
- aAny <<= sContent.makeStringAndClear();
- rTOCPropertySet->setPropertyValue(sTitle, aAny);
-
- if (bStyleNameOK)
- {
- aAny <<= sStyleName;
- rTOCPropertySet->setPropertyValue(sParaStyleHeading, aAny);
- }
-}
-
-void XMLIndexTitleTemplateContext::Characters(
- const OUString& sString)
-{
- sContent.append(sString);
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexUserSourceContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLIndexUserSourceContext.cxx
deleted file mode 100644
index 04ef9ca7cf18..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLIndexUserSourceContext.cxx
+++ /dev/null
@@ -1,236 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLIndexUserSourceContext.hxx"
-
-
-
-#include "XMLIndexTemplateContext.hxx"
-
-
-
-
-
-
-#include "xmlnmspe.hxx"
-
-
-
-#include "xmluconv.hxx"
-
-
-namespace binfilter {
-
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_USER_INDEX_ENTRY_TEMPLATE;
-using ::binfilter::xmloff::token::XML_OUTLINE_LEVEL;
-
-
-const sal_Char sAPI_CreateFromEmbeddedObjects[] = "CreateFromEmbeddedObjects";
-const sal_Char sAPI_CreateFromGraphicObjects[] = "CreateFromGraphicObjects";
-const sal_Char sAPI_CreateFromMarks[] = "CreateFromMarks";
-const sal_Char sAPI_CreateFromTables[] = "CreateFromTables";
-const sal_Char sAPI_CreateFromTextFrames[] = "CreateFromTextFrames";
-const sal_Char sAPI_UseLevelFromSource[] = "UseLevelFromSource";
-const sal_Char sAPI_CreateFromLevelParagraphStyles[] = "CreateFromLevelParagraphStyles";
-const sal_Char sAPI_UserIndexName[] = "UserIndexName";
-
-
-TYPEINIT1(XMLIndexUserSourceContext, XMLIndexSourceBaseContext);
-
-
-XMLIndexUserSourceContext::XMLIndexUserSourceContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- Reference<XPropertySet> & rPropSet) :
- XMLIndexSourceBaseContext(rImport, nPrfx, rLocalName,
- rPropSet, sal_True),
- sCreateFromEmbeddedObjects(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_CreateFromEmbeddedObjects)),
- sCreateFromGraphicObjects(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_CreateFromGraphicObjects)),
- sCreateFromMarks(RTL_CONSTASCII_USTRINGPARAM(sAPI_CreateFromMarks)),
- sCreateFromTables(RTL_CONSTASCII_USTRINGPARAM(sAPI_CreateFromTables)),
- sCreateFromTextFrames(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_CreateFromTextFrames)),
- sUseLevelFromSource(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_UseLevelFromSource)),
- sCreateFromLevelParagraphStyles(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_CreateFromLevelParagraphStyles)),
- sUserIndexName(RTL_CONSTASCII_USTRINGPARAM(sAPI_UserIndexName)),
- bUseObjects(sal_False),
- bUseGraphic(sal_False),
- bUseMarks(sal_False),
- bUseTables(sal_False),
- bUseFrames(sal_False),
- bUseLevelFromSource(sal_False),
- bUseLevelParagraphStyles(sal_False)
-{
-}
-
-XMLIndexUserSourceContext::~XMLIndexUserSourceContext()
-{
-}
-
-void XMLIndexUserSourceContext::ProcessAttribute(
- enum IndexSourceParamEnum eParam,
- const OUString& rValue)
-{
- sal_Bool bTmp;
-
- switch (eParam)
- {
- case XML_TOK_INDEXSOURCE_USE_INDEX_MARKS:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bUseMarks = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_USE_OBJECTS:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bUseObjects = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_USE_GRAPHICS:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bUseGraphic = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_USE_TABLES:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bUseTables = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_USE_FRAMES:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bUseFrames = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_COPY_OUTLINE_LEVELS:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bUseLevelFromSource = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_USE_INDEX_SOURCE_STYLES:
- if (SvXMLUnitConverter::convertBool(bTmp, rValue))
- {
- bUseLevelParagraphStyles = bTmp;
- }
- break;
-
- case XML_TOK_INDEXSOURCE_USER_INDEX_NAME:
- sIndexName = rValue;
- break;
-
- default:
- XMLIndexSourceBaseContext::ProcessAttribute(eParam, rValue);
- break;
- }
-}
-
-
-void XMLIndexUserSourceContext::EndElement()
-{
- Any aAny;
-
- aAny.setValue(&bUseObjects, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sCreateFromEmbeddedObjects, aAny);
-
- aAny.setValue(&bUseGraphic, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sCreateFromGraphicObjects, aAny);
-
- aAny.setValue(&bUseLevelFromSource, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sUseLevelFromSource, aAny);
-
- aAny.setValue(&bUseMarks, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sCreateFromMarks, aAny);
-
- aAny.setValue(&bUseTables, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sCreateFromTables, aAny);
-
- aAny.setValue(&bUseFrames, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sCreateFromTextFrames, aAny);
-
- aAny.setValue(&bUseLevelParagraphStyles, ::getBooleanCppuType());
- rIndexPropertySet->setPropertyValue(sCreateFromLevelParagraphStyles, aAny);
-
- if( sIndexName.getLength() > 0 )
- {
- aAny <<= sIndexName;
- rIndexPropertySet->setPropertyValue(sUserIndexName, aAny);
- }
-
- XMLIndexSourceBaseContext::EndElement();
-}
-
-
-SvXMLImportContext* XMLIndexUserSourceContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- if ( (XML_NAMESPACE_TEXT == nPrefix) &&
- (IsXMLToken(rLocalName, XML_USER_INDEX_ENTRY_TEMPLATE)) )
- {
- return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet,
- nPrefix, rLocalName,
- aLevelNameTOCMap,
- XML_OUTLINE_LEVEL,
- aLevelStylePropNameTOCMap,
- aAllowedTokenTypesUser);
- }
- else
- {
- return XMLIndexSourceBaseContext::CreateChildContext(nPrefix,
- rLocalName,
- xAttrList);
- }
-
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLLineNumberingExport.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLLineNumberingExport.cxx
deleted file mode 100644
index fab6b8da8389..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLLineNumberingExport.cxx
+++ /dev/null
@@ -1,220 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLLineNumberingExport.hxx"
-
-
-#include "com/sun/star/text/XLineNumberingProperties.hpp"
-
-#include <com/sun/star/style/LineNumberPosition.hpp>
-
-#include "xmlexp.hxx"
-
-#include "xmluconv.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-namespace binfilter {
-
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::text::XLineNumberingProperties;
-
-
-XMLLineNumberingExport::XMLLineNumberingExport(SvXMLExport& rExp) :
- rExport(rExp),
- sCharStyleName(RTL_CONSTASCII_USTRINGPARAM("CharStyleName")),
- sCountEmptyLines(RTL_CONSTASCII_USTRINGPARAM("CountEmptyLines")),
- sCountLinesInFrames(RTL_CONSTASCII_USTRINGPARAM("CountLinesInFrames")),
- sDistance(RTL_CONSTASCII_USTRINGPARAM("Distance")),
- sInterval(RTL_CONSTASCII_USTRINGPARAM("Interval")),
- sSeparatorText(RTL_CONSTASCII_USTRINGPARAM("SeparatorText")),
- sNumberPosition(RTL_CONSTASCII_USTRINGPARAM("NumberPosition")),
- sNumberingType(RTL_CONSTASCII_USTRINGPARAM("NumberingType")),
- sIsOn(RTL_CONSTASCII_USTRINGPARAM("IsOn")),
- sRestartAtEachPage(RTL_CONSTASCII_USTRINGPARAM("RestartAtEachPage")),
- sSeparatorInterval(RTL_CONSTASCII_USTRINGPARAM("SeparatorInterval"))
-{
-}
-
-SvXMLEnumMapEntry __READONLY_DATA aLineNumberPositionMap[] =
-{
- { XML_LEFT, style::LineNumberPosition::LEFT },
- { XML_RIGHT, style::LineNumberPosition::RIGHT },
- { XML_INSIDE, style::LineNumberPosition::INSIDE },
- { XML_OUTSIDE, style::LineNumberPosition::OUTSIDE },
- { XML_TOKEN_INVALID, 0 }
-};
-
-
-
-void XMLLineNumberingExport::Export()
-{
- // export element if we have line numbering info
- Reference<XLineNumberingProperties> xSupplier(rExport.GetModel(),
- UNO_QUERY);
- if (xSupplier.is())
- {
- Reference<XPropertySet> xLineNumbering =
- xSupplier->getLineNumberingProperties();
-
- if (xLineNumbering.is())
- {
- Any aAny;
-
- // char style
- aAny = xLineNumbering->getPropertyValue(sCharStyleName);
- OUString sTmp;
- aAny >>= sTmp;
- if (sTmp.getLength() > 0)
- {
- rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_STYLE_NAME, sTmp);
- }
-
- // enable
- aAny = xLineNumbering->getPropertyValue(sIsOn);
- if (! *(sal_Bool*)aAny.getValue())
- {
- rExport.AddAttribute(XML_NAMESPACE_TEXT,
- XML_NUMBER_LINES, XML_FALSE);
- }
-
- // count empty lines
- aAny = xLineNumbering->getPropertyValue(sCountEmptyLines);
- if (! *(sal_Bool*)aAny.getValue())
- {
- rExport.AddAttribute(XML_NAMESPACE_TEXT,
- XML_COUNT_EMPTY_LINES, XML_FALSE);
- }
-
- // count in frames
- aAny = xLineNumbering->getPropertyValue(sCountLinesInFrames);
- if (*(sal_Bool*)aAny.getValue())
- {
- rExport.AddAttribute(XML_NAMESPACE_TEXT,
- XML_COUNT_IN_FLOATING_FRAMES, XML_TRUE);
- }
-
- // restart numbering
- aAny = xLineNumbering->getPropertyValue(sRestartAtEachPage);
- if (*(sal_Bool*)aAny.getValue())
- {
- rExport.AddAttribute(XML_NAMESPACE_TEXT,
- XML_RESTART_ON_PAGE, XML_TRUE);
- }
-
- // Distance
- aAny = xLineNumbering->getPropertyValue(sDistance);
- sal_Int32 nLength;
- aAny >>= nLength;
- if (nLength != 0)
- {
- OUStringBuffer sBuf;
- rExport.GetMM100UnitConverter().convertMeasure(sBuf, nLength);
- rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_OFFSET,
- sBuf.makeStringAndClear());
- }
-
- // NumeringType
- OUStringBuffer sNumPosBuf;
- aAny = xLineNumbering->getPropertyValue(sNumberingType);
- sal_Int16 nFormat;
- aAny >>= nFormat;
- rExport.GetMM100UnitConverter().convertNumFormat( sNumPosBuf, nFormat );
- rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_FORMAT,
- sNumPosBuf.makeStringAndClear());
- rExport.GetMM100UnitConverter().convertNumLetterSync( sNumPosBuf, nFormat );
- if( sNumPosBuf.getLength() )
- {
- rExport.AddAttribute(XML_NAMESPACE_STYLE,
- XML_NUM_LETTER_SYNC,
- sNumPosBuf.makeStringAndClear() );
- }
-
- // number position
- aAny = xLineNumbering->getPropertyValue(sNumberPosition);
- sal_Int16 nPosition;
- aAny >>= nPosition;
- if (SvXMLUnitConverter::convertEnum(sNumPosBuf, nPosition,
- aLineNumberPositionMap))
- {
- rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_NUMBER_POSITION,
- sNumPosBuf.makeStringAndClear());
- }
-
- // sInterval
- aAny = xLineNumbering->getPropertyValue(sInterval);
- sal_Int16 nLineInterval;
- aAny >>= nLineInterval;
- OUStringBuffer sBuf;
- SvXMLUnitConverter::convertNumber(sBuf,
- (sal_Int32)nLineInterval);
- rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_INCREMENT,
- sBuf.makeStringAndClear());
-
- SvXMLElementExport aConfigElem(rExport, XML_NAMESPACE_TEXT,
- XML_LINENUMBERING_CONFIGURATION,
- sal_True, sal_True);
-
- // line separator
- aAny = xLineNumbering->getPropertyValue(sSeparatorText);
- OUString sSeparator;
- aAny >>= sSeparator;
- if (sSeparator.getLength() > 0)
- {
-
- // SeparatorInterval
- aAny = xLineNumbering->getPropertyValue(sSeparatorInterval);
- sal_Int16 nLineDistance;
- aAny >>= nLineDistance;
- OUStringBuffer sBuf;
- SvXMLUnitConverter::convertNumber(sBuf,
- (sal_Int32)nLineDistance);
- rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_INCREMENT,
- sBuf.makeStringAndClear());
-
- SvXMLElementExport aSeparatorElem(rExport, XML_NAMESPACE_TEXT,
- XML_LINENUMBERING_SEPARATOR,
- sal_True, sal_False);
- rExport.Characters(sSeparator);
- }
- }
- // else: no configuration: don't save -> default
- }
- // can't even get supplier: don't save -> default
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLLineNumberingImportContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLLineNumberingImportContext.cxx
deleted file mode 100644
index 113409ce51d7..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLLineNumberingImportContext.cxx
+++ /dev/null
@@ -1,336 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLLineNumberingImportContext.hxx"
-
-#include "XMLLineNumberingSeparatorImportContext.hxx"
-
-
-#include "com/sun/star/text/XLineNumberingProperties.hpp"
-
-#include <com/sun/star/style/LineNumberPosition.hpp>
-
-#include "xmlimp.hxx"
-
-#include "xmluconv.hxx"
-
-#include "xmlnmspe.hxx"
-
-#include "nmspmap.hxx"
-
-
-#include "xmlnumi.hxx"
-namespace binfilter {
-
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::style;
-using namespace ::binfilter::xmloff::token;
-
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::com::sun::star::text::XLineNumberingProperties;
-using ::rtl::OUString;
-
-TYPEINIT1( XMLLineNumberingImportContext, SvXMLStyleContext );
-
-
-XMLLineNumberingImportContext::XMLLineNumberingImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList) :
- SvXMLStyleContext(rImport, nPrfx, rLocalName, xAttrList, XML_STYLE_FAMILY_TEXT_LINENUMBERINGCONFIG),
- sStyleName(),
- sNumFormat(GetXMLToken(XML_1)),
- sNumLetterSync(GetXMLToken(XML_FALSE)),
- sSeparator(),
- nOffset(-1),
- nNumberPosition(style::LineNumberPosition::LEFT),
- nIncrement(-1),
- nSeparatorIncrement(-1),
- bNumberLines(sal_True),
- bCountEmptyLines(sal_True),
- bCountInFloatingFrames(sal_False),
- bRestartNumbering(sal_False),
- sCharStyleName(RTL_CONSTASCII_USTRINGPARAM("CharStyleName")),
- sCountEmptyLines(RTL_CONSTASCII_USTRINGPARAM("CountEmptyLines")),
- sCountLinesInFrames(RTL_CONSTASCII_USTRINGPARAM("CountLinesInFrames")),
- sDistance(RTL_CONSTASCII_USTRINGPARAM("Distance")),
- sInterval(RTL_CONSTASCII_USTRINGPARAM("Interval")),
- sSeparatorText(RTL_CONSTASCII_USTRINGPARAM("SeparatorText")),
- sNumberPosition(RTL_CONSTASCII_USTRINGPARAM("NumberPosition")),
- sNumberingType(RTL_CONSTASCII_USTRINGPARAM("NumberingType")),
- sIsOn(RTL_CONSTASCII_USTRINGPARAM("IsOn")),
- sRestartAtEachPage(RTL_CONSTASCII_USTRINGPARAM("RestartAtEachPage")),
- sSeparatorInterval(RTL_CONSTASCII_USTRINGPARAM("SeparatorInterval"))
-{
-}
-
-XMLLineNumberingImportContext::~XMLLineNumberingImportContext()
-{
-}
-
-
-
-static const SvXMLEnumMapEntry aLineNumberPositionMap[] =
-{
- { XML_LEFT, style::LineNumberPosition::LEFT },
- { XML_RIGHT, style::LineNumberPosition::RIGHT },
- { XML_INSIDE, style::LineNumberPosition::INSIDE },
- { XML_OUTSIDE, style::LineNumberPosition::OUTSIDE },
- { XML_TOKEN_INVALID, 0 }
-};
-
-static SvXMLTokenMapEntry aLineNumberingTokenMap[] =
-{
- { XML_NAMESPACE_TEXT, XML_STYLE_NAME, XML_TOK_LINENUMBERING_STYLE_NAME },
- { XML_NAMESPACE_TEXT, XML_NUMBER_LINES,
- XML_TOK_LINENUMBERING_NUMBER_LINES },
- { XML_NAMESPACE_TEXT, XML_COUNT_EMPTY_LINES,
- XML_TOK_LINENUMBERING_COUNT_EMPTY_LINES },
- { XML_NAMESPACE_TEXT, XML_COUNT_IN_FLOATING_FRAMES,
- XML_TOK_LINENUMBERING_COUNT_IN_FLOATING_FRAMES },
- { XML_NAMESPACE_TEXT, XML_RESTART_ON_PAGE,
- XML_TOK_LINENUMBERING_RESTART_NUMBERING },
- { XML_NAMESPACE_TEXT, XML_OFFSET, XML_TOK_LINENUMBERING_OFFSET },
- { XML_NAMESPACE_STYLE, XML_NUM_FORMAT, XML_TOK_LINENUMBERING_NUM_FORMAT },
- { XML_NAMESPACE_STYLE, XML_NUM_LETTER_SYNC,
- XML_TOK_LINENUMBERING_NUM_LETTER_SYNC },
- { XML_NAMESPACE_TEXT, XML_NUMBER_POSITION,
- XML_TOK_LINENUMBERING_NUMBER_POSITION },
- { XML_NAMESPACE_TEXT, XML_INCREMENT, XML_TOK_LINENUMBERING_INCREMENT },
-// { XML_NAMESPACE_TEXT, XML_LINENUMBERING_CONFIGURATION,
-// XML_TOK_LINENUMBERING_LINENUMBERING_CONFIGURATION },
-// { XML_NAMESPACE_TEXT, XML_INCREMENT, XML_TOK_LINENUMBERING_INCREMENT },
-// { XML_NAMESPACE_TEXT, XML_LINENUMBERING_SEPARATOR,
-// XML_TOK_LINENUMBERING_LINENUMBERING_SEPARATOR },
-
- XML_TOKEN_MAP_END
-};
-
-void XMLLineNumberingImportContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- SvXMLTokenMap aTokenMap(aLineNumberingTokenMap);
-
- // process attributes
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 i=0; i<nLength; i++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(i), &sLocalName );
-
- ProcessAttribute(
- (enum LineNumberingToken)aTokenMap.Get(nPrefix, sLocalName),
- xAttrList->getValueByIndex(i));
- }
-}
-
-void XMLLineNumberingImportContext::ProcessAttribute(
- enum LineNumberingToken eToken,
- OUString sValue)
-{
- sal_Bool bTmp;
- sal_Int32 nTmp;
-
- switch (eToken)
- {
- case XML_TOK_LINENUMBERING_STYLE_NAME:
- sStyleName = sValue;
- break;
-
- case XML_TOK_LINENUMBERING_NUMBER_LINES:
- if (SvXMLUnitConverter::convertBool(bTmp, sValue))
- {
- bNumberLines = bTmp;
- }
- break;
-
- case XML_TOK_LINENUMBERING_COUNT_EMPTY_LINES:
- if (SvXMLUnitConverter::convertBool(bTmp, sValue))
- {
- bCountEmptyLines = bTmp;
- }
- break;
-
- case XML_TOK_LINENUMBERING_COUNT_IN_FLOATING_FRAMES:
- if (SvXMLUnitConverter::convertBool(bTmp, sValue))
- {
- bCountInFloatingFrames = bTmp;
- }
- break;
-
- case XML_TOK_LINENUMBERING_RESTART_NUMBERING:
- if (SvXMLUnitConverter::convertBool(bTmp, sValue))
- {
- bRestartNumbering = bTmp;
- }
- break;
-
- case XML_TOK_LINENUMBERING_OFFSET:
- if (GetImport().GetMM100UnitConverter().
- convertMeasure(nTmp, sValue))
- {
- nOffset = nTmp;
- }
- break;
-
- case XML_TOK_LINENUMBERING_NUM_FORMAT:
- sNumFormat = sValue;
- break;
-
- case XML_TOK_LINENUMBERING_NUM_LETTER_SYNC:
- sNumLetterSync = sValue;
- break;
-
- case XML_TOK_LINENUMBERING_NUMBER_POSITION:
- {
- sal_uInt16 nTmp;
- if (SvXMLUnitConverter::convertEnum(nTmp, sValue,
- aLineNumberPositionMap))
- {
- nNumberPosition = nTmp;
- }
- break;
- }
-
- case XML_TOK_LINENUMBERING_INCREMENT:
- if (SvXMLUnitConverter::convertNumber(nTmp, sValue, 0))
- {
- nIncrement = (sal_Int16)nTmp;
- }
- break;
- }
-}
-
-void XMLLineNumberingImportContext::CreateAndInsert(
- sal_Bool bOverwrite)
-{
- // insert and block mode is handled in insertStyleFamily
-
- // we'll try to get the LineNumberingProperties
- Reference<XLineNumberingProperties> xSupplier(GetImport().GetModel(),
- UNO_QUERY);
- if (xSupplier.is())
- {
- Reference<XPropertySet> xLineNumbering =
- xSupplier->getLineNumberingProperties();
-
- if (xLineNumbering.is())
- {
- Any aAny;
-
- // set style name (if it exists)
- if ( GetImport().GetStyles()->FindStyleChildContext(
- XML_STYLE_FAMILY_TEXT_TEXT, sStyleName ) != NULL )
- {
- aAny <<= sStyleName;
- xLineNumbering->setPropertyValue(sCharStyleName, aAny);
- }
-
- aAny <<= sSeparator;
- xLineNumbering->setPropertyValue(sSeparatorText, aAny);
-
- aAny <<= nOffset;
- xLineNumbering->setPropertyValue(sDistance, aAny);
-
- aAny <<= nNumberPosition;
- xLineNumbering->setPropertyValue(sNumberPosition, aAny);
-
- if (nIncrement >= 0)
- {
- aAny <<= nIncrement;
- xLineNumbering->setPropertyValue(sInterval, aAny);
- }
-
- if (nSeparatorIncrement >= 0)
- {
- aAny <<= nSeparatorIncrement;
- xLineNumbering->setPropertyValue(sSeparatorInterval, aAny);
- }
-
- aAny.setValue(&bNumberLines, ::getBooleanCppuType());
- xLineNumbering->setPropertyValue(sIsOn, aAny);
-
- aAny.setValue(&bCountEmptyLines, ::getBooleanCppuType());
- xLineNumbering->setPropertyValue(sCountEmptyLines, aAny);
-
- aAny.setValue(&bCountInFloatingFrames, ::getBooleanCppuType());
- xLineNumbering->setPropertyValue(sCountLinesInFrames, aAny);
-
- aAny.setValue(&bRestartNumbering, ::getBooleanCppuType());
- xLineNumbering->setPropertyValue(sRestartAtEachPage, aAny);
-
- sal_Int16 nNumType = NumberingType::ARABIC;
- GetImport().GetMM100UnitConverter().convertNumFormat( nNumType,
- sNumFormat,
- sNumLetterSync );
- aAny <<= nNumType;
- xLineNumbering->setPropertyValue(sNumberingType, aAny);
- }
- }
-}
-
-SvXMLImportContext* XMLLineNumberingImportContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- if ( (nPrefix == XML_NAMESPACE_TEXT) &&
- IsXMLToken(rLocalName, XML_LINENUMBERING_SEPARATOR) )
- {
- return new XMLLineNumberingSeparatorImportContext(GetImport(),
- nPrefix, rLocalName,
- *this);
- }
- else
- {
- // unknown element: default context
- return SvXMLImportContext::CreateChildContext(nPrefix, rLocalName,
- xAttrList);
- }
-}
-
-void XMLLineNumberingImportContext::SetSeparatorText(
- const OUString& sText)
-{
- sSeparator = sText;
-}
-
-void XMLLineNumberingImportContext::SetSeparatorIncrement(
- sal_Int16 nIncr)
-{
- nSeparatorIncrement = nIncr;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLLineNumberingSeparatorImportContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLLineNumberingSeparatorImportContext.cxx
deleted file mode 100644
index bbec3313d154..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLLineNumberingSeparatorImportContext.cxx
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLLineNumberingSeparatorImportContext.hxx"
-
-#include "XMLLineNumberingImportContext.hxx"
-
-#include "xmlimp.hxx"
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "xmluconv.hxx"
-namespace binfilter {
-
-
-using namespace ::com::sun::star::uno;
-
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_INCREMENT;
-
-TYPEINIT1( XMLLineNumberingSeparatorImportContext, SvXMLImportContext );
-
-XMLLineNumberingSeparatorImportContext::XMLLineNumberingSeparatorImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- XMLLineNumberingImportContext& rLineNumbering) :
- SvXMLImportContext(rImport, nPrfx, rLocalName),
- rLineNumberingContext(rLineNumbering)
-{
-}
-
-XMLLineNumberingSeparatorImportContext::~XMLLineNumberingSeparatorImportContext()
-{
-}
-
-void XMLLineNumberingSeparatorImportContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 i=0; i<nLength; i++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(i), &sLocalName );
-
- if ( (nPrefix == XML_NAMESPACE_TEXT) &&
- IsXMLToken(sLocalName, XML_INCREMENT) )
- {
- sal_Int32 nTmp;
- if (SvXMLUnitConverter::convertNumber(
- nTmp, xAttrList->getValueByIndex(i), 0))
- {
- rLineNumberingContext.SetSeparatorIncrement((sal_Int16)nTmp);
- }
- // else: invalid number -> ignore
- }
- // else: unknown attribute -> ignore
- }
-}
-
-void XMLLineNumberingSeparatorImportContext::Characters(
- const OUString& rChars )
-{
- sSeparatorBuf.append(rChars);
-}
-
-void XMLLineNumberingSeparatorImportContext::EndElement()
-{
- rLineNumberingContext.SetSeparatorText(sSeparatorBuf.makeStringAndClear());
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLPropertyBackpatcher.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLPropertyBackpatcher.cxx
deleted file mode 100644
index f348f9cf4d9e..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLPropertyBackpatcher.cxx
+++ /dev/null
@@ -1,253 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <com/sun/star/uno/Reference.h>
-
-#include "rtl/ustring.hxx"
-
-#include <tools/debug.hxx>
-
-#include "XMLPropertyBackpatcher.hxx"
-
-#include "txtimp.hxx" // XMLTextImportHelper partially implemented here
-namespace binfilter {
-
-
-using ::rtl::OUString;
-using ::std::vector;
-using ::std::map;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::beans::XPropertySet;
-
-
-template<class A>
-XMLPropertyBackpatcher<A>::XMLPropertyBackpatcher(
- const ::rtl::OUString& sPropName) :
- sPropertyName(sPropName),
- bDefaultHandling(sal_False),
- bPreserveProperty(sal_False),
- sPreservePropertyName()
-{
-}
-
-template<class A>
-XMLPropertyBackpatcher<A>::~XMLPropertyBackpatcher()
-{
- SetDefault();
-}
-
-
-template<class A>
-void XMLPropertyBackpatcher<A>::ResolveId(
- const OUString& sName,
- A aValue)
-{
- // insert ID into ID map
- aIDMap[sName] = aValue;
-
- // backpatch old references, if backpatch list exists
- if (aBackpatchListMap.count(sName))
- {
- // aah, we have a backpatch list!
- BackpatchListType* pList =
- (BackpatchListType*)aBackpatchListMap[sName];
-
- // a) remove list from list map
- aBackpatchListMap.erase(sName);
-
- // b) for every item, set SequenceNumber
- // (and preserve Property, if appropriate)
- Any aAny;
- aAny <<= aValue;
- if (bPreserveProperty)
- {
- // preserve version
- for(BackpatchListType::iterator aIter = pList->begin();
- aIter != pList->end();
- aIter++)
- {
- Reference<XPropertySet> xProp = (*aIter);
- Any aPres = xProp->getPropertyValue(sPreservePropertyName);
- xProp->setPropertyValue(sPropertyName, aAny);
- xProp->setPropertyValue(sPreservePropertyName, aPres);
- }
- }
- else
- {
- // without preserve
- for(BackpatchListType::iterator aIter = pList->begin();
- aIter != pList->end();
- aIter++)
- {
- (*aIter)->setPropertyValue(sPropertyName, aAny);
- }
- }
-
- // c) delete list
- delete pList;
- }
- // else: no backpatch list -> then we're finished
-}
-
-template<class A>
-void XMLPropertyBackpatcher<A>::SetProperty(
- const Reference<XPropertySet> & xPropSet,
- const OUString& sName)
-{
- Reference<XPropertySet> xNonConstPropSet(xPropSet);
- SetProperty(xNonConstPropSet, sName);
-}
-
-template<class A>
-void XMLPropertyBackpatcher<A>::SetProperty(
- Reference<XPropertySet> & xPropSet,
- const OUString& sName)
-{
- if (aIDMap.count(sName))
- {
- // we know this ID -> set property
- Any aAny;
- aAny <<= aIDMap[sName];
- xPropSet->setPropertyValue(sPropertyName, aAny);
- }
- else
- {
- // ID unknown -> into backpatch list for later fixup
- if (! aBackpatchListMap.count(sName))
- {
- // create backpatch list for this name
- BackpatchListType* pTmp = new BackpatchListType() ;
- aBackpatchListMap[sName] = (void*)pTmp;
- }
-
- // insert footnote
- ((BackpatchListType*)aBackpatchListMap[sName])->push_back(xPropSet);
- }
-}
-
-template<class A>
-void XMLPropertyBackpatcher<A>::SetDefault()
-{
- if (bDefaultHandling)
- {
- // not implemented yet
- }
-}
-
-// force instantiation of templates
-template class XMLPropertyBackpatcher<sal_Int16>;
-template class XMLPropertyBackpatcher<OUString>;
-
-
-
-//
-// XMLTextImportHelper
-//
-// Code from XMLTextImportHelper using the XMLPropertyBackpatcher is
-// implemented here. The reason is that in the unxsols2 environment,
-// all templates are instatiated as file local (switch
-// -instances=static), and thus are not accessible from the outside.
-//
-// The previous solution was to force additional instantiation of
-// XMLPropertyBackpatcher in txtimp.cxx. This solution combines all
-// usage of the XMLPropertyBackpatcher in XMLPropertyBackpatcher.cxx
-// instead.
-//
-
-XMLPropertyBackpatcher<sal_Int16>& XMLTextImportHelper::GetFootnoteBP()
-{
- if (NULL == pFootnoteBackpatcher)
- {
- pFootnoteBackpatcher =
- new XMLPropertyBackpatcher<sal_Int16>(sSequenceNumber);
- }
- return *pFootnoteBackpatcher;
-}
-
-XMLPropertyBackpatcher<sal_Int16>& XMLTextImportHelper::GetSequenceIdBP()
-{
- if (NULL == pSequenceIdBackpatcher)
- {
- pSequenceIdBackpatcher =
- new XMLPropertyBackpatcher<sal_Int16>(sSequenceNumber);
- }
- return *pSequenceIdBackpatcher;
-}
-
-XMLPropertyBackpatcher<OUString>& XMLTextImportHelper::GetSequenceNameBP()
-{
- if (NULL == pSequenceNameBackpatcher)
- {
- pSequenceNameBackpatcher =
- new XMLPropertyBackpatcher<OUString>(sSourceName);
- }
- return *pSequenceNameBackpatcher;
-}
-
-void XMLTextImportHelper::InsertFootnoteID(
- const OUString& sXMLId,
- sal_Int16 nAPIId)
-{
- GetFootnoteBP().ResolveId(sXMLId, nAPIId);
-}
-
-void XMLTextImportHelper::ProcessFootnoteReference(
- const OUString& sXMLId,
- const Reference<XPropertySet> & xPropSet)
-{
- GetFootnoteBP().SetProperty(xPropSet, sXMLId);
-}
-
-void XMLTextImportHelper::InsertSequenceID(
- const OUString& sXMLId,
- const OUString& sName,
- sal_Int16 nAPIId)
-{
- GetSequenceIdBP().ResolveId(sXMLId, nAPIId);
- GetSequenceNameBP().ResolveId(sXMLId, sName);
-}
-
-void XMLTextImportHelper::ProcessSequenceReference(
- const OUString& sXMLId,
- const Reference<XPropertySet> & xPropSet)
-{
- GetSequenceIdBP().SetProperty(xPropSet, sXMLId);
- GetSequenceNameBP().SetProperty(xPropSet, sXMLId);
-}
-
-void XMLTextImportHelper::_FinitBackpatcher()
-{
- delete pFootnoteBackpatcher;
- delete pSequenceIdBackpatcher;
- delete pSequenceNameBackpatcher;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLRedlineExport.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLRedlineExport.cxx
deleted file mode 100644
index 88bcb8445a23..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLRedlineExport.cxx
+++ /dev/null
@@ -1,685 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLRedlineExport.hxx"
-
-#include <tools/debug.hxx>
-
-
-
-
-
-#include <com/sun/star/container/XEnumerationAccess.hpp>
-
-
-#include <com/sun/star/document/XRedlinesSupplier.hpp>
-
-
-
-#include <com/sun/star/text/XTextSection.hpp>
-
-#include <com/sun/star/util/DateTime.hpp>
-
-
-#include "xmlnmspe.hxx"
-
-#include "xmlexp.hxx"
-
-#include "xmluconv.hxx"
-namespace binfilter {
-
-
-using namespace ::com::sun::star;
-using namespace ::binfilter::xmloff::token;
-
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::beans::UnknownPropertyException;
-using ::com::sun::star::document::XRedlinesSupplier;
-using ::com::sun::star::container::XEnumerationAccess;
-using ::com::sun::star::container::XEnumeration;
-using ::com::sun::star::text::XText;
-using ::com::sun::star::text::XTextContent;
-using ::com::sun::star::text::XTextSection;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::util::DateTime;
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::std::list;
-
-
-XMLRedlineExport::XMLRedlineExport(SvXMLExport& rExp) :
- sDelete(RTL_CONSTASCII_USTRINGPARAM("Delete")),
- sDeletion(GetXMLToken(XML_DELETION)),
- sFormat(RTL_CONSTASCII_USTRINGPARAM("Format")),
- sFormatChange(GetXMLToken(XML_FORMAT_CHANGE)),
- sInsert(RTL_CONSTASCII_USTRINGPARAM("Insert")),
- sInsertion(GetXMLToken(XML_INSERTION)),
- sIsCollapsed(RTL_CONSTASCII_USTRINGPARAM("IsCollapsed")),
- sIsStart(RTL_CONSTASCII_USTRINGPARAM("IsStart")),
- sRedlineAuthor(RTL_CONSTASCII_USTRINGPARAM("RedlineAuthor")),
- sRedlineComment(RTL_CONSTASCII_USTRINGPARAM("RedlineComment")),
- sRedlineDateTime(RTL_CONSTASCII_USTRINGPARAM("RedlineDateTime")),
- sRedlineSuccessorData(RTL_CONSTASCII_USTRINGPARAM("RedlineSuccessorData")),
- sRedlineType(RTL_CONSTASCII_USTRINGPARAM("RedlineType")),
- sRedlineText(RTL_CONSTASCII_USTRINGPARAM("RedlineText")),
- sStyle(RTL_CONSTASCII_USTRINGPARAM("Style")),
- sTextTable(RTL_CONSTASCII_USTRINGPARAM("TextTable")),
- sUnknownChange(RTL_CONSTASCII_USTRINGPARAM("UnknownChange")),
- sChangePrefix(RTL_CONSTASCII_USTRINGPARAM("ct")),
- sStartRedline(RTL_CONSTASCII_USTRINGPARAM("StartRedline")),
- sEndRedline(RTL_CONSTASCII_USTRINGPARAM("EndRedline")),
- sRedlineIdentifier(RTL_CONSTASCII_USTRINGPARAM("RedlineIdentifier")),
- sIsInHeaderFooter(RTL_CONSTASCII_USTRINGPARAM("IsInHeaderFooter")),
- sRedlineProtectionKey(RTL_CONSTASCII_USTRINGPARAM("RedlineProtectionKey")),
- sRecordChanges(RTL_CONSTASCII_USTRINGPARAM("RecordChanges")),
- sMergeLastPara(RTL_CONSTASCII_USTRINGPARAM("MergeLastPara")),
- rExport(rExp),
- aChangeMap(),
- pCurrentChangesList(NULL)
-{
-}
-
-
-XMLRedlineExport::~XMLRedlineExport()
-{
- // delete changes lists
- for( ChangesMapType::iterator aIter = aChangeMap.begin();
- aIter != aChangeMap.end();
- aIter++ )
- {
- delete aIter->second;
- }
- aChangeMap.clear();
-}
-
-
-void XMLRedlineExport::ExportChange(
- const Reference<XPropertySet> & rPropSet,
- sal_Bool bAutoStyle)
-{
- if (bAutoStyle)
- {
- // For the headers/footers, we have to collect the autostyles
- // here. For the general case, however, it's better to collet
- // the autostyles by iterating over the global redline
- // list. So that's what we do: Here, we collect autostyles
- // only if we have no current list of changes. For the
- // main-document case, the autostyles are collected in
- // ExportChangesListAutoStyles().
- if (pCurrentChangesList != NULL)
- ExportChangeAutoStyle(rPropSet);
- }
- else
- {
- ExportChangeInline(rPropSet);
- }
-}
-
-
-void XMLRedlineExport::ExportChangesList(sal_Bool bAutoStyles)
-{
- if (bAutoStyles)
- {
- ExportChangesListAutoStyles();
- }
- else
- {
- ExportChangesListElements();
- }
-}
-
-
-void XMLRedlineExport::ExportChangesList(
- const Reference<XText> & rText,
- sal_Bool bAutoStyles)
-{
- // in the header/footer case, auto styles are collected from the
- // inline change elements.
- if (bAutoStyles)
- return;
-
- // look for changes list for this XText
- ChangesMapType::iterator aFind = aChangeMap.find(rText);
- if (aFind != aChangeMap.end())
- {
- ChangesListType* pChangesList = aFind->second;
-
- // export only if changes are found
- if (pChangesList->size() > 0)
- {
- // changes container element
- SvXMLElementExport aChanges(rExport, XML_NAMESPACE_TEXT,
- XML_TRACKED_CHANGES,
- sal_True, sal_True);
-
- // iterate over changes list
- for( ChangesListType::iterator aIter = pChangesList->begin();
- aIter != pChangesList->end();
- aIter++ )
- {
- ExportChangedRegion( *aIter );
- }
- }
- // else: changes list empty -> ignore
- }
- // else: no changes list found -> empty
-}
-
-void XMLRedlineExport::SetCurrentXText(
- const Reference<XText> & rText)
-{
- if (rText.is())
- {
- // look for appropriate list in map; use the found one, or create new
- ChangesMapType::iterator aIter = aChangeMap.find(rText);
- if (aIter == aChangeMap.end())
- {
- ChangesListType* pList = new ChangesListType;
- aChangeMap[rText] = pList;
- pCurrentChangesList = pList;
- }
- else
- pCurrentChangesList = aIter->second;
- }
- else
- {
- // don't record changes
- SetCurrentXText();
- }
-}
-
-void XMLRedlineExport::SetCurrentXText()
-{
- pCurrentChangesList = NULL;
-}
-
-
-void XMLRedlineExport::ExportChangesListElements()
-{
- // get redlines (aka tracked changes) from the model
- Reference<XRedlinesSupplier> xSupplier(rExport.GetModel(), uno::UNO_QUERY);
- if (xSupplier.is())
- {
- Reference<XEnumerationAccess> aEnumAccess = xSupplier->getRedlines();
-
- // redline protection key
- Sequence<sal_Int8> aKey;
- Reference<XPropertySet> aDocPropertySet( rExport.GetModel(),
- uno::UNO_QUERY );
- aDocPropertySet->getPropertyValue( sRedlineProtectionKey ) >>= aKey;
- if ( aKey.getLength() > 0 )
- {
- OUStringBuffer aBuffer;
- SvXMLUnitConverter::encodeBase64( aBuffer, aKey );
- rExport.AddAttribute( XML_NAMESPACE_TEXT, XML_PROTECTION_KEY,
- aBuffer.makeStringAndClear() );
- }
-
- // redlining enabled?
- sal_Bool bEnabled = *(sal_Bool*)aDocPropertySet->getPropertyValue(
- sRecordChanges ).getValue();
-
- // only export if we have redlines or attributes
- if ( aEnumAccess->hasElements() || bEnabled || aKey.getLength() > 0 )
- {
-
- // export only if we have changes, but tracking is not enabled
- if ( !bEnabled != !aEnumAccess->hasElements() )
- {
- rExport.AddAttribute(
- XML_NAMESPACE_TEXT, XML_TRACK_CHANGES,
- bEnabled ? XML_TRUE : XML_FALSE );
- }
-
- // changes container element
- SvXMLElementExport aChanges(rExport, XML_NAMESPACE_TEXT,
- XML_TRACKED_CHANGES,
- sal_True, sal_True);
-
- // get enumeration and iterate over elements
- Reference<XEnumeration> aEnum = aEnumAccess->createEnumeration();
- while (aEnum->hasMoreElements())
- {
- Any aAny = aEnum->nextElement();
- Reference<XPropertySet> xPropSet;
- aAny >>= xPropSet;
-
- DBG_ASSERT(xPropSet.is(),
- "can't get XPropertySet; skipping Redline");
- if (xPropSet.is())
- {
- // export only if not in header or footer
- // (those must be exported with their XText)
- aAny = xPropSet->getPropertyValue(sIsInHeaderFooter);
- if (! *(sal_Bool*)aAny.getValue())
- {
- // and finally, export change
- ExportChangedRegion(xPropSet);
- }
- }
- // else: no XPropertySet -> no export
- }
- }
- // else: no redlines -> no export
- }
- // else: no XRedlineSupplier -> no export
-}
-
-void XMLRedlineExport::ExportChangeAutoStyle(
- const Reference<XPropertySet> & rPropSet)
-{
- // record change (if changes should be recorded)
- if (NULL != pCurrentChangesList)
- {
- // put redline in list if it's collapsed or the redline start
- Any aIsStart = rPropSet->getPropertyValue(sIsStart);
- Any aIsCollapsed = rPropSet->getPropertyValue(sIsCollapsed);
-
- if ( *(sal_Bool*)aIsStart.getValue() ||
- *(sal_Bool*)aIsCollapsed.getValue() )
- pCurrentChangesList->push_back(rPropSet);
- }
-
- // get XText for export of redline auto styles
- Any aAny = rPropSet->getPropertyValue(sRedlineText);
- Reference<XText> xText;
- aAny >>= xText;
- if (xText.is())
- {
- // export the auto styles
- rExport.GetTextParagraphExport()->collectTextAutoStyles(xText);
- }
-}
-
-void XMLRedlineExport::ExportChangesListAutoStyles()
-{
- // get redlines (aka tracked changes) from the model
- Reference<XRedlinesSupplier> xSupplier(rExport.GetModel(), uno::UNO_QUERY);
- if (xSupplier.is())
- {
- Reference<XEnumerationAccess> aEnumAccess = xSupplier->getRedlines();
-
- // only export if we actually have redlines
- if (aEnumAccess->hasElements())
- {
- // get enumeration and iterate over elements
- Reference<XEnumeration> aEnum = aEnumAccess->createEnumeration();
- while (aEnum->hasMoreElements())
- {
- Any aAny = aEnum->nextElement();
- Reference<XPropertySet> xPropSet;
- aAny >>= xPropSet;
-
- DBG_ASSERT(xPropSet.is(),
- "can't get XPropertySet; skipping Redline");
- if (xPropSet.is())
- {
-
- // export only if not in header or footer
- // (those must be exported with their XText)
- aAny = xPropSet->getPropertyValue(sIsInHeaderFooter);
- if (! *(sal_Bool*)aAny.getValue())
- {
- ExportChangeAutoStyle(xPropSet);
- }
- }
- }
- }
- }
-}
-
-void XMLRedlineExport::ExportChangeInline(
- const Reference<XPropertySet> & rPropSet)
-{
- // determine element name (depending on collapsed, start/end)
- enum XMLTokenEnum eElement = XML_TOKEN_INVALID;
- Any aAny = rPropSet->getPropertyValue(sIsCollapsed);
- sal_Bool bCollapsed = *(sal_Bool *)aAny.getValue();
- sal_Bool bStart = sal_True; // ignored if bCollapsed = sal_True
- if (bCollapsed)
- {
- eElement = XML_CHANGE;
- }
- else
- {
- aAny = rPropSet->getPropertyValue(sIsStart);
- bStart = *(sal_Bool *)aAny.getValue();
- eElement = bStart ? XML_CHANGE_START : XML_CHANGE_END;
- }
-
- if (XML_TOKEN_INVALID != eElement)
- {
- // we always need the ID
- rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_CHANGE_ID,
- GetRedlineID(rPropSet));
-
- // export the element (no whitespace because we're in the text body)
- SvXMLElementExport aChangeElem(rExport, XML_NAMESPACE_TEXT,
- eElement, sal_False, sal_False);
- }
-}
-
-
-void XMLRedlineExport::ExportChangedRegion(
- const Reference<XPropertySet> & rPropSet)
-{
- // Redline-ID
- rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_ID, GetRedlineID(rPropSet) );
-
- // merge-last-paragraph
- Any aAny = rPropSet->getPropertyValue(sMergeLastPara);
- if( ! *(sal_Bool*)aAny.getValue() )
- rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_MERGE_LAST_PARAGRAPH,
- XML_FALSE);
-
- // export change region element
- SvXMLElementExport aChangedRegion(rExport, XML_NAMESPACE_TEXT,
- XML_CHANGED_REGION, sal_True, sal_True);
-
-
- // scope for (first) change element
- {
- aAny = rPropSet->getPropertyValue(sRedlineType);
- OUString sType;
- aAny >>= sType;
- SvXMLElementExport aChange(rExport, XML_NAMESPACE_TEXT,
- ConvertTypeName(sType), sal_True, sal_True);
-
- ExportChangeInfo(rPropSet);
-
- // get XText from the redline and export (if the XText exists)
- aAny = rPropSet->getPropertyValue(sRedlineText);
- Reference<XText> xText;
- aAny >>= xText;
- if (xText.is())
- {
- rExport.GetTextParagraphExport()->exportText(xText);
- // default parameters: bProgress, bExportParagraph ???
- }
- // else: no text interface -> content is inline and will
- // be exported there
- }
-
- // changed change? Hierarchical changes can onl be two levels
- // deep. Here we check for the second level.
- aAny = rPropSet->getPropertyValue(sRedlineSuccessorData);
- Sequence<PropertyValue> aSuccessorData;
- aAny >>= aSuccessorData;
-
- // if we actually got a hierarchical change, make element and
- // process change info
- if (aSuccessorData.getLength() > 0)
- {
- // The only change that can be "undone" is an insertion -
- // after all, you can't re-insert an deletion, but you can
- // delete an insertion. This assumption is asserted in
- // ExportChangeInfo(Sequence<PropertyValue>&).
- SvXMLElementExport aSecondChangeElem(
- rExport, XML_NAMESPACE_TEXT, XML_INSERTION,
- sal_True, sal_True);
-
- ExportChangeInfo(aSuccessorData);
- }
- // else: no hierarchical change
-}
-
-
-const OUString XMLRedlineExport::ConvertTypeName(
- const OUString& sApiName)
-{
- if (sApiName == sDelete)
- {
- return sDeletion;
- }
- else if (sApiName == sInsert)
- {
- return sInsertion;
- }
- else if (sApiName == sFormat)
- {
- return sFormatChange;
- }
- else
- {
- DBG_ERROR("unknown redline type");
- return sUnknownChange;
- }
-}
-
-
-/** Create a Redline-ID */
-const OUString XMLRedlineExport::GetRedlineID(
- const Reference<XPropertySet> & rPropSet)
-{
- Any aAny = rPropSet->getPropertyValue(sRedlineIdentifier);
- OUString sTmp;
- aAny >>= sTmp;
-
- OUStringBuffer sBuf(sChangePrefix);
- sBuf.append(sTmp);
- return sBuf.makeStringAndClear();
-}
-
-
-void XMLRedlineExport::ExportChangeInfo(
- const Reference<XPropertySet> & rPropSet)
-{
- Any aAny = rPropSet->getPropertyValue(sRedlineAuthor);
- OUString sTmp;
- aAny >>= sTmp;
- if (sTmp.getLength() > 0)
- {
- rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_CHG_AUTHOR, sTmp);
- }
-
- aAny = rPropSet->getPropertyValue(sRedlineDateTime);
- util::DateTime aDateTime;
- aAny >>= aDateTime;
- OUStringBuffer sBuf;
- rExport.GetMM100UnitConverter().convertDateTime(sBuf, aDateTime);
- rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_CHG_DATE_TIME,
- sBuf.makeStringAndClear());
-
- SvXMLElementExport aChangeInfo(rExport, XML_NAMESPACE_OFFICE,
- XML_CHANGE_INFO, sal_True, sal_True);
-
- // comment as <text:p> sequence
- aAny = rPropSet->getPropertyValue(sRedlineComment);
- aAny >>= sTmp;
- WriteComment( sTmp );
-}
-
-void XMLRedlineExport::ExportChangeInfo(
- const Sequence<PropertyValue> & rPropertyValues)
-{
- OUString sComment;
-
- sal_Int32 nCount = rPropertyValues.getLength();
- for(sal_Int32 i = 0; i < nCount; i++)
- {
- const PropertyValue& rVal = rPropertyValues[i];
-
- if( rVal.Name.equals(sRedlineAuthor) )
- {
- OUString sTmp;
- rVal.Value >>= sTmp;
- if (sTmp.getLength() > 0)
- {
- rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_CHG_AUTHOR, sTmp);
- }
- }
- else if( rVal.Name.equals(sRedlineComment) )
- {
- rVal.Value >>= sComment;
- }
- else if( rVal.Name.equals(sRedlineDateTime) )
- {
- util::DateTime aDateTime;
- rVal.Value >>= aDateTime;
- OUStringBuffer sBuf;
- rExport.GetMM100UnitConverter().convertDateTime(sBuf, aDateTime);
- rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_CHG_DATE_TIME,
- sBuf.makeStringAndClear());
- }
- else if( rVal.Name.equals(sRedlineType) )
- {
- // check if this is an insertion; cf. comment at calling location
- OUString sTmp;
- rVal.Value >>= sTmp;
- DBG_ASSERT(sTmp.equals(sInsert),
- "hierarchical change must be insertion");
- }
- // else: unknown value -> ignore
- }
-
- // finally write element
- SvXMLElementExport aChangeInfo(rExport, XML_NAMESPACE_OFFICE,
- XML_CHANGE_INFO, sal_True, sal_True);
-
- WriteComment( sComment );
-}
-
-void XMLRedlineExport::ExportStartOrEndRedline(
- const Reference<XPropertySet> & rPropSet,
- sal_Bool bStart)
-{
- if( ! rPropSet.is() )
- return;
-
- // get appropriate (start or end) property
- Any aAny;
- try
- {
- aAny = rPropSet->getPropertyValue(bStart ? sStartRedline : sEndRedline);
- }
- catch( UnknownPropertyException e )
- {
- // If we don't have the property, there's nothing to do.
- return;
- }
-
- Sequence<PropertyValue> aValues;
- aAny >>= aValues;
- const PropertyValue* pValues = aValues.getConstArray();
-
- // seek for redline properties
- sal_Bool bIsCollapsed = sal_False;
- sal_Bool bIsStart = sal_True;
- OUString sId;
- sal_Bool bIdOK = sal_False; // have we seen an ID?
- sal_Int32 nLength = aValues.getLength();
- for(sal_Int32 i = 0; i < nLength; i++)
- {
- if (sRedlineIdentifier.equals(pValues[i].Name))
- {
- pValues[i].Value >>= sId;
- bIdOK = sal_True;
- }
- else if (sIsCollapsed.equals(pValues[i].Name))
- {
- bIsCollapsed = *(sal_Bool*)pValues[i].Value.getValue();
- }
- else if (sIsStart.equals(pValues[i].Name))
- {
- bIsStart = *(sal_Bool*)pValues[i].Value.getValue();
- }
- }
-
- if( bIdOK )
- {
- DBG_ASSERT( sId.getLength() > 0, "Redlines must have IDs" );
-
- // TODO: use GetRedlineID or elimiate that function
- OUStringBuffer sBuffer(sChangePrefix);
- sBuffer.append(sId);
-
- rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_CHANGE_ID,
- sBuffer.makeStringAndClear());
-
- // export the element
- // (whitespace because we're not inside paragraphs)
- SvXMLElementExport aChangeElem(
- rExport, XML_NAMESPACE_TEXT,
- bIsCollapsed ? XML_CHANGE :
- ( bIsStart ? XML_CHANGE_START : XML_CHANGE_END ),
- sal_True, sal_True);
- }
-}
-
-void XMLRedlineExport::ExportStartOrEndRedline(
- const Reference<XTextContent> & rContent,
- sal_Bool bStart)
-{
- Reference<XPropertySet> xPropSet(rContent, uno::UNO_QUERY);
- if (xPropSet.is())
- {
- ExportStartOrEndRedline(xPropSet, bStart);
- }
- else
- {
- DBG_ERROR("XPropertySet expected");
- }
-}
-
-void XMLRedlineExport::ExportStartOrEndRedline(
- const Reference<XTextSection> & rSection,
- sal_Bool bStart)
-{
- Reference<XPropertySet> xPropSet(rSection, uno::UNO_QUERY);
- if (xPropSet.is())
- {
- ExportStartOrEndRedline(xPropSet, bStart);
- }
- else
- {
- DBG_ERROR("XPropertySet expected");
- }
-}
-
-void XMLRedlineExport::WriteComment(const OUString& rComment)
-{
- if (rComment.getLength() > 0)
- {
- // iterate over all string-pieces separated by return (0x0a) and
- // put each inside a paragraph element.
- SvXMLTokenEnumerator aEnumerator(rComment, sal_Char(0x0a));
- OUString aSubString;
- while (aEnumerator.getNextToken(aSubString))
- {
- SvXMLElementExport aParagraph(
- rExport, XML_NAMESPACE_TEXT, XML_P, sal_True, sal_False);
- rExport.Characters(aSubString);
- }
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLSectionExport.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLSectionExport.cxx
deleted file mode 100644
index 7207b7bbbf45..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLSectionExport.cxx
+++ /dev/null
@@ -1,1813 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLSectionExport.hxx"
-
-#include <tools/debug.hxx>
-
-
-
-#include <vector>
-
-
-
-
-
-
-
-#include <com/sun/star/beans/PropertyValues.hpp>
-
-
-
-#include <com/sun/star/text/XTextSection.hpp>
-
-#include <com/sun/star/text/SectionFileLink.hpp>
-
-
-
-#include <com/sun/star/text/XDocumentIndex.hpp>
-
-
-#include <com/sun/star/text/BibliographyDataField.hpp>
-
-#include <com/sun/star/text/XTextFieldsSupplier.hpp>
-#include <com/sun/star/text/XChapterNumberingSupplier.hpp>
-
-#include "xmlkywd.hxx"
-
-
-
-
-#include "xmluconv.hxx"
-
-
-#include "xmlexp.hxx"
-
-
-#include "txtflde.hxx"
-
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::uno;
-using namespace ::std;
-using namespace ::binfilter::xmloff::token;
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::beans::PropertyValues;
-using ::com::sun::star::beans::PropertyState;
-using ::com::sun::star::container::XIndexReplace;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::lang::XServiceInfo;
-using ::com::sun::star::lang::Locale;
-using ::com::sun::star::uno::XInterface;
-
-
-XMLSectionExport::XMLSectionExport(
- SvXMLExport& rExp,
- XMLTextParagraphExport& rParaExp) :
- rExport(rExp),
- rParaExport(rParaExp),
- sCondition(RTL_CONSTASCII_USTRINGPARAM("Condition")),
- sCreateFromChapter(RTL_CONSTASCII_USTRINGPARAM("CreateFromChapter")),
- sCreateFromLabels(RTL_CONSTASCII_USTRINGPARAM("CreateFromLabels")),
- sCreateFromMarks(RTL_CONSTASCII_USTRINGPARAM("CreateFromMarks")),
- sCreateFromOutline(RTL_CONSTASCII_USTRINGPARAM("CreateFromOutline")),
- sDdeCommandElement(RTL_CONSTASCII_USTRINGPARAM("DDECommandElement")),
- sDdeCommandFile(RTL_CONSTASCII_USTRINGPARAM("DDECommandFile")),
- sDdeCommandType(RTL_CONSTASCII_USTRINGPARAM("DDECommandType")),
- sFileLink(RTL_CONSTASCII_USTRINGPARAM("FileLink")),
- sIsCaseSensitive(RTL_CONSTASCII_USTRINGPARAM("IsCaseSensitive")),
- sIsProtected(RTL_CONSTASCII_USTRINGPARAM("IsProtected")),
- sIsVisible(RTL_CONSTASCII_USTRINGPARAM("IsVisible")),
- sLabelCategory(RTL_CONSTASCII_USTRINGPARAM("LabelCategory")),
- sLabelDisplayType(RTL_CONSTASCII_USTRINGPARAM("LabelDisplayType")),
- sLevel(RTL_CONSTASCII_USTRINGPARAM("Level")),
- sLevelFormat(RTL_CONSTASCII_USTRINGPARAM("LevelFormat")),
- sLevelParagraphStyles(
- RTL_CONSTASCII_USTRINGPARAM("LevelParagraphStyles")),
- sLinkRegion(RTL_CONSTASCII_USTRINGPARAM("LinkRegion")),
- sMainEntryCharacterStyleName(
- RTL_CONSTASCII_USTRINGPARAM("MainEntryCharacterStyleName")),
- sParaStyleHeading(RTL_CONSTASCII_USTRINGPARAM("ParaStyleHeading")),
- sParaStyleLevel(RTL_CONSTASCII_USTRINGPARAM("ParaStyleLevel")),
- sTitle(RTL_CONSTASCII_USTRINGPARAM("Title")),
- sName(RTL_CONSTASCII_USTRINGPARAM("Name")),
- sUseAlphabeticalSeparators(
- RTL_CONSTASCII_USTRINGPARAM("UseAlphabeticalSeparators")),
- sUseCombinedEntries(RTL_CONSTASCII_USTRINGPARAM("UseCombinedEntries")),
- sUseDash(RTL_CONSTASCII_USTRINGPARAM("UseDash")),
- sUseKeyAsEntry(RTL_CONSTASCII_USTRINGPARAM("UseKeyAsEntry")),
- sUsePP(RTL_CONSTASCII_USTRINGPARAM("UsePP")),
- sUseUpperCase(RTL_CONSTASCII_USTRINGPARAM("UseUpperCase")),
- sCreateFromOtherEmbeddedObjects(RTL_CONSTASCII_USTRINGPARAM("CreateFromOtherEmbeddedObjects")),
- sCreateFromStarCalc(RTL_CONSTASCII_USTRINGPARAM("CreateFromStarCalc")),
- sCreateFromStarChart(RTL_CONSTASCII_USTRINGPARAM("CreateFromStarChart")),
- sCreateFromStarDraw(RTL_CONSTASCII_USTRINGPARAM("CreateFromStarDraw")),
- sCreateFromStarImage(RTL_CONSTASCII_USTRINGPARAM("CreateFromStarImage")),
- sCreateFromStarMath(RTL_CONSTASCII_USTRINGPARAM("CreateFromStarMath")),
- sCreateFromEmbeddedObjects(RTL_CONSTASCII_USTRINGPARAM("CreateFromEmbeddedObjects")),
- sCreateFromGraphicObjects(RTL_CONSTASCII_USTRINGPARAM("CreateFromGraphicObjects")),
- sCreateFromTables(RTL_CONSTASCII_USTRINGPARAM("CreateFromTables")),
- sCreateFromTextFrames(RTL_CONSTASCII_USTRINGPARAM("CreateFromTextFrames")),
- sUseLevelFromSource(RTL_CONSTASCII_USTRINGPARAM("UseLevelFromSource")),
- sIsCommaSeparated(RTL_CONSTASCII_USTRINGPARAM("IsCommaSeparated")),
- sIsAutomaticUpdate(RTL_CONSTASCII_USTRINGPARAM("IsAutomaticUpdate")),
- sIsRelativeTabstops(RTL_CONSTASCII_USTRINGPARAM("IsRelativeTabstops")),
- sCreateFromLevelParagraphStyles(
- RTL_CONSTASCII_USTRINGPARAM("CreateFromLevelParagraphStyles")),
- sDocumentIndex(RTL_CONSTASCII_USTRINGPARAM("DocumentIndex")),
- sContentSection(RTL_CONSTASCII_USTRINGPARAM("ContentSection")),
- sHeaderSection(RTL_CONSTASCII_USTRINGPARAM("HeaderSection")),
- sTextSection(RTL_CONSTASCII_USTRINGPARAM("TextSection")),
- sIsGlobalDocumentSection(RTL_CONSTASCII_USTRINGPARAM("IsGlobalDocumentSection")),
- sProtectionKey(RTL_CONSTASCII_USTRINGPARAM("ProtectionKey")),
- sSortAlgorithm(RTL_CONSTASCII_USTRINGPARAM("SortAlgorithm")),
- sLocale(RTL_CONSTASCII_USTRINGPARAM("Locale")),
- sUserIndexName(RTL_CONSTASCII_USTRINGPARAM("UserIndexName")),
- sIsCurrentlyVisible(RTL_CONSTASCII_USTRINGPARAM("IsCurrentlyVisible")),
- sHeadingStyleName(RTL_CONSTASCII_USTRINGPARAM("HeadingStyleName")),
- sEmpty(),
- bHeadingDummiesExported( sal_False )
-{
-}
-
-void XMLSectionExport::ExportSectionStart(
- const Reference<XTextSection> & rSection,
- sal_Bool bAutoStyles)
-{
- Reference<XPropertySet> xPropertySet(rSection, UNO_QUERY);
-
- // always export section (auto) style
- if (bAutoStyles)
- {
- // get PropertySet and add section style
- GetParaExport().Add( XML_STYLE_FAMILY_TEXT_SECTION, xPropertySet );
- }
- else
- {
- // always export section style
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_STYLE_NAME,
- GetParaExport().Find(
- XML_STYLE_FAMILY_TEXT_SECTION,
- xPropertySet, sEmpty ));
-
- // export index or regular section
- Reference<XDocumentIndex> xIndex;
- if (GetIndex(rSection, xIndex))
- {
- if (xIndex.is())
- {
- // we are an index
- ExportIndexStart(xIndex);
- }
- else
- {
- // we are an index header
- ExportIndexHeaderStart(rSection);
- }
- }
- else
- {
- // we are not an index
- ExportRegularSectionStart(rSection);
- }
- }
-}
-
-sal_Bool XMLSectionExport::GetIndex(
- const Reference<XTextSection> & rSection,
- Reference<XDocumentIndex> & rIndex) const
-{
- // first, reset result
- sal_Bool bRet = sal_False;
- rIndex = NULL;
-
- // get section Properties
- Reference<XPropertySet> xSectionPropSet(rSection, UNO_QUERY);
-
- // then check if this section happens to be inside an index
- if (xSectionPropSet->getPropertySetInfo()->
- hasPropertyByName(sDocumentIndex))
- {
- Any aAny = xSectionPropSet->getPropertyValue(sDocumentIndex);
- Reference<XDocumentIndex> xDocumentIndex;
- aAny >>= xDocumentIndex;
-
- // OK, are we inside of an index
- if (xDocumentIndex.is())
- {
- // is the enclosing index identical with "our" section?
- Reference<XPropertySet> xIndexPropSet(xDocumentIndex, UNO_QUERY);
- aAny = xIndexPropSet->getPropertyValue(sContentSection);
- Reference<XTextSection> xEnclosingSection;
- aAny >>= xEnclosingSection;
-
- // if the enclosing section is "our" section, then we are an index!
- if (rSection == xEnclosingSection)
- {
- rIndex = xDocumentIndex;
- bRet = sal_True;
- }
- // else: index header or regular section
-
- // is the enclosing index identical with the header section?
- aAny = xIndexPropSet->getPropertyValue(sHeaderSection);
- // now mis-named: contains header section
- aAny >>= xEnclosingSection;
-
- // if the enclosing section is "our" section, then we are an index!
- if (rSection == xEnclosingSection)
- {
- bRet = sal_True;
- }
- // else: regular section
- }
- // else: we aren't even inside of an index
- }
- // else: we don't even know what an index is.
-
- return bRet;
-}
-
-
-void XMLSectionExport::ExportSectionEnd(
- const Reference<XTextSection> & rSection,
- sal_Bool bAutoStyles)
-{
- // no end section for styles
- if (!bAutoStyles)
- {
- enum XMLTokenEnum eElement = XML_TOKEN_INVALID;
-
- // export index or regular section end
- Reference<XDocumentIndex> xIndex;
- if (GetIndex(rSection, xIndex))
- {
- if (xIndex.is())
- {
- // index end: close index body element
- GetExport().EndElement( XML_NAMESPACE_TEXT, XML_INDEX_BODY,
- sal_True );
- GetExport().IgnorableWhitespace();
-
- switch (MapSectionType(xIndex->getServiceName()))
- {
- case TEXT_SECTION_TYPE_TOC:
- eElement = XML_TABLE_OF_CONTENT;
- break;
-
- case TEXT_SECTION_TYPE_ILLUSTRATION:
- eElement = XML_ILLUSTRATION_INDEX;
- break;
-
- case TEXT_SECTION_TYPE_ALPHABETICAL:
- eElement = XML_ALPHABETICAL_INDEX;
- break;
-
- case TEXT_SECTION_TYPE_TABLE:
- eElement = XML_TABLE_INDEX;
- break;
-
- case TEXT_SECTION_TYPE_OBJECT:
- eElement = XML_OBJECT_INDEX;
- break;
-
- case TEXT_SECTION_TYPE_USER:
- eElement = XML_USER_INDEX;
- break;
-
- case TEXT_SECTION_TYPE_BIBLIOGRAPHY:
- eElement = XML_BIBLIOGRAPHY;
- break;
-
- default:
- DBG_ERROR("unknown index type");
- // default: skip index!
- break;
- }
- }
- else
- {
- eElement = XML_INDEX_TITLE;
- }
- }
- else
- {
- eElement = XML_SECTION;
- }
-
- if (XML_TOKEN_INVALID != eElement)
- {
- // any old attributes?
- GetExport().CheckAttrList();
-
- // element surrounded by whitespace
- GetExport().EndElement( XML_NAMESPACE_TEXT, eElement, sal_True);
- GetExport().IgnorableWhitespace();
- }
- else
- {
- DBG_ERROR("Need element name!");
- }
- }
- // else: autostyles -> ignore
-}
-
-void XMLSectionExport::ExportIndexStart(
- const Reference<XDocumentIndex> & rIndex)
-{
- // get PropertySet
- Reference<XPropertySet> xPropertySet(rIndex, UNO_QUERY);
-
- switch (MapSectionType(rIndex->getServiceName()))
- {
- case TEXT_SECTION_TYPE_TOC:
- ExportTableOfContentStart(xPropertySet);
- break;
-
- case TEXT_SECTION_TYPE_ILLUSTRATION:
- ExportIllustrationIndexStart(xPropertySet);
- break;
-
- case TEXT_SECTION_TYPE_ALPHABETICAL:
- ExportAlphabeticalIndexStart(xPropertySet);
- break;
-
- case TEXT_SECTION_TYPE_TABLE:
- ExportTableIndexStart(xPropertySet);
- break;
-
- case TEXT_SECTION_TYPE_OBJECT:
- ExportObjectIndexStart(xPropertySet);
- break;
-
- case TEXT_SECTION_TYPE_USER:
- ExportUserIndexStart(xPropertySet);
- break;
-
- case TEXT_SECTION_TYPE_BIBLIOGRAPHY:
- ExportBibliographyStart(xPropertySet);
- break;
-
- default:
- // skip index
- DBG_ERROR("unknown index type");
- break;
- }
-}
-
-void XMLSectionExport::ExportIndexHeaderStart(
- const Reference<XTextSection> & rSection)
-{
- // export name, dammit!
- Reference<XNamed> xName(rSection, UNO_QUERY);
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, xName->getName());
-
- // format already handled -> export only start element
- GetExport().StartElement( XML_NAMESPACE_TEXT, XML_INDEX_TITLE, sal_True );
- GetExport().IgnorableWhitespace();
-}
-
-
-SvXMLEnumStringMapEntry __READONLY_DATA aIndexTypeMap[] =
-{
- ENUM_STRING_MAP_ENTRY( "com.sun.star.text.ContentIndex", TEXT_SECTION_TYPE_TOC ),
- ENUM_STRING_MAP_ENTRY( "com.sun.star.text.DocumentIndex", TEXT_SECTION_TYPE_ALPHABETICAL ),
- ENUM_STRING_MAP_ENTRY( "com.sun.star.text.TableIndex", TEXT_SECTION_TYPE_TABLE ),
- ENUM_STRING_MAP_ENTRY( "com.sun.star.text.ObjectIndex", TEXT_SECTION_TYPE_OBJECT ),
- ENUM_STRING_MAP_ENTRY( "com.sun.star.text.Bibliography", TEXT_SECTION_TYPE_BIBLIOGRAPHY ),
- ENUM_STRING_MAP_ENTRY( "com.sun.star.text.UserIndex", TEXT_SECTION_TYPE_USER ),
- ENUM_STRING_MAP_ENTRY( "com.sun.star.text.IllustrationsIndex", TEXT_SECTION_TYPE_ILLUSTRATION ),
- ENUM_STRING_MAP_END()
-};
-
-enum SectionTypeEnum XMLSectionExport::MapSectionType(
- const OUString& rServiceName)
-{
- enum SectionTypeEnum eType = TEXT_SECTION_TYPE_UNKNOWN;
-
- sal_uInt16 nTmp;
- if (SvXMLUnitConverter::convertEnum(nTmp, rServiceName, aIndexTypeMap))
- {
- eType = (enum SectionTypeEnum)nTmp;
- }
-
- // TODO: index header section types, etc.
-
- return eType;
-}
-
-void XMLSectionExport::ExportRegularSectionStart(
- const Reference<XTextSection> & rSection)
-{
- // style name already handled in ExportSectionStart(...)
-
- Reference<XNamed> xName(rSection, UNO_QUERY);
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, xName->getName());
-
- // get XPropertySet for other values
- Reference<XPropertySet> xPropSet(rSection, UNO_QUERY);
- Any aAny;
-
- // condition and display
- aAny = xPropSet->getPropertyValue(sCondition);
- OUString sCond;
- aAny >>= sCond;
- enum XMLTokenEnum eDisplay = XML_TOKEN_INVALID;
- if (sCond.getLength() > 0)
- {
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_CONDITION, sCond);
- eDisplay = XML_CONDITION;
-
- // #97450# store hidden-status (of conditional sections only)
- aAny = xPropSet->getPropertyValue(sIsCurrentlyVisible);
- if (! *(sal_Bool*)aAny.getValue())
- {
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_IS_HIDDEN,
- XML_TRUE);
- }
- }
- else
- {
- eDisplay = XML_NONE;
- }
- aAny = xPropSet->getPropertyValue(sIsVisible);
- if (! *(sal_Bool*)aAny.getValue())
- {
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_DISPLAY, eDisplay);
- }
-
- // protect + protection key
- aAny = xPropSet->getPropertyValue(sIsProtected);
- if (*(sal_Bool*)aAny.getValue())
- {
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_PROTECTED, XML_TRUE);
- }
- Sequence<sal_Int8> aPassword;
- xPropSet->getPropertyValue(sProtectionKey) >>= aPassword;
- if (aPassword.getLength() > 0)
- {
- OUStringBuffer aBuffer;
- SvXMLUnitConverter::encodeBase64(aBuffer, aPassword);
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_PROTECTION_KEY,
- aBuffer.makeStringAndClear());
- }
-
- // export element
- GetExport().IgnorableWhitespace();
- GetExport().StartElement( XML_NAMESPACE_TEXT, XML_SECTION, sal_True );
-
- // data source
- // unfortunately, we have to test all relevant strings for non-zero length
- aAny = xPropSet->getPropertyValue(sFileLink);
- SectionFileLink aFileLink;
- aAny >>= aFileLink;
-
- aAny = xPropSet->getPropertyValue(sLinkRegion);
- OUString sRegionName;
- aAny >>= sRegionName;
-
- if ( (aFileLink.FileURL.getLength() > 0) ||
- (aFileLink.FilterName.getLength() > 0) ||
- (sRegionName.getLength() > 0) )
- {
- if (aFileLink.FileURL.getLength() > 0)
- {
- GetExport().AddAttribute(XML_NAMESPACE_XLINK, XML_HREF,
- GetExport().GetRelativeReference( aFileLink.FileURL) );
- }
-
- if (aFileLink.FilterName.getLength() > 0)
- {
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_FILTER_NAME,
- aFileLink.FilterName);
- }
-
- if (sRegionName.getLength() > 0)
- {
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_SECTION_NAME,
- sRegionName);
- }
-
- SvXMLElementExport aElem(GetExport(),
- XML_NAMESPACE_TEXT, XML_SECTION_SOURCE,
- sal_True, sal_True);
- }
- else
- {
- // check for DDE first
- if (xPropSet->getPropertySetInfo()->hasPropertyByName(sDdeCommandFile))
- {
- // data source DDE
- // unfortunately, we have to test all relevant strings for
- // non-zero length
- aAny = xPropSet->getPropertyValue(sDdeCommandFile);
- OUString sApplication;
- aAny >>= sApplication;
- aAny = xPropSet->getPropertyValue(sDdeCommandType);
- OUString sTopic;
- aAny >>= sTopic;
- aAny = xPropSet->getPropertyValue(sDdeCommandElement);
- OUString sItem;
- aAny >>= sItem;
-
- if ( (sApplication.getLength() > 0) ||
- (sTopic.getLength() > 0) ||
- (sItem.getLength() > 0 ) )
- {
- GetExport().AddAttribute(XML_NAMESPACE_OFFICE,
- XML_DDE_APPLICATION, sApplication);
- GetExport().AddAttribute(XML_NAMESPACE_OFFICE, XML_DDE_TOPIC,
- sTopic);
- GetExport().AddAttribute(XML_NAMESPACE_OFFICE, XML_DDE_ITEM,
- sItem);
-
- aAny = xPropSet->getPropertyValue(sIsAutomaticUpdate);
- if (*(sal_Bool*)aAny.getValue())
- {
- GetExport().AddAttribute(XML_NAMESPACE_OFFICE,
- XML_AUTOMATIC_UPDATE, XML_TRUE);
- }
-
- SvXMLElementExport aElem(GetExport(),
- XML_NAMESPACE_OFFICE,
- XML_DDE_SOURCE, sal_True, sal_True);
- }
- // else: no DDE data source
- }
- // else: no DDE on this system
- }
-}
-
-void XMLSectionExport::ExportTableOfContentStart(
- const Reference<XPropertySet> & rPropertySet)
-{
- // export TOC element start
- ExportBaseIndexStart(XML_TABLE_OF_CONTENT, rPropertySet);
-
- // scope for table-of-content-source element
- {
-
- Any aAny;
-
- // TOC specific index source attributes:
-
- // outline-level: 1..10
- sal_Int16 nLevel;
- if( rPropertySet->getPropertyValue(sLevel) >>= nLevel )
- {
- OUStringBuffer sBuffer;
- SvXMLUnitConverter::convertNumber(sBuffer, (sal_Int32)nLevel);
- GetExport().AddAttribute(XML_NAMESPACE_TEXT,
- XML_OUTLINE_LEVEL,
- sBuffer.makeStringAndClear());
- }
-
- // use outline level
- ExportBoolean(rPropertySet, sCreateFromOutline,
- XML_USE_OUTLINE_LEVEL, sal_True);
-
- // use index marks
- ExportBoolean(rPropertySet, sCreateFromMarks,
- XML_USE_INDEX_MARKS, sal_True);
-
- // use level styles
- ExportBoolean(rPropertySet, sCreateFromLevelParagraphStyles,
- XML_USE_INDEX_SOURCE_STYLES, sal_False);
-
- ExportBaseIndexSource(TEXT_SECTION_TYPE_TOC, rPropertySet);
- }
-
- ExportBaseIndexBody(TEXT_SECTION_TYPE_TOC, rPropertySet);
-}
-
-void XMLSectionExport::ExportObjectIndexStart(
- const Reference<XPropertySet> & rPropertySet)
-{
- // export index start
- ExportBaseIndexStart(XML_OBJECT_INDEX, rPropertySet);
-
- // scope for index source element
- {
- ExportBoolean(rPropertySet, sCreateFromOtherEmbeddedObjects,
- XML_USE_OTHER_OBJECTS, sal_False);
- ExportBoolean(rPropertySet, sCreateFromStarCalc,
- XML_USE_SPREADSHEET_OBJECTS, sal_False);
- ExportBoolean(rPropertySet, sCreateFromStarChart,
- XML_USE_CHART_OBJECTS, sal_False);
- ExportBoolean(rPropertySet, sCreateFromStarDraw,
- XML_USE_DRAW_OBJECTS, sal_False);
- ExportBoolean(rPropertySet, sCreateFromStarMath,
- XML_USE_MATH_OBJECTS, sal_False);
-
- ExportBaseIndexSource(TEXT_SECTION_TYPE_OBJECT, rPropertySet);
- }
-
- ExportBaseIndexBody(TEXT_SECTION_TYPE_OBJECT, rPropertySet);
-}
-
-void XMLSectionExport::ExportIllustrationIndexStart(
- const Reference<XPropertySet> & rPropertySet)
-{
- // export index start
- ExportBaseIndexStart(XML_ILLUSTRATION_INDEX, rPropertySet);
-
- // scope for index source element
- {
- // export common attributes for illustration and table indices
- ExportTableAndIllustrationIndexSourceAttributes(rPropertySet);
-
- ExportBaseIndexSource(TEXT_SECTION_TYPE_ILLUSTRATION, rPropertySet);
- }
-
- ExportBaseIndexBody(TEXT_SECTION_TYPE_ILLUSTRATION, rPropertySet);
-}
-
-void XMLSectionExport::ExportTableIndexStart(
- const Reference<XPropertySet> & rPropertySet)
-{
- // export index start
- ExportBaseIndexStart(XML_TABLE_INDEX, rPropertySet);
-
- // scope for index source element
- {
- // export common attributes for illustration and table indices
- ExportTableAndIllustrationIndexSourceAttributes(rPropertySet);
-
- ExportBaseIndexSource(TEXT_SECTION_TYPE_TABLE, rPropertySet);
- }
-
- ExportBaseIndexBody(TEXT_SECTION_TYPE_TABLE, rPropertySet);
-}
-
-void XMLSectionExport::ExportAlphabeticalIndexStart(
- const Reference<XPropertySet> & rPropertySet)
-{
- // export TOC element start
- ExportBaseIndexStart(XML_ALPHABETICAL_INDEX, rPropertySet);
-
- // scope for table-of-content-source element
- {
-
- // style name (if present)
- Any aAny;
- aAny = rPropertySet->getPropertyValue(sMainEntryCharacterStyleName);
- OUString sStyleName;
- aAny >>= sStyleName;
- if (sStyleName.getLength())
- {
- GetExport().AddAttribute(XML_NAMESPACE_TEXT,
- XML_MAIN_ENTRY_STYLE_NAME,
- sStyleName);
- }
-
- // other (boolean) attributes
- ExportBoolean(rPropertySet, sIsCaseSensitive, XML_IGNORE_CASE,
- sal_False, sal_True);
- ExportBoolean(rPropertySet, sUseAlphabeticalSeparators,
- XML_ALPHABETICAL_SEPARATORS, sal_False);
- ExportBoolean(rPropertySet, sUseCombinedEntries, XML_COMBINE_ENTRIES,
- sal_True);
- ExportBoolean(rPropertySet, sUseDash, XML_COMBINE_ENTRIES_WITH_DASH,
- sal_False);
- ExportBoolean(rPropertySet, sUseKeyAsEntry, XML_USE_KEYS_AS_ENTRIES,
- sal_False);
- ExportBoolean(rPropertySet, sUsePP, XML_COMBINE_ENTRIES_WITH_PP,
- sal_True);
- ExportBoolean(rPropertySet, sUseUpperCase, XML_CAPITALIZE_ENTRIES,
- sal_False);
- ExportBoolean(rPropertySet, sIsCommaSeparated, XML_COMMA_SEPARATED,
- sal_False);
-
- // sort algorithm
- aAny = rPropertySet->getPropertyValue(sSortAlgorithm);
- OUString sAlgorithm;
- aAny >>= sAlgorithm;
- if (sAlgorithm.getLength() > 0)
- {
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_SORT_ALGORITHM,
- sAlgorithm );
- }
-
- // locale
- aAny = rPropertySet->getPropertyValue(sLocale);
- Locale aLocale;
- aAny >>= aLocale;
- GetExport().AddAttribute(XML_NAMESPACE_FO, XML_LANGUAGE,
- aLocale.Language);
- GetExport().AddAttribute(XML_NAMESPACE_FO, XML_COUNTRY,
- aLocale.Country);
-
- ExportBaseIndexSource(TEXT_SECTION_TYPE_ALPHABETICAL, rPropertySet);
- }
-
- ExportBaseIndexBody(TEXT_SECTION_TYPE_ALPHABETICAL, rPropertySet);
-}
-
-void XMLSectionExport::ExportUserIndexStart(
- const Reference<XPropertySet> & rPropertySet)
-{
- // export TOC element start
- ExportBaseIndexStart(XML_USER_INDEX, rPropertySet);
-
- // scope for table-of-content-source element
- {
- // bool attributes
- ExportBoolean(rPropertySet, sCreateFromEmbeddedObjects,
- XML_USE_OBJECTS, sal_False);
- ExportBoolean(rPropertySet, sCreateFromGraphicObjects,
- XML_USE_GRAPHICS, sal_False);
- ExportBoolean(rPropertySet, sCreateFromMarks,
- XML_USE_INDEX_MARKS, sal_False);
- ExportBoolean(rPropertySet, sCreateFromTables,
- XML_USE_TABLES, sal_False);
- ExportBoolean(rPropertySet, sCreateFromTextFrames,
- XML_USE_FLOATING_FRAMES, sal_False);
- ExportBoolean(rPropertySet, sUseLevelFromSource,
- XML_COPY_OUTLINE_LEVELS, sal_False);
- ExportBoolean(rPropertySet, sCreateFromLevelParagraphStyles,
- XML_USE_INDEX_SOURCE_STYLES, sal_False);
-
- Any aAny = rPropertySet->getPropertyValue( sUserIndexName );
- OUString sIndexName;
- aAny >>= sIndexName;
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_INDEX_NAME,
- sIndexName);
-
- ExportBaseIndexSource(TEXT_SECTION_TYPE_USER, rPropertySet);
- }
-
- ExportBaseIndexBody(TEXT_SECTION_TYPE_USER, rPropertySet);
-}
-
-void XMLSectionExport::ExportBibliographyStart(
- const Reference<XPropertySet> & rPropertySet)
-{
- // export TOC element start
- ExportBaseIndexStart(XML_BIBLIOGRAPHY, rPropertySet);
-
- // scope for table-of-content-source element
- {
- // No attributes. Fine.
-
- ExportBaseIndexSource(TEXT_SECTION_TYPE_BIBLIOGRAPHY, rPropertySet);
- }
-
- ExportBaseIndexBody(TEXT_SECTION_TYPE_BIBLIOGRAPHY, rPropertySet);
-}
-
-
-void XMLSectionExport::ExportBaseIndexStart(
- XMLTokenEnum eElement,
- const Reference<XPropertySet> & rPropertySet)
-{
- // protect + protection key
- Any aAny = rPropertySet->getPropertyValue(sIsProtected);
- if (*(sal_Bool*)aAny.getValue())
- {
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_PROTECTED, XML_TRUE);
- }
-
- // index name
- OUString sIndexName;
- rPropertySet->getPropertyValue(sName) >>= sIndexName;
- if ( sIndexName.getLength() > 0 )
- {
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, sIndexName);
- }
-
- // index Element start
- GetExport().IgnorableWhitespace();
- GetExport().StartElement( XML_NAMESPACE_TEXT, eElement, sal_False );
-}
-
-static const sal_Char* aTypeSourceElementNameMap[] =
-{
- sXML_table_of_content_source, // TOC
- sXML_table_index_source, // table index
- sXML_illustration_index_source, // illustration index
- sXML_object_index_source, // object index
- sXML_user_index_source, // user index
- sXML_alphabetical_index_source, // alphabetical index
- sXML_bibliography_source // bibliography
-};
-
-void XMLSectionExport::ExportBaseIndexSource(
- SectionTypeEnum eType,
- const Reference<XPropertySet> & rPropertySet)
-{
- // check type
- DBG_ASSERT(eType >= TEXT_SECTION_TYPE_TOC, "illegal index type");
- DBG_ASSERT(eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY, "illegal index type");
-
- Any aAny;
-
- // common attributes; not supported by bibliography
- if (eType != TEXT_SECTION_TYPE_BIBLIOGRAPHY)
- {
- // document or chapter index?
- aAny = rPropertySet->getPropertyValue(sCreateFromChapter);
- if (*(sal_Bool*)aAny.getValue())
- {
- GetExport().AddAttribute(XML_NAMESPACE_TEXT,
- XML_INDEX_SCOPE, XML_CHAPTER);
- }
-
- // tab-stops relative to margin?
- aAny = rPropertySet->getPropertyValue(sIsRelativeTabstops);
- if (! *(sal_Bool*)aAny.getValue())
- {
- GetExport().AddAttribute(XML_NAMESPACE_TEXT,
- XML_RELATIVE_TAB_STOP_POSITION,
- XML_FALSE);
- }
- }
-
- // the index source element (all indices)
- SvXMLElementExport aElem(GetExport(),
- XML_NAMESPACE_TEXT,
- aTypeSourceElementNameMap[
- eType - TEXT_SECTION_TYPE_TOC],
- sal_True, sal_True);
-
- // scope for title template (all indices)
- {
- // header style name
- aAny = rPropertySet->getPropertyValue(sParaStyleHeading);
- OUString sStyleName;
- aAny >>= sStyleName;
- GetExport().AddAttribute(XML_NAMESPACE_TEXT,
- XML_STYLE_NAME,
- sStyleName);
-
- // title template
- SvXMLElementExport aHeaderTemplate(GetExport(),
- XML_NAMESPACE_TEXT,
- XML_INDEX_TITLE_TEMPLATE,
- sal_True, sal_False);
-
- // title as element content
- aAny = rPropertySet->getPropertyValue(sTitle);
- OUString sTitleString;
- aAny >>= sTitleString;
- GetExport().Characters(sTitleString);
- }
-
- // export level templates (all indices)
- aAny = rPropertySet->getPropertyValue(sLevelFormat);
- Reference<XIndexReplace> xLevelTemplates;
- aAny >>= xLevelTemplates;
-
- // iterate over level formats;
- // skip element 0 (empty template for title)
- sal_Int32 nLevelCount = xLevelTemplates->getCount();
- for(sal_Int32 i = 1; i<nLevelCount; i++)
- {
- // get sequence
- Sequence<PropertyValues> aTemplateSequence;
- aAny = xLevelTemplates->getByIndex(i);
- aAny >>= aTemplateSequence;
-
- // export the sequence (abort export if an error occured; #91214#)
- sal_Bool bResult =
- ExportIndexTemplate(eType, i, rPropertySet, aTemplateSequence);
- if ( !bResult )
- break;
- }
-
- // only TOC and user index:
- // styles from which to build the index (LevelParagraphStyles)
- if ( (TEXT_SECTION_TYPE_TOC == eType) ||
- (TEXT_SECTION_TYPE_USER == eType) )
- {
- aAny = rPropertySet->getPropertyValue(sLevelParagraphStyles);
- Reference<XIndexReplace> xLevelParagraphStyles;
- aAny >>= xLevelParagraphStyles;
- ExportLevelParagraphStyles(xLevelParagraphStyles);
- }
-}
-
-
-void XMLSectionExport::ExportBaseIndexBody(
- SectionTypeEnum eType,
- const Reference<XPropertySet> & rSection)
-{
- // type not used; checked anyway.
- DBG_ASSERT(eType >= TEXT_SECTION_TYPE_TOC, "illegal index type");
- DBG_ASSERT(eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY, "illegal index type");
-
- // export start only
-
- // any old attributes?
- GetExport().CheckAttrList();
-
- // start surrounded by whitespace
- GetExport().IgnorableWhitespace();
- GetExport().StartElement( XML_NAMESPACE_TEXT, XML_INDEX_BODY, sal_True );
-}
-
-void XMLSectionExport::ExportTableAndIllustrationIndexSourceAttributes(
- const Reference<XPropertySet> & rPropertySet)
-{
- // use caption
- Any aAny = rPropertySet->getPropertyValue(sCreateFromLabels);
- if (! *(sal_Bool*)aAny.getValue())
- {
- GetExport().AddAttribute(XML_NAMESPACE_TEXT,
- XML_USE_CAPTION, XML_FALSE);
- }
-
- // sequence name
- aAny = rPropertySet->getPropertyValue(sLabelCategory);
- OUString sSequenceName;
- aAny >>= sSequenceName;
- GetExport().AddAttribute(XML_NAMESPACE_TEXT,
- XML_CAPTION_SEQUENCE_NAME,
- sSequenceName);
-
- // caption format
- aAny = rPropertySet->getPropertyValue(sLabelDisplayType);
- sal_Int16 nType;
- aAny >>= nType;
- GetExport().AddAttribute(XML_NAMESPACE_TEXT,
- XML_CAPTION_SEQUENCE_FORMAT,
- XMLTextFieldExport::MapReferenceType(nType));
-}
-
-
-// map index of LevelFormats to attribute value;
-// level 0 is always the header
-static const sal_Char* aLevelNameTOCMap[] =
- { NULL, sXML_1, sXML_2, sXML_3, sXML_4, sXML_5, sXML_6, sXML_7,
- sXML_8, sXML_9, sXML_10, NULL };
-static const sal_Char* aLevelNameTableMap[] =
- { NULL, "", NULL };
-static const sal_Char* aLevelNameAlphaMap[] =
- { NULL, sXML_separator, sXML_1, sXML_2, sXML_3, NULL };
-static const sal_Char* aLevelNameBibliographyMap[] =
- { NULL, sXML_article, sXML_book, sXML_booklet, sXML_conference,
- sXML_custom1, sXML_custom2, sXML_custom3, sXML_custom4,
- sXML_custom5, sXML_email, sXML_inbook, sXML_incollection,
- sXML_inproceedings, sXML_journal,
- sXML_manual, sXML_mastersthesis, sXML_misc, sXML_phdthesis,
- sXML_proceedings, sXML_techreport, sXML_unpublished, sXML_www,
- NULL };
-
-static const sal_Char** aTypeLevelNameMap[] =
-{
- aLevelNameTOCMap, // TOC
- aLevelNameTableMap, // table index
- aLevelNameTableMap, // illustration index
- aLevelNameTableMap, // object index
- aLevelNameTOCMap, // user index
- aLevelNameAlphaMap, // alphabetical index
- aLevelNameBibliographyMap // bibliography
-};
-
-static const sal_Char* aLevelStylePropNameTOCMap[] =
- { NULL, "ParaStyleLevel1", "ParaStyleLevel2", "ParaStyleLevel3",
- "ParaStyleLevel4", "ParaStyleLevel5", "ParaStyleLevel6",
- "ParaStyleLevel7", "ParaStyleLevel8", "ParaStyleLevel9",
- "ParaStyleLevel10", NULL };
-static const sal_Char* aLevelStylePropNameTableMap[] =
- { NULL, "ParaStyleLevel1", NULL };
-static const sal_Char* aLevelStylePropNameAlphaMap[] =
- { NULL, "ParaStyleSeparator", "ParaStyleLevel1", "ParaStyleLevel2",
- "ParaStyleLevel3", NULL };
-static const sal_Char* aLevelStylePropNameBibliographyMap[] =
- // TODO: replace with real property names, when available
- { NULL, "ParaStyleLevel1", "ParaStyleLevel1", "ParaStyleLevel1",
- "ParaStyleLevel1", "ParaStyleLevel1", "ParaStyleLevel1",
- "ParaStyleLevel1", "ParaStyleLevel1", "ParaStyleLevel1",
- "ParaStyleLevel1", "ParaStyleLevel1", "ParaStyleLevel1",
- "ParaStyleLevel1", "ParaStyleLevel1", "ParaStyleLevel1",
- "ParaStyleLevel1", "ParaStyleLevel1", "ParaStyleLevel1",
- "ParaStyleLevel1", "ParaStyleLevel1", "ParaStyleLevel1",
- "ParaStyleLevel1",
- NULL };
-
-static const sal_Char** aTypeLevelStylePropNameMap[] =
-{
- aLevelStylePropNameTOCMap, // TOC
- aLevelStylePropNameTableMap, // table index
- aLevelStylePropNameTableMap, // illustration index
- aLevelStylePropNameTableMap, // object index
- aLevelStylePropNameTOCMap, // user index
- aLevelStylePropNameAlphaMap, // alphabetical index
- aLevelStylePropNameBibliographyMap // bibliography
-};
-
-static const sal_Char* aTypeLevelAttrMap[] =
-{
- sXML_outline_level, // TOC
- NULL, // table index
- NULL, // illustration index
- NULL, // object index
- sXML_outline_level, // user index
- sXML_outline_level, // alphabetical index
- sXML_bibliography_type // bibliography
-};
-
-static const sal_Char* aTypeElementNameMap[] =
-{
- sXML_table_of_content_entry_template, // TOC
- sXML_table_index_entry_template, // table index
- sXML_illustration_index_entry_template, // illustration index
- sXML_object_index_entry_template, // object index
- sXML_user_index_entry_template, // user index
- sXML_alphabetical_index_entry_template, // alphabetical index
- sXML_bibliography_entry_template // bibliography
-};
-
-
-sal_Bool XMLSectionExport::ExportIndexTemplate(
- SectionTypeEnum eType,
- sal_Int32 nOutlineLevel,
- const Reference<XPropertySet> & rPropertySet,
- Sequence<Sequence<PropertyValue> > & rValues)
-{
- DBG_ASSERT(eType >= TEXT_SECTION_TYPE_TOC, "illegal index type");
- DBG_ASSERT(eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY, "illegal index type");
- DBG_ASSERT(nOutlineLevel >= 0, "illegal outline level");
-
- if ( (eType >= TEXT_SECTION_TYPE_TOC) &&
- (eType <= TEXT_SECTION_TYPE_BIBLIOGRAPHY) &&
- (nOutlineLevel >= 0) )
- {
- // get level name and level attribute name from aLevelNameMap;
- const sal_Char* pLevelAttrName =
- aTypeLevelAttrMap[eType-TEXT_SECTION_TYPE_TOC];
- const sal_Char* pLevelName =
- aTypeLevelNameMap[eType-TEXT_SECTION_TYPE_TOC][nOutlineLevel];
-
- // #92124#: some old documents may be broken, then they have
- // too many template levels; we need to recognize this and
- // export only as many as is legal for the respective index
- // type. To do this, we simply return an error flag, which
- // will then abort further template level exports.
- DBG_ASSERT(NULL != pLevelName, "can't find level name");
- if ( NULL == pLevelName )
- {
- // output level not found? Then end of templates! #91214#
- return sal_False;
- }
-
- // output level name
- if ((NULL != pLevelName) && (NULL != pLevelAttrName))
- {
- GetExport().AddAttributeASCII(XML_NAMESPACE_TEXT,
- pLevelAttrName,
- pLevelName);
- }
-
- // paragraph level style name
- const sal_Char* pPropName =
- aTypeLevelStylePropNameMap[eType-TEXT_SECTION_TYPE_TOC][nOutlineLevel];
- DBG_ASSERT(NULL != pPropName, "can't find property name");
- if (NULL != pPropName)
- {
- Any aAny = rPropertySet->getPropertyValue(
- OUString::createFromAscii(pPropName));
- OUString sParaStyleName;
- aAny >>= sParaStyleName;
- GetExport().AddAttribute(XML_NAMESPACE_TEXT,
- XML_STYLE_NAME,
- sParaStyleName);
- }
-
- // template element
- const sal_Char* pElementName =
- aTypeElementNameMap[eType - TEXT_SECTION_TYPE_TOC];
- SvXMLElementExport aLevelTemplate(GetExport(),
- XML_NAMESPACE_TEXT,
- pElementName,
- sal_True, sal_True);
-
- // export sequence
- sal_Int32 nTemplateCount = rValues.getLength();
- for(sal_Int32 nTemplateNo = 0;
- nTemplateNo < nTemplateCount;
- nTemplateNo++)
- {
- ExportIndexTemplateElement(
- rValues[nTemplateNo]);
- }
- }
-
- return sal_True;
-}
-
-
-enum TemplateTypeEnum
-{
- TOK_TTYPE_ENTRY_NUMBER,
- TOK_TTYPE_ENTRY_TEXT,
- TOK_TTYPE_TAB_STOP,
- TOK_TTYPE_TEXT,
- TOK_TTYPE_PAGE_NUMBER,
- TOK_TTYPE_CHAPTER_INFO,
- TOK_TTYPE_HYPERLINK_START,
- TOK_TTYPE_HYPERLINK_END,
- TOK_TTYPE_BIBLIOGRAPHY,
- TOK_TTYPE_INVALID
-};
-
-enum TemplateParamEnum
-{
- TOK_TPARAM_TOKEN_TYPE,
- TOK_TPARAM_CHAR_STYLE,
- TOK_TPARAM_TAB_RIGHT_ALIGNED,
- TOK_TPARAM_TAB_POSITION,
- TOK_TPARAM_TAB_FILL_CHAR,
- TOK_TPARAM_TEXT,
- TOK_TPARAM_CHAPTER_FORMAT,
- TOK_TPARAM_BIBLIOGRAPHY_DATA
-};
-
-SvXMLEnumStringMapEntry __READONLY_DATA aTemplateTypeMap[] =
-{
- ENUM_STRING_MAP_ENTRY( "TokenEntryNumber", TOK_TTYPE_ENTRY_NUMBER ),
- ENUM_STRING_MAP_ENTRY( "TokenEntryText", TOK_TTYPE_ENTRY_TEXT ),
- ENUM_STRING_MAP_ENTRY( "TokenTabStop", TOK_TTYPE_TAB_STOP ),
- ENUM_STRING_MAP_ENTRY( "TokenText", TOK_TTYPE_TEXT ),
- ENUM_STRING_MAP_ENTRY( "TokenPageNumber", TOK_TTYPE_PAGE_NUMBER ),
- ENUM_STRING_MAP_ENTRY( "TokenChapterInfo", TOK_TTYPE_CHAPTER_INFO ),
- ENUM_STRING_MAP_ENTRY( "TokenHyperlinkStart", TOK_TTYPE_HYPERLINK_START ),
- ENUM_STRING_MAP_ENTRY( "TokenHyperlinkEnd", TOK_TTYPE_HYPERLINK_END ),
- ENUM_STRING_MAP_ENTRY( "TokenBibliographyDataField", TOK_TTYPE_BIBLIOGRAPHY ),
- ENUM_STRING_MAP_END()
-};
-
-SvXMLEnumStringMapEntry __READONLY_DATA aTemplateParamMap[] =
-{
- ENUM_STRING_MAP_ENTRY( "TokenType", TOK_TPARAM_TOKEN_TYPE ),
- ENUM_STRING_MAP_ENTRY( "CharacterStyleName", TOK_TPARAM_CHAR_STYLE ),
- ENUM_STRING_MAP_ENTRY( "TabStopRightAligned", TOK_TPARAM_TAB_RIGHT_ALIGNED ),
- ENUM_STRING_MAP_ENTRY( "TabStopPosition", TOK_TPARAM_TAB_POSITION ),
- ENUM_STRING_MAP_ENTRY( "TabStopFillCharacter", TOK_TPARAM_TAB_FILL_CHAR ),
- ENUM_STRING_MAP_ENTRY( "Text", TOK_TPARAM_TEXT ),
- ENUM_STRING_MAP_ENTRY( "ChapterFormat", TOK_TPARAM_CHAPTER_FORMAT ),
- ENUM_STRING_MAP_ENTRY( "BibliographyDataField", TOK_TPARAM_BIBLIOGRAPHY_DATA ),
- ENUM_STRING_MAP_END()
-};
-
-SvXMLEnumMapEntry __READONLY_DATA aBibliographyDataFieldMap[] =
-{
- { XML_ADDRESS, BibliographyDataField::ADDRESS },
- { XML_ANNOTE, BibliographyDataField::ANNOTE },
- { XML_AUTHOR, BibliographyDataField::AUTHOR },
- { XML_BIBLIOGRAPHY_TYPE, BibliographyDataField::BIBILIOGRAPHIC_TYPE },
- { XML_BOOKTITLE, BibliographyDataField::BOOKTITLE },
- { XML_CHAPTER, BibliographyDataField::CHAPTER },
- { XML_CUSTOM1, BibliographyDataField::CUSTOM1 },
- { XML_CUSTOM2, BibliographyDataField::CUSTOM2 },
- { XML_CUSTOM3, BibliographyDataField::CUSTOM3 },
- { XML_CUSTOM4, BibliographyDataField::CUSTOM4 },
- { XML_CUSTOM5, BibliographyDataField::CUSTOM5 },
- { XML_EDITION, BibliographyDataField::EDITION },
- { XML_EDITOR, BibliographyDataField::EDITOR },
- { XML_HOWPUBLISHED, BibliographyDataField::HOWPUBLISHED },
- { XML_IDENTIFIER, BibliographyDataField::IDENTIFIER },
- { XML_INSTITUTION, BibliographyDataField::INSTITUTION },
- { XML_ISBN, BibliographyDataField::ISBN },
- { XML_JOURNAL, BibliographyDataField::JOURNAL },
- { XML_MONTH, BibliographyDataField::MONTH },
- { XML_NOTE, BibliographyDataField::NOTE },
- { XML_NUMBER, BibliographyDataField::NUMBER },
- { XML_ORGANIZATIONS, BibliographyDataField::ORGANIZATIONS },
- { XML_PAGES, BibliographyDataField::PAGES },
- { XML_PUBLISHER, BibliographyDataField::PUBLISHER },
- { XML_REPORT_TYPE, BibliographyDataField::REPORT_TYPE },
- { XML_SCHOOL, BibliographyDataField::SCHOOL },
- { XML_SERIES, BibliographyDataField::SERIES },
- { XML_TITLE, BibliographyDataField::TITLE },
- { XML_URL, BibliographyDataField::URL },
- { XML_VOLUME, BibliographyDataField::VOLUME },
- { XML_YEAR, BibliographyDataField::YEAR },
- { XML_TOKEN_INVALID, 0 }
-};
-
-void XMLSectionExport::ExportIndexTemplateElement(
- Sequence<PropertyValue> & rValues)
-{
- // variables for template values
-
- // char style
- OUString sCharStyle;
- sal_Bool bCharStyleOK = sal_False;
-
- // text
- OUString sText;
- sal_Bool bTextOK = sal_False;
-
- // tab position
- sal_Bool bRightAligned = sal_False;
- sal_Bool bRightAlignedOK = sal_False;
-
- // tab position
- sal_Int32 nTabPosition = 0;
- sal_Bool bTabPositionOK = sal_False;
-
- // fill character
- OUString sFillChar;
- sal_Bool bFillCharOK = sal_False;
-
- // chapter format
- sal_Int16 nChapterFormat = 0;
- sal_Bool bChapterFormatOK = sal_False;
-
- // Bibliography Data
- sal_Int16 nBibliographyData = 0;
- sal_Bool bBibliographyDataOK = sal_False;
-
-
- // token type
- enum TemplateTypeEnum nTokenType = TOK_TTYPE_INVALID;
-
- sal_Int32 nCount = rValues.getLength();
- for(sal_Int32 i = 0; i<nCount; i++)
- {
- sal_uInt16 nToken;
- if ( SvXMLUnitConverter::convertEnum( nToken, rValues[i].Name,
- aTemplateParamMap ) )
- {
- // Only use direct and default values.
- // Wrong. no property states, so ignore.
- // if ( (beans::PropertyState_DIRECT_VALUE == rValues[i].State) ||
- // (beans::PropertyState_DEFAULT_VALUE == rValues[i].State) )
-
- switch (nToken)
- {
- case TOK_TPARAM_TOKEN_TYPE:
- {
- sal_uInt16 nTmp;
- OUString sVal;
- rValues[i].Value >>= sVal;
- if (SvXMLUnitConverter::convertEnum( nTmp, sVal,
- aTemplateTypeMap))
- {
- nTokenType = (enum TemplateTypeEnum)nTmp;
- }
- break;
- }
-
- case TOK_TPARAM_CHAR_STYLE:
- // only valid, if not empty
- rValues[i].Value >>= sCharStyle;
- bCharStyleOK = sCharStyle.getLength() > 0;
- break;
-
- case TOK_TPARAM_TEXT:
- rValues[i].Value >>= sText;
- bTextOK = sal_True;
- break;
-
- case TOK_TPARAM_TAB_RIGHT_ALIGNED:
- bRightAligned =
- *(sal_Bool *)rValues[i].Value.getValue();
- bRightAlignedOK = sal_True;
- break;
-
- case TOK_TPARAM_TAB_POSITION:
- rValues[i].Value >>= nTabPosition;
- bTabPositionOK = sal_True;
- break;
-
- case TOK_TPARAM_TAB_FILL_CHAR:
- rValues[i].Value >>= sFillChar;
- bFillCharOK = sal_True;
- break;
-
- case TOK_TPARAM_CHAPTER_FORMAT:
- rValues[i].Value >>= nChapterFormat;
- bChapterFormatOK = sal_True;
- break;
- case TOK_TPARAM_BIBLIOGRAPHY_DATA:
- rValues[i].Value >>= nBibliographyData;
- bBibliographyDataOK = sal_True;
- break;
- }
- }
- }
-
- // convert type to token (and check validity) ...
- sal_Char* pElement = NULL;
- switch(nTokenType)
- {
- case TOK_TTYPE_ENTRY_TEXT:
- pElement = sXML_index_entry_text;
- break;
- case TOK_TTYPE_TAB_STOP:
- // test validity
- pElement = ( bRightAligned || bTabPositionOK || bFillCharOK )
- ? sXML_index_entry_tab_stop : NULL;
- break;
- case TOK_TTYPE_TEXT:
- // test validity
- pElement = bTextOK ? sXML_index_entry_span : NULL;
- break;
- case TOK_TTYPE_PAGE_NUMBER:
- pElement = sXML_index_entry_page_number;
- break;
- case TOK_TTYPE_CHAPTER_INFO: // keyword index
- pElement = sXML_index_entry_chapter;
- break;
- case TOK_TTYPE_ENTRY_NUMBER: // table of content
- pElement = sXML_index_entry_chapter_number;
- break;
- case TOK_TTYPE_HYPERLINK_START:
- pElement = sXML_index_entry_link_start;
- break;
- case TOK_TTYPE_HYPERLINK_END:
- pElement = sXML_index_entry_link_end;
- break;
- case TOK_TTYPE_BIBLIOGRAPHY:
- pElement = bBibliographyDataOK
- ? sXML_index_entry_bibliography : NULL;
- break;
- default:
- ; // unknown/unimplemented template
- break;
- }
-
- // ... and write Element
- if (pElement != NULL)
- {
- // character style (for most templates)
- if (bCharStyleOK)
- {
- switch (nTokenType)
- {
- case TOK_TTYPE_ENTRY_TEXT:
- case TOK_TTYPE_TEXT:
- case TOK_TTYPE_PAGE_NUMBER:
- case TOK_TTYPE_ENTRY_NUMBER:
- case TOK_TTYPE_HYPERLINK_START:
- case TOK_TTYPE_HYPERLINK_END:
- case TOK_TTYPE_BIBLIOGRAPHY:
- case TOK_TTYPE_CHAPTER_INFO:
- case TOK_TTYPE_TAB_STOP:
- GetExport().AddAttribute(XML_NAMESPACE_TEXT,
- XML_STYLE_NAME, sCharStyle);
- break;
- default:
- ; // nothing: no character style
- break;
- }
- }
-
- // tab properties
- if (TOK_TTYPE_TAB_STOP == nTokenType)
- {
- // tab type
- GetExport().AddAttribute(XML_NAMESPACE_STYLE, XML_TYPE,
- bRightAligned ? XML_RIGHT : XML_LEFT);
-
- if (bTabPositionOK && (! bRightAligned))
- {
- // position for left tabs (convert to measure)
- OUStringBuffer sBuf;
- GetExport().GetMM100UnitConverter().convertMeasure(sBuf,
- nTabPosition);
- GetExport().AddAttribute(XML_NAMESPACE_STYLE,
- XML_POSITION,
- sBuf.makeStringAndClear());
- }
-
- // fill char ("leader char")
- if (bFillCharOK && (sFillChar.getLength() > 0))
- {
- GetExport().AddAttribute(XML_NAMESPACE_STYLE,
- XML_LEADER_CHAR, sFillChar);
- }
- }
-
- // bibliography data
- if (TOK_TTYPE_BIBLIOGRAPHY == nTokenType)
- {
- DBG_ASSERT(bBibliographyDataOK, "need bibl data");
- OUStringBuffer sBuf;
- if (SvXMLUnitConverter::convertEnum( sBuf, nBibliographyData,
- aBibliographyDataFieldMap ) )
- {
- GetExport().AddAttribute(XML_NAMESPACE_TEXT,
- XML_BIBLIOGRAPHY_DATA_FIELD,
- sBuf.makeStringAndClear());
- }
- }
-
- // chapter info
- if (TOK_TTYPE_CHAPTER_INFO == nTokenType)
- {
- DBG_ASSERT(bChapterFormatOK, "need chapter info");
- GetExport().AddAttribute(
- XML_NAMESPACE_TEXT, XML_DISPLAY,
- XMLTextFieldExport::MapChapterDisplayFormat(nChapterFormat));
- }
-
- // export template
- SvXMLElementExport aTemplateElement(GetExport(), XML_NAMESPACE_TEXT,
- pElement, sal_True, sal_False);
-
- // entry text or span element: write text
- if (TOK_TTYPE_TEXT == nTokenType)
- {
- GetExport().Characters(sText);
- }
- }
-}
-
-void XMLSectionExport::ExportLevelParagraphStyles(
- Reference<XIndexReplace> & xLevelParagraphStyles)
-{
- // iterate over levels
- sal_Int32 nPLevelCount = xLevelParagraphStyles->getCount();
- for(sal_Int32 nLevel = 0; nLevel < nPLevelCount; nLevel++)
- {
- Any aAny = xLevelParagraphStyles->getByIndex(nLevel);
- Sequence<OUString> aStyleNames;
- aAny >>= aStyleNames;
-
- // export only if at least one style is contained
- sal_Int32 nNamesCount = aStyleNames.getLength();
- if (nNamesCount > 0)
- {
- // level attribute; we count 1..10; API 0..9
- OUStringBuffer sBuf;
- sal_Int32 nLevelPlusOne = nLevel + 1;
- SvXMLUnitConverter::convertNumber(sBuf, nLevelPlusOne);
- GetExport().AddAttribute(XML_NAMESPACE_TEXT,
- XML_OUTLINE_LEVEL,
- sBuf.makeStringAndClear());
-
- // source styles element
- SvXMLElementExport aParaStyles(GetExport(),
- XML_NAMESPACE_TEXT,
- XML_INDEX_SOURCE_STYLES,
- sal_True, sal_True);
-
- // iterate over styles in this level
- for(sal_Int32 nName = 0; nName < nNamesCount; nName++)
- {
- // stylename attribute
- GetExport().AddAttribute(XML_NAMESPACE_TEXT,
- XML_STYLE_NAME,
- aStyleNames[nName]);
-
- // element
- SvXMLElementExport aParaStyle(GetExport(),
- XML_NAMESPACE_TEXT,
- XML_INDEX_SOURCE_STYLE,
- sal_True, sal_False);
- }
- }
- }
-}
-
-void XMLSectionExport::ExportBoolean(
- const Reference<XPropertySet> & rPropSet,
- const OUString& sPropertyName,
- enum XMLTokenEnum eAttributeName,
- sal_Bool bDefault,
- sal_Bool bInvert)
-{
- DBG_ASSERT(eAttributeName != XML_TOKEN_INVALID, "Need attribute name");
-
- Any aAny = rPropSet->getPropertyValue(sPropertyName);
- sal_Bool bTmp = *(sal_Bool*)aAny.getValue();
-
- // value = value ^ bInvert
- // omit if value == default
- // negate forces sal_Bool to 0/1, making them comparable
- if ((!(bTmp ^ bInvert)) != (!bDefault))
- {
- // export non-default value (since default is omitted)
- GetExport().AddAttribute(XML_NAMESPACE_TEXT,
- eAttributeName,
- bDefault ? XML_FALSE : XML_TRUE);
- }
-}
-
-const sal_Char sAPI_FieldMaster_Bibliography[] =
- "com.sun.star.text.FieldMaster.Bibliography";
-const sal_Char sAPI_SortKey[] = "SortKey";
-const sal_Char sAPI_IsSortAscending[] = "IsSortAscending";
-
-void XMLSectionExport::ExportBibliographyConfiguration(SvXMLExport& rExport)
-{
- // first: get field master (via text field supplier)
- Reference<XTextFieldsSupplier> xTextFieldsSupp( rExport.GetModel(),
- UNO_QUERY );
- if ( xTextFieldsSupp.is() )
- {
- const OUString sFieldMaster_Bibliography(
- RTL_CONSTASCII_USTRINGPARAM(sAPI_FieldMaster_Bibliography));
-
- // get bibliography field master
- Reference<XNameAccess> xMasters =
- xTextFieldsSupp->getTextFieldMasters();
- if ( xMasters->hasByName(sFieldMaster_Bibliography) )
- {
- Any aAny =
- xMasters->getByName(sFieldMaster_Bibliography);
- Reference<XPropertySet> xPropSet;
- aAny >>= xPropSet;
-
- DBG_ASSERT( xPropSet.is(), "field master must have XPropSet" );
-
- const OUString sBracketBefore(
- RTL_CONSTASCII_USTRINGPARAM("BracketBefore"));
- const OUString sBracketAfter(
- RTL_CONSTASCII_USTRINGPARAM("BracketAfter"));
- const OUString sIsNumberEntries(
- RTL_CONSTASCII_USTRINGPARAM("IsNumberEntries"));
- const OUString sIsSortByPosition(
- RTL_CONSTASCII_USTRINGPARAM("IsSortByPosition"));
- const OUString sSortKeys(
- RTL_CONSTASCII_USTRINGPARAM("SortKeys"));
- const OUString sSortAlgorithm(
- RTL_CONSTASCII_USTRINGPARAM("SortAlgorithm"));
- const OUString sLocale(
- RTL_CONSTASCII_USTRINGPARAM("Locale"));
-
- OUString sTmp;
-
- aAny = xPropSet->getPropertyValue(sBracketBefore);
- aAny >>= sTmp;
- rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_PREFIX, sTmp);
-
- aAny = xPropSet->getPropertyValue(sBracketAfter);
- aAny >>= sTmp;
- rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_SUFFIX, sTmp);
-
- aAny = xPropSet->getPropertyValue(sIsNumberEntries);
- if (*(sal_Bool*)aAny.getValue())
- {
- rExport.AddAttribute(XML_NAMESPACE_TEXT,
- XML_NUMBERED_ENTRIES, XML_TRUE);
- }
-
- aAny = xPropSet->getPropertyValue(sIsSortByPosition);
- if (! *(sal_Bool*)aAny.getValue())
- {
- rExport.AddAttribute(XML_NAMESPACE_TEXT,
- XML_SORT_BY_POSITION, XML_FALSE);
- }
-
- // sort algorithm
- aAny = xPropSet->getPropertyValue(sSortAlgorithm);
- OUString sAlgorithm;
- aAny >>= sAlgorithm;
- if( sAlgorithm.getLength() > 0 )
- {
- rExport.AddAttribute( XML_NAMESPACE_TEXT,
- XML_SORT_ALGORITHM, sAlgorithm );
- }
-
- // locale
- aAny = xPropSet->getPropertyValue(sLocale);
- Locale aLocale;
- aAny >>= aLocale;
- rExport.AddAttribute(XML_NAMESPACE_FO, XML_LANGUAGE,
- aLocale.Language);
- rExport.AddAttribute(XML_NAMESPACE_FO, XML_COUNTRY,
- aLocale.Country);
-
- // configuration element
- SvXMLElementExport aElement(rExport, XML_NAMESPACE_TEXT,
- XML_BIBLIOGRAPHY_CONFIGURATION,
- sal_True, sal_True);
-
- // sort keys
- aAny = xPropSet->getPropertyValue(sSortKeys);
- Sequence<Sequence<PropertyValue> > aKeys;
- aAny >>= aKeys;
- sal_Int32 nKeysCount = aKeys.getLength();
- for(sal_Int32 nKeys = 0; nKeys < nKeysCount; nKeys++)
- {
- Sequence<PropertyValue> & rKey = aKeys[nKeys];
-
- sal_Int32 nKeyCount = rKey.getLength();
- for(sal_Int32 nKey = 0; nKey < nKeyCount; nKey++)
- {
- PropertyValue& rValue = rKey[nKey];
-
- if (rValue.Name.equalsAsciiL(sAPI_SortKey,
- sizeof(sAPI_SortKey)-1))
- {
- sal_Int16 nKey;
- rValue.Value >>= nKey;
- OUStringBuffer sBuf;
- if (SvXMLUnitConverter::convertEnum( sBuf, nKey,
- aBibliographyDataFieldMap ) )
- {
- rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_KEY,
- sBuf.makeStringAndClear());
- }
- }
- else if (rValue.Name.equalsAsciiL(sAPI_IsSortAscending,
- sizeof(sAPI_IsSortAscending)-1))
- {
- sal_Bool bTmp = *(sal_Bool*)rValue.Value.getValue();
- rExport.AddAttribute(XML_NAMESPACE_TEXT,
- XML_SORT_ASCENDING,
- bTmp ? XML_TRUE : XML_FALSE);
- }
- }
-
- SvXMLElementExport aKeyElem(rExport,
- XML_NAMESPACE_TEXT, XML_SORT_KEY,
- sal_True, sal_True);
- }
- }
- }
-}
-
-
-sal_Bool XMLSectionExport::IsMuteSection(
- const Reference<XTextSection> & rSection) const
-{
- sal_Bool bRet = sal_False;
-
- // a section is mute if
- // 1) it exists
- // 2) the SaveLinkedSections flag (at the export) is false
- // 3) the IsGlobalDocumentSection property is true
- // 4) it is not an Index
-
- if ( (!rExport.IsSaveLinkedSections()) && rSection.is() )
- {
- // walk the section chain and set bRet if any is linked
- for(Reference<XTextSection> aSection(rSection);
- aSection.is();
- aSection = aSection->getParentSection())
- {
- // check if it is a global document section (linked or index)
- Reference<XPropertySet> xPropSet(aSection, UNO_QUERY);
- if (xPropSet.is())
- {
- Any aAny = xPropSet->getPropertyValue(sIsGlobalDocumentSection);
-
- if ( *(sal_Bool*)aAny.getValue() )
- {
- Reference<XDocumentIndex> xIndex;
- if (! GetIndex(rSection, xIndex))
- {
- bRet = sal_True;
-
- // early out if result is known
- break;
- }
- }
- }
- // section has no properties: ignore
- }
- }
- // else: no section, or always save sections: default (false)
-
- return bRet;
-}
-
-sal_Bool XMLSectionExport::IsMuteSection(
- const Reference<XTextContent> & rSection,
- sal_Bool bDefault) const
-{
- // default: like default argument
- sal_Bool bRet = bDefault;
-
- Reference<XPropertySet> xPropSet(rSection->getAnchor(), UNO_QUERY);
- if (xPropSet.is())
- {
- if (xPropSet->getPropertySetInfo()->hasPropertyByName(sTextSection))
- {
- Any aAny = xPropSet->getPropertyValue(sTextSection);
- Reference<XTextSection> xSection;
- aAny >>= xSection;
-
- bRet = IsMuteSection(xSection);
- }
- // else: return default
- }
- // else: return default
-
- return bRet;
-}
-
-sal_Bool XMLSectionExport::IsInSection(
- const Reference<XTextSection> & rEnclosingSection,
- const Reference<XTextContent> & rContent,
- sal_Bool bDefault)
-{
- // default: like default argument
- sal_Bool bRet = bDefault;
- DBG_ASSERT(rEnclosingSection.is(), "enclosing section expected");
-
- Reference<XPropertySet> xPropSet(rContent, UNO_QUERY);
- if (xPropSet.is())
- {
- if (xPropSet->getPropertySetInfo()->hasPropertyByName(sTextSection))
- {
- Any aAny = xPropSet->getPropertyValue(sTextSection);
- Reference<XTextSection> xSection;
- aAny >>= xSection;
-
- // now walk chain of text sections (if we have one)
- if (xSection.is())
- {
- do
- {
- bRet = (rEnclosingSection == xSection);
- xSection = xSection->getParentSection();
- }
- while (!bRet && xSection.is());
- }
- else
- bRet = sal_False; // no section -> can't be inside
- }
- // else: no TextSection property -> return default
- }
- // else: no XPropertySet -> return default
-
- return bRet;
-}
-
-
-void XMLSectionExport::ExportMasterDocHeadingDummies()
-{
- if( bHeadingDummiesExported )
- return;
-
- Reference< XChapterNumberingSupplier > xCNSupplier( rExport.GetModel(),
- UNO_QUERY );
-
- Reference< XIndexReplace > xChapterNumbering;
- if( xCNSupplier.is() )
- xChapterNumbering = xCNSupplier->getChapterNumberingRules();
-
- if( !xChapterNumbering.is() )
- return;
-
- sal_Int32 nCount = xChapterNumbering->getCount();
- for( sal_Int32 nLevel = 0; nLevel < nCount; nLevel++ )
- {
- OUString sStyle;
- Sequence<PropertyValue> aProperties;
- xChapterNumbering->getByIndex( nLevel ) >>= aProperties;
- for( sal_Int32 i = 0; i < aProperties.getLength(); i++ )
- {
- if( aProperties[i].Name == sHeadingStyleName )
- {
- aProperties[i].Value >>= sStyle;
- break;
- }
- }
- if( sStyle.getLength() > 0 )
- {
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME,
- sStyle );
-
- OUStringBuffer sTmp;
- sTmp.append( nLevel+1L );
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_LEVEL,
- sTmp.makeStringAndClear() );
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, XML_H,
- sal_True, sal_False );
- }
- }
-
- bHeadingDummiesExported = sal_True;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLSectionFootnoteConfigExport.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLSectionFootnoteConfigExport.cxx
deleted file mode 100644
index 2cf9e4c53cff..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLSectionFootnoteConfigExport.cxx
+++ /dev/null
@@ -1,200 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLSectionFootnoteConfigExport.hxx"
-
-#include "xmlexp.hxx"
-
-
-#include <com/sun/star/style/NumberingType.hpp>
-
-
-#include "txtprmap.hxx"
-
-
-#include "xmlnmspe.hxx"
-
-#include "xmluconv.hxx"
-
-
-
-#include <tools/debug.hxx>
-
-#include "rtl/ustring.hxx"
-
-
-#include <vector>
-namespace binfilter {
-
-
-using namespace ::binfilter::xmloff::token;
-
-using ::std::vector;
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::style::NumberingType::ARABIC;
-
-
-void XMLSectionFootnoteConfigExport::exportXML(
- SvXMLExport& rExport,
- sal_Bool bEndnote,
- const vector<XMLPropertyState> *pProperties,
- sal_uInt32 nIdx,
- const UniReference<XMLPropertySetMapper> & rMapper)
-{
- // store and initialize the values
- sal_Bool bNumOwn = sal_False;
- sal_Bool bNumRestart = sal_False;
- sal_Int16 nNumRestartAt = 0;
- sal_Int16 nNumberingType = ARABIC;
- OUString sNumPrefix;
- OUString sNumSuffix;
- sal_Bool bEnd = sal_False;
-
- // find entries in property states vector
- sal_uInt32 nCount = pProperties->size();
- for(sal_uInt32 i = 0; i < nCount; i++)
- {
- const XMLPropertyState& rState = (*pProperties)[i];
-
- sal_Int16 nContextId = rMapper->GetEntryContextId(rState.mnIndex);
- if (!bEndnote)
- {
- switch (nContextId)
- {
- case CTF_SECTION_FOOTNOTE_NUM_OWN:
- rState.maValue >>= bNumOwn;
- break;
- case CTF_SECTION_FOOTNOTE_NUM_RESTART:
- rState.maValue >>= bNumRestart;
- break;
- case CTF_SECTION_FOOTNOTE_NUM_RESTART_AT:
- rState.maValue >>= nNumRestartAt;
- break;
- case CTF_SECTION_FOOTNOTE_NUM_TYPE:
- rState.maValue >>= nNumberingType;
- break;
- case CTF_SECTION_FOOTNOTE_NUM_PREFIX:
- rState.maValue >>= sNumPrefix;
- break;
- case CTF_SECTION_FOOTNOTE_NUM_SUFFIX:
- rState.maValue >>= sNumSuffix;
- break;
- case CTF_SECTION_FOOTNOTE_END:
- DBG_ASSERT( i == nIdx,
- "received wrong property state index" );
- rState.maValue >>= bEnd;
- break;
- }
- }
- else
- {
- switch (nContextId)
- {
- case CTF_SECTION_ENDNOTE_NUM_OWN:
- rState.maValue >>= bNumOwn;
- break;
- case CTF_SECTION_ENDNOTE_NUM_RESTART:
- rState.maValue >>= bNumRestart;
- break;
- case CTF_SECTION_ENDNOTE_NUM_RESTART_AT:
- rState.maValue >>= nNumRestartAt;
- break;
- case CTF_SECTION_ENDNOTE_NUM_TYPE:
- rState.maValue >>= nNumberingType;
- break;
- case CTF_SECTION_ENDNOTE_NUM_PREFIX:
- rState.maValue >>= sNumPrefix;
- break;
- case CTF_SECTION_ENDNOTE_NUM_SUFFIX:
- rState.maValue >>= sNumSuffix;
- break;
- case CTF_SECTION_ENDNOTE_END:
- DBG_ASSERT( i == nIdx,
- "received wrong property state index" );
- rState.maValue >>= bEnd;
- break;
- }
- }
- }
-
- // we only make an element if we have an own footnote/endnote numbering
- if (bEnd)
- {
- // start numbering
- OUStringBuffer sBuf;
- if (bNumRestart)
- {
- // restart number is stored as 0.., but interpreted as 1..
- SvXMLUnitConverter::convertNumber(sBuf,
- (sal_Int32)(nNumRestartAt+1));
- rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_START_VALUE,
- sBuf.makeStringAndClear());
- }
-
- if (bNumOwn)
- {
- // prefix and suffix
- if (sNumPrefix.getLength() > 0)
- {
- rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_PREFIX,
- sNumPrefix);
- }
- if (sNumSuffix.getLength() > 0)
- {
- rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_SUFFIX,
- sNumSuffix);
- }
-
- // number type: num format
- rExport.GetMM100UnitConverter().convertNumFormat( sBuf,
- nNumberingType );
- rExport.AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_FORMAT,
- sBuf.makeStringAndClear());
-
- // and letter sync, if applicable
- rExport.GetMM100UnitConverter().convertNumLetterSync(
- sBuf, nNumberingType );
- if (sBuf.getLength())
- {
- rExport.AddAttribute(XML_NAMESPACE_STYLE,
- XML_NUM_LETTER_SYNC,
- sBuf.makeStringAndClear());
- }
- }
-
- // and finally, the element
- SvXMLElementExport rElem(rExport, XML_NAMESPACE_TEXT,
- (bEndnote ? XML_ENDNOTES_CONFIGURATION :
- XML_FOOTNOTES_CONFIGURATION ),
- sal_True, sal_True);
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLSectionFootnoteConfigImport.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLSectionFootnoteConfigImport.cxx
deleted file mode 100644
index b2cbfbc53728..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLSectionFootnoteConfigImport.cxx
+++ /dev/null
@@ -1,201 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLSectionFootnoteConfigImport.hxx"
-
-#include "rtl/ustring.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-#include "xmlimp.hxx"
-
-
-#include "xmluconv.hxx"
-
-
-#include "xmlnmspe.hxx"
-
-#include "nmspmap.hxx"
-
-
-#include "xmlnumi.hxx"
-
-#include "txtprmap.hxx"
-
-#include <tools/debug.hxx>
-
-#include <vector>
-namespace binfilter {
-
-
-using namespace ::binfilter::xmloff::token;
-using namespace ::com::sun::star::style;
-
-using ::rtl::OUString;
-using ::std::vector;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::xml::sax::XAttributeList;
-
-
-TYPEINIT1(XMLSectionFootnoteConfigImport, SvXMLImportContext);
-
-
-XMLSectionFootnoteConfigImport::XMLSectionFootnoteConfigImport(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- vector<XMLPropertyState> & rProps,
- const UniReference<XMLPropertySetMapper> & rMapperRef,
- sal_Int32 nIndex) :
- SvXMLImportContext(rImport, nPrefix, rLocalName),
- rProperties(rProps),
- nPropIndex(nIndex),
- rMapper(rMapperRef)
-{
-}
-
-XMLSectionFootnoteConfigImport::~XMLSectionFootnoteConfigImport()
-{
-}
-
-void XMLSectionFootnoteConfigImport::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- sal_Bool bEnd = sal_True; // we're inside the element, so this is true
- sal_Bool bNumOwn = sal_False;
- sal_Bool bNumRestart = sal_False;
- sal_Int16 nNumRestartAt = 0;
- OUString sNumPrefix;
- OUString sNumSuffix;
- OUString sNumFormat;
- OUString sNumLetterSync;
-
- // iterate over xattribute list and fill values
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
- OUString sAttrValue = xAttrList->getValueByIndex(nAttr);
-
- if (XML_NAMESPACE_TEXT == nPrefix)
- {
- if (IsXMLToken(sLocalName, XML_START_VALUE))
- {
- sal_Int32 nTmp;
- if (SvXMLUnitConverter::convertNumber(nTmp, sAttrValue))
- {
- nNumRestartAt = nTmp - 1;
- bNumRestart = sal_True;
- }
- }
- }
- else if (XML_NAMESPACE_STYLE == nPrefix)
- {
- if (IsXMLToken(sLocalName, XML_NUM_PREFIX))
- {
- sNumPrefix = sAttrValue;
- bNumOwn = sal_True;
- }
- else if (IsXMLToken(sLocalName, XML_NUM_SUFFIX))
- {
- sNumSuffix = sAttrValue;
- bNumOwn = sal_True;
- }
- else if (IsXMLToken(sLocalName, XML_NUM_FORMAT))
- {
- sNumFormat = sAttrValue;
- bNumOwn = sal_True;
- }
- else if (IsXMLToken(sLocalName, XML_NUM_LETTER_SYNC))
- {
- sNumLetterSync = sAttrValue;
- bNumOwn = sal_True;
- }
- }
- }
-
- // OK, now we have all values and can fill the XMLPropertyState vector
- Any aAny;
- sal_Bool bEndnote = IsXMLToken(GetLocalName(), XML_ENDNOTES_CONFIGURATION);
-
- aAny.setValue( &bNumOwn, ::getBooleanCppuType() );
- sal_Int32 nIndex = rMapper->FindEntryIndex( bEndnote ?
- CTF_SECTION_ENDNOTE_NUM_OWN : CTF_SECTION_FOOTNOTE_NUM_OWN );
- XMLPropertyState aNumOwn( nIndex, aAny );
- rProperties.push_back( aNumOwn );
-
- aAny.setValue( &bNumRestart, ::getBooleanCppuType() );
- nIndex = rMapper->FindEntryIndex( bEndnote ?
- CTF_SECTION_ENDNOTE_NUM_RESTART : CTF_SECTION_FOOTNOTE_NUM_RESTART );
- XMLPropertyState aNumRestart( nIndex, aAny );
- rProperties.push_back( aNumRestart );
-
- aAny <<= nNumRestartAt;
- nIndex = rMapper->FindEntryIndex( bEndnote ?
- CTF_SECTION_ENDNOTE_NUM_RESTART_AT :
- CTF_SECTION_FOOTNOTE_NUM_RESTART_AT );
- XMLPropertyState aNumRestartAtState( nIndex, aAny );
- rProperties.push_back( aNumRestartAtState );
-
- sal_Int16 nNumType = NumberingType::ARABIC;
- GetImport().GetMM100UnitConverter().convertNumFormat( nNumType,
- sNumFormat,
- sNumLetterSync );
- aAny <<= nNumType;
- nIndex = rMapper->FindEntryIndex( bEndnote ?
- CTF_SECTION_ENDNOTE_NUM_TYPE : CTF_SECTION_FOOTNOTE_NUM_TYPE );
- XMLPropertyState aNumFormatState( nIndex, aAny );
- rProperties.push_back( aNumFormatState );
-
- aAny <<= sNumPrefix;
- nIndex = rMapper->FindEntryIndex( bEndnote ?
- CTF_SECTION_ENDNOTE_NUM_PREFIX : CTF_SECTION_FOOTNOTE_NUM_PREFIX );
- XMLPropertyState aPrefixState( nIndex, aAny );
- rProperties.push_back( aPrefixState );
-
- aAny <<= sNumSuffix;
- nIndex = rMapper->FindEntryIndex( bEndnote ?
- CTF_SECTION_ENDNOTE_NUM_SUFFIX : CTF_SECTION_FOOTNOTE_NUM_SUFFIX );
- XMLPropertyState aSuffixState( nIndex, aAny );
- rProperties.push_back( aSuffixState );
-
- aAny.setValue( &bEnd, ::getBooleanCppuType() );
- nIndex = rMapper->FindEntryIndex( bEndnote ?
- CTF_SECTION_ENDNOTE_END : CTF_SECTION_FOOTNOTE_END );
- DBG_ASSERT( nIndex == nPropIndex, "Wrong property mapper index received.");
- XMLPropertyState aEndState( nIndex, aAny );
- rProperties.push_back( aEndState );
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLSectionImportContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLSectionImportContext.cxx
deleted file mode 100644
index 92acd6f5ece9..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLSectionImportContext.cxx
+++ /dev/null
@@ -1,409 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLSectionImportContext.hxx"
-
-#include "XMLSectionSourceImportContext.hxx"
-
-#include "XMLSectionSourceDDEImportContext.hxx"
-
-
-#include "xmlimp.hxx"
-
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "xmluconv.hxx"
-
-#include "prstylei.hxx"
-
-
-#include <com/sun/star/uno/Reference.h>
-
-#include <com/sun/star/text/XTextContent.hpp>
-
-
-
-#include <com/sun/star/text/ControlCharacter.hpp>
-namespace binfilter {
-
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::container::XNamed;
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::text;
-using namespace ::binfilter::xmloff::token;
-
-
-TYPEINIT1( XMLSectionImportContext, SvXMLImportContext );
-
-const sal_Char sAPI_TextSection[] = "com.sun.star.text.TextSection";
-const sal_Char sAPI_IndexHeaderSection[] = "com.sun.star.text.IndexHeaderSection";
-const sal_Char sAPI_IsProtected[] = "IsProtected";
-const sal_Char sAPI_Condition[] = "Condition";
-const sal_Char sAPI_IsVisible[] = "IsVisible";
-const sal_Char sAPI_IsCurrentlyVisible[] = "IsCurrentlyVisible";
-const sal_Char sAPI_ProtectionKey[] = "ProtectionKey";
-
-enum XMLSectionToken
-{
- XML_TOK_SECTION_STYLE_NAME,
- XML_TOK_SECTION_NAME,
- XML_TOK_SECTION_CONDITION,
- XML_TOK_SECTION_DISPLAY,
- XML_TOK_SECTION_PROTECT,
- XML_TOK_SECTION_PROTECTION_KEY,
- XML_TOK_SECTION_IS_HIDDEN
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aSectionTokenMap[] =
-{
- { XML_NAMESPACE_TEXT, XML_STYLE_NAME, XML_TOK_SECTION_STYLE_NAME },
- { XML_NAMESPACE_TEXT, XML_NAME, XML_TOK_SECTION_NAME },
- { XML_NAMESPACE_TEXT, XML_CONDITION, XML_TOK_SECTION_CONDITION },
- { XML_NAMESPACE_TEXT, XML_DISPLAY, XML_TOK_SECTION_DISPLAY },
- { XML_NAMESPACE_TEXT, XML_PROTECTED, XML_TOK_SECTION_PROTECT },
- { XML_NAMESPACE_TEXT, XML_PROTECTION_KEY, XML_TOK_SECTION_PROTECTION_KEY},
- { XML_NAMESPACE_TEXT, XML_IS_HIDDEN, XML_TOK_SECTION_IS_HIDDEN },
- // compatibility with SRC629 (or earlier) versions
- { XML_NAMESPACE_TEXT, XML_PROTECT, XML_TOK_SECTION_PROTECT },
- XML_TOKEN_MAP_END
-};
-
-
-// section import: This one is fairly tricky due to a variety of
-// limits of the core or the API. The main problem is that if you
-// insert a section within another section, you can't move the cursor
-// between the ends of the inner and the enclosing section. To avoid
-// these problems, additional markers are first inserted and later deleted.
-XMLSectionImportContext::XMLSectionImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName ) :
- SvXMLImportContext(rImport, nPrfx, rLocalName),
- xStartRange(),
- xEndRange(),
- xSectionPropertySet(),
- sTextSection(RTL_CONSTASCII_USTRINGPARAM(sAPI_TextSection)),
- sIndexHeaderSection(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_IndexHeaderSection)),
- sCondition(RTL_CONSTASCII_USTRINGPARAM(sAPI_Condition)),
- sIsVisible(RTL_CONSTASCII_USTRINGPARAM(sAPI_IsVisible)),
- sProtectionKey(RTL_CONSTASCII_USTRINGPARAM(sAPI_ProtectionKey)),
- sIsProtected(RTL_CONSTASCII_USTRINGPARAM(sAPI_IsProtected)),
- sIsCurrentlyVisible(RTL_CONSTASCII_USTRINGPARAM(sAPI_IsCurrentlyVisible)),
- sStyleName(),
- sName(),
- sCond(),
- sEmpty(),
- bValid(sal_False),
- bCondOK(sal_False),
- bIsVisible(sal_True),
- bSequenceOK(sal_False),
- bProtect(sal_False),
- bHasContent(sal_False),
- bIsCurrentlyVisible(sal_True),
- bIsCurrentlyVisibleOK(sal_False)
-{
-}
-
-XMLSectionImportContext::~XMLSectionImportContext()
-{
-}
-
-void XMLSectionImportContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- // process attributes
- ProcessAttributes(xAttrList);
-
- // process index headers:
- sal_Bool bIsIndexHeader = IsXMLToken( GetLocalName(), XML_INDEX_TITLE );
- if (bIsIndexHeader)
- {
- bValid = sal_True;
- }
-
- UniReference<XMLTextImportHelper> rHelper = GetImport().GetTextImport();
-
- // valid?
- if (bValid)
- {
- // create text section (as XPropertySet)
- Reference<XMultiServiceFactory> xFactory(
- GetImport().GetModel(),UNO_QUERY);
- if (xFactory.is())
- {
- Reference<XInterface> xIfc =
- xFactory->createInstance( bIsIndexHeader ? sIndexHeaderSection
- : sTextSection );
- if (xIfc.is())
- {
- Reference<XPropertySet> xPropSet(xIfc, UNO_QUERY);
-
- // save PropertySet (for CreateChildContext)
- xSectionPropertySet = xPropSet;
-
- // name
- Reference<XNamed> xNamed(xPropSet, UNO_QUERY);
- xNamed->setName(sName);
-
- // stylename?
- if (sStyleName.getLength() > 0)
- {
- XMLPropStyleContext* pStyle = rHelper->
- FindSectionStyle(sStyleName);
-
- if (pStyle != NULL)
- {
- pStyle->FillPropertySet( xPropSet );
- }
- }
-
- // IsVisible and condition (not for index headers)
- if (! bIsIndexHeader)
- {
- Any aAny;
- aAny.setValue( &bIsVisible, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( sIsVisible, aAny );
-
- // #97450# hidden sections must be hidden on reload
- // For backwards compatibilty, set flag only if it is
- // present
- if( bIsCurrentlyVisibleOK )
- {
- aAny.setValue( &bIsCurrentlyVisible,
- ::getBooleanCppuType() );
- xPropSet->setPropertyValue( sIsCurrentlyVisible, aAny);
- }
-
- if (bCondOK)
- {
- aAny <<= sCond;
- xPropSet->setPropertyValue( sCondition, aAny );
- }
- }
-
- // password (only for regular sections)
- if ( bSequenceOK &&
- IsXMLToken(GetLocalName(), XML_SECTION) )
- {
- Any aAny;
- aAny <<= aSequence;
- xPropSet->setPropertyValue(sProtectionKey, aAny);
- }
-
- // protection
- Any aAny;
- aAny.setValue( &bProtect, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( sIsProtected, aAny );
-
- // insert marker, <paragraph>, marker; then insert
- // section over the first marker character, and delete the
- // last paragraph (and marker) when closing a section.
- Reference<XTextRange> xStart =
- rHelper->GetCursor()->getStart();
-#ifndef DBG_UTIL
- static const sal_Char sMarker[] = " ";
-#else
- static const sal_Char sMarker[] = "X";
-#endif
- OUString sMarkerString(RTL_CONSTASCII_USTRINGPARAM(sMarker));
- rHelper->InsertString(sMarkerString);
- rHelper->InsertControlCharacter(
- ControlCharacter::APPEND_PARAGRAPH );
- rHelper->InsertString(sMarkerString);
-
- // select first marker
- rHelper->GetCursor()->gotoRange(xStart, sal_False);
- rHelper->GetCursor()->goRight(1, sal_True);
-
- // convert section to XTextContent
- Reference<XTextContent> xTextContent(xSectionPropertySet,
- UNO_QUERY);
-
- // and insert (over marker)
- rHelper->GetText()->insertTextContent(
- rHelper->GetCursorAsRange(), xTextContent, sal_True );
-
- // and delete first marker (in section)
- rHelper->GetText()->insertString(
- rHelper->GetCursorAsRange(), sEmpty, sal_True);
-
- // finally, check for redlines that should start at
- // the section start node
- rHelper->RedlineAdjustStartNodeCursor(sal_True); // start ???
- }
- }
- }
-}
-
-void XMLSectionImportContext::ProcessAttributes(
- const Reference<XAttributeList> & xAttrList )
-{
- SvXMLTokenMap aTokenMap(aSectionTokenMap);
-
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
- OUString sAttr = xAttrList->getValueByIndex(nAttr);
-
- switch (aTokenMap.Get(nPrefix, sLocalName))
- {
- case XML_TOK_SECTION_STYLE_NAME:
- sStyleName = sAttr;
- break;
- case XML_TOK_SECTION_NAME:
- sName = sAttr;
- bValid = sal_True;
- break;
- case XML_TOK_SECTION_CONDITION:
- sCond = sAttr;
- bCondOK = sal_True;
- break;
- case XML_TOK_SECTION_DISPLAY:
- if (IsXMLToken(sAttr, XML_TRUE))
- {
- bIsVisible = sal_True;
- }
- else if ( IsXMLToken(sAttr, XML_NONE) ||
- IsXMLToken(sAttr, XML_CONDITION) )
- {
- bIsVisible = sal_False;
- }
- // else: ignore
- break;
- case XML_TOK_SECTION_IS_HIDDEN:
- {
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(bTmp, sAttr))
- {
- bIsCurrentlyVisible = !bTmp;
- bIsCurrentlyVisibleOK = sal_True;
- }
- }
- break;
- case XML_TOK_SECTION_PROTECTION_KEY:
- SvXMLUnitConverter::decodeBase64(aSequence, sAttr);
- bSequenceOK = sal_True;
- break;
- case XML_TOK_SECTION_PROTECT:
- {
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(bTmp, sAttr))
- {
- bProtect = bTmp;
- }
- break;
- }
- default:
- ; // ignore
- break;
- }
- }
-}
-
-void XMLSectionImportContext::EndElement()
-{
- // get rid of last paragraph
- // (unless it's the only paragraph in the section)
- UniReference<XMLTextImportHelper> rHelper = GetImport().GetTextImport();
- rHelper->GetCursor()->goRight(1, sal_False);
- if (bHasContent)
- {
- rHelper->GetCursor()->goLeft(1, sal_True);
- rHelper->GetText()->insertString(rHelper->GetCursorAsRange(),
- sEmpty, sal_True);
- }
-
- // and delete second marker
- rHelper->GetCursor()->goRight(1, sal_True);
- rHelper->GetText()->insertString(rHelper->GetCursorAsRange(),
- sEmpty, sal_True);
-
- // check for redlines to our endnode
- rHelper->RedlineAdjustStartNodeCursor(sal_False);
-}
-
-SvXMLImportContext* XMLSectionImportContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
-
- // section-source (-dde) elements
- if ( (XML_NAMESPACE_TEXT == nPrefix) &&
- IsXMLToken(rLocalName, XML_SECTION_SOURCE) )
- {
- pContext = new XMLSectionSourceImportContext(GetImport(),
- nPrefix, rLocalName,
- xSectionPropertySet);
- }
- else if ( (XML_NAMESPACE_OFFICE == nPrefix) &&
- IsXMLToken(rLocalName, XML_DDE_SOURCE) )
- {
- pContext = new XMLSectionSourceDDEImportContext(GetImport(),
- nPrefix, rLocalName,
- xSectionPropertySet);
- }
- else
- {
- // otherwise: text context
- pContext = GetImport().GetTextImport()->CreateTextChildContext(
- GetImport(), nPrefix, rLocalName, xAttrList,
- XML_TEXT_TYPE_SECTION );
-
- // if that fails, default context
- if (NULL == pContext)
- {
- pContext = new SvXMLImportContext( GetImport(),
- nPrefix, rLocalName );
- }
- else
- bHasContent = sal_True;
- }
-
- return pContext;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLSectionSourceDDEImportContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLSectionSourceDDEImportContext.cxx
deleted file mode 100644
index 0bd849a8fd7d..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLSectionSourceDDEImportContext.cxx
+++ /dev/null
@@ -1,195 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLSectionSourceDDEImportContext.hxx"
-
-
-
-
-#include "xmlimp.hxx"
-
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include "xmluconv.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-
-
-#include <tools/debug.hxx>
-namespace binfilter {
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::beans::XMultiPropertySet;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::xml::sax::XAttributeList;
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::text;
-using namespace ::binfilter::xmloff::token;
-
-const sal_Char sAPI_DDECommandFile[] = "DDECommandFile";
-const sal_Char sAPI_DDECommandType[] = "DDECommandType";
-const sal_Char sAPI_DDECommandElement[] = "DDECommandElement";
-const sal_Char sAPI_IsAutomaticUpdate[] = "IsAutomaticUpdate";
-
-
-TYPEINIT1(XMLSectionSourceDDEImportContext, SvXMLImportContext);
-
-XMLSectionSourceDDEImportContext::XMLSectionSourceDDEImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- Reference<XPropertySet> & rSectPropSet) :
- SvXMLImportContext(rImport, nPrfx, rLocalName),
- rSectionPropertySet(rSectPropSet),
- sDdeCommandFile(RTL_CONSTASCII_USTRINGPARAM(sAPI_DDECommandFile)),
- sDdeCommandType(RTL_CONSTASCII_USTRINGPARAM(sAPI_DDECommandType)),
- sDdeCommandElement(RTL_CONSTASCII_USTRINGPARAM(sAPI_DDECommandElement)),
- sIsAutomaticUpdate(RTL_CONSTASCII_USTRINGPARAM(sAPI_IsAutomaticUpdate))
-{
-}
-
-XMLSectionSourceDDEImportContext::~XMLSectionSourceDDEImportContext()
-{
-}
-
-enum XMLSectionSourceDDEToken
-{
- XML_TOK_SECTION_DDE_APPLICATION,
- XML_TOK_SECTION_DDE_TOPIC,
- XML_TOK_SECTION_DDE_ITEM,
- XML_TOK_SECTION_IS_AUTOMATIC_UPDATE
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aSectionSourceDDETokenMap[] =
-{
- { XML_NAMESPACE_OFFICE, XML_DDE_APPLICATION,
- XML_TOK_SECTION_DDE_APPLICATION },
- { XML_NAMESPACE_OFFICE, XML_DDE_TOPIC, XML_TOK_SECTION_DDE_TOPIC },
- { XML_NAMESPACE_OFFICE, XML_DDE_ITEM, XML_TOK_SECTION_DDE_ITEM },
- { XML_NAMESPACE_OFFICE, XML_AUTOMATIC_UPDATE,
- XML_TOK_SECTION_IS_AUTOMATIC_UPDATE },
- XML_TOKEN_MAP_END
-};
-
-
-void XMLSectionSourceDDEImportContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- SvXMLTokenMap aTokenMap(aSectionSourceDDETokenMap);
- OUString sApplication;
- OUString sTopic;
- OUString sItem;
- sal_Bool bAutomaticUpdate = sal_False;
-
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
-
- switch (aTokenMap.Get(nPrefix, sLocalName))
- {
- case XML_TOK_SECTION_DDE_APPLICATION:
- sApplication = xAttrList->getValueByIndex(nAttr);
- break;
- case XML_TOK_SECTION_DDE_TOPIC:
- sTopic = xAttrList->getValueByIndex(nAttr);
- break;
- case XML_TOK_SECTION_DDE_ITEM:
- sItem = xAttrList->getValueByIndex(nAttr);
- break;
- case XML_TOK_SECTION_IS_AUTOMATIC_UPDATE:
- {
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(
- bTmp, xAttrList->getValueByIndex(nAttr)))
- {
- bAutomaticUpdate = bTmp;
- }
- break;
- }
- default:
- ; // ignore
- break;
- }
- }
-
- // DDE not supported on all platforms; query property first
- if (rSectionPropertySet->getPropertySetInfo()->
- hasPropertyByName(sDdeCommandFile))
- {
- // use multi property set to force single update of connection #83654#
- Sequence<OUString> aNames(4);
- Sequence<Any> aValues(4);
-
- aValues[0] <<= sApplication;
- aNames[0] = sDdeCommandFile;
-
- aValues[1] <<= sTopic;
- aNames[1] = sDdeCommandType;
-
- aValues[2] <<= sItem;
- aNames[2] = sDdeCommandElement;
-
- aValues[3].setValue(&bAutomaticUpdate, ::getBooleanCppuType());
- aNames[3] = sIsAutomaticUpdate;
-
- Reference<XMultiPropertySet> rMultiPropSet(rSectionPropertySet,
- UNO_QUERY);
- DBG_ASSERT(rMultiPropSet.is(), "we'd really like a XMultiPropertySet");
- if (rMultiPropSet.is())
- rMultiPropSet->setPropertyValues(aNames, aValues);
- // else: ignore
- }
-}
-
-void XMLSectionSourceDDEImportContext::EndElement()
-{
- // nothing to be done!
-}
-
-SvXMLImportContext* XMLSectionSourceDDEImportContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- // ignore -> default context
- return new SvXMLImportContext(GetImport(), nPrefix, rLocalName);
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLSectionSourceImportContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLSectionSourceImportContext.cxx
deleted file mode 100644
index 49f799383179..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLSectionSourceImportContext.cxx
+++ /dev/null
@@ -1,164 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLSectionSourceImportContext.hxx"
-
-
-#include <com/sun/star/text/SectionFileLink.hpp>
-
-
-#include "xmlimp.hxx"
-
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include <com/sun/star/uno/Reference.h>
-
-namespace binfilter {
-
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::xml::sax::XAttributeList;
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::text;
-using namespace ::binfilter::xmloff::token;
-
-
-TYPEINIT1(XMLSectionSourceImportContext, SvXMLImportContext);
-
-XMLSectionSourceImportContext::XMLSectionSourceImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- Reference<XPropertySet> & rSectPropSet) :
- SvXMLImportContext(rImport, nPrfx, rLocalName),
- rSectionPropertySet(rSectPropSet)
-{
-}
-
-XMLSectionSourceImportContext::~XMLSectionSourceImportContext()
-{
-}
-
-enum XMLSectionSourceToken
-{
- XML_TOK_SECTION_XLINK_HREF,
- XML_TOK_SECTION_TEXT_FILTER_NAME,
- XML_TOK_SECTION_TEXT_SECTION_NAME
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aSectionSourceTokenMap[] =
-{
- { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_SECTION_XLINK_HREF },
- { XML_NAMESPACE_TEXT, XML_FILTER_NAME, XML_TOK_SECTION_TEXT_FILTER_NAME },
- { XML_NAMESPACE_TEXT, XML_SECTION_NAME,
- XML_TOK_SECTION_TEXT_SECTION_NAME },
- XML_TOKEN_MAP_END
-};
-
-
-void XMLSectionSourceImportContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- SvXMLTokenMap aTokenMap(aSectionSourceTokenMap);
- OUString sURL;
- OUString sFilterName;
- OUString sSectionName;
-
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
-
- switch (aTokenMap.Get(nPrefix, sLocalName))
- {
- case XML_TOK_SECTION_XLINK_HREF:
- sURL = xAttrList->getValueByIndex(nAttr);
- break;
-
- case XML_TOK_SECTION_TEXT_FILTER_NAME:
- sFilterName = xAttrList->getValueByIndex(nAttr);
- break;
-
- case XML_TOK_SECTION_TEXT_SECTION_NAME:
- sSectionName = xAttrList->getValueByIndex(nAttr);
- break;
-
- default:
- ; // ignore
- break;
- }
- }
-
- // we only need them once
- const OUString sFileLink(RTL_CONSTASCII_USTRINGPARAM("FileLink"));
- const OUString sLinkRegion(RTL_CONSTASCII_USTRINGPARAM("LinkRegion"));
-
- Any aAny;
- if ((sURL.getLength() > 0) || (sFilterName.getLength() > 0))
- {
- SectionFileLink aFileLink;
- aFileLink.FileURL = GetImport().GetAbsoluteReference( sURL );
- aFileLink.FilterName = sFilterName;
-
- aAny <<= aFileLink;
- rSectionPropertySet->setPropertyValue(sFileLink, aAny);
- }
-
- if (sSectionName.getLength() > 0)
- {
- aAny <<= sSectionName;
- rSectionPropertySet->setPropertyValue(sLinkRegion, aAny);
- }
-}
-
-void XMLSectionSourceImportContext::EndElement()
-{
- // this space intentionally left blank.
-}
-
-SvXMLImportContext* XMLSectionSourceImportContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- // ignore -> default context
- return new SvXMLImportContext(GetImport(), nPrefix, rLocalName);
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLStringBufferImportContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLStringBufferImportContext.cxx
deleted file mode 100644
index 9615db1b8b57..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLStringBufferImportContext.cxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLStringBufferImportContext.hxx"
-
-#include "xmltoken.hxx"
-
-#include "xmlnmspe.hxx"
-namespace binfilter {
-
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::xml::sax::XAttributeList;
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_P;
-
-
-TYPEINIT1(XMLStringBufferImportContext, SvXMLImportContext);
-
-XMLStringBufferImportContext::XMLStringBufferImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& sLocalName,
- OUStringBuffer& rBuffer) :
- SvXMLImportContext(rImport, nPrefix, sLocalName),
- rTextBuffer(rBuffer)
-{
-}
-
-XMLStringBufferImportContext::~XMLStringBufferImportContext()
-{
-}
-
-SvXMLImportContext *XMLStringBufferImportContext::CreateChildContext(
- USHORT nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList)
-{
- return new XMLStringBufferImportContext(GetImport(), nPrefix,
- rLocalName, rTextBuffer);
-}
-
-void XMLStringBufferImportContext::Characters(
- const OUString& rChars )
-{
- rTextBuffer.append(rChars);
-}
-
-void XMLStringBufferImportContext::EndElement()
-{
- // add return for paragraph elements
- if ( (XML_NAMESPACE_TEXT == GetPrefix()) &&
- (IsXMLToken(GetLocalName(), XML_P)) )
- {
- rTextBuffer.append(sal_Unicode(0x0a));
- }
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextCharStyleNamesElementExport.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextCharStyleNamesElementExport.cxx
deleted file mode 100644
index 8e36305e42e2..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextCharStyleNamesElementExport.cxx
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLTextCharStyleNamesElementExport.hxx"
-#include "xmlnmspe.hxx"
-#include "nmspmap.hxx"
-#include "xmlexp.hxx"
-
-namespace com { namespace sun { namespace star {
- namespace beans { class XPropertySet; }
-} } }
-namespace binfilter {
-
-using namespace ::com::sun::star::uno;
-using ::com::sun::star::beans::XPropertySet;
-using ::rtl::OUString;
-using namespace ::binfilter::xmloff::token;
-
-XMLTextCharStyleNamesElementExport::XMLTextCharStyleNamesElementExport(
- SvXMLExport& rExp,
- sal_Bool bDoSth,
- const Reference < XPropertySet > & rPropSet,
- const OUString& rPropName ) :
- rExport( rExp ),
- nCount( 0 )
-{
- if( bDoSth )
- {
- Any aAny = rPropSet->getPropertyValue( rPropName );
- Sequence < OUString > aNames;
- if( aAny >>= aNames )
- {
- nCount = aNames.getLength();
- OSL_ENSURE( nCount > 0, "no char style found" );
- if( nCount > 1 )
- {
- aName = rExport.GetNamespaceMap().GetQNameByKey(
- XML_NAMESPACE_TEXT, GetXMLToken(XML_SPAN) );
- sal_Int32 i = nCount;
- const OUString *pName = aNames.getConstArray();
- while( --i )
- {
- rExport.AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME,
- *pName );
- rExport.StartElement( aName, sal_False );
- ++pName;
- }
- }
- }
- }
-}
-
-XMLTextCharStyleNamesElementExport::~XMLTextCharStyleNamesElementExport()
-{
- if( nCount > 1 )
- {
- sal_Int32 i = nCount;
- while( --i )
- rExport.EndElement( aName, sal_False );
- }
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextColumnsContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextColumnsContext.cxx
deleted file mode 100644
index 6ac934dd4e31..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextColumnsContext.cxx
+++ /dev/null
@@ -1,499 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/text/XTextColumns.hpp>
-#include <com/sun/star/style/VerticalAlignment.hpp>
-
-#include "xmluconv.hxx"
-#include "nmspmap.hxx"
-#include "xmlnmspe.hxx"
-#include "xmlimp.hxx"
-#include "XMLTextColumnsContext.hxx"
-#define _SVSTDARR_USHORTS
-#include <bf_svtools/svstdarr.hxx>
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::beans;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-enum SvXMLTokenMapAttrs
-{
- XML_TOK_COLUMN_WIDTH,
- XML_TOK_COLUMN_MARGIN_LEFT,
- XML_TOK_COLUMN_MARGIN_RIGHT,
- XML_TOK_COLUMN_END=XML_TOK_UNKNOWN
-};
-
-enum SvXMLSepTokenMapAttrs
-{
- XML_TOK_COLUMN_SEP_WIDTH,
- XML_TOK_COLUMN_SEP_HEIGHT,
- XML_TOK_COLUMN_SEP_COLOR,
- XML_TOK_COLUMN_SEP_ALIGN,
- XML_TOK_COLUMN_SEP_END=XML_TOK_UNKNOWN
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aColAttrTokenMap[] =
-{
- { XML_NAMESPACE_STYLE, XML_REL_WIDTH, XML_TOK_COLUMN_WIDTH },
- { XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TOK_COLUMN_MARGIN_LEFT },
- { XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TOK_COLUMN_MARGIN_RIGHT },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aColSepAttrTokenMap[] =
-{
- { XML_NAMESPACE_STYLE, XML_WIDTH, XML_TOK_COLUMN_SEP_WIDTH },
- { XML_NAMESPACE_STYLE, XML_COLOR, XML_TOK_COLUMN_SEP_COLOR },
- { XML_NAMESPACE_STYLE, XML_HEIGHT, XML_TOK_COLUMN_SEP_HEIGHT },
- { XML_NAMESPACE_STYLE, XML_VERTICAL_ALIGN, XML_TOK_COLUMN_SEP_ALIGN },
- XML_TOKEN_MAP_END
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_Sep_Align_Enum[] =
-{
- { XML_TOP, VerticalAlignment_TOP },
- { XML_MIDDLE, VerticalAlignment_MIDDLE },
- { XML_BOTTOM, VerticalAlignment_BOTTOM },
- { XML_TOKEN_INVALID, 0 }
-};
-
-class XMLTextColumnContext_Impl: public SvXMLImportContext
-{
- text::TextColumn aColumn;
-
-public:
- TYPEINFO();
-
- XMLTextColumnContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference<
- xml::sax::XAttributeList > & xAttrList,
- const SvXMLTokenMap& rTokenMap );
-
- virtual ~XMLTextColumnContext_Impl();
-
- text::TextColumn& getTextColumn() { return aColumn; }
-};
-
-TYPEINIT1( XMLTextColumnContext_Impl, SvXMLImportContext );
-
-XMLTextColumnContext_Impl::XMLTextColumnContext_Impl(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference<
- xml::sax::XAttributeList > & xAttrList,
- const SvXMLTokenMap& rTokenMap ) :
- SvXMLImportContext( rImport, nPrfx, rLName )
-{
- aColumn.Width = 0;
- aColumn.LeftMargin = 0;
- aColumn.RightMargin = 0;
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- sal_Int32 nVal;
- switch( rTokenMap.Get( nPrefix, aLocalName ) )
- {
- case XML_TOK_COLUMN_WIDTH:
- {
- sal_Int32 nPos = rValue.indexOf( (sal_Unicode)'*' );
- if( nPos != -1 && nPos+1 == rValue.getLength() )
- {
- OUString sTmp( rValue.copy( 0, nPos ) );
- if( GetImport().GetMM100UnitConverter().
- convertNumber( nVal, sTmp, 0, USHRT_MAX ) )
- aColumn.Width = nVal;
- }
- }
- break;
- case XML_TOK_COLUMN_MARGIN_LEFT:
- if( GetImport().GetMM100UnitConverter().
- convertMeasure( nVal, rValue ) )
- aColumn.LeftMargin = nVal;
- break;
- case XML_TOK_COLUMN_MARGIN_RIGHT:
-
- if( GetImport().GetMM100UnitConverter().
- convertMeasure( nVal, rValue ) )
- aColumn.RightMargin = nVal;
- break;
- }
- }
-}
-
-XMLTextColumnContext_Impl::~XMLTextColumnContext_Impl()
-{
-}
-
-// --------------------------------------------------------------------------
-
-class XMLTextColumnSepContext_Impl: public SvXMLImportContext
-{
- sal_Int32 nWidth;
- sal_Int32 nColor;
- sal_Int8 nHeight;
- VerticalAlignment eVertAlign;
-
-
-public:
- TYPEINFO();
-
- XMLTextColumnSepContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference<
- xml::sax::XAttributeList > & xAttrList,
- const SvXMLTokenMap& rTokenMap );
-
- virtual ~XMLTextColumnSepContext_Impl();
-
- sal_Int32 GetWidth() const { return nWidth; }
- sal_Int32 GetColor() const { return nColor; }
- sal_Int8 GetHeight() const { return nHeight; }
- VerticalAlignment GetVertAlign() const { return eVertAlign; }
-};
-
-
-TYPEINIT1( XMLTextColumnSepContext_Impl, SvXMLImportContext );
-
-XMLTextColumnSepContext_Impl::XMLTextColumnSepContext_Impl(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference<
- xml::sax::XAttributeList > & xAttrList,
- const SvXMLTokenMap& rTokenMap ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- nWidth( 2 ),
- nColor( 0 ),
- nHeight( 100 ),
- eVertAlign( VerticalAlignment_TOP )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- sal_Int32 nVal;
- switch( rTokenMap.Get( nPrefix, aLocalName ) )
- {
- case XML_TOK_COLUMN_SEP_WIDTH:
- if( GetImport().GetMM100UnitConverter().
- convertMeasure( nVal, rValue ) )
- nWidth = nVal;
- break;
- case XML_TOK_COLUMN_SEP_HEIGHT:
- if( GetImport().GetMM100UnitConverter().
- convertPercent( nVal, rValue ) &&
- nVal >=1 && nVal <= 100 )
- nHeight = (sal_Int8)nVal;
- break;
- case XML_TOK_COLUMN_SEP_COLOR:
- {
- Color aColor;
- if( GetImport().GetMM100UnitConverter().
- convertColor( aColor, rValue ) )
- nColor = (sal_Int32)aColor.GetColor();
- }
- break;
- case XML_TOK_COLUMN_SEP_ALIGN:
- {
- sal_uInt16 nAlign;
- if( GetImport().GetMM100UnitConverter().
- convertEnum( nAlign, rValue,
- pXML_Sep_Align_Enum ) )
- eVertAlign = (VerticalAlignment)nAlign;
- }
- break;
- }
- }
-}
-
-XMLTextColumnSepContext_Impl::~XMLTextColumnSepContext_Impl()
-{
-}
-
-// --------------------------------------------------------------------------
-
-typedef XMLTextColumnContext_Impl *XMLTextColumnContext_ImplPtr;
-SV_DECL_PTRARR( XMLTextColumnsArray_Impl, XMLTextColumnContext_ImplPtr, 5, 5 )
-
-TYPEINIT1( XMLTextColumnsContext, XMLElementPropertyContext );
-
-XMLTextColumnsContext::XMLTextColumnsContext(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList >&
- xAttrList,
- const XMLPropertyState& rProp,
- ::std::vector< XMLPropertyState > &rProps ) :
- XMLElementPropertyContext( rImport, nPrfx, rLName, rProp, rProps ),
- pColumnAttrTokenMap( new SvXMLTokenMap(aColAttrTokenMap) ),
- pColumnSepAttrTokenMap( new SvXMLTokenMap(aColSepAttrTokenMap) ),
- pColumns( 0 ),
- pColumnSep( 0 ),
- nCount( 0 ),
- bAutomatic( sal_False ),
- nAutomaticDistance( 0 ),
- sSeparatorLineIsOn(RTL_CONSTASCII_USTRINGPARAM("SeparatorLineIsOn")),
- sSeparatorLineWidth(RTL_CONSTASCII_USTRINGPARAM("SeparatorLineWidth")),
- sSeparatorLineColor(RTL_CONSTASCII_USTRINGPARAM("SeparatorLineColor")),
- sSeparatorLineRelativeHeight(RTL_CONSTASCII_USTRINGPARAM("SeparatorLineRelativeHeight")),
- sSeparatorLineVerticalAlignment(RTL_CONSTASCII_USTRINGPARAM("SeparatorLineVerticalAlignment")),
- sIsAutomatic(RTL_CONSTASCII_USTRINGPARAM("IsAutomatic")),
- sAutomaticDistance(RTL_CONSTASCII_USTRINGPARAM("AutomaticDistance"))
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- sal_Int32 nVal;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- const OUString& rValue = xAttrList->getValueByIndex( i );
- if( XML_NAMESPACE_FO == nPrefix )
- {
- if( IsXMLToken( aLocalName, XML_COLUMN_COUNT ) &&
- GetImport().GetMM100UnitConverter().
- convertNumber( nVal, rValue, 0, SHRT_MAX ) )
- {
- nCount = (sal_Int16)nVal;
- }
- else if( IsXMLToken( aLocalName, XML_COLUMN_GAP ) )
- {
- bAutomatic = GetImport().GetMM100UnitConverter().
- convertMeasure( nAutomaticDistance, rValue );
- }
- }
- }
-}
-
-XMLTextColumnsContext::~XMLTextColumnsContext()
-{
- if( pColumns )
- {
- sal_uInt16 nCount = pColumns->Count();
- while( nCount )
- {
- nCount--;
- XMLTextColumnContext_Impl *pColumn = (*pColumns)[nCount];
- pColumns->Remove( nCount, 1 );
- pColumn->ReleaseRef();
- }
- }
- if( pColumnSep )
- pColumnSep->ReleaseRef();
-
- delete pColumns;
- delete pColumnAttrTokenMap;
- delete pColumnSepAttrTokenMap;
-}
-
-SvXMLImportContext *XMLTextColumnsContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
-
- if( XML_NAMESPACE_STYLE == nPrefix &&
- IsXMLToken( rLocalName, XML_COLUMN ) )
- {
- XMLTextColumnContext_Impl *pColumn =
- new XMLTextColumnContext_Impl( GetImport(), nPrefix, rLocalName,
- xAttrList, *pColumnAttrTokenMap );
-
- // add new tabstop to array of tabstops
- if( !pColumns )
- pColumns = new XMLTextColumnsArray_Impl;
-
- pColumns->Insert( pColumn, pColumns->Count() );
- pColumn->AddRef();
-
- pContext = pColumn;
- }
- else if( XML_NAMESPACE_STYLE == nPrefix &&
- IsXMLToken( rLocalName, XML_COLUMN_SEP ) )
- {
- pColumnSep =
- new XMLTextColumnSepContext_Impl( GetImport(), nPrefix, rLocalName,
- xAttrList, *pColumnSepAttrTokenMap );
- pColumnSep->AddRef();
-
- pContext = pColumnSep;
- }
- else
- {
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
- }
-
- return pContext;
-}
-
-void XMLTextColumnsContext::EndElement( )
-{
- Reference<XMultiServiceFactory> xFactory(GetImport().GetModel(),UNO_QUERY);
- if( !xFactory.is() )
- return;
-
- Reference<XInterface> xIfc = xFactory->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextColumns")));
- if( !xIfc.is() )
- return;
-
- Reference< XTextColumns > xColumns( xIfc, UNO_QUERY );
- if ( 0 == nCount )
- {
- // zero columns = no columns -> 1 column
- xColumns->setColumnCount( 1 );
- }
- else if( !bAutomatic && pColumns &&
- pColumns->Count() == (sal_uInt16)nCount )
- {
- // if we have column descriptions, one per column, and we don't use
- // automatic width, then set the column widths
-
- sal_Int32 nRelWidth = 0;
- sal_uInt16 nColumnsWithWidth = 0;
- sal_Int16 i;
-
- for( i=0; i < nCount; i++ )
- {
- const TextColumn& rColumn =
- (*pColumns)[(sal_uInt16)i]->getTextColumn();
- if( rColumn.Width > 0 )
- {
- nRelWidth += rColumn.Width;
- nColumnsWithWidth++;
- }
- }
- if( nColumnsWithWidth < nCount )
- {
- sal_Int32 nColWidth = 0==nRelWidth
- ? USHRT_MAX / nCount
- : nRelWidth / nColumnsWithWidth;
-
- for( i=0; i < nCount; i++ )
- {
- TextColumn& rColumn =
- (*pColumns)[(sal_uInt16)i]->getTextColumn();
- if( rColumn.Width == 0 )
- {
- rColumn.Width = nColWidth;
- nRelWidth += rColumn.Width;
- if( 0 == --nColumnsWithWidth )
- break;
- }
- }
- }
-
- Sequence< TextColumn > aColumns( (sal_Int32)nCount );
- TextColumn *pTextColumns = aColumns.getArray();
- for( i=0; i < nCount; i++ )
- *pTextColumns++ = (*pColumns)[(sal_uInt16)i]->getTextColumn();
-
- xColumns->setColumns( aColumns );
- }
- else
- {
- // only set column count (and let the columns be distributed
- // automatically)
-
- xColumns->setColumnCount( nCount );
- }
-
- Reference < XPropertySet > xPropSet( xColumns, UNO_QUERY );
- if( xPropSet.is() )
- {
- Any aAny;
- sal_Bool bOn = pColumnSep != 0;
-
- aAny.setValue( &bOn, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( sSeparatorLineIsOn, aAny );
-
- if( pColumnSep )
- {
- if( pColumnSep->GetWidth() )
- {
- aAny <<= pColumnSep->GetWidth();
- xPropSet->setPropertyValue( sSeparatorLineWidth, aAny );
- }
- if( pColumnSep->GetHeight() )
- {
- aAny <<= pColumnSep->GetHeight();
- xPropSet->setPropertyValue( sSeparatorLineRelativeHeight,
- aAny );
- }
-
-
- aAny <<= pColumnSep->GetColor();
- xPropSet->setPropertyValue( sSeparatorLineColor, aAny );
-
-
- aAny <<= pColumnSep->GetVertAlign();
- xPropSet->setPropertyValue( sSeparatorLineVerticalAlignment, aAny );
- }
-
- // handle 'automatic columns': column distance
- if( bAutomatic )
- {
- aAny <<= nAutomaticDistance;
- xPropSet->setPropertyValue( sAutomaticDistance, aAny );
- }
- }
-
- aProp.maValue <<= xColumns;
-
- SetInsert( sal_True );
- XMLElementPropertyContext::EndElement();
-
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextColumnsExport.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextColumnsExport.cxx
deleted file mode 100644
index 50b5ffecb3bf..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextColumnsExport.cxx
+++ /dev/null
@@ -1,188 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-
-
-#include <com/sun/star/text/XTextColumns.hpp>
-#include <com/sun/star/style/VerticalAlignment.hpp>
-
-
-#include "xmlnmspe.hxx"
-#include "xmluconv.hxx"
-#include "xmlexp.hxx"
-
-#include "XMLTextColumnsExport.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-
-XMLTextColumnsExport::XMLTextColumnsExport( SvXMLExport& rExp ) :
- rExport( rExp ),
- sSeparatorLineIsOn(RTL_CONSTASCII_USTRINGPARAM("SeparatorLineIsOn")),
- sSeparatorLineWidth(RTL_CONSTASCII_USTRINGPARAM("SeparatorLineWidth")),
- sSeparatorLineColor(RTL_CONSTASCII_USTRINGPARAM("SeparatorLineColor")),
- sSeparatorLineRelativeHeight(RTL_CONSTASCII_USTRINGPARAM("SeparatorLineRelativeHeight")),
- sSeparatorLineVerticalAlignment(RTL_CONSTASCII_USTRINGPARAM("SeparatorLineVerticalAlignment")),
- sIsAutomatic(RTL_CONSTASCII_USTRINGPARAM("IsAutomatic")),
- sAutomaticDistance(RTL_CONSTASCII_USTRINGPARAM("AutomaticDistance"))
-{
-}
-
-void XMLTextColumnsExport::exportXML( const Any& rAny )
-{
- Reference < XTextColumns > xColumns;
- rAny >>= xColumns;
-
- Sequence < TextColumn > aColumns = xColumns->getColumns();
- const TextColumn *pColumns = aColumns.getArray();
- sal_Int32 nCount = aColumns.getLength();
-
- OUStringBuffer sValue;
- GetExport().GetMM100UnitConverter().convertNumber( sValue, nCount );
- GetExport().AddAttribute( XML_NAMESPACE_FO, XML_COLUMN_COUNT,
- sValue.makeStringAndClear() );
-
- // handle 'automatic' columns
- Reference < XPropertySet > xPropSet( xColumns, UNO_QUERY );
- if( xPropSet.is() )
- {
- Any aAny = xPropSet->getPropertyValue( sIsAutomatic );
- if ( *(sal_Bool*)aAny.getValue() )
- {
- aAny = xPropSet->getPropertyValue( sAutomaticDistance );
- sal_Int32 nDistance = 0;
- aAny >>= nDistance;
- OUStringBuffer aBuffer;
- GetExport().GetMM100UnitConverter().convertMeasure(
- aBuffer, nDistance );
- GetExport().AddAttribute( XML_NAMESPACE_FO,
- XML_COLUMN_GAP,
- aBuffer.makeStringAndClear() );
- }
- }
-
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, XML_COLUMNS,
- sal_True, sal_True );
-
- if( xPropSet.is() )
- {
- Any aAny = xPropSet->getPropertyValue( sSeparatorLineIsOn );
- if( *(sal_Bool *)aAny.getValue() )
- {
- // style:width
- aAny = xPropSet->getPropertyValue( sSeparatorLineWidth );
- sal_Int32 nWidth;
- aAny >>= nWidth;
- GetExport().GetMM100UnitConverter().convertMeasure( sValue,
- nWidth );
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_WIDTH,
- sValue.makeStringAndClear() );
-
- // style:color
- aAny = xPropSet->getPropertyValue( sSeparatorLineColor );
- sal_Int32 nColor;
- aAny >>= nColor;
- GetExport().GetMM100UnitConverter().convertColor( sValue,
- nColor );
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_COLOR,
- sValue.makeStringAndClear() );
-
- // style:height
- aAny = xPropSet->getPropertyValue( sSeparatorLineRelativeHeight );
- sal_Int8 nHeight;
- aAny >>= nHeight;
- GetExport().GetMM100UnitConverter().convertPercent( sValue,
- nHeight );
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_HEIGHT,
- sValue.makeStringAndClear() );
-
- // style:vertical-align
- aAny = xPropSet->getPropertyValue( sSeparatorLineVerticalAlignment );
- VerticalAlignment eVertAlign;
- aAny >>= eVertAlign;
-
- enum XMLTokenEnum eStr = XML_TOKEN_INVALID;
- switch( eVertAlign )
- {
-// case VerticalAlignment_TOP: eStr = XML_TOP;
- case VerticalAlignment_MIDDLE: eStr = XML_MIDDLE; break;
- case VerticalAlignment_BOTTOM: eStr = XML_BOTTOM; break;
- }
-
- if( eStr != XML_TOKEN_INVALID)
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_VERTICAL_ALIGN, eStr );
-
- // style:column-sep
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
- XML_COLUMN_SEP,
- sal_True, sal_True );
- }
- }
-
- while( nCount-- )
- {
- // style:rel-width
- GetExport().GetMM100UnitConverter().convertNumber( sValue,
- pColumns->Width );
- sValue.append( (sal_Unicode)'*' );
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REL_WIDTH,
- sValue.makeStringAndClear() );
-
- // fo:margin-left
- GetExport().GetMM100UnitConverter().convertMeasure( sValue,
- pColumns->LeftMargin );
- GetExport().AddAttribute( XML_NAMESPACE_FO, XML_MARGIN_LEFT,
- sValue.makeStringAndClear() );
-
- // fo:margin-right
- GetExport().GetMM100UnitConverter().convertMeasure( sValue,
- pColumns->RightMargin );
- GetExport().AddAttribute( XML_NAMESPACE_FO, XML_MARGIN_RIGHT,
- sValue.makeStringAndClear() );
-
- // style:column
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, XML_COLUMN,
- sal_True, sal_True );
- pColumns++;
- }
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextFrameContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextFrameContext.cxx
deleted file mode 100644
index f12804376f5b..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextFrameContext.cxx
+++ /dev/null
@@ -1,1174 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include <com/sun/star/text/XTextFrame.hpp>
-#include <com/sun/star/text/SizeType.hpp>
-#include <com/sun/star/document/XEventsSupplier.hpp>
-#include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
-#include <com/sun/star/io/XOutputStream.hpp>
-#include <com/sun/star/text/HoriOrientation.hpp>
-#include <com/sun/star/text/VertOrientation.hpp>
-#include "xmlimp.hxx"
-#include "xmlnmspe.hxx"
-#include "xmlkywd.hxx"
-#include "nmspmap.hxx"
-#include "xmluconv.hxx"
-#include "XMLAnchorTypePropHdl.hxx"
-#include "XMLEmbeddedObjectImportContext.hxx"
-#include "XMLBase64ImportContext.hxx"
-#include "prstylei.hxx"
-#include "i18nmap.hxx"
-#include "xexptran.hxx"
-#include "XMLEventsImportContext.hxx"
-#include "XMLImageMapContext.hxx"
-
-#include "XMLTextFrameContext.hxx"
-
-#include "XMLTextListBlockContext.hxx"
-
-#include "XMLTextListItemContext.hxx"
-namespace binfilter {
-
-
-
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::drawing;
-using namespace ::com::sun::star::document;
-using namespace ::binfilter::xmloff::token;
-using ::com::sun::star::document::XEventsSupplier;
-
-using rtl::OUString;
-
-class XMLTextFrameContextHyperlink_Impl
-{
- OUString sHRef;
- OUString sName;
- OUString sTargetFrameName;
- sal_Bool bMap;
-
-public:
-
- inline XMLTextFrameContextHyperlink_Impl( const OUString& rHRef,
- const OUString& rName,
- const OUString& rTargetFrameName,
- sal_Bool bMap );
-
- const OUString& GetHRef() const { return sHRef; }
- const OUString& GetName() const { return sName; }
- const OUString& GetTargetFrameName() const { return sTargetFrameName; }
- sal_Bool GetMap() const { return bMap; }
-};
-
-inline XMLTextFrameContextHyperlink_Impl::XMLTextFrameContextHyperlink_Impl(
- const OUString& rHRef, const OUString& rName,
- const OUString& rTargetFrameName, sal_Bool bM ) :
- sHRef( rHRef ),
- sName( rName ),
- sTargetFrameName( rTargetFrameName ),
- bMap( bM )
-{
-}
-
-class XMLTextFrameDescContext_Impl : public SvXMLImportContext
-{
- OUString& rDesc;
-
-public:
-
- TYPEINFO();
-
- XMLTextFrameDescContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- OUString& rD );
- virtual ~XMLTextFrameDescContext_Impl();
-
- virtual void Characters( const OUString& rText );
-};
-
-TYPEINIT1( XMLTextFrameDescContext_Impl, SvXMLImportContext );
-
-XMLTextFrameDescContext_Impl::XMLTextFrameDescContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx, const OUString& rLName,
- const Reference< XAttributeList > & xAttrList,
- OUString& rD ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rDesc( rD )
-{
-}
-
-XMLTextFrameDescContext_Impl::~XMLTextFrameDescContext_Impl()
-{
-}
-
-void XMLTextFrameDescContext_Impl::Characters( const OUString& rText )
-{
- rDesc += rText;
-}
-
-// ------------------------------------------------------------------------
-
-class XMLTextFrameParam_Impl : public SvXMLImportContext
-{
-public:
-
- TYPEINFO();
-
- XMLTextFrameParam_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- sal_uInt16 nType,
- ParamMap &rParamMap);
- virtual ~XMLTextFrameParam_Impl();
-};
-
-TYPEINIT1( XMLTextFrameParam_Impl, SvXMLImportContext );
-
-XMLTextFrameParam_Impl::~XMLTextFrameParam_Impl()
-{
-}
-
-XMLTextFrameParam_Impl::XMLTextFrameParam_Impl(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- sal_uInt16 nType,
- ParamMap &rParamMap):
- SvXMLImportContext( rImport, nPrfx, rLName )
-{
- OUString sName, sValue;
- sal_Bool bFoundValue = sal_False; // to allow empty values
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName );
- if ( XML_NAMESPACE_DRAW == nPrefix )
- {
- if( IsXMLToken(aLocalName, XML_VALUE) )
- {
- sValue = rValue;
- bFoundValue=sal_True;
- }
- else if( IsXMLToken(aLocalName, XML_NAME) )
- {
- sName = rValue;
- }
- }
- }
- if (sName.getLength() && bFoundValue )
- rParamMap[sName] = sValue;
-}
-class XMLTextFrameContourContext_Impl : public SvXMLImportContext
-{
- Reference < XPropertySet > xPropSet;
-
-public:
-
- TYPEINFO();
-
- XMLTextFrameContourContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- const Reference < XPropertySet >& rPropSet,
- sal_Bool bPath );
- virtual ~XMLTextFrameContourContext_Impl();
-};
-
-TYPEINIT1( XMLTextFrameContourContext_Impl, SvXMLImportContext );
-
-XMLTextFrameContourContext_Impl::XMLTextFrameContourContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx, const OUString& rLName,
- const Reference< XAttributeList > & xAttrList,
- const Reference < XPropertySet >& rPropSet,
- sal_Bool bPath ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- xPropSet( rPropSet )
-{
- OUString sD, sPoints, sViewBox;
- sal_Bool bPixelWidth = sal_False, bPixelHeight = sal_False;
- sal_Bool bAuto = sal_False;
- sal_Int32 nWidth = 0;
- sal_Int32 nHeight = 0;
-
- const SvXMLTokenMap& rTokenMap =
- GetImport().GetTextImport()->GetTextContourAttrTokenMap();
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- switch( rTokenMap.Get( nPrefix, aLocalName ) )
- {
- case XML_TOK_TEXT_CONTOUR_VIEWBOX:
- sViewBox = rValue;
- break;
- case XML_TOK_TEXT_CONTOUR_D:
- if( bPath )
- sD = rValue;
- break;
- case XML_TOK_TEXT_CONTOUR_POINTS:
- if( !bPath )
- sPoints = rValue;
- break;
- case XML_TOK_TEXT_CONTOUR_WIDTH:
- if( GetImport().GetMM100UnitConverter().convertMeasurePx( nWidth,
- rValue) )
- bPixelWidth = sal_True;
- else
- GetImport().GetMM100UnitConverter().convertMeasure( nWidth,
- rValue);
- break;
- case XML_TOK_TEXT_CONTOUR_HEIGHT:
- if( GetImport().GetMM100UnitConverter().convertMeasurePx( nHeight,
- rValue) )
- bPixelHeight = sal_True;
- else
- GetImport().GetMM100UnitConverter().convertMeasure( nHeight,
- rValue);
- break;
- case XML_TOK_TEXT_CONTOUR_AUTO:
- bAuto = IsXMLToken(rValue, XML_TRUE);
- break;
- }
- }
-
- OUString sContourPolyPolygon(
- RTL_CONSTASCII_USTRINGPARAM("ContourPolyPolygon") );
- Reference < XPropertySetInfo > xPropSetInfo =
- rPropSet->getPropertySetInfo();
- if( xPropSetInfo->hasPropertyByName(
- sContourPolyPolygon ) &&
- nWidth > 0 && nHeight > 0 && bPixelWidth == bPixelHeight &&
- (bPath ? sD : sPoints).getLength() )
- {
- awt::Point aPoint( 0, 0 );
- awt::Size aSize( nWidth, nHeight );
- SdXMLImExViewBox aViewBox( sViewBox,
- GetImport().GetMM100UnitConverter());
- Any aAny;
- if( bPath )
- {
- SdXMLImExSvgDElement aPoints( sD, aViewBox, aPoint, aSize,
- GetImport().GetMM100UnitConverter() );
- aAny <<= aPoints.GetPointSequenceSequence();
- }
- else
- {
- SdXMLImExPointsElement aPoints( sPoints, aViewBox, aPoint, aSize,
- GetImport().GetMM100UnitConverter() );
- aAny <<= aPoints.GetPointSequenceSequence();
- }
-
- OUString sIsPixelContour(
- RTL_CONSTASCII_USTRINGPARAM("IsPixelContour") );
- xPropSet->setPropertyValue( sContourPolyPolygon, aAny );
-
- if( xPropSetInfo->hasPropertyByName( sIsPixelContour ) )
- {
- aAny.setValue( &bPixelWidth, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( sIsPixelContour, aAny );
- }
-
- OUString sIsAutomaticContour(
- RTL_CONSTASCII_USTRINGPARAM("IsAutomaticContour") );
- if( xPropSetInfo->hasPropertyByName( sIsAutomaticContour ) )
- {
- aAny.setValue( &bAuto, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( sIsAutomaticContour, aAny );
- }
- }
-}
-
-XMLTextFrameContourContext_Impl::~XMLTextFrameContourContext_Impl()
-{
-}
-
-
-// ------------------------------------------------------------------------
-
-TYPEINIT1( XMLTextFrameContext, SvXMLImportContext );
-
-void XMLTextFrameContext::Create( sal_Bool bHRefOrBase64 )
-{
- UniReference < XMLTextImportHelper > xTxtImport =
- GetImport().GetTextImport();
-
- switch ( nType)
- {
- case XML_TEXT_FRAME_OBJECT:
- case XML_TEXT_FRAME_OBJECT_OLE:
- if( bHRefOrBase64 )
- {
- OUString sURL( GetImport().ResolveEmbeddedObjectURL( sHRef,
- OUString() ) );
-
- if( sURL.getLength() )
- xPropSet = GetImport().GetTextImport()
- ->createAndInsertOLEObject( GetImport(), sURL,
- sStyleName,
- sTblName,
- nWidth, nHeight );
- }
- else
- {
- OUString sURL( RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.ServiceName:") );
- sURL += sFilterService;
- xPropSet = GetImport().GetTextImport()
- ->createAndInsertOLEObject( GetImport(), sURL,
- sStyleName,
- sTblName,
- nWidth, nHeight );
-
- }
- break;
- case XML_TEXT_FRAME_APPLET:
- {
- xPropSet = GetImport().GetTextImport()
- ->createAndInsertApplet( sAppletName, sCode,
- bMayScript, sHRef,
- nWidth, nHeight);
- break;
- }
- case XML_TEXT_FRAME_PLUGIN:
- {
- xPropSet = GetImport().GetTextImport()
- ->createAndInsertPlugin( sMimeType, sHRef,
- nWidth, nHeight);
-
- break;
- }
- case XML_TEXT_FRAME_FLOATING_FRAME:
- {
- xPropSet = GetImport().GetTextImport()
- ->createAndInsertFloatingFrame( sFrameName, sHRef,
- sStyleName,
- nWidth, nHeight);
- break;
- }
- default:
- {
- Reference<XMultiServiceFactory> xFactory( GetImport().GetModel(),
- UNO_QUERY );
- if( xFactory.is() )
- {
- OUString sServiceName;
- switch( nType )
- {
- case XML_TEXT_FRAME_TEXTBOX: sServiceName = sTextBoxServiceName; break;
- case XML_TEXT_FRAME_GRAPHIC: sServiceName = sGraphicServiceName; break;
- }
- Reference<XInterface> xIfc = xFactory->createInstance( sServiceName );
- DBG_ASSERT( xIfc.is(), "couldn't create frame" );
- if( xIfc.is() )
- xPropSet = Reference < XPropertySet >( xIfc, UNO_QUERY );
- }
- }
- }
-
- if( !xPropSet.is() )
- {
- bCreateFailed = sal_True;
- return;
- }
-
- Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
-
- // set name
- Reference < XNamed > xNamed( xPropSet, UNO_QUERY );
- if( xNamed.is() )
- {
- OUString sOrigName( xNamed->getName() );
- if( !sOrigName.getLength() ||
- (sName.getLength() && sOrigName != sName) )
- {
- OUString sOldName( sName );
- sal_Int32 i = 0;
- while( xTxtImport->HasFrameByName( sName ) )
- {
- sName = sOldName;
- sName += OUString::valueOf( ++i );
- }
- xNamed->setName( sName );
- if( sName != sOldName )
- xTxtImport->GetRenameMap().Add( XML_TEXT_RENAME_TYPE_FRAME,
- sOldName, sName );
- }
- }
-
- // frame style
- XMLPropStyleContext *pStyle = 0;
- if( sStyleName.getLength() )
- {
- pStyle = xTxtImport->FindAutoFrameStyle( sStyleName );
- if( pStyle )
- sStyleName = pStyle->GetParent();
- }
-
- Any aAny;
- if( sStyleName.getLength() )
- {
- const Reference < XNameContainer > & rStyles =
- xTxtImport->GetFrameStyles();
- if( rStyles.is() &&
- rStyles->hasByName( sStyleName ) )
- {
- aAny <<= sStyleName;
- xPropSet->setPropertyValue( sFrameStyleName, aAny );
- }
- }
-
- // anchor type (must be set before any other properties, because
- // otherwise some orientations cannot be set or will be changed
- // afterwards)
- aAny <<= eAnchorType;
- xPropSet->setPropertyValue( sAnchorType, aAny );
-
- // hard properties
- if( pStyle )
- pStyle->FillPropertySet( xPropSet );
-
-
- // x and y
- sal_Int16 nHoriOrient = HoriOrientation::NONE;
- aAny = xPropSet->getPropertyValue( sHoriOrient );
- aAny >>= nHoriOrient;
- if( HoriOrientation::NONE == nHoriOrient )
- {
- aAny <<= nX;
- xPropSet->setPropertyValue( sHoriOrientPosition, aAny );
- }
-
- sal_Int16 nVertOrient = VertOrientation::NONE;
- aAny = xPropSet->getPropertyValue( sVertOrient );
- aAny >>= nVertOrient;
- if( VertOrientation::NONE == nVertOrient )
- {
- aAny <<= nY;
- xPropSet->setPropertyValue( sVertOrientPosition, aAny );
- }
-
- // width
- if( nWidth > 0 )
- {
- aAny <<= nWidth;
- xPropSet->setPropertyValue( sWidth, aAny );
- }
- if( nRelWidth > 0 || nWidth > 0 )
- {
- aAny <<= nRelWidth;
- xPropSet->setPropertyValue( sRelativeWidth, aAny );
- }
- if( bSyncWidth || nWidth > 0 )
- {
- sal_Bool bTmp = bSyncWidth;
- aAny.setValue( &bTmp, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( sIsSyncWidthToHeight, aAny );
- }
-
- if( nHeight > 0 )
- {
- aAny <<= nHeight;
- xPropSet->setPropertyValue( sHeight, aAny );
- }
- if( nRelHeight > 0 || nHeight > 0 )
- {
- aAny <<= nRelHeight;
- xPropSet->setPropertyValue( sRelativeHeight, aAny );
- }
- if( bSyncHeight || nHeight > 0 )
- {
- sal_Bool bTmp = bSyncHeight;
- aAny.setValue( &bTmp, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( sIsSyncHeightToWidth, aAny );
- }
- if( xPropSetInfo->hasPropertyByName( sSizeType ) &&
- (bMinHeight || nHeight > 0 || nRelHeight > 0 ) )
- {
- sal_Int16 nSizeType =
- (bMinHeight && XML_TEXT_FRAME_TEXTBOX == nType) ? SizeType::MIN
- : SizeType::FIX;
- aAny <<= nSizeType;
- xPropSet->setPropertyValue( sSizeType, aAny );
- }
-
- if( XML_TEXT_FRAME_GRAPHIC == nType )
- {
- // URL
- OSL_ENSURE( sHRef.getLength() > 0 || xBase64Stream.is(),
- "neither URL nor base64 image data given" );
- UniReference < XMLTextImportHelper > xTxtImport =
- GetImport().GetTextImport();
- if( sHRef.getLength() )
- {
- sal_Bool bForceLoad = xTxtImport->IsInsertMode() ||
- xTxtImport->IsBlockMode() ||
- xTxtImport->IsStylesOnlyMode() ||
- xTxtImport->IsOrganizerMode();
- sHRef = GetImport().ResolveGraphicObjectURL( sHRef, !bForceLoad );
- }
- else if( xBase64Stream.is() )
- {
- sHRef = GetImport().ResolveGraphicObjectURLFromBase64( xBase64Stream );
- xBase64Stream = 0;
- }
- aAny <<= sHRef;
- xPropSet->setPropertyValue( sGraphicURL, aAny );
-
- // filter name
- aAny <<=sFilterName;
- xPropSet->setPropertyValue( sGraphicFilter, aAny );
-
- // rotation
- aAny <<= nRotation;
- xPropSet->setPropertyValue( sGraphicRotation, aAny );
- }
-
- // page number (must be set after the frame is inserted, because it
- // will be overwritten then inserting the frame.
- if( TextContentAnchorType_AT_PAGE == eAnchorType && nPage > 0 )
- {
- aAny <<= nPage;
- xPropSet->setPropertyValue( sAnchorPageNo, aAny );
- }
-
- if( XML_TEXT_FRAME_OBJECT != nType &&
- XML_TEXT_FRAME_OBJECT_OLE != nType &&
- XML_TEXT_FRAME_APPLET != nType &&
- XML_TEXT_FRAME_PLUGIN!= nType &&
- XML_TEXT_FRAME_FLOATING_FRAME != nType)
- {
- Reference < XTextContent > xTxtCntnt( xPropSet, UNO_QUERY );
- xTxtImport->InsertTextContent( xTxtCntnt );
- }
-
- Reference < XShape > xShape( xPropSet, UNO_QUERY );
-
- // #107848#
- // Make adding the shepe to Z-Ordering dependent from if we are
- // inside a inside_deleted_section (redlining). That is necessary
- // since the shape will be removed again later. It would lead to
- // errors if it would stay inside the Z-Ordering. Thus, the
- // easiest way to solve that conflict is to not add it here.
- if(!GetImport().HasTextImport()
- || !GetImport().GetTextImport()->IsInsideDeleteContext())
- {
- GetImport().GetShapeImport()->shapeWithZIndexAdded( xShape, nZIndex );
- }
-
- if( XML_TEXT_FRAME_TEXTBOX == nType )
- {
- xTxtImport->ConnectFrameChains( sName, sNextName, xPropSet );
- Reference < XTextFrame > xTxtFrame( xPropSet, UNO_QUERY );
- Reference < XText > xTxt = xTxtFrame->getText();
- xOldTextCursor = xTxtImport->GetCursor();
- xTxtImport->SetCursor( xTxt->createTextCursor() );
-
- // remember old list item and block (#89892#) and reset them
- // for the text frame
- xListBlock = xTxtImport->GetListBlock();
- xListItem = xTxtImport->GetListItem();
- xTxtImport->SetListBlock( NULL );
- xTxtImport->SetListItem( NULL );
- }
-
- if( pHyperlink )
- {
- SetHyperlink( pHyperlink->GetHRef(), pHyperlink->GetName(),
- pHyperlink->GetTargetFrameName(), pHyperlink->GetMap() );
- delete pHyperlink;
- pHyperlink = 0;
- }
-
-}
-
-sal_Bool XMLTextFrameContext::CreateIfNotThere()
-{
- if( !xPropSet.is() &&
- ( XML_TEXT_FRAME_OBJECT_OLE == nType ||
- XML_TEXT_FRAME_GRAPHIC == nType ) &&
- xBase64Stream.is() && !bCreateFailed )
- {
- if( bOwnBase64Stream )
- xBase64Stream->closeOutput();
- Create( sal_True );
- }
-
- return xPropSet.is();
-}
-
-XMLTextFrameContext::XMLTextFrameContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx, const OUString& rLName,
- const Reference< XAttributeList > & xAttrList,
- TextContentAnchorType eATyp,
- sal_uInt16 nNewType ) :
- nType( nNewType ),
- eAnchorType( eATyp ),
- SvXMLImportContext( rImport, nPrfx, rLName ),
- sWidth(RTL_CONSTASCII_USTRINGPARAM("Width")),
- sRelativeWidth(RTL_CONSTASCII_USTRINGPARAM("RelativeWidth")),
- sHeight(RTL_CONSTASCII_USTRINGPARAM("Height")),
- sRelativeHeight(RTL_CONSTASCII_USTRINGPARAM("RelativeHeight")),
- sSizeType(RTL_CONSTASCII_USTRINGPARAM("SizeType")),
- sIsSyncWidthToHeight(RTL_CONSTASCII_USTRINGPARAM("IsSyncWidthToHeight")),
- sIsSyncHeightToWidth(RTL_CONSTASCII_USTRINGPARAM("IsSyncHeightToWidth")),
- sHoriOrient(RTL_CONSTASCII_USTRINGPARAM("HoriOrient")),
- sHoriOrientPosition(RTL_CONSTASCII_USTRINGPARAM("HoriOrientPosition")),
- sVertOrient(RTL_CONSTASCII_USTRINGPARAM("VertOrient")),
- sVertOrientPosition(RTL_CONSTASCII_USTRINGPARAM("VertOrientPosition")),
- sChainNextName(RTL_CONSTASCII_USTRINGPARAM("ChainNextName")),
- sAnchorType(RTL_CONSTASCII_USTRINGPARAM("AnchorType")),
- sAnchorPageNo(RTL_CONSTASCII_USTRINGPARAM("AnchorPageNo")),
- sGraphicURL(RTL_CONSTASCII_USTRINGPARAM("GraphicURL")),
- sGraphicFilter(RTL_CONSTASCII_USTRINGPARAM("GraphicFilter")),
- sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText")),
- sFrameStyleName(RTL_CONSTASCII_USTRINGPARAM("FrameStyleName")),
- sGraphicRotation(RTL_CONSTASCII_USTRINGPARAM("GraphicRotation")),
- sTextBoxServiceName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextFrame")),
- sGraphicServiceName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.GraphicObject")),
- pHyperlink( 0 )
-{
- nX = 0;
- nY = 0;
- nWidth = 0;
- nHeight = 0;
- nZIndex = -1;
- nPage = 0;
- nRotation = 0;
- nRelWidth = 0;
- nRelHeight = 0;
- bMayScript = sal_False;
-
- bMinHeight = sal_False;
- bSyncWidth = sal_False;
- bSyncHeight = sal_False;
- bCreateFailed = sal_False;
- bOwnBase64Stream = sal_False;
-
- UniReference < XMLTextImportHelper > xTxtImport =
- GetImport().GetTextImport();
- const SvXMLTokenMap& rTokenMap =
- xTxtImport->GetTextFrameAttrTokenMap();
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- switch( rTokenMap.Get( nPrefix, aLocalName ) )
- {
- case XML_TOK_TEXT_FRAME_STYLE_NAME:
- sStyleName = rValue;
- break;
- case XML_TOK_TEXT_FRAME_NAME:
- sName = rValue;
- break;
- case XML_TOK_TEXT_FRAME_FRAME_NAME:
- sFrameName = rValue;
- break;
- case XML_TOK_TEXT_FRAME_APPLET_NAME:
- sAppletName = rValue;
- break;
- case XML_TOK_TEXT_FRAME_ANCHOR_TYPE:
- if( TextContentAnchorType_AT_PARAGRAPH == eAnchorType ||
- TextContentAnchorType_AT_CHARACTER == eAnchorType ||
- TextContentAnchorType_AS_CHARACTER == eAnchorType )
- {
-
- TextContentAnchorType eNew;
- if( XMLAnchorTypePropHdl::convert( rValue,
- GetImport().GetMM100UnitConverter(), eNew ) &&
- ( TextContentAnchorType_AT_PARAGRAPH == eNew ||
- TextContentAnchorType_AT_CHARACTER == eNew ||
- TextContentAnchorType_AS_CHARACTER == eNew ||
- TextContentAnchorType_AT_PAGE == eNew) )
- eAnchorType = eNew;
- }
- break;
- case XML_TOK_TEXT_FRAME_ANCHOR_PAGE_NUMBER:
- {
- sal_Int32 nTmp;
- if( GetImport().GetMM100UnitConverter().
- convertNumber( nTmp, rValue, 1, SHRT_MAX ) )
- nPage = (sal_Int16)nTmp;
- }
- break;
- case XML_TOK_TEXT_FRAME_X:
- GetImport().GetMM100UnitConverter().convertMeasure( nX, rValue );
- break;
- case XML_TOK_TEXT_FRAME_Y:
- GetImport().GetMM100UnitConverter().convertMeasure( nY, rValue );
- break;
- case XML_TOK_TEXT_FRAME_WIDTH:
- // relative widths are obsolete since SRC617. Remove them some day!
- if( rValue.indexOf( '%' ) != -1 )
- {
- sal_Int32 nTmp;
- GetImport().GetMM100UnitConverter().convertPercent( nTmp,
- rValue );
- nRelWidth = (sal_Int16)nTmp;
- }
- else
- {
- GetImport().GetMM100UnitConverter().convertMeasure( nWidth,
- rValue, 0 );
- }
- break;
- case XML_TOK_TEXT_FRAME_REL_WIDTH:
- if( IsXMLToken(rValue, XML_SCALE) )
- {
- bSyncWidth = sal_True;
- }
- else
- {
- sal_Int32 nTmp;
- if( GetImport().GetMM100UnitConverter().
- convertPercent( nTmp, rValue ) )
- nRelWidth = (sal_Int16)nTmp;
- }
- break;
- case XML_TOK_TEXT_FRAME_HEIGHT:
- // relative heights are obsolete since SRC617. Remove them some day!
- if( rValue.indexOf( '%' ) != -1 )
- {
- sal_Int32 nTmp;
- GetImport().GetMM100UnitConverter().convertPercent( nTmp,
- rValue );
- nRelHeight = (sal_Int16)nTmp;
- }
- else
- {
- GetImport().GetMM100UnitConverter().convertMeasure( nHeight,
- rValue, 0 );
- }
- break;
- case XML_TOK_TEXT_FRAME_REL_HEIGHT:
- if( IsXMLToken( rValue, XML_SCALE ) )
- {
- bSyncHeight = sal_True;
- }
- else if( IsXMLToken( rValue, XML_SCALE_MIN ) )
- {
- bSyncHeight = sal_True;
- bMinHeight = sal_True;
- }
- else
- {
- sal_Int32 nTmp;
- if( GetImport().GetMM100UnitConverter().
- convertPercent( nTmp, rValue ) )
- nRelHeight = (sal_Int16)nTmp;
- }
- break;
- case XML_TOK_TEXT_FRAME_MIN_HEIGHT:
- if( rValue.indexOf( '%' ) != -1 )
- {
- sal_Int32 nTmp;
- GetImport().GetMM100UnitConverter().convertPercent( nTmp,
- rValue );
- nRelHeight = (sal_Int16)nTmp;
- }
- else
- {
- GetImport().GetMM100UnitConverter().convertMeasure( nHeight,
- rValue, 0 );
- }
- bMinHeight = sal_True;
- break;
- case XML_TOK_TEXT_FRAME_Z_INDEX:
- GetImport().GetMM100UnitConverter().convertNumber( nZIndex, rValue, -1 );
- break;
- case XML_TOK_TEXT_FRAME_NEXT_CHAIN_NAME:
- sNextName = rValue;
- break;
- case XML_TOK_TEXT_FRAME_HREF:
- sHRef = rValue;
- break;
- case XML_TOK_TEXT_FRAME_FILTER_NAME:
- sFilterName = rValue;
- break;
- case XML_TOK_TEXT_FRAME_TRANSFORM:
- {
- OUString sValue( rValue );
- sValue.trim();
- const sal_Int32 nRotateLen = sizeof(sXML_rotate)-1;
- sal_Int32 nLen = sValue.getLength();
- if( nLen >= nRotateLen+3 &&
- 0 == sValue.compareToAscii( sXML_rotate, nRotateLen ) &&
- '(' == sValue[nRotateLen] &&
- ')' == sValue[nLen-1] )
- {
- sValue = sValue.copy( nRotateLen+1, nLen-(nRotateLen+2) );
- sValue.trim();
- sal_Int32 nVal;
- if( GetImport().GetMM100UnitConverter().convertNumber( nVal, sValue ) )
- nRotation = (sal_Int16)(nVal % 360 );
- }
- }
- break;
- case XML_TOK_TEXT_FRAME_CODE:
- sCode = rValue;
- break;
- case XML_TOK_TEXT_FRAME_OBJECT:
- sObject = rValue;
- break;
- case XML_TOK_TEXT_FRAME_ARCHIVE:
- sArchive = rValue;
- break;
- case XML_TOK_TEXT_FRAME_MAY_SCRIPT:
- bMayScript = IsXMLToken( rValue, XML_TRUE );
- break;
- case XML_TOK_TEXT_FRAME_MIME_TYPE:
- sMimeType = rValue;
- break;
- case XML_TOK_TEXT_FRAME_NOTIFY_ON_UPDATE:
- sTblName = rValue;
- break;
- }
- }
-
- if( ( (XML_TEXT_FRAME_GRAPHIC == nType ||
- XML_TEXT_FRAME_OBJECT == nType ||
- XML_TEXT_FRAME_OBJECT_OLE == nType) &&
- !sHRef.getLength() ) ||
- ( XML_TEXT_FRAME_APPLET == nType && !sCode.getLength() ) ||
- ( XML_TEXT_FRAME_PLUGIN == nType &&
- sHRef.getLength() == 0 && sMimeType.getLength() == 0 ) )
- return; // no URL: no image or OLE object
-
- Create( sal_True );
-}
-
-XMLTextFrameContext::~XMLTextFrameContext()
-{
- delete pHyperlink; // should be 0, but might exist not only because of
- // a filter bug but also because of an improper XML
- // file, so an OSL_ENSURE is not correct either.
-}
-
-void XMLTextFrameContext::EndElement()
-{
- CreateIfNotThere();
-
- // alternative text
- if( sDesc.getLength() )
- {
- if ( xPropSet.is() )
- {
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
- if( xPropSetInfo->hasPropertyByName( sAlternativeText ) )
- {
- Any aAny;
- aAny <<= sDesc;
- xPropSet->setPropertyValue( sAlternativeText, aAny );
- }
- }
- }
-
- if( xOldTextCursor.is() )
- {
- GetImport().GetTextImport()->DeleteParagraph();
- GetImport().GetTextImport()->SetCursor( xOldTextCursor );
- }
-
- // reinstall old list item (if necessary) #89892#
- if ( xListBlock.Is() )
- {
- GetImport().GetTextImport()->SetListBlock(
- (XMLTextListBlockContext*)&xListBlock );
- GetImport().GetTextImport()->SetListItem(
- (XMLTextListItemContext*)&xListItem );
- }
-
- if (( nType == XML_TEXT_FRAME_APPLET || nType == XML_TEXT_FRAME_PLUGIN ) && xPropSet.is())
- GetImport().GetTextImport()->endAppletOrPlugin( xPropSet, aParamMap);
-}
-
-SvXMLImportContext *XMLTextFrameContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
-
- if( XML_NAMESPACE_SVG == nPrefix &&
- IsXMLToken( rLocalName, XML_DESC ) )
- {
- pContext = new XMLTextFrameDescContext_Impl( GetImport(),
- nPrefix, rLocalName,
- xAttrList, sDesc );
- }
- else if( XML_NAMESPACE_DRAW == nPrefix )
- {
- if ( (nType == XML_TEXT_FRAME_APPLET || nType == XML_TEXT_FRAME_PLUGIN) &&
- IsXMLToken( rLocalName, XML_PARAM ) )
- {
- pContext = new XMLTextFrameParam_Impl( GetImport(),
- nPrefix, rLocalName,
- xAttrList, nType, aParamMap );
- }
- else
- {
- if( IsXMLToken( rLocalName, XML_CONTOUR_POLYGON ) )
- {
- if( CreateIfNotThere() )
- pContext = new XMLTextFrameContourContext_Impl( GetImport(),
- nPrefix, rLocalName,
- xAttrList, xPropSet, sal_False );
- }
- else if( IsXMLToken( rLocalName, XML_CONTOUR_PATH ) )
- {
- if( CreateIfNotThere() )
- pContext = new XMLTextFrameContourContext_Impl( GetImport(),
- nPrefix, rLocalName,
- xAttrList, xPropSet, sal_True );
- }
- else if ( IsXMLToken( rLocalName, XML_IMAGE_MAP ) &&
- ( nType == XML_TEXT_FRAME_TEXTBOX ||
- nType == XML_TEXT_FRAME_GRAPHIC ||
- nType == XML_TEXT_FRAME_OBJECT_OLE ) )
- {
- if( CreateIfNotThere() )
- pContext = new XMLImageMapContext( GetImport(), nPrefix,
- rLocalName, xPropSet );
- }
- }
- }
- else if( (XML_NAMESPACE_OFFICE == nPrefix) )
- {
- if( IsXMLToken( rLocalName, XML_EVENTS ) )
- {
- // do we still have the frame object?
- if( CreateIfNotThere() )
- {
- // is it an event supplier?
- Reference<XEventsSupplier> xEventsSupplier(xPropSet, UNO_QUERY);
- if (xEventsSupplier.is())
- {
- // OK, we have the events, so create the context
- pContext = new XMLEventsImportContext(GetImport(), nPrefix,
- rLocalName, xEventsSupplier);
- }
- // else: no events, no event import
- }
- // else: no object, no event import
- }
- else if( xmloff::token::IsXMLToken( rLocalName,
- xmloff::token::XML_BINARY_DATA ) )
- {
- if( !xPropSet.is() && !xBase64Stream.is() && !bCreateFailed )
- {
- switch( nType )
- {
- case XML_TEXT_FRAME_GRAPHIC:
- xBase64Stream = GetImport().GetStreamForGraphicObjectURLFromBase64();
- break;
- case XML_TEXT_FRAME_OBJECT_OLE:
- sHRef = OUString( RTL_CONSTASCII_USTRINGPARAM( "#Obj12345678" ) );
- xBase64Stream =
- GetImport().ResolveEmbeddedObjectURLFromBase64( sHRef );
- break;
- }
- if( xBase64Stream.is() )
- pContext = new XMLBase64ImportContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- xBase64Stream );
- }
- }
- }
- if( !pContext &&
- ( XML_TEXT_FRAME_OBJECT == nType &&
- (XML_NAMESPACE_OFFICE == nPrefix &&
- IsXMLToken( rLocalName, XML_DOCUMENT )) ||
- (XML_NAMESPACE_MATH == nPrefix &&
- IsXMLToken(rLocalName, XML_MATH) ) ) )
- {
- if( !xPropSet.is() && !bCreateFailed )
- {
- XMLEmbeddedObjectImportContext *pEContext =
- new XMLEmbeddedObjectImportContext( GetImport(), nPrefix,
- rLocalName, xAttrList );
- sFilterService = pEContext->GetFilterServiceName();
- if( sFilterService.getLength() != 0 )
- {
- Create( sal_False );
- if( xPropSet.is() )
- {
- Reference < XEmbeddedObjectSupplier > xEOS( xPropSet,
- UNO_QUERY );
- OSL_ENSURE( xEOS.is(),
- "no embedded object supplier for own object" );
- Reference< ::com::sun::star::lang::XComponent> aXComponent(xEOS->getEmbeddedObject());
- pEContext->SetComponent( aXComponent );
- }
- }
- pContext = pEContext;
- }
- }
- if( !pContext && xOldTextCursor.is() ) // text-box
- pContext = GetImport().GetTextImport()->CreateTextChildContext(
- GetImport(), nPrefix, rLocalName, xAttrList,
- XML_TEXT_TYPE_TEXTBOX );
-
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
- return pContext;
-}
-
-void XMLTextFrameContext::Characters( const OUString& rChars )
-{
- if( ( XML_TEXT_FRAME_OBJECT_OLE == nType ||
- XML_TEXT_FRAME_GRAPHIC == nType) &&
- !xPropSet.is() && !bCreateFailed )
- {
- OUString sTrimmedChars( rChars. trim() );
- if( sTrimmedChars.getLength() )
- {
- if( !xBase64Stream.is() )
- {
- if( XML_TEXT_FRAME_GRAPHIC == nType )
- {
- xBase64Stream = GetImport().GetStreamForGraphicObjectURLFromBase64();
- }
- else
- {
- sHRef = OUString( RTL_CONSTASCII_USTRINGPARAM( "#Obj12345678" ) );
- xBase64Stream =
- GetImport().ResolveEmbeddedObjectURLFromBase64( sHRef );
- }
- if( xBase64Stream.is() )
- bOwnBase64Stream = sal_True;
- }
- if( bOwnBase64Stream && xBase64Stream.is() )
- {
- OUString sChars;
- if( sBase64CharsLeft )
- {
- sChars = sBase64CharsLeft;
- sChars += sTrimmedChars;
- sBase64CharsLeft = OUString();
- }
- else
- {
- sChars = sTrimmedChars;
- }
- Sequence< sal_Int8 > aBuffer( (sChars.getLength() / 4) * 3 );
- sal_Int32 nCharsDecoded =
- GetImport().GetMM100UnitConverter().
- decodeBase64SomeChars( aBuffer, sChars );
- xBase64Stream->writeBytes( aBuffer );
- if( nCharsDecoded != sChars.getLength() )
- sBase64CharsLeft = sChars.copy( nCharsDecoded );
- }
- }
- }
-}
-
-void XMLTextFrameContext::SetHyperlink( const OUString& rHRef,
- const OUString& rName,
- const OUString& rTargetFrameName,
- sal_Bool bMap )
-{
- if( !xPropSet.is() )
- {
- OSL_ENSURE( !pHyperlink, "recursive SetHyperlink call" );
- delete pHyperlink;
- pHyperlink = new XMLTextFrameContextHyperlink_Impl(
- rHRef, rName, rTargetFrameName, bMap );
- return;
- }
-
- UniReference< XMLTextImportHelper > xTxtImp = GetImport().GetTextImport();
- Reference < XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
- if( !xPropSetInfo.is() ||
- !xPropSetInfo->hasPropertyByName( xTxtImp->sHyperLinkURL ) )
- return;
-
- Any aAny;
- aAny <<= rHRef;
- xPropSet->setPropertyValue( xTxtImp->sHyperLinkURL, aAny );
-
- if( xPropSetInfo->hasPropertyByName( xTxtImp->sHyperLinkName ) )
- {
- aAny <<= rName;
- xPropSet->setPropertyValue( xTxtImp->sHyperLinkName, aAny );
- }
-
- if( xPropSetInfo->hasPropertyByName( xTxtImp->sHyperLinkTarget ) )
- {
- aAny <<= rTargetFrameName;
- xPropSet->setPropertyValue( xTxtImp->sHyperLinkTarget, aAny );
- }
-
- if( xPropSetInfo->hasPropertyByName( xTxtImp->sServerMap ) )
- {
- aAny.setValue( &bMap, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( xTxtImp->sServerMap, aAny );
- }
-}
-
-Reference < XTextContent > XMLTextFrameContext::GetTextContent() const
-{
- return Reference < XTextContent >( xPropSet, UNO_QUERY );
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextFrameHyperlinkContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextFrameHyperlinkContext.cxx
deleted file mode 100644
index 6eeb150db276..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextFrameHyperlinkContext.cxx
+++ /dev/null
@@ -1,172 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "xmlimp.hxx"
-#include "nmspmap.hxx"
-#include "xmlnmspe.hxx"
-#include "xmluconv.hxx"
-#include "XMLTextFrameContext.hxx"
-#include "XMLTextFrameHyperlinkContext.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::beans;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-TYPEINIT1( XMLTextFrameHyperlinkContext, SvXMLImportContext );
-
-XMLTextFrameHyperlinkContext::XMLTextFrameHyperlinkContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx, const OUString& rLName,
- const Reference< XAttributeList > & xAttrList,
- TextContentAnchorType eATyp,
- Reference < XTextContent> *pTxtCntnt,
- TextContentAnchorType *pAnchrType ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- eAnchorType( eATyp ),
- pTextContent( pTxtCntnt ),
- pAnchorType( pAnchrType ),
- bMap( sal_False )
-{
- OUString sShow;
- const SvXMLTokenMap& rTokenMap =
- GetImport().GetTextImport()->GetTextHyperlinkAttrTokenMap();
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- switch( rTokenMap.Get( nPrefix, aLocalName ) )
- {
- case XML_TOK_TEXT_HYPERLINK_HREF:
- sHRef = GetImport().GetAbsoluteReference( rValue );
- break;
- case XML_TOK_TEXT_HYPERLINK_NAME:
- sName = rValue;
- break;
- case XML_TOK_TEXT_HYPERLINK_TARGET_FRAME:
- sTargetFrameName = rValue;
- break;
- case XML_TOK_TEXT_HYPERLINK_SHOW:
- sShow = rValue;
- break;
- case XML_TOK_TEXT_HYPERLINK_SERVER_MAP:
- {
- sal_Bool bTmp;
- if( rImport.GetMM100UnitConverter().convertBool( bTmp,
- rValue ) )
- {
- bMap = bTmp;
- }
- }
- break;
- }
- }
-
- if( sShow.getLength() && !sTargetFrameName.getLength() )
- {
- if( IsXMLToken( sShow, XML_NEW ) )
- sTargetFrameName =
- OUString( RTL_CONSTASCII_USTRINGPARAM("_blank" ) );
- else if( IsXMLToken( sShow, XML_REPLACE ) )
- sTargetFrameName =
- OUString( RTL_CONSTASCII_USTRINGPARAM("_self" ) );
- }
-}
-
-XMLTextFrameHyperlinkContext::~XMLTextFrameHyperlinkContext()
-{
-}
-
-void XMLTextFrameHyperlinkContext::EndElement()
-{
-}
-
-SvXMLImportContext *XMLTextFrameHyperlinkContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
- XMLTextFrameContext *pTextFrameContext = 0;
-
- if( XML_NAMESPACE_DRAW == nPrefix )
- {
- sal_uInt16 nFrameType = USHRT_MAX;
- if( IsXMLToken( rLocalName, XML_TEXT_BOX ) )
- nFrameType = XML_TEXT_FRAME_TEXTBOX;
- else if( IsXMLToken( rLocalName, XML_IMAGE ) )
- nFrameType = XML_TEXT_FRAME_GRAPHIC;
- else if( IsXMLToken( rLocalName, XML_OBJECT ) )
- nFrameType = XML_TEXT_FRAME_OBJECT;
- else if( IsXMLToken( rLocalName, XML_OBJECT_OLE ) )
- nFrameType = XML_TEXT_FRAME_OBJECT_OLE;
- else if( IsXMLToken( rLocalName, XML_APPLET) )
- nFrameType = XML_TEXT_FRAME_APPLET;
- else if( IsXMLToken( rLocalName, XML_PLUGIN ) )
- nFrameType = XML_TEXT_FRAME_PLUGIN;
- else if( IsXMLToken( rLocalName, XML_FLOATING_FRAME ) )
- nFrameType = XML_TEXT_FRAME_FLOATING_FRAME;
-
- if( USHRT_MAX != nFrameType )
- pTextFrameContext = new XMLTextFrameContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- eAnchorType,
- nFrameType );
- }
-
- if( pTextFrameContext )
- {
- pTextFrameContext->SetHyperlink( sHRef, sName, sTargetFrameName, bMap );
- if( pAnchorType )
- *pAnchorType = pTextFrameContext->GetAnchorType();
- if( pTextContent )
- *pTextContent = pTextFrameContext->GetTextContent();
- pContext = pTextFrameContext;
- }
- else
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
- return pContext;
-}
-
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextHeaderFooterContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextHeaderFooterContext.cxx
deleted file mode 100644
index 418d32ab41be..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextHeaderFooterContext.cxx
+++ /dev/null
@@ -1,194 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/text/XRelativeTextContentRemove.hpp>
-#include "XMLTextHeaderFooterContext.hxx"
-#include "xmlimp.hxx"
-namespace binfilter {
-
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::xml::sax;
-
-using rtl::OUString;
-//using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::beans;
-//using namespace ::com::sun::star::container;
-//using namespace ::com::sun::star::lang;
-//using namespace ::com::sun::star::text;
-
-
-TYPEINIT1( XMLTextHeaderFooterContext, SvXMLImportContext );
-
-XMLTextHeaderFooterContext::XMLTextHeaderFooterContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const uno::Reference<
- xml::sax::XAttributeList > & xAttrList,
- const Reference < XPropertySet > & rPageStylePropSet,
- sal_Bool bFooter, sal_Bool bLft ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- xPropSet( rPageStylePropSet ),
- sOn( OUString::createFromAscii( bFooter ? "FooterIsOn" : "HeaderIsOn" ) ),
- sShareContent( OUString::createFromAscii( bFooter ? "FooterIsShared"
- : "HeaderIsShared" ) ),
- sText( OUString::createFromAscii( bFooter ? "FooterText" : "HeaderText" ) ),
- sTextLeft( OUString::createFromAscii( bFooter ? "FooterTextLeft"
- : "HeaderTextLeft" ) ),
- bInsertContent( sal_True ),
- bLeft( bLft )
-{
- if( bLeft )
- {
- Any aAny;
-
- aAny = xPropSet->getPropertyValue( sOn );
- sal_Bool bOn = *(sal_Bool *)aAny.getValue();
-
- if( bOn )
- {
- aAny = xPropSet->getPropertyValue( sShareContent );
- sal_Bool bShared = *(sal_Bool *)aAny.getValue();
- if( bShared )
- {
- // Don't share headers any longer
- bShared = sal_False;
- aAny.setValue( &bShared, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( sShareContent, aAny );
- }
- }
- else
- {
- // If headers or footers are switched off, no content must be
- // inserted.
- bInsertContent = sal_False;
- }
- }
-}
-
-XMLTextHeaderFooterContext::~XMLTextHeaderFooterContext()
-{
-}
-
-SvXMLImportContext *XMLTextHeaderFooterContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
- if( bInsertContent )
- {
- if( !xOldTextCursor.is() )
- {
- sal_Bool bRemoveContent = sal_True;
- Any aAny;
- if( bLeft )
- {
- // Headers and footers are switched on already,
- // and they aren't shared.
- aAny = xPropSet->getPropertyValue( sTextLeft );
- }
- else
- {
- aAny = xPropSet->getPropertyValue( sOn );
- sal_Bool bOn = *(sal_Bool *)aAny.getValue();
-
- if( !bOn )
- {
- // Switch header on
- bOn = sal_True;
- aAny.setValue( &bOn, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( sOn, aAny );
-
- // The content has not to be removed, because the header
- // or footer is empty already.
- bRemoveContent;
- }
-
- // If a header or footer is not shared, share it now.
- aAny = xPropSet->getPropertyValue( sShareContent );
- sal_Bool bShared = *(sal_Bool *)aAny.getValue();
- if( !bShared )
- {
- bShared = sal_True;
- aAny.setValue( &bShared, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( sShareContent, aAny );
- }
-
- aAny = xPropSet->getPropertyValue( sText );
- }
-
- Reference < XText > xText;
- aAny >>= xText;
-
- if( bRemoveContent )
- {
- OUString sText;
- xText->setString( sText );
- }
-
- UniReference < XMLTextImportHelper > xTxtImport =
- GetImport().GetTextImport();
-
- xOldTextCursor = xTxtImport->GetCursor();
- xTxtImport->SetCursor( xText->createTextCursor() );
- }
-
- pContext =
- GetImport().GetTextImport()->CreateTextChildContext(
- GetImport(), nPrefix, rLocalName, xAttrList,
- XML_TEXT_TYPE_HEADER_FOOTER );
- }
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
- return pContext;
-}
-
-void XMLTextHeaderFooterContext::EndElement()
-{
- if( xOldTextCursor.is() )
- {
- GetImport().GetTextImport()->DeleteParagraph();
- GetImport().GetTextImport()->SetCursor( xOldTextCursor );
- }
- else if( !bLeft )
- {
- // If no content has been inserted inro the header or footer,
- // switch it off.
- sal_Bool bOn = sal_False;
- Any aAny;
- aAny.setValue( &bOn, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( sOn, aAny );
- }
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextListAutoStylePool.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextListAutoStylePool.cxx
deleted file mode 100644
index 0a10a777d9b6..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextListAutoStylePool.cxx
+++ /dev/null
@@ -1,307 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-#include <bf_svtools/cntnrsrt.hxx>
-
-#include <com/sun/star/ucb/XAnyCompareFactory.hpp>
-
-
-#include <com/sun/star/container/XIndexReplace.hpp>
-
-
-#include "xmlnume.hxx"
-#include "XMLTextListAutoStylePool.hxx"
-#include "xmlexp.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::style;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-
-int XMLTextListAutoStylePoolNameCmp_Impl( const OUString& r1,
- const OUString& r2 )
-{
- return (int)r1.compareTo( r2 );
-}
-
-DECLARE_CONTAINER_SORT_DEL( XMLTextListAutoStylePoolNames_Impl,
- OUString )
-IMPL_CONTAINER_SORT( XMLTextListAutoStylePoolNames_Impl,
- OUString,
- XMLTextListAutoStylePoolNameCmp_Impl )
-
-class XMLTextListAutoStylePoolEntry_Impl
-{
- OUString sName;
- OUString sInternalName;
- Reference < XIndexReplace > xNumRules;
- sal_uInt32 nPos;
- sal_Bool bIsNamed;
-
-
-public:
-
- XMLTextListAutoStylePoolEntry_Impl(
- sal_uInt32 nPos,
- const Reference < XIndexReplace > & rNumRules,
- XMLTextListAutoStylePoolNames_Impl& rNames,
- const OUString& rPrefix,
- sal_uInt32& rName );
-
- XMLTextListAutoStylePoolEntry_Impl(
- const Reference < XIndexReplace > & rNumRules ) :
- nPos( 0 ),
- xNumRules( rNumRules ),
- bIsNamed( sal_False )
- {
- Reference < XNamed > xNamed( xNumRules, UNO_QUERY );
- if( xNamed.is() )
- {
- sInternalName = xNamed->getName();
- bIsNamed = sal_True;
- }
- }
-
- XMLTextListAutoStylePoolEntry_Impl(
- const OUString& rInternalName ) :
- nPos( 0 ),
- sInternalName( rInternalName ),
- bIsNamed( sal_True )
- {
- }
-
- const OUString& GetName() const { return sName; }
- const OUString& GetInternalName() const { return sInternalName; }
- const Reference < XIndexReplace > & GetNumRules() const { return xNumRules; }
- sal_uInt32 GetPos() const { return nPos; }
- sal_Bool IsNamed() const { return bIsNamed; }
-};
-
-XMLTextListAutoStylePoolEntry_Impl::XMLTextListAutoStylePoolEntry_Impl(
- sal_uInt32 nP,
- const Reference < XIndexReplace > & rNumRules,
- XMLTextListAutoStylePoolNames_Impl& rNames,
- const OUString& rPrefix,
- sal_uInt32& rName ) :
- nPos( nP ),
- xNumRules( rNumRules ),
- bIsNamed( sal_False )
-{
- Reference < XNamed > xNamed( xNumRules, UNO_QUERY );
- if( xNamed.is() )
- {
- sInternalName = xNamed->getName();
- bIsNamed = sal_True;
- }
-
- // create a name that hasn't been used before. The created name has not
- // to be added to the array, because it will never tried again
- OUStringBuffer sBuffer( 7 );
- do
- {
- rName++;
- sBuffer.append( rPrefix );
- sBuffer.append( (sal_Int32)rName );
- sName = sBuffer.makeStringAndClear();
- }
- while( rNames.Seek_Entry( &sName, 0 ) );
-}
-
-int XMLTextListAutoStylePoolEntryCmp_Impl(
- const XMLTextListAutoStylePoolEntry_Impl& r1,
- const XMLTextListAutoStylePoolEntry_Impl& r2 )
-{
- int nRet;
- if( r1.IsNamed() )
- {
- if( r2.IsNamed() )
- nRet = (int)r1.GetInternalName().compareTo( r2.GetInternalName());
- else
- nRet = -1;
- }
- else
- {
- if( r2.IsNamed() )
- nRet = 1;
- else
- nRet = (int)(r1.GetNumRules().get() - r2.GetNumRules().get());
- }
-
- return nRet;
-}
-
-typedef XMLTextListAutoStylePoolEntry_Impl *XMLTextListAutoStylePoolEntryPtr;
-DECLARE_CONTAINER_SORT( XMLTextListAutoStylePool_Impl,
- XMLTextListAutoStylePoolEntry_Impl )
-IMPL_CONTAINER_SORT( XMLTextListAutoStylePool_Impl,
- XMLTextListAutoStylePoolEntry_Impl,
- XMLTextListAutoStylePoolEntryCmp_Impl )
-
-XMLTextListAutoStylePool::XMLTextListAutoStylePool( SvXMLExport& rExp ) :
- rExport( rExp ),
- pPool( new XMLTextListAutoStylePool_Impl( 5, 5 ) ),
- pNames( new XMLTextListAutoStylePoolNames_Impl( 5, 5 ) ),
- nName( 0 ),
- sPrefix( RTL_CONSTASCII_USTRINGPARAM("L") )
-{
- Reference<ucb::XAnyCompareFactory> xCompareFac( rExp.GetModel(), uno::UNO_QUERY );
- if( xCompareFac.is() )
- mxNumRuleCompare = xCompareFac->createAnyCompareByName( OUString( RTL_CONSTASCII_USTRINGPARAM( "NumberingRules" ) ) );
-}
-
-XMLTextListAutoStylePool::~XMLTextListAutoStylePool()
-{
- delete pPool;
- delete pNames;
-}
-
-void XMLTextListAutoStylePool::RegisterName( const OUString& rName )
-{
- OUString *pName = new OUString( rName );
- if( !pNames->Insert( pName ) )
- delete pName;
-}
-
-sal_uInt32 XMLTextListAutoStylePool::Find( XMLTextListAutoStylePoolEntry_Impl* pEntry ) const
-{
- ULONG nPos;
- if( !pEntry->IsNamed() && mxNumRuleCompare.is() )
- {
- const sal_uInt32 nCount = pPool->Count();
-
- uno::Any aAny1, aAny2;
- aAny1 <<= pEntry->GetNumRules();
-
- for( nPos = 0; nPos < nCount; nPos++ )
- {
- aAny2 <<= pPool->GetObject(nPos)->GetNumRules();
-
- if( mxNumRuleCompare->compare( aAny1, aAny2 ) == 0 )
- return nPos;
- }
- }
- else if( pPool->Seek_Entry( pEntry, &nPos ) )
- {
- return nPos;
- }
-
- return (sal_uInt32)-1;
-}
-
-OUString XMLTextListAutoStylePool::Add(
- const Reference < XIndexReplace > & rNumRules )
-{
- OUString sName;
- XMLTextListAutoStylePoolEntry_Impl aTmp( rNumRules );
-
- sal_uInt32 nPos = Find( &aTmp );
- if( nPos != (sal_uInt32)-1 )
- {
- sName = pPool->GetObject( nPos )->GetName();
- }
- else
- {
- XMLTextListAutoStylePoolEntry_Impl *pEntry =
- new XMLTextListAutoStylePoolEntry_Impl( pPool->Count(),
- rNumRules, *pNames, sPrefix,
- nName );
- pPool->Insert( pEntry );
- sName = pEntry->GetName();
- }
-
- return sName;
-}
-
-::rtl::OUString XMLTextListAutoStylePool::Find(
- const Reference < XIndexReplace > & rNumRules ) const
-{
- OUString sName;
- XMLTextListAutoStylePoolEntry_Impl aTmp( rNumRules );
-
- sal_uInt32 nPos = Find( &aTmp );
- if( nPos != (sal_uInt32)-1 )
- sName = pPool->GetObject( nPos )->GetName();
-
- return sName;
-}
-
-::rtl::OUString XMLTextListAutoStylePool::Find(
- const OUString& rInternalName ) const
-{
- OUString sName;
- XMLTextListAutoStylePoolEntry_Impl aTmp( rInternalName );
- sal_uInt32 nPos = Find( &aTmp );
- if( nPos != (sal_uInt32)-1 )
- sName = pPool->GetObject( nPos )->GetName();
-
- return sName;
-}
-
-void XMLTextListAutoStylePool::exportXML() const
-{
- sal_uInt32 nCount = pPool->Count();
- if( !nCount )
- return;
-
- XMLTextListAutoStylePoolEntry_Impl **aExpEntries =
- new XMLTextListAutoStylePoolEntryPtr[nCount];
-
- sal_uInt32 i;
- for( i=0; i < nCount; i++ )
- {
- aExpEntries[i] = 0;
- }
- for( i=0; i < nCount; i++ )
- {
- XMLTextListAutoStylePoolEntry_Impl *pEntry = pPool->GetObject(i);
- DBG_ASSERT( pEntry->GetPos() < nCount, "Illegal pos" );
- aExpEntries[pEntry->GetPos()] = pEntry;
- }
-
- SvxXMLNumRuleExport aNumRuleExp( rExport );
-
- for( i=0; i < nCount; i++ )
- {
- XMLTextListAutoStylePoolEntry_Impl *pEntry = aExpEntries[i];
- aNumRuleExp.exportNumberingRule( pEntry->GetName(),
- pEntry->GetNumRules() );
- }
- delete [] aExpEntries;
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextListBlockContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextListBlockContext.cxx
deleted file mode 100644
index 29bd0f307a43..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextListBlockContext.cxx
+++ /dev/null
@@ -1,239 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include <com/sun/star/style/XStyle.hpp>
-
-#include "xmlimp.hxx"
-#include "xmlnumi.hxx"
-#include "nmspmap.hxx"
-
-#include "XMLTextListItemContext.hxx"
-#include "XMLTextListBlockContext.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::beans;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-TYPEINIT1( XMLTextListBlockContext, SvXMLImportContext );
-
-XMLTextListBlockContext::XMLTextListBlockContext(
- SvXMLImport& rImport,
- XMLTextImportHelper& rTxtImp,
- sal_uInt16 nPrfx, const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- sal_Bool bOrd ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rTxtImport( rTxtImp ),
- xParentListBlock( rTxtImp.GetListBlock() ),
- nLevel( 0 ),
- nLevels( 0 ),
- bOrdered( bOrd ),
- bRestartNumbering( sal_True ),
- bSetDefaults( sal_False ),
- sNumberingRules( RTL_CONSTASCII_USTRINGPARAM( "NumberingRules" ) )
-{
- // Inherit style name from parent list, as well as the flags whether
- // numbering must be restarted and formats have to be created.
- OUString sParentStyleName;
- if( xParentListBlock.Is() )
- {
- XMLTextListBlockContext *pParent =
- (XMLTextListBlockContext *)&xParentListBlock;
- sStyleName = pParent->GetStyleName();
- xNumRules = pParent->GetNumRules();
- sParentStyleName = sStyleName;
- nLevels = pParent->nLevels;
- nLevel = pParent->GetLevel() + 1;
- bRestartNumbering = pParent->IsRestartNumbering();
- bSetDefaults = pParent->bSetDefaults;
- }
-
- const SvXMLTokenMap& rTokenMap =
- rTxtImport.GetTextListBlockAttrTokenMap();
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- switch( rTokenMap.Get( nPrefix, aLocalName ) )
- {
- case XML_TOK_TEXT_LIST_BLOCK_CONTINUE_NUMBERING:
- bRestartNumbering = !IsXMLToken(rValue, XML_TRUE);
- break;
- case XML_TOK_TEXT_LIST_BLOCK_STYLE_NAME:
- sStyleName = rValue;
- break;
- }
- }
-
- if( sStyleName.getLength() && sStyleName != sParentStyleName )
- {
- const Reference < XNameContainer >& rNumStyles =
- rTxtImport.GetNumberingStyles();
- if( rNumStyles.is() && rNumStyles->hasByName( sStyleName ) )
- {
- Reference < XStyle > xStyle;
- Any aAny = rNumStyles->getByName( sStyleName );
- aAny >>= xStyle;
-
- // If the style has not been used, the restart numbering has
- // to be set never.
- if( bRestartNumbering && !xStyle->isInUse() )
- bRestartNumbering = sal_False;
-
- Reference< XPropertySet > xPropSet( xStyle, UNO_QUERY );
- aAny = xPropSet->getPropertyValue( sNumberingRules );
- aAny >>= xNumRules;
- nLevels = xNumRules->getCount();
- }
- else
- {
- const SvxXMLListStyleContext *pListStyle =
- rTxtImport.FindAutoListStyle( sStyleName );
- if( pListStyle )
- {
- xNumRules = pListStyle->GetNumRules();
- sal_Bool bUsed = xNumRules.is();
- if( !xNumRules.is() )
- {
- pListStyle->CreateAndInsertAuto();
- xNumRules = pListStyle->GetNumRules();
- }
- if( bRestartNumbering && !bUsed )
- bRestartNumbering = sal_False;
- nLevels = pListStyle->GetLevels();
- }
- }
- }
-
- if( !xNumRules.is() )
- {
- // If no style name has been specified for this style and for any
- // parent or if no num rule this the specified name is existing,
- // create a new one.
-
- xNumRules =
- SvxXMLListStyleContext::CreateNumRule( GetImport().GetModel() );
- DBG_ASSERT( xNumRules.is(), "go no numbering rule" );
- if( !xNumRules.is() )
- return;
-
- nLevels = xNumRules->getCount();
-
- // Because its a new num rule, numbering mist be restarted never.
- bRestartNumbering = sal_False;
- bSetDefaults = sal_True;
- }
-
- if( nLevel >= nLevels )
- nLevel = nLevels-1;
-
- if( bSetDefaults )
- {
- // Because there is no list style sheet for this style, a default
- // format must be set for any level of this num rule.
- SvxXMLListStyleContext::SetDefaultStyle( xNumRules, nLevel,
- bOrdered );
- }
-
- // Remember this list block.
- rTxtImport.SetListBlock( this );
-
- // There is no list item by now.
- rTxtImport.SetListItem( 0 );
-}
-
-XMLTextListBlockContext::~XMLTextListBlockContext()
-{
-}
-
-void XMLTextListBlockContext::EndElement()
-{
- // Numbering has not to be restarted if it has been restarted within
- // a child list.
- XMLTextListBlockContext *pParent =
- (XMLTextListBlockContext *)&xParentListBlock;
- if( pParent )
- {
- pParent->bRestartNumbering = bRestartNumbering;
- }
-
- // Restore current list block.
- rTxtImport.SetListBlock( pParent );
-
- // Any paragraph following the list within the same list item mist not
- // be numbered.
- rTxtImport.SetListItem( 0 );
-}
-
-SvXMLImportContext *XMLTextListBlockContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
-
- const SvXMLTokenMap& rTokenMap =
- rTxtImport.GetTextListBlockElemTokenMap();
- sal_Bool bHeader = sal_False;
- switch( rTokenMap.Get( nPrefix, rLocalName ) )
- {
- case XML_TOK_TEXT_LIST_HEADER:
- bHeader = sal_True;
- case XML_TOK_TEXT_LIST_ITEM:
- pContext = new XMLTextListItemContext( GetImport(), rTxtImport,
- nPrefix, rLocalName,
- xAttrList, bHeader );
- break;
- }
-
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
- return pContext;
-}
-
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextListItemContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextListItemContext.cxx
deleted file mode 100644
index b70a33ea7d48..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextListItemContext.cxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include "xmlimp.hxx"
-#include "nmspmap.hxx"
-#include "xmlnmspe.hxx"
-#include "txtparai.hxx"
-#include "XMLTextListBlockContext.hxx"
-
-
-#include "XMLTextListItemContext.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-TYPEINIT1( XMLTextListItemContext, SvXMLImportContext );
-
-XMLTextListItemContext::XMLTextListItemContext(
- SvXMLImport& rImport,
- XMLTextImportHelper& rTxtImp, sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- sal_Bool bIsHeader ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rTxtImport( rTxtImp ),
- nStartValue( -1 )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- if( !bIsHeader && XML_NAMESPACE_TEXT == nPrefix &&
- IsXMLToken( aLocalName, XML_START_VALUE ) )
- {
- sal_Int32 nTmp = rValue.toInt32();
- if( nTmp >= 0 && nTmp <= SHRT_MAX )
- nStartValue = (sal_Int16)nTmp;
- }
- }
-
- DBG_ASSERT( !rTxtImport.GetListItem(),
- "SwXMLListItemContext::SwXMLListItemContext: list item is existing" );
-
- // If this is a <text:list-item> element, then remember it as a sign
- // that a bullet has to be generated.
- if( !bIsHeader )
- rTxtImport.SetListItem( this );
-}
-
-XMLTextListItemContext::~XMLTextListItemContext()
-{
-}
-
-void XMLTextListItemContext::EndElement()
-{
- // finish current list item
- rTxtImport.SetListItem( 0 );
-}
-
-SvXMLImportContext *XMLTextListItemContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
-
- const SvXMLTokenMap& rTokenMap = rTxtImport.GetTextElemTokenMap();
- sal_Bool bOrdered = sal_False;
- sal_Bool bHeading = sal_False;
- switch( rTokenMap.Get( nPrefix, rLocalName ) )
- {
- case XML_TOK_TEXT_H:
- bHeading = sal_True;
- case XML_TOK_TEXT_P:
- pContext = new XMLParaContext( GetImport(),
- nPrefix, rLocalName,
- xAttrList, bHeading );
- if (rTxtImport.IsProgress())
- GetImport().GetProgressBarHelper()->Increment();
-
- break;
- case XML_TOK_TEXT_ORDERED_LIST:
- bOrdered = sal_True;
- case XML_TOK_TEXT_UNORDERED_LIST:
- pContext = new XMLTextListBlockContext( GetImport(), rTxtImport,
- nPrefix, rLocalName,
- xAttrList, bOrdered );
- break;
- }
-
- if( !pContext )
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
- return pContext;
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextMarkImportContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextMarkImportContext.cxx
deleted file mode 100644
index b11ee30c03dd..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextMarkImportContext.cxx
+++ /dev/null
@@ -1,244 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "XMLTextMarkImportContext.hxx"
-
-#include "rtl/ustring.hxx"
-
-#include <tools/debug.hxx>
-
-#include "xmluconv.hxx"
-
-
-#include "xmlimp.hxx"
-
-#include "nmspmap.hxx"
-
-#include "xmlnmspe.hxx"
-
-
-#include <com/sun/star/text/XTextContent.hpp>
-
-
-
-#include <com/sun/star/container/XNamed.hpp>
-namespace binfilter {
-
-
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-TYPEINIT1( XMLTextMarkImportContext, SvXMLImportContext);
-
-XMLTextMarkImportContext::XMLTextMarkImportContext(
- SvXMLImport& rImport,
- XMLTextImportHelper& rHlp,
- sal_uInt16 nPrefix,
- const OUString& rLocalName ) :
- SvXMLImportContext(rImport, nPrefix, rLocalName),
- rHelper(rHlp)
-{
-}
-
-enum lcl_MarkType { TypeReference, TypeReferenceStart, TypeReferenceEnd,
- TypeBookmark, TypeBookmarkStart, TypeBookmarkEnd };
-
-static SvXMLEnumMapEntry __READONLY_DATA lcl_aMarkTypeMap[] =
-{
- { XML_REFERENCE_MARK, TypeReference },
- { XML_REFERENCE_MARK_START, TypeReferenceStart },
- { XML_REFERENCE_MARK_END, TypeReferenceEnd },
- { XML_BOOKMARK, TypeBookmark },
- { XML_BOOKMARK_START, TypeBookmarkStart },
- { XML_BOOKMARK_END, TypeBookmarkEnd },
- { XML_TOKEN_INVALID, 0 },
-};
-
-void XMLTextMarkImportContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- const OUString sAPI_reference_mark(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.ReferenceMark"));
- const OUString sAPI_bookmark(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Bookmark"));
-
-
- OUString sName;
-
- if (FindName(GetImport(), xAttrList, sName))
- {
- sal_uInt16 nTmp;
- if (SvXMLUnitConverter::convertEnum(nTmp, GetLocalName(),
- lcl_aMarkTypeMap))
- {
- switch ((lcl_MarkType)nTmp)
- {
- case TypeReference:
- // export point reference mark
- CreateAndInsertMark(GetImport(),
- sAPI_reference_mark,
- sName,
- rHelper.GetCursorAsRange()->getStart());
- break;
-
- case TypeBookmark:
- // export point bookmark
- CreateAndInsertMark(GetImport(),
- sAPI_bookmark,
- sName,
- rHelper.GetCursorAsRange()->getStart());
- break;
-
- case TypeBookmarkStart:
- // save XTextRange for later construction of bookmark
- rHelper.InsertBookmarkStartRange(
- sName, rHelper.GetCursorAsRange()->getStart());
- break;
-
- case TypeBookmarkEnd:
- {
- // get old range, and construct
- Reference<XTextRange> xStartRange;
- if (rHelper.FindAndRemoveBookmarkStartRange(xStartRange,
- sName))
- {
- Reference<XTextRange> xEndRange(
- rHelper.GetCursorAsRange()->getEnd());
-
- // check if beginning and end are in same XText
- if (xStartRange->getText() == xEndRange->getText())
- {
- // create range for insertion
- Reference<XTextCursor> xInsertionCursor =
- rHelper.GetText()->createTextCursorByRange(
- xEndRange);
- xInsertionCursor->gotoRange(xStartRange, sal_True);
-
- //DBG_ASSERT(! xInsertionCursor->isCollapsed(),
- // "we want no point mark");
- // can't assert, because someone could
- // create a file with subsequence
- // start/end elements
-
- Reference<XTextRange> xInsertionRange(
- xInsertionCursor, UNO_QUERY);
-
- // insert reference
- CreateAndInsertMark(GetImport(),
- sAPI_bookmark,
- sName,
- xInsertionRange);
- }
- // else: beginning/end in different XText -> ignore!
- }
- // else: no start found -> ignore!
- break;
- }
-
- case TypeReferenceStart:
- case TypeReferenceEnd:
- DBG_ERROR("reference start/end are handled in txtparai !");
- break;
-
- default:
- DBG_ERROR("unknown mark type");
- break;
- }
- }
- }
-}
-
-
-void XMLTextMarkImportContext::CreateAndInsertMark(
- SvXMLImport& rImport,
- const OUString& sServiceName,
- const OUString& sMarkName,
- const Reference<XTextRange> & rRange)
-{
- // create mark
- Reference<XMultiServiceFactory> xFactory(rImport.GetModel(),UNO_QUERY);
- if( xFactory.is() )
- {
- Reference<XInterface> xIfc = xFactory->createInstance(sServiceName);
-
- // set name
- Reference<XNamed> xNamed(xIfc, UNO_QUERY);
- if (xNamed.is())
- {
- xNamed->setName(sMarkName);
-
- // cast to XTextContent and attach to document
- Reference<XTextContent> xTextContent(xIfc, UNO_QUERY);
- if (xTextContent.is())
- {
- // if inserting marks, bAbsorb==sal_False will cause
- // collapsing of the given XTextRange.
- rImport.GetTextImport()->GetText()->insertTextContent(rRange,
- xTextContent, sal_True);
- }
- }
- }
-}
-
-sal_Bool XMLTextMarkImportContext::FindName(
- SvXMLImport& rImport,
- const Reference<XAttributeList> & xAttrList,
- OUString& sName)
-{
- sal_Bool bNameOK;
-
- // find name attribute first
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
- &sLocalName );
-
- if ( (XML_NAMESPACE_TEXT == nPrefix) &&
- IsXMLToken(sLocalName, XML_NAME) )
- {
- sName = xAttrList->getValueByIndex(nAttr);
- bNameOK = sal_True;
- }
- }
-
- return bNameOK;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextMasterPageContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextMasterPageContext.cxx
deleted file mode 100644
index baa37d47b874..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextMasterPageContext.cxx
+++ /dev/null
@@ -1,273 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/beans/XMultiPropertyStates.hpp>
-#include "nmspmap.hxx"
-#include "xmlnmspe.hxx"
-#include "XMLTextMasterPageContext.hxx"
-#include "XMLTextHeaderFooterContext.hxx"
-#include "PageMasterImportContext.hxx"
-namespace binfilter {
-
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-
-using rtl::OUString;
-//using namespace ::com::sun::star::text;
-using namespace ::binfilter::xmloff::token;
-
-Reference < XStyle > XMLTextMasterPageContext::Create()
-{
- Reference < XStyle > xNewStyle;
-
- Reference< XMultiServiceFactory > xFactory( GetImport().GetModel(),
- UNO_QUERY );
- if( xFactory.is() )
- {
- Reference < XInterface > xIfc =
- xFactory->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.style.PageStyle")) );
- if( xIfc.is() )
- xNewStyle = Reference < XStyle >( xIfc, UNO_QUERY );
- }
-
- return xNewStyle;
-}
-TYPEINIT1( XMLTextMasterPageContext, SvXMLStyleContext );
-
-XMLTextMasterPageContext::XMLTextMasterPageContext( SvXMLImport& rImport,
- sal_uInt16 nPrfx, const OUString& rLName,
- const Reference< XAttributeList > & xAttrList,
- sal_Bool bOverwrite ) :
- SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, XML_STYLE_FAMILY_MASTER_PAGE ),
- sIsPhysical( RTL_CONSTASCII_USTRINGPARAM( "IsPhysical" ) ),
- sFollowStyle( RTL_CONSTASCII_USTRINGPARAM( "FollowStyle" ) ),
- sPageStyleLayout( RTL_CONSTASCII_USTRINGPARAM( "PageStyleLayout" ) ),
- sPageMasterName(),
- bInsertHeader( sal_False ),
- bInsertFooter( sal_False ),
- bInsertHeaderLeft( sal_False ),
- bInsertFooterLeft( sal_False ),
- bHeaderInserted( sal_False ),
- bFooterInserted( sal_False ),
- bHeaderLeftInserted( sal_False ),
- bFooterLeftInserted( sal_False )
-{
- OUString sName;
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName, &aLocalName );
- if( XML_NAMESPACE_STYLE == nPrefix )
- {
- if( IsXMLToken( aLocalName, XML_NAME ) )
- {
- sName = xAttrList->getValueByIndex( i );
- }
- else if( IsXMLToken( aLocalName, XML_NEXT_STYLE_NAME ) )
- {
- sFollow = xAttrList->getValueByIndex( i );
- }
- else if( IsXMLToken( aLocalName, XML_PAGE_MASTER_NAME ) )
- {
- sPageMasterName = xAttrList->getValueByIndex( i );
- }
- }
- }
-
- if( 0 == sName.getLength() )
- return;
-
- Reference < XNameContainer > xPageStyles =
- GetImport().GetTextImport()->GetPageStyles();
- if( !xPageStyles.is() )
- return;
-
- Any aAny;
- sal_Bool bNew = sal_False;
- if( xPageStyles->hasByName( sName ) )
- {
- aAny = xPageStyles->getByName( sName );
- aAny >>= xStyle;
- }
- else
- {
- xStyle = Create();
- if( !xStyle.is() )
- return;
-
- aAny <<= xStyle;
- xPageStyles->insertByName( sName, aAny );
- bNew = sal_True;
- }
-
- Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
- if( !bNew && xPropSetInfo->hasPropertyByName( sIsPhysical ) )
- {
- aAny = xPropSet->getPropertyValue( sIsPhysical );
- bNew = !*(sal_Bool *)aAny.getValue();
- }
- SetNew( bNew );
-
- if( bOverwrite || bNew )
- {
- Reference < XMultiPropertyStates > xMultiStates( xPropSet,
- UNO_QUERY );
- OSL_ENSURE( xMultiStates.is(),
- "text page style does not support multi property set" );
- if( xMultiStates.is() )
- xMultiStates->setAllPropertiesToDefault();
-
- bInsertHeader = bInsertFooter = sal_True;
- bInsertHeaderLeft = bInsertFooterLeft = sal_True;
- }
-}
-
-XMLTextMasterPageContext::~XMLTextMasterPageContext()
-{
-}
-
-SvXMLImportContext *XMLTextMasterPageContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
-
- const SvXMLTokenMap& rTokenMap =
- GetImport().GetTextImport()->GetTextMasterPageElemTokenMap();
-
- sal_Bool bInsert = sal_False, bFooter = sal_False, bLeft = sal_False;
- switch( rTokenMap.Get( nPrefix, rLocalName ) )
- {
- case XML_TOK_TEXT_MP_HEADER:
- if( bInsertHeader && !bHeaderInserted )
- {
- bInsert = sal_True;
- bHeaderInserted = sal_True;
- }
- break;
- case XML_TOK_TEXT_MP_FOOTER:
- if( bInsertFooter && !bFooterInserted )
- {
- bInsert = bFooter = sal_True;
- bFooterInserted = sal_True;
- }
- break;
- case XML_TOK_TEXT_MP_HEADER_LEFT:
- if( bInsertHeaderLeft && bHeaderInserted && !bHeaderLeftInserted )
- bInsert = bLeft = sal_True;
- break;
- case XML_TOK_TEXT_MP_FOOTER_LEFT:
- if( bInsertFooterLeft && bFooterInserted && !bFooterLeftInserted )
- bInsert = bFooter = bLeft = sal_True;
- break;
- }
-
- if( bInsert && xStyle.is() )
- {
- pContext = CreateHeaderFooterContext( nPrefix, rLocalName,
- xAttrList,
- bFooter, bLeft );
- }
- else
- {
- pContext = SvXMLStyleContext::CreateChildContext( nPrefix, rLocalName,
- xAttrList );
- }
-
- return pContext;
-}
-
-SvXMLImportContext *XMLTextMasterPageContext::CreateHeaderFooterContext(
- sal_uInt16 nPrefix,
- const ::rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
- const sal_Bool bFooter,
- const sal_Bool bLeft )
-{
- Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
- return new XMLTextHeaderFooterContext( GetImport(),
- nPrefix, rLocalName,
- xAttrList,
- xPropSet,
- bFooter, bLeft );
-}
-
-void XMLTextMasterPageContext::Finish( sal_Bool bOverwrite )
-{
- if( xStyle.is() && (IsNew() || bOverwrite) )
- {
- Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
- if ( sPageMasterName.getLength() )
- {
- XMLPropStyleContext* pStyle =
- GetImport().GetTextImport()->FindPageMaster( sPageMasterName );
- if (pStyle)
- {
- pStyle->FillPropertySet(xPropSet);
- }
- }
-
- Reference < XNameContainer > xPageStyles =
- GetImport().GetTextImport()->GetPageStyles();
- if( !xPageStyles.is() )
- return;
-
- if( !sFollow.getLength() || !xPageStyles->hasByName( sFollow ) )
- sFollow = xStyle->getName();
-
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
- if( xPropSetInfo->hasPropertyByName( sFollowStyle ) )
- {
- Any aAny = xPropSet->getPropertyValue( sFollowStyle );
- OUString sCurrFollow;
- aAny >>= sCurrFollow;
- if( sCurrFollow != sFollow )
- {
- aAny <<= sFollow;
- xPropSet->setPropertyValue( sFollowStyle, aAny );
- }
- }
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextMasterPageExport.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextMasterPageExport.cxx
deleted file mode 100644
index cd6fc3265d3a..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextMasterPageExport.cxx
+++ /dev/null
@@ -1,188 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include "xmlnmspe.hxx"
-
-#include <com/sun/star/text/XText.hpp>
-
-
-#include "xmlexp.hxx"
-
-#include "XMLTextMasterPageExport.hxx"
-namespace binfilter {
-
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::beans;
-using namespace ::binfilter::xmloff::token;
-
-XMLTextMasterPageExport::XMLTextMasterPageExport( SvXMLExport& rExp ) :
- XMLPageExport( rExp ),
- sHeaderText( RTL_CONSTASCII_USTRINGPARAM( "HeaderText" ) ),
- sHeaderOn( RTL_CONSTASCII_USTRINGPARAM( "HeaderIsOn" ) ),
- sHeaderShareContent( RTL_CONSTASCII_USTRINGPARAM( "HeaderIsShared" ) ),
- sHeaderTextLeft( RTL_CONSTASCII_USTRINGPARAM( "HeaderTextLeft" ) ),
- sFooterText( RTL_CONSTASCII_USTRINGPARAM( "FooterText" ) ),
- sFooterOn( RTL_CONSTASCII_USTRINGPARAM( "FooterIsOn" ) ),
- sFooterShareContent( RTL_CONSTASCII_USTRINGPARAM( "FooterIsShared" ) ),
- sFooterTextLeft( RTL_CONSTASCII_USTRINGPARAM( "FooterTextLeft" ) )
-{
-}
-
-XMLTextMasterPageExport::~XMLTextMasterPageExport()
-{
-}
-
-
-void XMLTextMasterPageExport::exportHeaderFooterContent(
- const Reference< XText >& rText,
- sal_Bool bAutoStyles, sal_Bool bExportParagraph )
-{
- DBG_ASSERT( rText.is(), "There is the text" );
-
- // tracked changes (autostyles + changes list)
- GetExport().GetTextParagraphExport()->recordTrackedChangesForXText(rText);
- GetExport().GetTextParagraphExport()->exportTrackedChanges(rText,
- bAutoStyles);
- if( bAutoStyles )
- GetExport().GetTextParagraphExport()
- ->collectTextAutoStyles( rText, sal_True, bExportParagraph );
- else
- {
- GetExport().GetTextParagraphExport()->exportTextDeclarations( rText );
- GetExport().GetTextParagraphExport()->exportText( rText, sal_True, bExportParagraph );
- }
-
- // tracked changes (end of XText)
- GetExport().GetTextParagraphExport()->recordTrackedChangesNoXText();
-}
-
-void XMLTextMasterPageExport::exportMasterPageContent(
- const Reference < XPropertySet > & rPropSet,
- sal_Bool bAutoStyles )
-{
- Any aAny;
-
- Reference < XText > xHeaderText;
- aAny = rPropSet->getPropertyValue( sHeaderText );
- aAny >>= xHeaderText;
-
- Reference < XText > xHeaderTextLeft;
- aAny = rPropSet->getPropertyValue( sHeaderTextLeft );
- aAny >>= xHeaderTextLeft;
-
- Reference < XText > xFooterText;
- aAny = rPropSet->getPropertyValue( sFooterText );
- aAny >>= xFooterText;
-
- Reference < XText > xFooterTextLeft;
- aAny = rPropSet->getPropertyValue( sFooterTextLeft );
- aAny >>= xFooterTextLeft;
-
- if( bAutoStyles )
- {
- if( xHeaderText.is() )
- exportHeaderFooterContent( xHeaderText, sal_True );
- if( xHeaderTextLeft.is() && xHeaderTextLeft != xHeaderText )
- exportHeaderFooterContent( xHeaderTextLeft, sal_True );
- if( xFooterText.is() )
- exportHeaderFooterContent( xFooterText, sal_True );
- if( xFooterTextLeft.is() && xFooterTextLeft != xFooterText )
- exportHeaderFooterContent( xFooterTextLeft, sal_True );
- }
- else
- {
- aAny = rPropSet->getPropertyValue( sHeaderOn );
- sal_Bool bHeader = *(sal_Bool *)aAny.getValue();
-
- sal_Bool bHeaderLeft = sal_False;
- if( bHeader )
- {
- aAny = rPropSet->getPropertyValue( sHeaderShareContent );
- bHeaderLeft = !*(sal_Bool *)aAny.getValue();
- }
-
- if( xHeaderText.is() )
- {
- if( !bHeader )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_DISPLAY, XML_FALSE );
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
- XML_HEADER, sal_True, sal_True );
- exportHeaderFooterContent( xHeaderText, sal_False );
- }
-
- if( xHeaderTextLeft.is() && xHeaderTextLeft != xHeaderText )
- {
- if( !bHeaderLeft )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_DISPLAY, XML_FALSE );
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
- XML_HEADER_LEFT, sal_True, sal_True );
- exportHeaderFooterContent( xHeaderTextLeft, sal_False );
- }
-
- aAny = rPropSet->getPropertyValue( sFooterOn );
- sal_Bool bFooter = *(sal_Bool *)aAny.getValue();
-
- sal_Bool bFooterLeft = sal_False;
- if( bFooter )
- {
- aAny = rPropSet->getPropertyValue( sFooterShareContent );
- bFooterLeft = !*(sal_Bool *)aAny.getValue();
- }
-
- if( xFooterText.is() )
- {
- if( !bFooter )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_DISPLAY, XML_FALSE );
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
- XML_FOOTER, sal_True, sal_True );
- exportHeaderFooterContent( xFooterText, sal_False );
- }
-
- if( xFooterTextLeft.is() && xFooterTextLeft != xFooterText )
- {
- if( !bFooterLeft )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_DISPLAY, XML_FALSE );
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE,
- XML_FOOTER_LEFT, sal_True, sal_True );
- exportHeaderFooterContent( xFooterTextLeft, sal_False );
- }
- }
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextMasterStylesContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextMasterStylesContext.cxx
deleted file mode 100644
index dc14635ccbb8..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextMasterStylesContext.cxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-
-#include "xmlimp.hxx"
-#include "xmlnmspe.hxx"
-
-#include "XMLTextMasterPageContext.hxx"
-#include "XMLTextMasterStylesContext.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::xml::sax;
-
-using rtl::OUString;
-
-using ::binfilter::xmloff::token::IsXMLToken;
-using ::binfilter::xmloff::token::XML_MASTER_PAGE;
-
-// ------------------------------------------------------------------------
-
-TYPEINIT1( XMLTextMasterStylesContext, SvXMLStylesContext );
-
-sal_Bool XMLTextMasterStylesContext::InsertStyleFamily( sal_uInt16 ) const
-{
- return sal_True;
-}
-
-XMLTextMasterStylesContext::XMLTextMasterStylesContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx, const OUString& rLName,
- const Reference< XAttributeList > & xAttrList ) :
- SvXMLStylesContext( rImport, nPrfx, rLName, xAttrList )
-{
-}
-
-XMLTextMasterStylesContext::~XMLTextMasterStylesContext()
-{
-}
-
-SvXMLStyleContext *XMLTextMasterStylesContext::CreateStyleChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< XAttributeList > & xAttrList )
-{
- SvXMLStyleContext *pContext = 0;
-
- if( XML_NAMESPACE_STYLE == nPrefix &&
- IsXMLToken( rLocalName, XML_MASTER_PAGE ) &&
- InsertStyleFamily( XML_STYLE_FAMILY_MASTER_PAGE ) )
- pContext = new XMLTextMasterPageContext(
- GetImport(), nPrefix, rLocalName,
- xAttrList,
- !GetImport().GetTextImport()->IsInsertMode() );
-
- // any other style will be ignored here!
-
- return pContext;
-}
-
-SvXMLStyleContext *XMLTextMasterStylesContext::CreateStyleStyleChildContext(
- sal_uInt16 nFamily,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< XAttributeList > & xAttrList )
-{
- return 0;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextNumRuleInfo.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextNumRuleInfo.cxx
deleted file mode 100644
index f08eb00f11d5..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextNumRuleInfo.cxx
+++ /dev/null
@@ -1,147 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/style/NumberingType.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-
-#include "XMLTextNumRuleInfo.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::style;
-
-XMLTextNumRuleInfo::XMLTextNumRuleInfo() :
- sNumberingRules(RTL_CONSTASCII_USTRINGPARAM("NumberingRules")),
- sNumberingLevel(RTL_CONSTASCII_USTRINGPARAM("NumberingLevel")),
- sNumberingStartValue(RTL_CONSTASCII_USTRINGPARAM("NumberingStartValue")),
- sParaIsNumberingRestart(RTL_CONSTASCII_USTRINGPARAM("ParaIsNumberingRestart")),
- sNumberingType(RTL_CONSTASCII_USTRINGPARAM("NumberingType")),
- sIsNumbering(RTL_CONSTASCII_USTRINGPARAM("IsNumbering")),
- sNumberingIsNumber(RTL_CONSTASCII_USTRINGPARAM("NumberingIsNumber"))
-{
- Reset();
-}
-
-void XMLTextNumRuleInfo::Set(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::text::XTextContent > & xTextContent )
-{
- Reset();
-
- Reference< XPropertySet > xPropSet( xTextContent, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
-
- Any aAny;
-
- // check if this paragraph supports a numbering
- if( !xPropSetInfo->hasPropertyByName( sNumberingLevel ) )
- return;
-
- if( xPropSetInfo->hasPropertyByName( sNumberingRules ) )
- {
- aAny = xPropSet->getPropertyValue( sNumberingRules );
- aAny >>= xNumRules;
- }
-
- if( xNumRules.is() )
- {
- Reference < XNamed > xNamed( xNumRules, UNO_QUERY );
- if( xNamed.is() )
- {
- bIsNamed = sal_True;
- sName = xNamed->getName();
- }
-
- aAny = xPropSet->getPropertyValue( sNumberingLevel );
- aAny >>= nLevel;
-
- bIsNumbered = sal_True;
- if( xPropSetInfo->hasPropertyByName( sNumberingIsNumber ) )
- {
- aAny = xPropSet->getPropertyValue( sNumberingIsNumber );
- bIsNumbered = *(sal_Bool *)aAny.getValue();
- }
-
- if( bIsNumbered )
- {
- if( xPropSetInfo->hasPropertyByName( sParaIsNumberingRestart ) )
- {
- aAny = xPropSet->getPropertyValue( sParaIsNumberingRestart );
- bIsRestart = *(sal_Bool *)aAny.getValue();
- }
- if( xPropSetInfo->hasPropertyByName( sNumberingStartValue ) )
- {
- aAny = xPropSet->getPropertyValue( sNumberingStartValue );
- aAny >>= nStartValue;
- }
- }
-
- OSL_ENSURE( nLevel < xNumRules->getCount(), "wrong num rule level" );
- if( nLevel >= xNumRules->getCount() )
- {
- Reset();
- return;
- }
-
- aAny = xNumRules->getByIndex( nLevel );
- Sequence<PropertyValue> aProps;
- aAny >>= aProps;
- const PropertyValue* pPropArray = aProps.getConstArray();
- sal_Int32 nCount = aProps.getLength();
- for( sal_Int32 i=0; i<nCount; i++ )
- {
- const beans::PropertyValue& rProp = pPropArray[i];
-
- if( rProp.Name == sNumberingType )
- {
- sal_Int16 nType;
- rProp.Value >>= nType;
- if( NumberingType::CHAR_SPECIAL != nType &&
- NumberingType::BITMAP != nType )
- {
- bIsOrdered = sal_True;
- }
- break;
- }
- }
- nLevel++;
- }
-}
-
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextPropertySetContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextPropertySetContext.cxx
deleted file mode 100644
index 12533940ace6..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextPropertySetContext.cxx
+++ /dev/null
@@ -1,159 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include "XMLTextPropertySetContext.hxx"
-#include "XMLTextColumnsContext.hxx"
-#include "XMLBackgroundImageContext.hxx"
-#include "XMLSectionFootnoteConfigImport.hxx"
-
-#include "txtprmap.hxx"
-#include "xmltabi.hxx"
-#include "txtdropi.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star;
-
-XMLTextPropertySetContext::XMLTextPropertySetContext(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- ::std::vector< XMLPropertyState > &rProps,
- const UniReference < SvXMLImportPropertyMapper > &rMap,
- OUString& rDCTextStyleName ) :
- SvXMLPropertySetContext( rImport, nPrfx, rLName, xAttrList, rProps, rMap ),
- rDropCapTextStyleName( rDCTextStyleName )
-{
-}
-
-XMLTextPropertySetContext::~XMLTextPropertySetContext()
-{
-}
-
-SvXMLImportContext *XMLTextPropertySetContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- ::std::vector< XMLPropertyState > &rProperties,
- const XMLPropertyState& rProp )
-{
- SvXMLImportContext *pContext = 0;
-
- switch( xMapper->getPropertySetMapper()
- ->GetEntryContextId( rProp.mnIndex ) )
- {
- case CTF_TABSTOP:
- pContext = new SvxXMLTabStopImportContext( GetImport(), nPrefix,
- rLocalName, rProp,
- rProperties );
- break;
- case CTF_TEXTCOLUMNS:
-#ifndef SVX_LIGHT
- pContext = new XMLTextColumnsContext( GetImport(), nPrefix,
- rLocalName, xAttrList, rProp,
- rProperties );
-#else
- // create default context to skip content
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-#endif // #ifndef SVX_LIGHT
- break;
-
- case CTF_DROPCAPFORMAT:
- {
- DBG_ASSERT( rProp.mnIndex >= 2 &&
- CTF_DROPCAPWHOLEWORD == xMapper->getPropertySetMapper()
- ->GetEntryContextId( rProp.mnIndex-2 ),
- "invalid property map!");
- XMLTextDropCapImportContext *pDCContext =
- new XMLTextDropCapImportContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- rProp,
- rProp.mnIndex-2,
- rProperties );
- rDropCapTextStyleName = pDCContext->GetStyleName();
- pContext = pDCContext;
- }
- break;
-
- case CTF_BACKGROUND_URL:
- {
- DBG_ASSERT( rProp.mnIndex >= 2 &&
- CTF_BACKGROUND_POS == xMapper->getPropertySetMapper()
- ->GetEntryContextId( rProp.mnIndex-2 ) &&
- CTF_BACKGROUND_FILTER == xMapper->getPropertySetMapper()
- ->GetEntryContextId( rProp.mnIndex-1 ),
- "invalid property map!");
-
- // #99657# Transparency might be there as well... but doesn't have
- // to. Thus, this is checked with an if, rather than with an assertion.
- sal_Int32 nTranspIndex = -1;
- if( (rProp.mnIndex >= 3) &&
- ( CTF_BACKGROUND_TRANSPARENCY ==
- xMapper->getPropertySetMapper()->GetEntryContextId(
- rProp.mnIndex-3 ) ) )
- nTranspIndex = rProp.mnIndex-3;
-
- pContext =
- new XMLBackgroundImageContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- rProp,
- rProp.mnIndex-2,
- rProp.mnIndex-1,
- nTranspIndex,
- rProperties );
- }
- break;
-#ifndef SVX_LIGHT
- case CTF_SECTION_FOOTNOTE_END:
- pContext = new XMLSectionFootnoteConfigImport(
- GetImport(), nPrefix, rLocalName, rProperties,
- xMapper->getPropertySetMapper(), rProp.mnIndex);
- break;
- case CTF_SECTION_ENDNOTE_END:
- pContext = new XMLSectionFootnoteConfigImport(
- GetImport(), nPrefix, rLocalName, rProperties,
- xMapper->getPropertySetMapper(), rProp.mnIndex);
- break;
-#endif // #ifndef SVX_LIGHT
- }
-
- if( !pContext )
- pContext = SvXMLPropertySetContext::CreateChildContext( nPrefix, rLocalName,
- xAttrList,
- rProperties, rProp );
-
- return pContext;
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextShapeImportHelper.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextShapeImportHelper.cxx
deleted file mode 100644
index 7cb0e2d332c9..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextShapeImportHelper.cxx
+++ /dev/null
@@ -1,162 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/text/XTextContent.hpp>
-
-#include "xmlimp.hxx"
-#include "xmluconv.hxx"
-#include "nmspmap.hxx"
-#include "XMLAnchorTypePropHdl.hxx"
-#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
-
-#include "XMLTextShapeImportHelper.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::drawing;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::xml::sax;
-
-using rtl::OUString;
-
-XMLTextShapeImportHelper::XMLTextShapeImportHelper(
- SvXMLImport& rImp ) :
- XMLShapeImportHelper( rImp, rImp.GetModel(),
- XMLTextImportHelper::CreateShapeExtPropMapper(rImp) ),
- rImport( rImp ),
- sAnchorType(RTL_CONSTASCII_USTRINGPARAM("AnchorType")),
- sAnchorPageNo(RTL_CONSTASCII_USTRINGPARAM("AnchorPageNo")),
- sVertOrientPosition(RTL_CONSTASCII_USTRINGPARAM("VertOrientPosition"))
-{
- Reference < XDrawPageSupplier > xDPS( rImp.GetModel(), UNO_QUERY );
- if( xDPS.is() )
- {
- Reference < XShapes > xShapes( xDPS->getDrawPage(), UNO_QUERY );
- pushGroupForSorting( xShapes );
- }
-
-}
-
-XMLTextShapeImportHelper::~XMLTextShapeImportHelper()
-{
- popGroupAndSort();
-}
-
-void XMLTextShapeImportHelper::addShape(
- Reference< XShape >& rShape,
- const Reference< XAttributeList >& xAttrList,
- Reference< XShapes >& rShapes )
-{
- if( rShapes.is() )
- {
- // It's a group shape or 3DScene , so we have to call the base class method.
- XMLShapeImportHelper::addShape( rShape, xAttrList, rShapes );
- return;
- }
-
- TextContentAnchorType eAnchorType = TextContentAnchorType_AT_PARAGRAPH;
- sal_Int16 nPage = 0;
- sal_Int32 nY = 0;
-
- UniReference < XMLTextImportHelper > xTxtImport =
- rImport.GetTextImport();
- const SvXMLTokenMap& rTokenMap =
- xTxtImport->GetTextFrameAttrTokenMap();
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- OUString aLocalName;
- sal_uInt16 nPrefix =
- rImport.GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- switch( rTokenMap.Get( nPrefix, aLocalName ) )
- {
- case XML_TOK_TEXT_FRAME_ANCHOR_TYPE:
- {
- TextContentAnchorType eNew;
- if( XMLAnchorTypePropHdl::convert( rValue,
- rImport.GetMM100UnitConverter(), eNew ) &&
- ( TextContentAnchorType_AT_PAGE == eNew ||
- TextContentAnchorType_AT_PARAGRAPH == eNew ||
- TextContentAnchorType_AS_CHARACTER == eNew ||
- TextContentAnchorType_AT_FRAME == eNew) )
- eAnchorType = eNew;
- }
- break;
- case XML_TOK_TEXT_FRAME_ANCHOR_PAGE_NUMBER:
- {
- sal_Int32 nTmp;
- if( rImport.GetMM100UnitConverter().
- convertNumber( nTmp, rValue, 1, SHRT_MAX ) )
- nPage = (sal_Int16)nTmp;
- }
- break;
- case XML_TOK_TEXT_FRAME_Y:
- rImport.GetMM100UnitConverter().convertMeasure( nY, rValue );
- break;
- }
- }
-
- Reference < XPropertySet > xPropSet( rShape, UNO_QUERY );
- Any aAny;
-
- // anchor type
- aAny <<= eAnchorType;
- xPropSet->setPropertyValue( sAnchorType, aAny );
-
- Reference < XTextContent > xTxtCntnt( rShape, UNO_QUERY );
- xTxtImport->InsertTextContent( xTxtCntnt );
-
- // page number (must be set after the frame is inserted, because it
- // will be overwritten then inserting the frame.
- switch( eAnchorType )
- {
- case TextContentAnchorType_AT_PAGE:
- // only set positive page numbers
- if ( nPage > 0 )
- {
- aAny <<= nPage;
- xPropSet->setPropertyValue( sAnchorPageNo, aAny );
- }
- break;
- case TextContentAnchorType_AS_CHARACTER:
- aAny <<= nY;
- xPropSet->setPropertyValue( sVertOrientPosition, aAny );
- break;
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextShapeStyleContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextShapeStyleContext.cxx
deleted file mode 100644
index c8a779e99671..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextShapeStyleContext.cxx
+++ /dev/null
@@ -1,235 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-#include <com/sun/star/document/XEventsSupplier.hpp>
-#include "xmlnmspe.hxx"
-#include "XMLEventsImportContext.hxx"
-#include "XMLShapePropertySetContext.hxx"
-#include "XMLTextColumnsContext.hxx"
-#include "XMLBackgroundImageContext.hxx"
-#include "txtprmap.hxx"
-
-#include "XMLTextShapeStyleContext.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star::document;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::beans;
-using namespace ::binfilter::xmloff::token;
-
-class XMLTextShapePropertySetContext_Impl : public XMLShapePropertySetContext
-{
-public:
- XMLTextShapePropertySetContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< XAttributeList >& xAttrList,
- ::std::vector< XMLPropertyState > &rProps,
- const UniReference < SvXMLImportPropertyMapper > &rMap );
-
- virtual ~XMLTextShapePropertySetContext_Impl();
-
- virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
- const OUString& rLocalName,
- const Reference< XAttributeList >& xAttrList,
- ::std::vector< XMLPropertyState > &rProperties,
- const XMLPropertyState& rProp);
-};
-
-XMLTextShapePropertySetContext_Impl::XMLTextShapePropertySetContext_Impl(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< XAttributeList > & xAttrList,
- ::std::vector< XMLPropertyState > &rProps,
- const UniReference < SvXMLImportPropertyMapper > &rMap ) :
- XMLShapePropertySetContext( rImport, nPrfx, rLName, xAttrList, rProps,
- rMap )
-{
-}
-
-XMLTextShapePropertySetContext_Impl::~XMLTextShapePropertySetContext_Impl()
-{
-}
-
-SvXMLImportContext *XMLTextShapePropertySetContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< XAttributeList > & xAttrList,
- ::std::vector< XMLPropertyState > &rProperties,
- const XMLPropertyState& rProp )
-{
- SvXMLImportContext *pContext = 0;
-
- switch( xMapper->getPropertySetMapper()
- ->GetEntryContextId( rProp.mnIndex ) )
- {
- case CTF_TEXTCOLUMNS:
- pContext = new XMLTextColumnsContext( GetImport(), nPrefix,
- rLocalName, xAttrList, rProp,
- rProperties );
- break;
-
- case CTF_BACKGROUND_URL:
- DBG_ASSERT( rProp.mnIndex >= 3 &&
- CTF_BACKGROUND_TRANSPARENCY ==
- xMapper->getPropertySetMapper()
- ->GetEntryContextId( rProp.mnIndex-3 ) &&
- CTF_BACKGROUND_POS == xMapper->getPropertySetMapper()
- ->GetEntryContextId( rProp.mnIndex-2 ) &&
- CTF_BACKGROUND_FILTER == xMapper->getPropertySetMapper()
- ->GetEntryContextId( rProp.mnIndex-1 ),
- "invalid property map!");
- pContext =
- new XMLBackgroundImageContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- rProp,
- rProp.mnIndex-2,
- rProp.mnIndex-1,
- rProp.mnIndex-3,
- rProperties );
- break;
- }
-
- if( !pContext )
- pContext = XMLShapePropertySetContext::CreateChildContext(
- nPrefix, rLocalName, xAttrList, rProperties, rProp );
-
- return pContext;
-}
-
-//-----------------------------------------------------------------------------
-
-void XMLTextShapeStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
- const OUString& rLocalName,
- const OUString& rValue )
-{
- if( XML_NAMESPACE_STYLE == nPrefixKey &&
- IsXMLToken( rLocalName, XML_AUTO_UPDATE ) )
- {
- if( IsXMLToken( rValue, XML_TRUE ) )
- bAutoUpdate = sal_True;
- }
- else
- {
- XMLShapeStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue );
- }
-}
-
-TYPEINIT1( XMLTextShapeStyleContext, XMLShapeStyleContext );
-
-XMLTextShapeStyleContext::XMLTextShapeStyleContext( SvXMLImport& rImport,
- sal_uInt16 nPrfx, const OUString& rLName,
- const Reference< XAttributeList > & xAttrList,
- SvXMLStylesContext& rStyles, sal_uInt16 nFamily,
- sal_Bool bDefaultStyle ) :
- XMLShapeStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles,
- nFamily ),
- bAutoUpdate( sal_False ),
- sIsAutoUpdate( RTL_CONSTASCII_USTRINGPARAM( "IsAutoUpdate" ) )
-{
-}
-
-XMLTextShapeStyleContext::~XMLTextShapeStyleContext()
-{
-}
-
-SvXMLImportContext *XMLTextShapeStyleContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
-
- if( XML_NAMESPACE_STYLE == nPrefix &&
- IsXMLToken( rLocalName, XML_PROPERTIES ) )
- {
- UniReference < SvXMLImportPropertyMapper > xImpPrMap =
- GetStyles()->GetImportPropertyMapper( GetFamily() );
- if( xImpPrMap.is() )
- {
- pContext = new XMLTextShapePropertySetContext_Impl(
- GetImport(), nPrefix, rLocalName, xAttrList,
- GetProperties(), xImpPrMap );
- }
- }
- else if ( (XML_NAMESPACE_OFFICE == nPrefix) &&
- IsXMLToken( rLocalName, XML_EVENTS ) )
- {
- // create and remember events import context
- // (for delayed processing of events)
- pContext = new XMLEventsImportContext( GetImport(), nPrefix,
- rLocalName);
- xEventContext = pContext;
- }
-
- if( !pContext )
- pContext = XMLShapeStyleContext::CreateChildContext( nPrefix, rLocalName,
- xAttrList );
-
- return pContext;
-}
-
-void XMLTextShapeStyleContext::CreateAndInsert( sal_Bool bOverwrite )
-{
- XMLShapeStyleContext::CreateAndInsert( bOverwrite );
- Reference < XStyle > xStyle = GetStyle();
- if( !xStyle.is() || !(bOverwrite || IsNew()) )
- return;
-
- Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
- if( xPropSetInfo->hasPropertyByName( sIsAutoUpdate ) )
- {
- Any aAny;
- sal_Bool bTmp = bAutoUpdate;
- aAny.setValue( &bTmp, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( sIsAutoUpdate, aAny );
- }
-
- // tell the style about it's events (if applicable)
- if( xEventContext.Is() )
- {
- // set event suppplier and release reference to context
- Reference<XEventsSupplier> xEventsSupplier(xStyle, UNO_QUERY);
- ((XMLEventsImportContext *)&xEventContext)->SetEvents(xEventsSupplier);
- xEventContext = 0;
- }
-}
-
-
-void XMLTextShapeStyleContext::Finish( sal_Bool bOverwrite )
-{
- XMLPropStyleContext::Finish( bOverwrite );
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextTableContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextTableContext.cxx
deleted file mode 100644
index 400bfa478342..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextTableContext.cxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLTextTableContext.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::text;
-
-
-TYPEINIT1( XMLTextTableContext, SvXMLImportContext );
-
-XMLTextTableContext::XMLTextTableContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx, const OUString& rLName ) :
- SvXMLImportContext( rImport, nPrfx, rLName )
-{
-}
-
-XMLTextTableContext::~XMLTextTableContext()
-{
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTrackedChangesImportContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTrackedChangesImportContext.cxx
deleted file mode 100644
index 6dbb679eddac..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_XMLTrackedChangesImportContext.cxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "XMLTrackedChangesImportContext.hxx"
-
-#include "XMLChangedRegionImportContext.hxx"
-
-#include <com/sun/star/uno/Reference.h>
-
-#include <com/sun/star/uno/Sequence.h>
-
-#include "xmlimp.hxx"
-
-#include "xmlnmspe.hxx"
-
-#include "nmspmap.hxx"
-
-#include "xmluconv.hxx"
-
-namespace binfilter {
-
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::xml::sax::XAttributeList;
-using namespace ::binfilter::xmloff::token;
-
-
-
-TYPEINIT1( XMLTrackedChangesImportContext, SvXMLImportContext );
-
-XMLTrackedChangesImportContext::XMLTrackedChangesImportContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName) :
- SvXMLImportContext(rImport, nPrefix, rLocalName)
-{
-}
-
-XMLTrackedChangesImportContext::~XMLTrackedChangesImportContext()
-{
-}
-
-void XMLTrackedChangesImportContext::StartElement(
- const Reference<XAttributeList> & xAttrList )
-{
- sal_Bool bTrackChanges = sal_True;
- Sequence<sal_Int8> aProtectionKey;
-
- // scan for text:track-changes and text:protection-key attributes
- sal_Int16 nLength = xAttrList->getLength();
- for( sal_Int16 i = 0; i < nLength; i++ )
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(i), &sLocalName );
-
- if ( XML_NAMESPACE_TEXT == nPrefix )
- {
- if ( IsXMLToken( sLocalName, XML_TRACK_CHANGES ) )
- {
- sal_Bool bTmp;
- if( SvXMLUnitConverter::convertBool(
- bTmp, xAttrList->getValueByIndex(i)) )
- {
- bTrackChanges = bTmp;
- }
- }
- else if ( IsXMLToken( sLocalName, XML_PROTECTION_KEY ) ) {
- Sequence<sal_Int8> aSequence;
- SvXMLUnitConverter::decodeBase64(
- aSequence, xAttrList->getValueByIndex(i));
- if ( aSequence.getLength() > 0 )
- {
- aProtectionKey = aSequence;
- }
- }
- }
- }
-
- // set tracked changes
- GetImport().GetTextImport()->SetRecordChanges( bTrackChanges );
- GetImport().GetTextImport()->SetChangesProtectionKey( aProtectionKey );
-}
-
-
-SvXMLImportContext* XMLTrackedChangesImportContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList)
-{
- SvXMLImportContext* pContext = NULL;
-
- if ( (XML_NAMESPACE_TEXT == nPrefix) &&
- IsXMLToken( rLocalName, XML_CHANGED_REGION ) )
- {
- pContext = new XMLChangedRegionImportContext(GetImport(),
- nPrefix, rLocalName);
- }
-
- if (NULL == pContext)
- {
- pContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName,
- xAttrList);
- }
-
- return pContext;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_txtdrope.cxx b/binfilter/bf_xmloff/source/text/xmloff_txtdrope.cxx
deleted file mode 100644
index 6e2cbb7df7b6..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_txtdrope.cxx
+++ /dev/null
@@ -1,111 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-
-#include <com/sun/star/style/DropCapFormat.hpp>
-
-
-#include "xmlexp.hxx"
-
-#include "xmluconv.hxx"
-
-#include "xmlnmspe.hxx"
-
-#include "txtdrope.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::uno;
-using namespace ::rtl;
-using namespace ::binfilter::xmloff::token;
-
-
-XMLTextDropCapExport::XMLTextDropCapExport( SvXMLExport& rExp ) :
- rExport(rExp)
-{
-}
-
-XMLTextDropCapExport::~XMLTextDropCapExport()
-{
-}
-
-void XMLTextDropCapExport::exportXML( const Any& rAny,
- sal_Bool bWholeWord,
- const OUString& rStyleName )
-{
- DropCapFormat aFormat;
- rAny >>= aFormat;
- OUString sValue;
- OUStringBuffer sBuffer;
- if( aFormat.Lines > 1 )
- {
- SvXMLUnitConverter& rUnitConv = rExport.GetMM100UnitConverter();
-
- // style:lines
- rUnitConv.convertNumber( sBuffer, (sal_Int32)aFormat.Lines );
- rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_LINES,
- sBuffer.makeStringAndClear() );
-
- // style:length
- if( bWholeWord )
- {
- sValue = GetXMLToken(XML_WORD);
- }
- else if( aFormat.Count > 1 )
- {
- rUnitConv.convertNumber( sBuffer, (sal_Int32)aFormat.Count );
- sValue = sBuffer.makeStringAndClear();
- }
- if( sValue.getLength() )
- rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_LENGTH, sValue );
-
- // style:distance
- if( aFormat.Distance > 0 )
- {
- rUnitConv.convertMeasure( sBuffer, aFormat.Distance );
- rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_DISTANCE,
- sBuffer.makeStringAndClear() );
- }
-
- // style:style-name
- if( rStyleName.getLength() )
- rExport.AddAttribute( XML_NAMESPACE_STYLE, XML_STYLE_NAME,
- rStyleName );
- }
-
- SvXMLElementExport aElem( rExport, XML_NAMESPACE_STYLE, XML_DROP_CAP,
- sal_False, sal_False );
-}
-
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_txtdropi.cxx b/binfilter/bf_xmloff/source/text/xmloff_txtdropi.cxx
deleted file mode 100644
index 80b197901c75..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_txtdropi.cxx
+++ /dev/null
@@ -1,154 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/style/DropCapFormat.hpp>
-#include "txtdropi.hxx"
-#include "xmluconv.hxx"
-#include "nmspmap.hxx"
-#include "xmlnmspe.hxx"
-#include "xmlimp.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::style;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-
-enum SvXMLTokenMapDropAttrs
-{
- XML_TOK_DROP_LINES,
- XML_TOK_DROP_LENGTH,
- XML_TOK_DROP_DISTANCE,
- XML_TOK_DROP_STYLE,
- XML_TOK_DROP_END=XML_TOK_UNKNOWN
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aDropAttrTokenMap[] =
-{
- { XML_NAMESPACE_STYLE, XML_LINES, XML_TOK_DROP_LINES },
- { XML_NAMESPACE_STYLE, XML_LENGTH, XML_TOK_DROP_LENGTH },
- { XML_NAMESPACE_STYLE, XML_DISTANCE, XML_TOK_DROP_DISTANCE },
- { XML_NAMESPACE_STYLE, XML_STYLE_NAME, XML_TOK_DROP_STYLE },
- XML_TOKEN_MAP_END
-};
-
-TYPEINIT1( XMLTextDropCapImportContext, XMLElementPropertyContext );
-void XMLTextDropCapImportContext::ProcessAttrs(
- const Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLTokenMap aTokenMap( aDropAttrTokenMap );
-
- DropCapFormat aFormat;
- sal_Bool bWholeWord = sal_False;
-
- sal_Int32 nTmp;
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- switch( aTokenMap.Get( nPrefix, aLocalName ) )
- {
- case XML_TOK_DROP_LINES:
- if( GetImport().GetMM100UnitConverter().convertNumber( nTmp, rValue, 0, 255 ) )
- {
- aFormat.Lines = nTmp < 2 ? 0 : (sal_Int8)nTmp;
- }
- break;
-
- case XML_TOK_DROP_LENGTH:
- if( IsXMLToken( rValue, XML_WORD ) )
- {
- bWholeWord = sal_True;
- }
- else if( GetImport().GetMM100UnitConverter().convertNumber( nTmp, rValue, 1, 255 ) )
- {
- bWholeWord = sal_False;
- aFormat.Count = (sal_Int8)nTmp;
- }
- break;
-
- case XML_TOK_DROP_DISTANCE:
- if( GetImport().GetMM100UnitConverter().convertMeasure( nTmp, rValue, 0 ) )
- {
- aFormat.Distance = (sal_uInt16)nTmp;
- }
- break;
-
- case XML_TOK_DROP_STYLE:
- sStyleName = rValue;
- break;
- }
- }
-
- if( aFormat.Lines > 1 && aFormat.Count < 1 )
- aFormat.Count = 1;
-
- aProp.maValue <<= aFormat;
-
- aWholeWordProp.maValue.setValue( &bWholeWord, ::getBooleanCppuType() );
-}
-
-XMLTextDropCapImportContext::XMLTextDropCapImportContext(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- const XMLPropertyState& rProp,
- sal_Int32 nWholeWordIdx,
- ::std::vector< XMLPropertyState > &rProps ) :
- XMLElementPropertyContext( rImport, nPrfx, rLName, rProp, rProps ),
- aWholeWordProp( nWholeWordIdx )
-{
- ProcessAttrs( xAttrList );
-}
-
-XMLTextDropCapImportContext::~XMLTextDropCapImportContext()
-{
-}
-
-void XMLTextDropCapImportContext::EndElement()
-{
- SetInsert( sal_True );
- XMLElementPropertyContext::EndElement();
-
- if( -1 != aWholeWordProp.mnIndex )
- rProperties.push_back( aWholeWordProp );
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_txtexppr.cxx b/binfilter/bf_xmloff/source/text/xmloff_txtexppr.cxx
deleted file mode 100644
index 770032389fa1..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_txtexppr.cxx
+++ /dev/null
@@ -1,836 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include "txtprmap.hxx"
-
-#include <com/sun/star/table/BorderLine.hpp>
-#include <com/sun/star/text/SizeType.hpp>
-#include <com/sun/star/text/WrapTextMode.hpp>
-#include <com/sun/star/text/TextContentAnchorType.hpp>
-#include <com/sun/star/awt/FontFamily.hpp>
-#include <com/sun/star/awt/FontPitch.hpp>
-#include <com/sun/star/awt/FontUnderline.hpp>
-#include "txtexppr.hxx"
-#include "xmlexp.hxx"
-#include "XMLSectionFootnoteConfigExport.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::awt;
-
-using rtl::OUString;
-
-void XMLTextExportPropertySetMapper::handleElementItem(
- SvXMLExport& rExport,
- const XMLPropertyState& rProperty,
- sal_uInt16 nFlags,
- const ::std::vector< XMLPropertyState > *pProperties,
- sal_uInt32 nIdx ) const
-{
- XMLTextExportPropertySetMapper *pThis =
- ((XMLTextExportPropertySetMapper *)this);
-
- switch( getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ) )
- {
- case CTF_DROPCAPFORMAT:
- pThis->maDropCapExport.exportXML( rProperty.maValue, bDropWholeWord,
- sDropCharStyle );
- pThis->bDropWholeWord = sal_False;
- pThis->sDropCharStyle = OUString();
- break;
-
- case CTF_TABSTOP:
- pThis->maTabStopExport.Export( rProperty.maValue );
- break;
-
- case CTF_TEXTCOLUMNS:
- pThis->maTextColumnsExport.exportXML( rProperty.maValue );
- break;
-
- case CTF_BACKGROUND_URL:
- {
- DBG_ASSERT( pProperties && nIdx >= 3,
- "property vector missing" );
- const Any *pPos = 0, *pFilter = 0, *pTrans = 0;
- if( pProperties && nIdx >= 3 )
- {
- const XMLPropertyState& rTrans = (*pProperties)[nIdx-3];
- // #99657# transparency may be there, but doesn't have to be.
- // If it's there, it must be in the right position.
- if( CTF_BACKGROUND_TRANSPARENCY == getPropertySetMapper()
- ->GetEntryContextId( rTrans.mnIndex ) )
- pTrans = &rTrans.maValue;
-
- const XMLPropertyState& rPos = (*pProperties)[nIdx-2];
- DBG_ASSERT( CTF_BACKGROUND_POS == getPropertySetMapper()
- ->GetEntryContextId( rPos.mnIndex ),
- "invalid property map: pos expected" );
- if( CTF_BACKGROUND_POS == getPropertySetMapper()
- ->GetEntryContextId( rPos.mnIndex ) )
- pPos = &rPos.maValue;
-
- const XMLPropertyState& rFilter = (*pProperties)[nIdx-1];
- DBG_ASSERT( CTF_BACKGROUND_FILTER == getPropertySetMapper()
- ->GetEntryContextId( rFilter.mnIndex ),
- "invalid property map: filter expected" );
- if( CTF_BACKGROUND_FILTER == getPropertySetMapper()
- ->GetEntryContextId( rFilter.mnIndex ) )
- pFilter = &rFilter.maValue;
- }
- sal_uInt32 nPropIndex = rProperty.mnIndex;
- pThis->maBackgroundImageExport.exportXML(
- rProperty.maValue, pPos, pFilter, pTrans,
- getPropertySetMapper()->GetEntryNameSpace( nPropIndex ),
- getPropertySetMapper()->GetEntryXMLName( nPropIndex ) );
- }
- break;
-
- case CTF_SECTION_FOOTNOTE_END:
- XMLSectionFootnoteConfigExport::exportXML(rExport, sal_False,
- pProperties, nIdx,
- getPropertySetMapper());
- break;
-
- case CTF_SECTION_ENDNOTE_END:
- XMLSectionFootnoteConfigExport::exportXML(rExport, sal_True,
- pProperties, nIdx,
- getPropertySetMapper());
- break;
-
- default:
- SvXMLExportPropertyMapper::handleElementItem( rExport, rProperty, nFlags, pProperties, nIdx );
- break;
- }
-}
-
-void XMLTextExportPropertySetMapper::handleSpecialItem(
- SvXMLAttributeList& rAttrList,
- const XMLPropertyState& rProperty,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap,
- const ::std::vector< XMLPropertyState > *pProperties,
- sal_uInt32 nIdx ) const
-{
- XMLTextExportPropertySetMapper *pThis =
- ((XMLTextExportPropertySetMapper *)this);
-
- switch( getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ) )
- {
- case CTF_DROPCAPWHOLEWORD:
- DBG_ASSERT( !bDropWholeWord, "drop whole word is set already!" );
- pThis->bDropWholeWord = *(sal_Bool *)rProperty.maValue.getValue();
- break;
- case CTF_DROPCAPCHARSTYLE:
- DBG_ASSERT( !sDropCharStyle.getLength(),
- "drop char style is set already!" );
- rProperty.maValue >>= pThis->sDropCharStyle;
- break;
- case CTF_NUMBERINGSTYLENAME:
- case CTF_PAGEDESCNAME:
- case CTF_OLDTEXTBACKGROUND:
- case CTF_BACKGROUND_POS:
- case CTF_BACKGROUND_FILTER:
- case CTF_BACKGROUND_TRANSPARENCY:
- case CTF_SECTION_FOOTNOTE_NUM_OWN:
- case CTF_SECTION_FOOTNOTE_NUM_RESTART:
- case CTF_SECTION_FOOTNOTE_NUM_RESTART_AT:
- case CTF_SECTION_FOOTNOTE_NUM_TYPE:
- case CTF_SECTION_FOOTNOTE_NUM_PREFIX:
- case CTF_SECTION_FOOTNOTE_NUM_SUFFIX:
- case CTF_SECTION_ENDNOTE_NUM_OWN:
- case CTF_SECTION_ENDNOTE_NUM_RESTART:
- case CTF_SECTION_ENDNOTE_NUM_RESTART_AT:
- case CTF_SECTION_ENDNOTE_NUM_TYPE:
- case CTF_SECTION_ENDNOTE_NUM_PREFIX:
- case CTF_SECTION_ENDNOTE_NUM_SUFFIX:
- // There's nothing to do here!
- break;
- default:
- SvXMLExportPropertyMapper::handleSpecialItem(rAttrList, rProperty, rUnitConverter, rNamespaceMap, pProperties, nIdx );
- break;
- }
-}
-
-XMLTextExportPropertySetMapper::XMLTextExportPropertySetMapper(
- const UniReference< XMLPropertySetMapper >& rMapper,
- SvXMLExport& rExp ) :
- SvXMLExportPropertyMapper( rMapper ),
- rExport( rExp ),
- bDropWholeWord( sal_False ),
- maTabStopExport( rExp ),
- maDropCapExport( rExp ),
- maTextColumnsExport( rExp ),
- maBackgroundImageExport( rExp )
-{
-}
-
-XMLTextExportPropertySetMapper::~XMLTextExportPropertySetMapper()
-{
-}
-
-void XMLTextExportPropertySetMapper::ContextFontFilter(
- XMLPropertyState *pFontNameState,
- XMLPropertyState *pFontFamilyNameState,
- XMLPropertyState *pFontStyleNameState,
- XMLPropertyState *pFontFamilyState,
- XMLPropertyState *pFontPitchState,
- XMLPropertyState *pFontCharsetState ) const
-{
- OUString sFamilyName;
- OUString sStyleName;
- sal_Int16 nFamily = FontFamily::DONTKNOW;
- sal_Int16 nPitch = FontPitch::DONTKNOW;
- rtl_TextEncoding eEnc = RTL_TEXTENCODING_DONTKNOW;
-
- OUString sTmp;
- if( pFontFamilyNameState && (pFontFamilyNameState->maValue >>= sTmp ) )
- sFamilyName = sTmp;
- if( pFontStyleNameState && (pFontStyleNameState->maValue >>= sTmp ) )
- sStyleName = sTmp;
-
- sal_Int16 nTmp;
- if( pFontFamilyState && (pFontFamilyState->maValue >>= nTmp ) )
- nFamily = nTmp;
- if( pFontPitchState && (pFontPitchState->maValue >>= nTmp ) )
- nPitch = nTmp;
- if( pFontCharsetState && (pFontCharsetState->maValue >>= nTmp ) )
- eEnc = (rtl_TextEncoding)nTmp;
-
- OUString sName( ((SvXMLExport&)GetExport()).GetFontAutoStylePool()->Find(
- sFamilyName, sStyleName, nFamily, nPitch, eEnc ) );
- if( sName.getLength() )
- {
- pFontNameState->maValue <<= sName;
- if( pFontFamilyNameState )
- pFontFamilyNameState->mnIndex = -1;
- if( pFontStyleNameState )
- pFontStyleNameState->mnIndex = -1;
- if( pFontFamilyState )
- pFontFamilyState->mnIndex = -1;
- if( pFontPitchState )
- pFontPitchState->mnIndex = -1;
- if( pFontCharsetState )
- pFontCharsetState->mnIndex = -1;
- }
- else
- {
- pFontNameState->mnIndex = -1;
- }
-
- if( pFontFamilyNameState && (0 == sFamilyName.getLength()) )
- {
- pFontFamilyNameState->mnIndex = -1;
- }
-
- if( pFontStyleNameState && (0 == sStyleName.getLength()) )
- {
- pFontStyleNameState->mnIndex = -1;
- }
-}
-
-void XMLTextExportPropertySetMapper::ContextFontHeightFilter(
- XMLPropertyState* pCharHeightState,
- XMLPropertyState* pCharPropHeightState,
- XMLPropertyState* pCharDiffHeightState ) const
-{
- if( pCharPropHeightState )
- {
- sal_Int32 nTemp;
- pCharPropHeightState->maValue >>= nTemp;
- if( nTemp == 100 )
- {
- pCharPropHeightState->mnIndex = -1;
- pCharPropHeightState->maValue.clear();
- }
- else
- {
- pCharHeightState->mnIndex = -1;
- pCharHeightState->maValue.clear();
- }
- }
- if( pCharDiffHeightState )
- {
- float nTemp;
- pCharDiffHeightState->maValue >>= nTemp;
- if( nTemp == 0. )
- {
- pCharDiffHeightState->mnIndex = -1;
- pCharDiffHeightState->maValue.clear();
- }
- else
- {
- pCharHeightState->mnIndex = -1;
- pCharHeightState->maValue.clear();
- }
- }
-
-}
-
-void XMLTextExportPropertySetMapper::ContextFilter(
- ::std::vector< XMLPropertyState >& rProperties,
- Reference< XPropertySet > rPropSet ) const
-{
- // filter font
- XMLPropertyState *pFontNameState = 0;
- XMLPropertyState *pFontFamilyNameState = 0;
- XMLPropertyState *pFontStyleNameState = 0;
- XMLPropertyState *pFontFamilyState = 0;
- XMLPropertyState *pFontPitchState = 0;
- XMLPropertyState *pFontCharsetState = 0;
- XMLPropertyState *pFontNameCJKState = 0;
- XMLPropertyState *pFontFamilyNameCJKState = 0;
- XMLPropertyState *pFontStyleNameCJKState = 0;
- XMLPropertyState *pFontFamilyCJKState = 0;
- XMLPropertyState *pFontPitchCJKState = 0;
- XMLPropertyState *pFontCharsetCJKState = 0;
- XMLPropertyState *pFontNameCTLState = 0;
- XMLPropertyState *pFontFamilyNameCTLState = 0;
- XMLPropertyState *pFontStyleNameCTLState = 0;
- XMLPropertyState *pFontFamilyCTLState = 0;
- XMLPropertyState *pFontPitchCTLState = 0;
- XMLPropertyState *pFontCharsetCTLState = 0;
-
- // filter char height point/percent
- XMLPropertyState* pCharHeightState = NULL;
- XMLPropertyState* pCharPropHeightState = NULL;
- XMLPropertyState* pCharDiffHeightState = NULL;
- XMLPropertyState* pCharHeightCJKState = NULL;
- XMLPropertyState* pCharPropHeightCJKState = NULL;
- XMLPropertyState* pCharDiffHeightCJKState = NULL;
- XMLPropertyState* pCharHeightCTLState = NULL;
- XMLPropertyState* pCharPropHeightCTLState = NULL;
- XMLPropertyState* pCharDiffHeightCTLState = NULL;
-
- // filter left margin measure/percent
- XMLPropertyState* pParaLeftMarginState = NULL;
- XMLPropertyState* pParaLeftMarginRelState = NULL;
-
- // filter right margin measure/percent
- XMLPropertyState* pParaRightMarginState = NULL;
- XMLPropertyState* pParaRightMarginRelState = NULL;
-
- // filter first line indent measure/percent
- XMLPropertyState* pParaFirstLineState = NULL;
- XMLPropertyState* pParaFirstLineRelState = NULL;
-
- // filter ParaTopMargin/Relative
- XMLPropertyState* pParaTopMarginState = NULL;
- XMLPropertyState* pParaTopMarginRelState = NULL;
-
- // filter ParaTopMargin/Relative
- XMLPropertyState* pParaBottomMarginState = NULL;
- XMLPropertyState* pParaBottomMarginRelState = NULL;
-
- // filter (Left|Right|Top|Bottom|)BorderWidth
- XMLPropertyState* pAllBorderWidthState = NULL;
- XMLPropertyState* pLeftBorderWidthState = NULL;
- XMLPropertyState* pRightBorderWidthState = NULL;
- XMLPropertyState* pTopBorderWidthState = NULL;
- XMLPropertyState* pBottomBorderWidthState = NULL;
-
- // filter (Left|Right|Top|)BorderDistance
- XMLPropertyState* pAllBorderDistanceState = NULL;
- XMLPropertyState* pLeftBorderDistanceState = NULL;
- XMLPropertyState* pRightBorderDistanceState = NULL;
- XMLPropertyState* pTopBorderDistanceState = NULL;
- XMLPropertyState* pBottomBorderDistanceState = NULL;
-
- // filter (Left|Right|Top|Bottom|)Border
- XMLPropertyState* pAllBorderState = NULL;
- XMLPropertyState* pLeftBorderState = NULL;
- XMLPropertyState* pRightBorderState = NULL;
- XMLPropertyState* pTopBorderState = NULL;
- XMLPropertyState* pBottomBorderState = NULL;
-
- // filter height properties
- XMLPropertyState* pHeightMinAbsState = NULL;
- XMLPropertyState* pHeightMinRelState = NULL;
- XMLPropertyState* pHeightAbsState = NULL;
- XMLPropertyState* pHeightRelState = NULL;
- XMLPropertyState* pSizeTypeState = NULL;
-
- // wrap
- XMLPropertyState* pWrapState = NULL;
- XMLPropertyState* pWrapContourState = NULL;
- XMLPropertyState* pWrapContourModeState = NULL;
- XMLPropertyState* pWrapParagraphOnlyState = NULL;
-
- // anchor
- XMLPropertyState* pAnchorTypeState = NULL;
-
- // horizontal position and relation
- XMLPropertyState* pHoriOrientState = NULL;
- XMLPropertyState* pHoriOrientMirroredState = NULL;
- XMLPropertyState* pHoriOrientRelState = NULL;
- XMLPropertyState* pHoriOrientRelFrameState = NULL;
- XMLPropertyState* pHoriOrientMirrorState = NULL;
-
- // vertical position and relation
- XMLPropertyState* pVertOrientState = NULL;
- XMLPropertyState* pVertOrientAtCharState = NULL;
- XMLPropertyState* pVertOrientRelState = NULL;
- XMLPropertyState* pVertOrientRelPageState = NULL;
- XMLPropertyState* pVertOrientRelFrameState = NULL;
- XMLPropertyState* pVertOrientRelAsCharState = NULL;
-
- // filter underline color
- XMLPropertyState* pUnderlineState = NULL;
- XMLPropertyState* pUnderlineColorState = NULL;
- XMLPropertyState* pUnderlineHasColorState = NULL;
-
- sal_Bool bNeedsAnchor = sal_False;
-
- for( ::std::vector< XMLPropertyState >::iterator propertie = rProperties.begin();
- propertie != rProperties.end();
- propertie++ )
- {
- switch( getPropertySetMapper()->GetEntryContextId( propertie->mnIndex ) )
- {
- case CTF_CHARHEIGHT: pCharHeightState = &(*propertie); break;
- case CTF_CHARHEIGHT_REL: pCharPropHeightState = &(*propertie); break;
- case CTF_CHARHEIGHT_DIFF: pCharDiffHeightState = &(*propertie); break;
- case CTF_CHARHEIGHT_CJK: pCharHeightCJKState = &(*propertie); break;
- case CTF_CHARHEIGHT_REL_CJK: pCharPropHeightCJKState = &(*propertie); break;
- case CTF_CHARHEIGHT_DIFF_CJK: pCharDiffHeightCJKState = &(*propertie); break;
- case CTF_CHARHEIGHT_CTL: pCharHeightCTLState = &(*propertie); break;
- case CTF_CHARHEIGHT_REL_CTL: pCharPropHeightCTLState = &(*propertie); break;
- case CTF_CHARHEIGHT_DIFF_CTL: pCharDiffHeightCTLState = &(*propertie); break;
- case CTF_PARALEFTMARGIN: pParaLeftMarginState = &(*propertie); break;
- case CTF_PARALEFTMARGIN_REL: pParaLeftMarginRelState = &(*propertie); break;
- case CTF_PARARIGHTMARGIN: pParaRightMarginState = &(*propertie); break;
- case CTF_PARARIGHTMARGIN_REL: pParaRightMarginRelState = &(*propertie); break;
- case CTF_PARAFIRSTLINE: pParaFirstLineState = &(*propertie); break;
- case CTF_PARAFIRSTLINE_REL: pParaFirstLineRelState = &(*propertie); break;
- case CTF_PARATOPMARGIN: pParaTopMarginState = &(*propertie); break;
- case CTF_PARATOPMARGIN_REL: pParaTopMarginRelState = &(*propertie); break;
- case CTF_PARABOTTOMMARGIN: pParaBottomMarginState = &(*propertie); break;
- case CTF_PARABOTTOMMARGIN_REL: pParaBottomMarginRelState = &(*propertie); break;
- case CTF_ALLBORDERWIDTH: pAllBorderWidthState = &(*propertie); break;
- case CTF_LEFTBORDERWIDTH: pLeftBorderWidthState = &(*propertie); break;
- case CTF_RIGHTBORDERWIDTH: pRightBorderWidthState = &(*propertie); break;
- case CTF_TOPBORDERWIDTH: pTopBorderWidthState = &(*propertie); break;
- case CTF_BOTTOMBORDERWIDTH: pBottomBorderWidthState = &(*propertie); break;
- case CTF_ALLBORDERDISTANCE: pAllBorderDistanceState = &(*propertie); break;
- case CTF_LEFTBORDERDISTANCE: pLeftBorderDistanceState = &(*propertie); break;
- case CTF_RIGHTBORDERDISTANCE: pRightBorderDistanceState = &(*propertie); break;
- case CTF_TOPBORDERDISTANCE: pTopBorderDistanceState = &(*propertie); break;
- case CTF_BOTTOMBORDERDISTANCE: pBottomBorderDistanceState = &(*propertie); break;
- case CTF_ALLBORDER: pAllBorderState = &(*propertie); break;
- case CTF_LEFTBORDER: pLeftBorderState = &(*propertie); break;
- case CTF_RIGHTBORDER: pRightBorderState = &(*propertie); break;
- case CTF_TOPBORDER: pTopBorderState = &(*propertie); break;
- case CTF_BOTTOMBORDER: pBottomBorderState = &(*propertie); break;
-
- case CTF_FRAMEHEIGHT_MIN_ABS: pHeightMinAbsState = &(*propertie); break;
- case CTF_FRAMEHEIGHT_MIN_REL: pHeightMinRelState = &(*propertie); break;
- case CTF_FRAMEHEIGHT_ABS: pHeightAbsState = &(*propertie); break;
- case CTF_FRAMEHEIGHT_REL: pHeightRelState = &(*propertie); break;
- case CTF_SIZETYPE: pSizeTypeState = &(*propertie); break;
-
- case CTF_WRAP: pWrapState = &(*propertie); break;
- case CTF_WRAP_CONTOUR: pWrapContourState = &(*propertie); break;
- case CTF_WRAP_CONTOUR_MODE: pWrapContourModeState = &(*propertie); break;
- case CTF_WRAP_PARAGRAPH_ONLY: pWrapParagraphOnlyState = &(*propertie); break;
- case CTF_ANCHORTYPE: pAnchorTypeState = &(*propertie); break;
-
- case CTF_HORIZONTALPOS: pHoriOrientState = &(*propertie); bNeedsAnchor = sal_True; break;
- case CTF_HORIZONTALPOS_MIRRORED: pHoriOrientMirroredState = &(*propertie); bNeedsAnchor = sal_True; break;
- case CTF_HORIZONTALREL: pHoriOrientRelState = &(*propertie); bNeedsAnchor = sal_True; break;
- case CTF_HORIZONTALREL_FRAME: pHoriOrientRelFrameState = &(*propertie); bNeedsAnchor = sal_True; break;
- case CTF_HORIZONTALMIRROR: pHoriOrientMirrorState = &(*propertie); bNeedsAnchor = sal_True; break;
- case CTF_VERTICALPOS: pVertOrientState = &(*propertie); bNeedsAnchor = sal_True; break;
- case CTF_VERTICALPOS_ATCHAR: pVertOrientAtCharState = &(*propertie); bNeedsAnchor = sal_True; break;
- case CTF_VERTICALREL: pVertOrientRelState = &(*propertie); bNeedsAnchor = sal_True; break;
- case CTF_VERTICALREL_PAGE: pVertOrientRelPageState = &(*propertie); bNeedsAnchor = sal_True; break;
- case CTF_VERTICALREL_FRAME: pVertOrientRelFrameState = &(*propertie); bNeedsAnchor = sal_True; break;
- case CTF_VERTICALREL_ASCHAR: pVertOrientRelAsCharState = &(*propertie); bNeedsAnchor = sal_True; break;
-
- case CTF_FONTNAME: pFontNameState = &(*propertie); break;
- case CTF_FONTFAMILYNAME: pFontFamilyNameState = &(*propertie); break;
- case CTF_FONTSTYLENAME: pFontStyleNameState = &(*propertie); break;
- case CTF_FONTFAMILY: pFontFamilyState = &(*propertie); break;
- case CTF_FONTPITCH: pFontPitchState = &(*propertie); break;
- case CTF_FONTCHARSET: pFontCharsetState = &(*propertie); break;
-
- case CTF_FONTNAME_CJK: pFontNameCJKState = &(*propertie); break;
- case CTF_FONTFAMILYNAME_CJK: pFontFamilyNameCJKState = &(*propertie); break;
- case CTF_FONTSTYLENAME_CJK: pFontStyleNameCJKState = &(*propertie); break;
- case CTF_FONTFAMILY_CJK: pFontFamilyCJKState = &(*propertie); break;
- case CTF_FONTPITCH_CJK: pFontPitchCJKState = &(*propertie); break;
- case CTF_FONTCHARSET_CJK: pFontCharsetCJKState = &(*propertie); break;
-
- case CTF_FONTNAME_CTL: pFontNameCTLState = &(*propertie); break;
- case CTF_FONTFAMILYNAME_CTL: pFontFamilyNameCTLState = &(*propertie); break;
- case CTF_FONTSTYLENAME_CTL: pFontStyleNameCTLState = &(*propertie); break;
- case CTF_FONTFAMILY_CTL: pFontFamilyCTLState = &(*propertie); break;
- case CTF_FONTPITCH_CTL: pFontPitchCTLState = &(*propertie); break;
- case CTF_FONTCHARSET_CTL: pFontCharsetCTLState = &(*propertie); break;
- case CTF_UNDERLINE: pUnderlineState = &(*propertie); break;
- case CTF_UNDERLINE_COLOR: pUnderlineColorState = &(*propertie); break;
- case CTF_UNDERLINE_HASCOLOR: pUnderlineHasColorState = &(*propertie); break;
- }
- }
-
- if( pFontNameState )
- ContextFontFilter( pFontNameState, pFontFamilyNameState,
- pFontStyleNameState, pFontFamilyState,
- pFontPitchState, pFontCharsetState );
- if( pFontNameCJKState )
- ContextFontFilter( pFontNameCJKState, pFontFamilyNameCJKState,
- pFontStyleNameCJKState, pFontFamilyCJKState,
- pFontPitchCJKState, pFontCharsetCJKState );
- if( pFontNameCTLState )
- ContextFontFilter( pFontNameCTLState, pFontFamilyNameCTLState,
- pFontStyleNameCTLState, pFontFamilyCTLState,
- pFontPitchCTLState, pFontCharsetCTLState );
-
- if( pCharHeightState && (pCharPropHeightState || pCharDiffHeightState ) )
- ContextFontHeightFilter( pCharHeightState, pCharPropHeightState,
- pCharDiffHeightState );
- if( pCharHeightCJKState &&
- (pCharPropHeightCJKState || pCharDiffHeightCJKState ) )
- ContextFontHeightFilter( pCharHeightCJKState, pCharPropHeightCJKState,
- pCharDiffHeightCJKState );
- if( pCharHeightCTLState &&
- (pCharPropHeightCTLState || pCharDiffHeightCTLState ) )
- ContextFontHeightFilter( pCharHeightCTLState, pCharPropHeightCTLState,
- pCharDiffHeightCTLState );
- if( pUnderlineColorState || pUnderlineHasColorState )
- {
- sal_Bool bClear = !pUnderlineState;
- if( !bClear )
- {
- sal_Int16 nUnderline;
- pUnderlineState->maValue >>= nUnderline;
- bClear = FontUnderline::NONE == nUnderline;
- }
- if( bClear )
- {
- if( pUnderlineColorState )
- pUnderlineColorState->mnIndex = -1;
- if( pUnderlineHasColorState )
- pUnderlineHasColorState->mnIndex = -1;
- }
- }
-
- if( pParaLeftMarginState && pParaLeftMarginRelState )
- {
- sal_Int32 nTemp;
- pParaLeftMarginRelState->maValue >>= nTemp;
- if( nTemp == 100 )
- {
- pParaLeftMarginRelState->mnIndex = -1;
- pParaLeftMarginRelState->maValue.clear();
- }
- else
- {
- pParaLeftMarginState->mnIndex = -1;
- pParaLeftMarginState->maValue.clear();
- }
-
- }
-
- if( pParaRightMarginState && pParaRightMarginRelState )
- {
- sal_Int32 nTemp;
- pParaRightMarginRelState->maValue >>= nTemp;
- if( nTemp == 100 )
- {
- pParaRightMarginRelState->mnIndex = -1;
- pParaRightMarginRelState->maValue.clear();
- }
- else
- {
- pParaRightMarginState->mnIndex = -1;
- pParaRightMarginState->maValue.clear();
- }
- }
-
- if( pParaFirstLineState && pParaFirstLineRelState )
- {
- sal_Int32 nTemp;
- pParaFirstLineRelState->maValue >>= nTemp;
- if( nTemp == 100 )
- {
- pParaFirstLineRelState->mnIndex = -1;
- pParaFirstLineRelState->maValue.clear();
- }
- else
- {
- pParaFirstLineState->mnIndex = -1;
- pParaFirstLineState->maValue.clear();
- }
- }
-
- if( pParaTopMarginState && pParaTopMarginRelState )
- {
- sal_Int32 nTemp;
- pParaTopMarginRelState->maValue >>= nTemp;
- if( nTemp == 100 )
- {
- pParaTopMarginRelState->mnIndex = -1;
- pParaTopMarginRelState->maValue.clear();
- }
- else
- {
- pParaTopMarginState->mnIndex = -1;
- pParaTopMarginState->maValue.clear();
- }
-
- }
-
- if( pParaBottomMarginState && pParaBottomMarginRelState )
- {
- sal_Int32 nTemp;
- pParaBottomMarginRelState->maValue >>= nTemp;
- if( nTemp == 100 )
- {
- pParaBottomMarginRelState->mnIndex = -1;
- pParaBottomMarginRelState->maValue.clear();
- }
- else
- {
- pParaBottomMarginState->mnIndex = -1;
- pParaBottomMarginState->maValue.clear();
- }
-
- }
-
- if( pAllBorderWidthState )
- {
- if( pLeftBorderWidthState && pRightBorderWidthState && pTopBorderWidthState && pBottomBorderWidthState )
- {
- table::BorderLine aLeft, aRight, aTop, aBottom;
-
- pLeftBorderWidthState->maValue >>= aLeft;
- pRightBorderWidthState->maValue >>= aRight;
- pTopBorderWidthState->maValue >>= aTop;
- pBottomBorderWidthState->maValue >>= aBottom;
- if( aLeft.Color == aRight.Color && aLeft.InnerLineWidth == aRight.InnerLineWidth &&
- aLeft.OuterLineWidth == aRight.OuterLineWidth && aLeft.LineDistance == aRight.LineDistance &&
- aLeft.Color == aTop.Color && aLeft.InnerLineWidth == aTop.InnerLineWidth &&
- aLeft.OuterLineWidth == aTop.OuterLineWidth && aLeft.LineDistance == aTop.LineDistance &&
- aLeft.Color == aBottom.Color && aLeft.InnerLineWidth == aBottom.InnerLineWidth &&
- aLeft.OuterLineWidth == aBottom.OuterLineWidth && aLeft.LineDistance == aBottom.LineDistance )
- {
- pLeftBorderWidthState->mnIndex = -1;
- pLeftBorderWidthState->maValue.clear();
- pRightBorderWidthState->mnIndex = -1;
- pRightBorderWidthState->maValue.clear();
- pTopBorderWidthState->mnIndex = -1;
- pTopBorderWidthState->maValue.clear();
- pBottomBorderWidthState->mnIndex = -1;
- pBottomBorderWidthState->maValue.clear();
- }
- else
- {
- pAllBorderWidthState->mnIndex = -1;
- pAllBorderWidthState->maValue.clear();
- }
- }
- else
- {
- pAllBorderWidthState->mnIndex = -1;
- pAllBorderWidthState->maValue.clear();
- }
- }
-
- if( pAllBorderDistanceState )
- {
- if( pLeftBorderDistanceState && pRightBorderDistanceState && pTopBorderDistanceState && pBottomBorderDistanceState )
- {
- sal_Int32 aLeft, aRight, aTop, aBottom;
-
- pLeftBorderDistanceState->maValue >>= aLeft;
- pRightBorderDistanceState->maValue >>= aRight;
- pTopBorderDistanceState->maValue >>= aTop;
- pBottomBorderDistanceState->maValue >>= aBottom;
- if( aLeft == aRight && aLeft == aTop && aLeft == aBottom )
- {
- pLeftBorderDistanceState->mnIndex = -1;
- pLeftBorderDistanceState->maValue.clear();
- pRightBorderDistanceState->mnIndex = -1;
- pRightBorderDistanceState->maValue.clear();
- pTopBorderDistanceState->mnIndex = -1;
- pTopBorderDistanceState->maValue.clear();
- pBottomBorderDistanceState->mnIndex = -1;
- pBottomBorderDistanceState->maValue.clear();
- }
- else
- {
- pAllBorderDistanceState->mnIndex = -1;
- pAllBorderDistanceState->maValue.clear();
- }
- }
- else
- {
- pAllBorderDistanceState->mnIndex = -1;
- pAllBorderDistanceState->maValue.clear();
- }
- }
-
- if( pAllBorderState )
- {
- if( pLeftBorderState && pRightBorderState && pTopBorderState && pBottomBorderState )
- {
- table::BorderLine aLeft, aRight, aTop, aBottom;
-
- pLeftBorderState->maValue >>= aLeft;
- pRightBorderState->maValue >>= aRight;
- pTopBorderState->maValue >>= aTop;
- pBottomBorderState->maValue >>= aBottom;
- if( aLeft.Color == aRight.Color && aLeft.InnerLineWidth == aRight.InnerLineWidth &&
- aLeft.OuterLineWidth == aRight.OuterLineWidth && aLeft.LineDistance == aRight.LineDistance &&
- aLeft.Color == aTop.Color && aLeft.InnerLineWidth == aTop.InnerLineWidth &&
- aLeft.OuterLineWidth == aTop.OuterLineWidth && aLeft.LineDistance == aTop.LineDistance &&
- aLeft.Color == aBottom.Color && aLeft.InnerLineWidth == aBottom.InnerLineWidth &&
- aLeft.OuterLineWidth == aBottom.OuterLineWidth && aLeft.LineDistance == aBottom.LineDistance )
- {
- pLeftBorderState->mnIndex = -1;
- pLeftBorderState->maValue.clear();
- pRightBorderState->mnIndex = -1;
- pRightBorderState->maValue.clear();
- pTopBorderState->mnIndex = -1;
- pTopBorderState->maValue.clear();
- pBottomBorderState->mnIndex = -1;
- pBottomBorderState->maValue.clear();
- }
- else
- {
- pAllBorderState->mnIndex = -1;
- pAllBorderState->maValue.clear();
- }
- }
- else
- {
- pAllBorderState->mnIndex = -1;
- pAllBorderState->maValue.clear();
- }
- }
-
- sal_Int16 nSizeType = SizeType::FIX;
- if( pSizeTypeState )
- {
- pSizeTypeState->maValue >>= nSizeType;
- pSizeTypeState->mnIndex = -1;
- }
-
- if( pHeightMinAbsState )
- {
- sal_Int16 nRel;
- if( (SizeType::MIN != nSizeType) ||
- ( pHeightMinRelState &&
- ( !(pHeightMinRelState->maValue >>= nRel) || nRel > 0 ) ) )
- {
- pHeightMinAbsState->mnIndex = -1;
- }
- }
- if( pHeightMinRelState && SizeType::MIN != nSizeType)
- pHeightMinRelState->mnIndex = -1;
- if( pHeightAbsState && pHeightMinAbsState &&
- -1 != pHeightMinAbsState->mnIndex )
- pHeightAbsState->mnIndex = -1;
- if( pHeightRelState && SizeType::FIX != nSizeType)
- pHeightRelState->mnIndex = -1;
-
- if( pWrapState )
- {
- WrapTextMode eVal;
- pWrapState->maValue >>= eVal;
- switch( eVal )
- {
- // merge fix #i32592# into binfilter module
- case WrapTextMode_NONE:
- // no wrapping: disable para-only and contour
- if( pWrapParagraphOnlyState )
- pWrapParagraphOnlyState->mnIndex = -1;
- // no break
- case WrapTextMode_THROUGHT:
- // wrap through: disable only contour
- if( pWrapContourState )
- pWrapContourState->mnIndex = -1;
- break;
- // <--
- }
- if( pWrapContourModeState &&
- (!pWrapContourState ||
- !*(sal_Bool *)pWrapContourState ->maValue.getValue() ) )
- pWrapContourModeState->mnIndex = -1;
- }
-
- TextContentAnchorType eAnchor = TextContentAnchorType_AT_PARAGRAPH;
- if( pAnchorTypeState )
- pAnchorTypeState->maValue >>= eAnchor;
- else if( bNeedsAnchor )
- {
- Any aAny = rPropSet->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AnchorType") ) );
- aAny >>= eAnchor;
- }
-
- if( pHoriOrientState && pHoriOrientMirroredState )
- {
- if( pHoriOrientMirrorState &&
- *(sal_Bool *)pHoriOrientMirrorState->maValue.getValue() )
- pHoriOrientState->mnIndex = -1;
- else
- pHoriOrientMirroredState->mnIndex = -1;
- }
- if( pHoriOrientMirrorState )
- pHoriOrientMirrorState->mnIndex = -1;
-
- if( pHoriOrientRelState && TextContentAnchorType_AT_FRAME == eAnchor )
- pHoriOrientRelState->mnIndex = -1;
- if( pHoriOrientRelFrameState && TextContentAnchorType_AT_FRAME != eAnchor )
- pHoriOrientRelFrameState->mnIndex = -1;;
-
- if( pVertOrientState && TextContentAnchorType_AT_CHARACTER == eAnchor )
- pVertOrientState->mnIndex = -1;
- if( pVertOrientAtCharState && TextContentAnchorType_AT_CHARACTER != eAnchor )
- pVertOrientAtCharState->mnIndex = -1;
- if( pVertOrientRelState && TextContentAnchorType_AT_PARAGRAPH != eAnchor &&
- TextContentAnchorType_AT_CHARACTER != eAnchor )
- pVertOrientRelState->mnIndex = -1;
- if( pVertOrientRelPageState && TextContentAnchorType_AT_PAGE != eAnchor )
- pVertOrientRelPageState->mnIndex = -1;
- if( pVertOrientRelFrameState && TextContentAnchorType_AT_FRAME != eAnchor )
- pVertOrientRelFrameState->mnIndex = -1;
- if( pVertOrientRelAsCharState && TextContentAnchorType_AS_CHARACTER != eAnchor )
- pVertOrientRelAsCharState->mnIndex = -1;
-
- SvXMLExportPropertyMapper::ContextFilter(rProperties,rPropSet);
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_txtflde.cxx b/binfilter/bf_xmloff/source/text/xmloff_txtflde.cxx
deleted file mode 100644
index f1f28e2f6184..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_txtflde.cxx
+++ /dev/null
@@ -1,3394 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/** @#file
- *
- * export of all text fields
- */
-
-#include "txtflde.hxx"
-
-#include "xmlexp.hxx"
-
-
-
-
-#include "xmluconv.hxx"
-
-
-#include "numehelp.hxx"
-
-
-
-#include "XMLEventExport.hxx"
-
-#include "XMLTextCharStyleNamesElementExport.hxx"
-
-#include <com/sun/star/util/DateTime.hpp>
-
-
-
-#include <com/sun/star/text/UserDataPart.hpp>
-
-#include <com/sun/star/text/PageNumberType.hpp>
-
-#include <com/sun/star/style/NumberingType.hpp>
-
-#include <com/sun/star/text/ReferenceFieldPart.hpp>
-
-#include <com/sun/star/text/ReferenceFieldSource.hpp>
-
-
-#include <com/sun/star/beans/XPropertyState.hpp>
-
-
-#include <com/sun/star/text/XDependentTextField.hpp>
-
-#include <com/sun/star/text/XTextFieldsSupplier.hpp>
-
-#include <com/sun/star/text/SetVariableType.hpp>
-
-#include <com/sun/star/text/PlaceholderType.hpp>
-
-#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
-
-
-#include <com/sun/star/text/FilenameDisplayFormat.hpp>
-
-#include <com/sun/star/text/ChapterFormat.hpp>
-
-#include <com/sun/star/text/TemplateDisplayFormat.hpp>
-
-
-#include <com/sun/star/container/XNameReplace.hpp>
-
-#include <com/sun/star/uno/Sequence.h>
-
-
-#include <com/sun/star/text/BibliographyDataType.hpp>
-
-#include <com/sun/star/sdb/CommandType.hpp>
-
-
-#include <tools/debug.hxx>
-
-#include <rtl/math.hxx>
-
-#include <vector>
-namespace binfilter {
-
-using namespace ::std;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::document;
-using namespace ::com::sun::star::container;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-
-static sal_Char __READONLY_DATA FIELD_SERVICE_SENDER[] = "ExtendedUser";
-static sal_Char __READONLY_DATA FIELD_SERVICE_AUTHOR[] = "Author";
-static sal_Char __READONLY_DATA FIELD_SERVICE_JUMPEDIT[] = "JumpEdit";
-static sal_Char __READONLY_DATA FIELD_SERVICE_GETEXP[] = "GetExpression";
-static sal_Char __READONLY_DATA FIELD_SERVICE_SETEXP[] = "SetExpression";
-static sal_Char __READONLY_DATA FIELD_SERVICE_USER[] = "User";
-static sal_Char __READONLY_DATA FIELD_SERVICE_INPUT[] = "Input";
-static sal_Char __READONLY_DATA FIELD_SERVICE_USERINPUT[] = "InputUser";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DATETIME[] = "DateTime";
-static sal_Char __READONLY_DATA FIELD_SERVICE_PAGENUMBER[] = "PageNumber";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DB_NEXT[] = "DatabaseNextSet";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DB_SELECT[] = "DatabaseNumberOfSet";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DB_NUMBER[] = "DatabaseSetNumber";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DB_DISPLAY[] = "Database";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DB_NAME[] = "DatabaseName";
-static sal_Char __READONLY_DATA FIELD_SERVICE_CONDITIONAL_TEXT[] = "ConditionalText";
-static sal_Char __READONLY_DATA FIELD_SERVICE_HIDDEN_TEXT[] = "HiddenText";
-static sal_Char __READONLY_DATA FIELD_SERVICE_HIDDEN_PARAGRAPH[] = "HiddenParagraph";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_CHANGE_AUTHOR[] = "DocInfo.ChangeAuthor";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_CHANGE_DATE_TIME[] = "DocInfo.ChangeDateTime";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_EDIT_TIME[] = "DocInfo.EditTime";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_DESCRIPTION[] = "DocInfo.Description";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_CREATE_AUTHOR[] = "DocInfo.CreateAuthor";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_CREATE_DATE_TIME[] = "DocInfo.CreateDateTime";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_INFO0[] = "DocInfo.Info0";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_INFO1[] = "DocInfo.Info1";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_INFO2[] = "DocInfo.Info2";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_INFO3[] = "DocInfo.Info3";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_PRINT_AUTHOR[] = "DocInfo.PrintAuthor";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_PRINT_DATE_TIME[] = "DocInfo.PrintDateTime";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_KEY_WORDS[] = "DocInfo.KeyWords";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_SUBJECT[] = "DocInfo.Subject";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_TITLE[] = "DocInfo.Title";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DOC_INFO_REVISION[] = "DocInfo.Revision";
-static sal_Char __READONLY_DATA FIELD_SERVICE_FILE_NAME[] = "FileName";
-static sal_Char __READONLY_DATA FIELD_SERVICE_CHAPTER[] = "Chapter";
-static sal_Char __READONLY_DATA FIELD_SERVICE_TEMPLATE_NAME[] = "TemplateName";
-static sal_Char __READONLY_DATA FIELD_SERVICE_PAGE_COUNT[] = "PageCount";
-static sal_Char __READONLY_DATA FIELD_SERVICE_PARAGRAPH_COUNT[] = "ParagraphCount";
-static sal_Char __READONLY_DATA FIELD_SERVICE_WORD_COUNT[] = "WordCount";
-static sal_Char __READONLY_DATA FIELD_SERVICE_CHARACTER_COUNT[] = "CharacterCount";
-static sal_Char __READONLY_DATA FIELD_SERVICE_TABLE_COUNT[] = "TableCount";
-static sal_Char __READONLY_DATA FIELD_SERVICE_GRAPHIC_COUNT[] = "GraphicObjectCount";
-static sal_Char __READONLY_DATA FIELD_SERVICE_OBJECT_COUNT[] = "EmbeddedObjectCount";
-static sal_Char __READONLY_DATA FIELD_SERVICE_REFERENCE_PAGE_SET[] = "ReferencePageSet";
-static sal_Char __READONLY_DATA FIELD_SERVICE_REFERENCE_PAGE_GET[] = "ReferencePageGet";
-static sal_Char __READONLY_DATA FIELD_SERVICE_SHEET_NAME[] = "SheetName";
-static sal_Char __READONLY_DATA FIELD_SERVICE_MACRO[] = "Macro";
-static sal_Char __READONLY_DATA FIELD_SERVICE_GET_REFERENCE[] = "GetReference";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DDE[] = "DDE";
-static sal_Char __READONLY_DATA FIELD_SERVICE_URL[] = "URL";
-static sal_Char __READONLY_DATA FIELD_SERVICE_BIBLIOGRAPHY[] = "Bibliography";
-static sal_Char __READONLY_DATA FIELD_SERVICE_SCRIPT[] = "Script";
-static sal_Char __READONLY_DATA FIELD_SERVICE_ANNOTATION[] = "Annotation";
-static sal_Char __READONLY_DATA FIELD_SERVICE_COMBINED_CHARACTERS[] = "CombinedCharacters";
-static sal_Char __READONLY_DATA FIELD_SERVICE_MEASURE[] = "Measure";
-static sal_Char __READONLY_DATA FIELD_SERVICE_TABLE_FORMULA[] = "TableFormula";
-static sal_Char __READONLY_DATA FIELD_SERVICE_DROP_DOWN[] = "DropDown";
-
-
-SvXMLEnumStringMapEntry __READONLY_DATA aFieldServiceNameMapping[] =
-{
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_SENDER, FIELD_ID_SENDER ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_AUTHOR, FIELD_ID_AUTHOR ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_JUMPEDIT, FIELD_ID_PLACEHOLDER ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_GETEXP, FIELD_ID_VARIABLE_GET ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_SETEXP, FIELD_ID_VARIABLE_SET ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_USER, FIELD_ID_USER_GET ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_INPUT, FIELD_ID_TEXT_INPUT ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_USERINPUT, FIELD_ID_USER_INPUT ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DATETIME, FIELD_ID_TIME ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_PAGENUMBER, FIELD_ID_PAGENUMBER ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_REFERENCE_PAGE_SET, FIELD_ID_REFPAGE_SET ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_REFERENCE_PAGE_GET, FIELD_ID_REFPAGE_GET ),
-
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DB_NEXT, FIELD_ID_DATABASE_NEXT ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DB_SELECT, FIELD_ID_DATABASE_SELECT ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DB_NUMBER, FIELD_ID_DATABASE_NUMBER ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DB_DISPLAY, FIELD_ID_DATABASE_DISPLAY ),
- // workaround for #no-bug#: Database/DataBase
- ENUM_STRING_MAP_ENTRY( "DataBase", FIELD_ID_DATABASE_DISPLAY ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DB_NAME, FIELD_ID_DATABASE_NAME ),
-
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_CREATE_AUTHOR, FIELD_ID_DOCINFO_CREATION_AUTHOR ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_CREATE_DATE_TIME, FIELD_ID_DOCINFO_CREATION_TIME),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_CHANGE_AUTHOR, FIELD_ID_DOCINFO_SAVE_AUTHOR ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_CHANGE_DATE_TIME, FIELD_ID_DOCINFO_SAVE_TIME ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_EDIT_TIME, FIELD_ID_DOCINFO_EDIT_DURATION ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_DESCRIPTION, FIELD_ID_DOCINFO_DESCRIPTION ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_INFO0, FIELD_ID_DOCINFO_INFORMATION0 ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_INFO1, FIELD_ID_DOCINFO_INFORMATION1 ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_INFO2, FIELD_ID_DOCINFO_INFORMATION2 ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_INFO3, FIELD_ID_DOCINFO_INFORMATION3 ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_PRINT_AUTHOR, FIELD_ID_DOCINFO_PRINT_AUTHOR ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_PRINT_DATE_TIME, FIELD_ID_DOCINFO_PRINT_TIME ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_KEY_WORDS, FIELD_ID_DOCINFO_KEYWORDS ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_SUBJECT, FIELD_ID_DOCINFO_SUBJECT ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_TITLE, FIELD_ID_DOCINFO_TITLE ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DOC_INFO_REVISION, FIELD_ID_DOCINFO_REVISION ),
-
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_CONDITIONAL_TEXT, FIELD_ID_CONDITIONAL_TEXT ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_HIDDEN_TEXT, FIELD_ID_HIDDEN_TEXT ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_HIDDEN_PARAGRAPH, FIELD_ID_HIDDEN_PARAGRAPH ),
-
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_FILE_NAME, FIELD_ID_FILE_NAME ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_CHAPTER, FIELD_ID_CHAPTER ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_TEMPLATE_NAME, FIELD_ID_TEMPLATE_NAME ),
-
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_PAGE_COUNT, FIELD_ID_COUNT_PAGES ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_PARAGRAPH_COUNT, FIELD_ID_COUNT_PARAGRAPHS ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_WORD_COUNT, FIELD_ID_COUNT_WORDS ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_CHARACTER_COUNT, FIELD_ID_COUNT_CHARACTERS ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_TABLE_COUNT, FIELD_ID_COUNT_TABLES ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_GRAPHIC_COUNT, FIELD_ID_COUNT_GRAPHICS ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_OBJECT_COUNT, FIELD_ID_COUNT_OBJECTS ),
-
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_MACRO, FIELD_ID_MACRO ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_GET_REFERENCE, FIELD_ID_REF_REFERENCE ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DDE, FIELD_ID_DDE ),
-
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_BIBLIOGRAPHY, FIELD_ID_BIBLIOGRAPHY ),
-
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_SCRIPT, FIELD_ID_SCRIPT ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_ANNOTATION, FIELD_ID_ANNOTATION ),
-
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_COMBINED_CHARACTERS, FIELD_ID_COMBINED_CHARACTERS ),
-
- // non-writer fields
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_SHEET_NAME, FIELD_ID_SHEET_NAME ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_URL, FIELD_ID_URL ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_MEASURE, FIELD_ID_MEASURE ),
-
- // deprecated fields
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_TABLE_FORMULA, FIELD_ID_TABLE_FORMULA ),
- ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DROP_DOWN, FIELD_ID_DROP_DOWN ),
- ENUM_STRING_MAP_END()
-};
-
-
-
-// property accessor helper functions
-inline sal_Bool GetBoolProperty(const OUString&,
- const Reference<XPropertySet> &);
-inline sal_Bool GetOptionalBoolProperty(const OUString&,
- const Reference<XPropertySet> &,
- const Reference<XPropertySetInfo> &,
- sal_Bool bDefault);
-inline double GetDoubleProperty(const OUString&,
- const Reference<XPropertySet> &);
-inline OUString const GetStringProperty(const OUString&,
- const Reference<XPropertySet> &);
-inline sal_Int32 GetIntProperty(const OUString&,
- const Reference<XPropertySet> &);
-inline sal_Int16 GetInt16Property(const OUString&,
- const Reference<XPropertySet> &);
-inline sal_Int8 GetInt8Property(const OUString&,
- const Reference<XPropertySet> &);
-inline DateTime const GetDateTimeProperty( const OUString& sPropName,
- const Reference<XPropertySet> & xPropSet);
-inline Date const GetDateProperty( const OUString& sPropName,
- const Reference<XPropertySet> & xPropSet);
-inline Sequence<OUString> const GetStringSequenceProperty(
- const OUString& sPropName,
- const Reference<XPropertySet> & xPropSet);
-
-
-
-XMLTextFieldExport::XMLTextFieldExport( SvXMLExport& rExp,
- XMLPropertyState* pCombinedCharState)
- : rExport(rExp),
- pUsedMasters(NULL),
- sServicePrefix(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextField.")),
- sFieldMasterPrefix(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.FieldMaster.")),
- sPropertyContent(RTL_CONSTASCII_USTRINGPARAM("Content")),
- sPropertyIsFixed(RTL_CONSTASCII_USTRINGPARAM("IsFixed")),
- sPropertyFullName(RTL_CONSTASCII_USTRINGPARAM("FullName")),
- sPropertyFieldSubType(RTL_CONSTASCII_USTRINGPARAM("UserDataType")),
- sPropertyHint(RTL_CONSTASCII_USTRINGPARAM("Hint")),
- sPropertyPlaceholder(RTL_CONSTASCII_USTRINGPARAM("PlaceHolder")),
- sPropertyPlaceholderType(RTL_CONSTASCII_USTRINGPARAM("PlaceHolderType")),
- sPropertyIsVisible(RTL_CONSTASCII_USTRINGPARAM("IsVisible")),
- sPropertyIsShowFormula(RTL_CONSTASCII_USTRINGPARAM("IsShowFormula")),
- sPropertyIsInput(RTL_CONSTASCII_USTRINGPARAM("Input")),
- sPropertyIsExpression(RTL_CONSTASCII_USTRINGPARAM("IsExpression")),
- sPropertyNumberFormat(RTL_CONSTASCII_USTRINGPARAM("NumberFormat")),
- sPropertyVariableName(RTL_CONSTASCII_USTRINGPARAM("VariableName")),
- sPropertySubType(RTL_CONSTASCII_USTRINGPARAM("SubType")),
- sPropertyName(RTL_CONSTASCII_USTRINGPARAM("Name")),
- sPropertyVariableSubType(RTL_CONSTASCII_USTRINGPARAM("VariableSubtype")),
- sPropertyValue(RTL_CONSTASCII_USTRINGPARAM("Value")),
- sPropertyChapterNumberingLevel(
- RTL_CONSTASCII_USTRINGPARAM("ChapterNumberingLevel")),
- sPropertyNumberingSeparator(
- RTL_CONSTASCII_USTRINGPARAM("NumberingSeparator")),
- sPropertyNumberingType(
- RTL_CONSTASCII_USTRINGPARAM("NumberingType")),
- sPropertyDateTimeValue(RTL_CONSTASCII_USTRINGPARAM("DateTimeValue")),
- sPropertyUserText(RTL_CONSTASCII_USTRINGPARAM("UserText")),
- sPropertyOffset(RTL_CONSTASCII_USTRINGPARAM("Offset")),
- sPropertyDataBaseName(RTL_CONSTASCII_USTRINGPARAM("DataBaseName")),
- sPropertyDataTableName(RTL_CONSTASCII_USTRINGPARAM("DataTableName")),
- sPropertyCondition(RTL_CONSTASCII_USTRINGPARAM("Condition")),
- sPropertySetNumber(RTL_CONSTASCII_USTRINGPARAM("SetNumber")),
- sPropertyIsDataBaseFormat(RTL_CONSTASCII_USTRINGPARAM("DataBaseFormat")),
- sPropertyDataColumnName(RTL_CONSTASCII_USTRINGPARAM("DataColumnName")),
- sPropertyDateTime(RTL_CONSTASCII_USTRINGPARAM("DateTime")),
- sPropertyTrueContent(RTL_CONSTASCII_USTRINGPARAM("TrueContent")),
- sPropertyFalseContent(RTL_CONSTASCII_USTRINGPARAM("FalseContent")),
- sPropertyRevision(RTL_CONSTASCII_USTRINGPARAM("Revision")),
- sPropertyFileFormat(RTL_CONSTASCII_USTRINGPARAM("FileFormat")),
- sPropertyChapterFormat(RTL_CONSTASCII_USTRINGPARAM("ChapterFormat")),
- sPropertyLevel(RTL_CONSTASCII_USTRINGPARAM("Level")),
- sPropertyIsDate(RTL_CONSTASCII_USTRINGPARAM("IsDate")),
- sPropertyAdjust(RTL_CONSTASCII_USTRINGPARAM("Adjust")),
- sPropertyOn(RTL_CONSTASCII_USTRINGPARAM("On")),
- sPropertyMacro(RTL_CONSTASCII_USTRINGPARAM("Macro")),
- sPropertyReferenceFieldPart(
- RTL_CONSTASCII_USTRINGPARAM("ReferenceFieldPart")),
- sPropertyReferenceFieldType(
- RTL_CONSTASCII_USTRINGPARAM("ReferenceFieldType")),
- sPropertyReferenceFieldSource(
- RTL_CONSTASCII_USTRINGPARAM("ReferenceFieldSource")),
- sPropertySequenceNumber(RTL_CONSTASCII_USTRINGPARAM("SequenceNumber")),
- sPropertySequenceValue(RTL_CONSTASCII_USTRINGPARAM("SequenceValue")),
- sPropertySourceName(RTL_CONSTASCII_USTRINGPARAM("SourceName")),
- sPropertyDDECommandType(RTL_CONSTASCII_USTRINGPARAM("DDECommandType")),
- sPropertyDDECommandFile(RTL_CONSTASCII_USTRINGPARAM("DDECommandFile")),
- sPropertyDDECommandElement(
- RTL_CONSTASCII_USTRINGPARAM("DDECommandElement")),
- sPropertyIsAutomaticUpdate(
- RTL_CONSTASCII_USTRINGPARAM("IsAutomaticUpdate")),
- sPropertyDependentTextFields(
- RTL_CONSTASCII_USTRINGPARAM("DependentTextFields")),
- sPropertyURL(RTL_CONSTASCII_USTRINGPARAM("URL")),
- sPropertyTargetFrame(RTL_CONSTASCII_USTRINGPARAM("TargetFrame")),
- sPropertyFields(RTL_CONSTASCII_USTRINGPARAM("Fields")),
- sPropertyScriptType(RTL_CONSTASCII_USTRINGPARAM("ScriptType")),
- sPropertyURLContent(RTL_CONSTASCII_USTRINGPARAM("URLContent")),
- sPropertyAuthor(RTL_CONSTASCII_USTRINGPARAM("Author")),
- sPropertyDate(RTL_CONSTASCII_USTRINGPARAM("Date")),
- sPropertyMeasureKind(RTL_CONSTASCII_USTRINGPARAM("Kind")),
- sPropertyInstanceName(RTL_CONSTASCII_USTRINGPARAM("InstanceName")),
- sPropertyIsHidden(RTL_CONSTASCII_USTRINGPARAM("IsHidden")),
- sPropertyIsConditionTrue(RTL_CONSTASCII_USTRINGPARAM("IsConditionTrue")),
- sPropertyDataCommandType(RTL_CONSTASCII_USTRINGPARAM("DataCommandType")),
- sPropertyIsFixedLanguage(RTL_CONSTASCII_USTRINGPARAM("IsFixedLanguage")),
- sPropertyCharStyleNames(RTL_CONSTASCII_USTRINGPARAM("CharStyleNames")),
- sPropertyItems(RTL_CONSTASCII_USTRINGPARAM("Items")),
- sPropertySelectedItem(RTL_CONSTASCII_USTRINGPARAM("SelectedItem")),
- pCombinedCharactersPropertyState(pCombinedCharState)
-{
- SetExportOnlyUsedFieldDeclarations();
-}
-
-XMLTextFieldExport::~XMLTextFieldExport()
-{
- delete pCombinedCharactersPropertyState;
- delete pUsedMasters;
-}
-
-/// get the field ID (as in FieldIDEnum) from XTextField
-enum FieldIdEnum XMLTextFieldExport::GetFieldID(
- const Reference<XTextField> & rTextField,
- const Reference<XPropertySet> & xPropSet)
-{
- // get service names for rTextField (via XServiceInfo service)
- Reference<XServiceInfo> xService(rTextField, UNO_QUERY);
- const Sequence<OUString> aServices = xService->getSupportedServiceNames();
- const OUString* pNames = aServices.getConstArray();
- sal_Int32 nCount = aServices.getLength();
-
- OUString sFieldName; // service name postfix of current field
-
- // search for TextField service name
- while( nCount-- )
- {
- if( 0 == pNames->compareTo(sServicePrefix, sServicePrefix.getLength()))
- {
- // TextField found => postfix is field type!
- sFieldName = pNames->copy(sServicePrefix.getLength());
- break;
- }
-
- ++pNames;
- }
-
-
- // map postfix of service name to field ID
- DBG_ASSERT(sFieldName.getLength()>0, "no TextField service found!");
- return MapFieldName(sFieldName, xPropSet);
-}
-
-enum FieldIdEnum XMLTextFieldExport::MapFieldName(
- const OUString& sFieldName, // field (master) name
- const Reference<XPropertySet> & xPropSet) // for subtype
-{
- // we'll proceed in 2 steps:
- // a) map service name to preliminary FIELD_ID
- // b) map those prelim. FIELD_IDs that correspond to several field types
- // (in our (XML) world) to final FIELD IDs
-
-
- // a) find prelim. FIELD_ID via aFieldServiceMapping
-
- // check for non-empty service name
- DBG_ASSERT(sFieldName.getLength()>0, "no valid service name!");
- enum FieldIdEnum nToken = FIELD_ID_UNKNOWN;
- if (sFieldName.getLength() > 0)
- {
- // map name to prelim. ID
- sal_uInt16 nTmp;
- sal_Bool bRet = GetExport().GetMM100UnitConverter().convertEnum(
- nTmp, sFieldName, aFieldServiceNameMapping);
-
- // check return
- DBG_ASSERT(bRet, "Unknown field service name encountered!");
- if (! bRet)
- {
- nToken = FIELD_ID_UNKNOWN;
- }
- else
- {
- nToken = (enum FieldIdEnum)nTmp;
- }
- } else {
- // invalid service name
- nToken = FIELD_ID_UNKNOWN;
- }
-
- // b) map prelim. to final FIELD_IDs
- switch (nToken) {
- case FIELD_ID_VARIABLE_SET:
- if (GetBoolProperty(sPropertyIsInput, xPropSet))
- {
- nToken = FIELD_ID_VARIABLE_INPUT;
- }
- else
- {
- switch (GetIntProperty(sPropertySubType, xPropSet))
- {
- case SetVariableType::STRING: // text field
- case SetVariableType::VAR: // num field
- nToken = FIELD_ID_VARIABLE_SET;
- break;
- case SetVariableType::SEQUENCE:
- nToken = FIELD_ID_SEQUENCE;
- break;
- case SetVariableType::FORMULA:
- default:
- nToken = FIELD_ID_UNKNOWN;
- break;
- }
- }
- break;
-
- case FIELD_ID_VARIABLE_GET:
- switch (GetIntProperty(sPropertySubType, xPropSet))
- {
- case SetVariableType::STRING: // text field
- case SetVariableType::VAR: // num field
- nToken = FIELD_ID_VARIABLE_GET;
- break;
- case SetVariableType::FORMULA:
- nToken = FIELD_ID_EXPRESSION;
- break;
- case SetVariableType::SEQUENCE:
- default:
- nToken = FIELD_ID_UNKNOWN;
- break;
- }
- break;
-
- case FIELD_ID_TIME:
- if (GetBoolProperty(sPropertyIsDate, xPropSet))
- {
- nToken = FIELD_ID_DATE;
- }
- break;
-
- case FIELD_ID_PAGENUMBER:
- // NumberingType not available in non-Writer apps
- if (xPropSet->getPropertySetInfo()->
- hasPropertyByName(sPropertyNumberingType))
- {
- if (NumberingType::CHAR_SPECIAL == GetIntProperty(
- sPropertyNumberingType, xPropSet))
- {
- nToken = FIELD_ID_PAGESTRING;
- }
- }
- break;
-
- case FIELD_ID_DOCINFO_CREATION_TIME:
- if (GetBoolProperty(sPropertyIsDate, xPropSet))
- {
- nToken = FIELD_ID_DOCINFO_CREATION_DATE;
- }
- break;
-
- case FIELD_ID_DOCINFO_PRINT_TIME:
- if (GetBoolProperty(sPropertyIsDate, xPropSet))
- {
- nToken = FIELD_ID_DOCINFO_PRINT_DATE;
- }
- break;
-
- case FIELD_ID_DOCINFO_SAVE_TIME:
- if (GetBoolProperty(sPropertyIsDate, xPropSet))
- {
- nToken = FIELD_ID_DOCINFO_SAVE_DATE;
- }
- break;
-
- case FIELD_ID_REF_REFERENCE:
- switch (GetInt16Property(sPropertyReferenceFieldSource, xPropSet))
- {
- case ReferenceFieldSource::REFERENCE_MARK:
- nToken = FIELD_ID_REF_REFERENCE;
- break;
- case ReferenceFieldSource::SEQUENCE_FIELD:
- nToken = FIELD_ID_REF_SEQUENCE;
- break;
- case ReferenceFieldSource::BOOKMARK:
- nToken = FIELD_ID_REF_BOOKMARK;
- break;
- case ReferenceFieldSource::FOOTNOTE:
- nToken = FIELD_ID_REF_FOOTNOTE;
- break;
- case ReferenceFieldSource::ENDNOTE:
- nToken = FIELD_ID_REF_ENDNOTE;
- break;
- default:
- nToken = FIELD_ID_UNKNOWN;
- break;
- }
- break;
-
- case FIELD_ID_COMBINED_CHARACTERS:
- case FIELD_ID_SCRIPT:
- case FIELD_ID_ANNOTATION:
- case FIELD_ID_BIBLIOGRAPHY:
- case FIELD_ID_DDE:
- case FIELD_ID_MACRO:
- case FIELD_ID_REFPAGE_SET:
- case FIELD_ID_REFPAGE_GET:
- case FIELD_ID_COUNT_PAGES:
- case FIELD_ID_COUNT_PARAGRAPHS:
- case FIELD_ID_COUNT_WORDS:
- case FIELD_ID_COUNT_CHARACTERS:
- case FIELD_ID_COUNT_TABLES:
- case FIELD_ID_COUNT_GRAPHICS:
- case FIELD_ID_COUNT_OBJECTS:
- case FIELD_ID_CONDITIONAL_TEXT:
- case FIELD_ID_HIDDEN_TEXT:
- case FIELD_ID_HIDDEN_PARAGRAPH:
- case FIELD_ID_DOCINFO_CREATION_AUTHOR:
- case FIELD_ID_DOCINFO_DESCRIPTION:
- case FIELD_ID_DOCINFO_INFORMATION0:
- case FIELD_ID_DOCINFO_INFORMATION1:
- case FIELD_ID_DOCINFO_INFORMATION2:
- case FIELD_ID_DOCINFO_INFORMATION3:
- case FIELD_ID_DOCINFO_PRINT_AUTHOR:
- case FIELD_ID_DOCINFO_TITLE:
- case FIELD_ID_DOCINFO_SUBJECT:
- case FIELD_ID_DOCINFO_KEYWORDS:
- case FIELD_ID_DOCINFO_REVISION:
- case FIELD_ID_DOCINFO_EDIT_DURATION:
- case FIELD_ID_DOCINFO_SAVE_AUTHOR:
- case FIELD_ID_TEXT_INPUT:
- case FIELD_ID_USER_INPUT:
- case FIELD_ID_AUTHOR:
- case FIELD_ID_SENDER:
- case FIELD_ID_PLACEHOLDER:
- case FIELD_ID_USER_GET:
- case FIELD_ID_DATABASE_NEXT:
- case FIELD_ID_DATABASE_SELECT:
- case FIELD_ID_DATABASE_DISPLAY:
- case FIELD_ID_DATABASE_NAME:
- case FIELD_ID_DATABASE_NUMBER:
- case FIELD_ID_TEMPLATE_NAME:
- case FIELD_ID_CHAPTER:
- case FIELD_ID_FILE_NAME:
- case FIELD_ID_SHEET_NAME:
- case FIELD_ID_MEASURE:
- case FIELD_ID_URL:
- case FIELD_ID_TABLE_FORMULA:
- case FIELD_ID_DROP_DOWN:
- ; // these field IDs are final
- break;
-
- default:
- nToken = FIELD_ID_UNKNOWN;
- }
-
- // ... and return final FIELD_ID
- return nToken;
-}
-
-// is string or numeric field?
-sal_Bool XMLTextFieldExport::IsStringField(
- sal_uInt16 nFieldType,
- const Reference<XPropertySet> & xPropSet)
-{
- switch (nFieldType) {
-
- case FIELD_ID_VARIABLE_GET:
- case FIELD_ID_VARIABLE_SET:
- case FIELD_ID_VARIABLE_INPUT:
- {
- // depends on field sub type
- return ( GetIntProperty(sPropertySubType, xPropSet) ==
- SetVariableType::STRING );
- }
-
- case FIELD_ID_USER_GET:
- case FIELD_ID_USER_INPUT:
- {
- Reference<XTextField> xTextField(xPropSet, UNO_QUERY);
- DBG_ASSERT(xTextField.is(), "field is no XTextField!");
- sal_Bool bRet = GetBoolProperty(sPropertyIsExpression,
- GetMasterPropertySet(xTextField));
- return !bRet;
- }
-
- case FIELD_ID_DATABASE_DISPLAY:
- // TODO: depends on... ???
- // workaround #no-bug#: no data type
- return 5100 == GetIntProperty(sPropertyNumberFormat, xPropSet);
- break;
-
- case FIELD_ID_TABLE_FORMULA:
- // legacy field: always a number field (because it always has
- // a number format)
- return sal_False;
- break;
-
- case FIELD_ID_COUNT_PAGES:
- case FIELD_ID_COUNT_PARAGRAPHS:
- case FIELD_ID_COUNT_WORDS:
- case FIELD_ID_COUNT_CHARACTERS:
- case FIELD_ID_COUNT_TABLES:
- case FIELD_ID_COUNT_GRAPHICS:
- case FIELD_ID_COUNT_OBJECTS:
- case FIELD_ID_DOCINFO_SAVE_TIME:
- case FIELD_ID_DOCINFO_SAVE_DATE:
- case FIELD_ID_DOCINFO_CREATION_DATE:
- case FIELD_ID_DOCINFO_CREATION_TIME:
- case FIELD_ID_DOCINFO_PRINT_TIME:
- case FIELD_ID_DOCINFO_PRINT_DATE:
- case FIELD_ID_DOCINFO_EDIT_DURATION:
- case FIELD_ID_DOCINFO_REVISION:
- case FIELD_ID_DATABASE_NUMBER:
- case FIELD_ID_EXPRESSION:
- case FIELD_ID_SEQUENCE:
- case FIELD_ID_DATE:
- case FIELD_ID_TIME:
- case FIELD_ID_PAGENUMBER:
- case FIELD_ID_REFPAGE_SET:
- case FIELD_ID_REFPAGE_GET:
- // always number
- return sal_False;
-
- case FIELD_ID_COMBINED_CHARACTERS:
- case FIELD_ID_BIBLIOGRAPHY:
- case FIELD_ID_DDE:
- case FIELD_ID_REF_REFERENCE:
- case FIELD_ID_REF_SEQUENCE:
- case FIELD_ID_REF_BOOKMARK:
- case FIELD_ID_REF_FOOTNOTE:
- case FIELD_ID_REF_ENDNOTE:
- case FIELD_ID_MACRO:
- case FIELD_ID_TEMPLATE_NAME:
- case FIELD_ID_CHAPTER:
- case FIELD_ID_FILE_NAME:
- case FIELD_ID_CONDITIONAL_TEXT:
- case FIELD_ID_HIDDEN_TEXT:
- case FIELD_ID_HIDDEN_PARAGRAPH:
- case FIELD_ID_DOCINFO_CREATION_AUTHOR:
- case FIELD_ID_DOCINFO_DESCRIPTION:
- case FIELD_ID_DOCINFO_INFORMATION0:
- case FIELD_ID_DOCINFO_INFORMATION1:
- case FIELD_ID_DOCINFO_INFORMATION2:
- case FIELD_ID_DOCINFO_INFORMATION3:
- case FIELD_ID_DOCINFO_PRINT_AUTHOR:
- case FIELD_ID_DOCINFO_TITLE:
- case FIELD_ID_DOCINFO_SUBJECT:
- case FIELD_ID_DOCINFO_KEYWORDS:
- case FIELD_ID_DOCINFO_SAVE_AUTHOR:
- case FIELD_ID_DATABASE_NAME:
- case FIELD_ID_TEXT_INPUT:
- case FIELD_ID_SENDER:
- case FIELD_ID_AUTHOR:
- case FIELD_ID_PAGESTRING:
- case FIELD_ID_SHEET_NAME:
- case FIELD_ID_MEASURE:
- case FIELD_ID_URL:
- case FIELD_ID_DROP_DOWN:
- // always string:
- return sal_True;
-
- case FIELD_ID_SCRIPT:
- case FIELD_ID_ANNOTATION:
- case FIELD_ID_DATABASE_NEXT:
- case FIELD_ID_DATABASE_SELECT:
- case FIELD_ID_VARIABLE_DECL:
- case FIELD_ID_USER_DECL:
- case FIELD_ID_SEQUENCE_DECL:
- case FIELD_ID_PLACEHOLDER:
- case FIELD_ID_UNKNOWN:
- default:
- DBG_ERROR("unkown field type/field has no content");
- return sal_True; // invalid info; string in case of doubt
- }
-}
-
-/// export the styles needed by the given field. Called on first pass
-/// through document
-void XMLTextFieldExport::ExportFieldAutoStyle(
- const Reference<XTextField> & rTextField)
-{
- // get property set
- Reference<XPropertySet> xPropSet(rTextField, UNO_QUERY);
-
- // add field master to list of used field masters (if desired)
- if (NULL != pUsedMasters)
- {
- Reference<XDependentTextField> xDepField(rTextField, UNO_QUERY);
- if (xDepField.is())
- {
- Reference<XText> xOurText = rTextField->getAnchor()->getText();
-
- map<Reference<XText>, set<OUString> >::iterator aMapIter =
- pUsedMasters->find(xOurText);
-
- // insert a list for our XText (if necessary)
- if (aMapIter == pUsedMasters->end())
- {
- set<OUString> aSet;
- (*pUsedMasters)[xOurText] = aSet;
- aMapIter = pUsedMasters->find(xOurText);
- }
-
- // insert this text field master
- OUString sFieldMasterName = GetStringProperty(
- sPropertyInstanceName, xDepField->getTextFieldMaster());
- if (sFieldMasterName.getLength() > 0)
- aMapIter->second.insert( sFieldMasterName );
- }
- // else: no dependent field -> no master -> ignore
- }
-
- // get Field ID
- sal_uInt16 nToken = GetFieldID(rTextField, xPropSet);
-
- // export the character style for all fields
- // with one exception: combined character fields export their own
- // text style below
- Reference <XPropertySet> xRangePropSet(rTextField->getAnchor(), UNO_QUERY);
- if (FIELD_ID_COMBINED_CHARACTERS != nToken)
- {
- GetExport().GetTextParagraphExport()->Add(
- XML_STYLE_FAMILY_TEXT_TEXT, xRangePropSet);
- }
-
- // process special styles for each field (e.g. data styles)
- switch (nToken) {
-
- case FIELD_ID_DATABASE_DISPLAY:
- {
- sal_Int32 nFormat = GetIntProperty(sPropertyNumberFormat, xPropSet);
- // workaround: #no-bug#; see IsStringField(...)
- if ( (5100 != nFormat) &&
- !GetBoolProperty(sPropertyIsDataBaseFormat, xPropSet) )
- {
- GetExport().addDataStyle(nFormat);
- }
- break;
- }
-
- case FIELD_ID_DATE:
- case FIELD_ID_TIME:
- {
- // date and time fields are always number fields, but the
- // NumberFormat property is optional (e.g. Calc doesn't
- // support it)
- Reference<XPropertySetInfo> xPropSetInfo(
- xPropSet->getPropertySetInfo() );
- if ( xPropSetInfo->hasPropertyByName( sPropertyNumberFormat ) )
- {
- sal_Int32 nFormat =
- GetIntProperty(sPropertyNumberFormat, xPropSet);
-
- // nFormat may be -1 for numeric fields that display their
- // variable name. (Maybe this should be a field type, then?)
- if (nFormat != -1)
- {
- if( ! GetOptionalBoolProperty(
- sPropertyIsFixedLanguage,
- xPropSet, xPropSetInfo, sal_False ) )
- {
- nFormat =
- GetExport().dataStyleForceSystemLanguage(nFormat);
- }
-
- GetExport().addDataStyle( nFormat,
- nToken == FIELD_ID_TIME );
- }
- }
- }
- break;
-
- case FIELD_ID_DOCINFO_PRINT_TIME:
- case FIELD_ID_DOCINFO_PRINT_DATE:
- case FIELD_ID_DOCINFO_CREATION_DATE:
- case FIELD_ID_DOCINFO_CREATION_TIME:
- case FIELD_ID_DOCINFO_SAVE_TIME:
- case FIELD_ID_DOCINFO_SAVE_DATE:
- case FIELD_ID_DOCINFO_EDIT_DURATION:
- case FIELD_ID_VARIABLE_SET:
- case FIELD_ID_VARIABLE_GET:
- case FIELD_ID_VARIABLE_INPUT:
- case FIELD_ID_USER_GET:
- case FIELD_ID_EXPRESSION:
- case FIELD_ID_TABLE_FORMULA:
- // register number format, if this is a numeric field
- if (! IsStringField(nToken, xPropSet)) {
-
- sal_Int32 nFormat =
- GetIntProperty(sPropertyNumberFormat, xPropSet);
-
- // nFormat may be -1 for numeric fields that display their
- // variable name. (Maybe this should be a field type, then?)
- if (nFormat != -1)
- {
- // handle formats for fixed language fields
- // for all these fields (except table formula)
- if( ( nToken != FIELD_ID_TABLE_FORMULA ) &&
- ! GetOptionalBoolProperty(
- sPropertyIsFixedLanguage,
- xPropSet, xPropSet->getPropertySetInfo(),
- sal_False ) )
- {
- nFormat =
- GetExport().dataStyleForceSystemLanguage(nFormat);
- }
-
- GetExport().addDataStyle(nFormat);
- }
- }
- break;
-
- case FIELD_ID_COMBINED_CHARACTERS:
- {
- // export text style with the addition of the combined characters
- DBG_ASSERT(NULL != pCombinedCharactersPropertyState,
- "need proper PropertyState for combined characters");
- const XMLPropertyState *aStates[] = { pCombinedCharactersPropertyState, 0 };
- GetExport().GetTextParagraphExport()->Add(
- XML_STYLE_FAMILY_TEXT_TEXT, xRangePropSet,
- aStates);
- break;
- }
-
- case FIELD_ID_SCRIPT:
- case FIELD_ID_ANNOTATION:
- case FIELD_ID_BIBLIOGRAPHY:
- case FIELD_ID_DDE:
- case FIELD_ID_REF_REFERENCE:
- case FIELD_ID_REF_SEQUENCE:
- case FIELD_ID_REF_BOOKMARK:
- case FIELD_ID_REF_FOOTNOTE:
- case FIELD_ID_REF_ENDNOTE:
- case FIELD_ID_MACRO:
- case FIELD_ID_REFPAGE_SET:
- case FIELD_ID_REFPAGE_GET:
- case FIELD_ID_COUNT_PAGES:
- case FIELD_ID_COUNT_PARAGRAPHS:
- case FIELD_ID_COUNT_WORDS:
- case FIELD_ID_COUNT_CHARACTERS:
- case FIELD_ID_COUNT_TABLES:
- case FIELD_ID_COUNT_GRAPHICS:
- case FIELD_ID_COUNT_OBJECTS:
- case FIELD_ID_CONDITIONAL_TEXT:
- case FIELD_ID_HIDDEN_TEXT:
- case FIELD_ID_HIDDEN_PARAGRAPH:
- case FIELD_ID_DOCINFO_CREATION_AUTHOR:
- case FIELD_ID_DOCINFO_DESCRIPTION:
- case FIELD_ID_DOCINFO_INFORMATION0:
- case FIELD_ID_DOCINFO_INFORMATION1:
- case FIELD_ID_DOCINFO_INFORMATION2:
- case FIELD_ID_DOCINFO_INFORMATION3:
- case FIELD_ID_DOCINFO_PRINT_AUTHOR:
- case FIELD_ID_DOCINFO_TITLE:
- case FIELD_ID_DOCINFO_SUBJECT:
- case FIELD_ID_DOCINFO_KEYWORDS:
- case FIELD_ID_DOCINFO_REVISION:
- case FIELD_ID_DOCINFO_SAVE_AUTHOR:
- case FIELD_ID_SEQUENCE:
- case FIELD_ID_PAGENUMBER:
- case FIELD_ID_PAGESTRING:
- case FIELD_ID_AUTHOR:
- case FIELD_ID_SENDER:
- case FIELD_ID_PLACEHOLDER:
- case FIELD_ID_USER_INPUT:
- case FIELD_ID_TEXT_INPUT:
- case FIELD_ID_DATABASE_NEXT:
- case FIELD_ID_DATABASE_SELECT:
- case FIELD_ID_DATABASE_NAME:
- case FIELD_ID_DATABASE_NUMBER:
- case FIELD_ID_TEMPLATE_NAME:
- case FIELD_ID_CHAPTER:
- case FIELD_ID_FILE_NAME:
- case FIELD_ID_SHEET_NAME:
- case FIELD_ID_MEASURE:
- case FIELD_ID_URL:
- case FIELD_ID_DROP_DOWN:
- ; // no formats for these fields!
- break;
-
- case FIELD_ID_UNKNOWN:
- default:
- DBG_ERROR("unkown field type!");
- // ignore -> no format for unkowns
- break;
- }
-}
-
-/// export the given field to XML. Called on second pass through document
-void XMLTextFieldExport::ExportField(const Reference<XTextField> & rTextField )
-{
- // get property set
- Reference<XPropertySet> xPropSet(rTextField, UNO_QUERY);
-
- // get property set of range (for the attributes)
- Reference <XPropertySet> xRangePropSet(rTextField->getAnchor(), UNO_QUERY);
-
- // get Field ID
- enum FieldIdEnum nToken = GetFieldID(rTextField, xPropSet);
-
- // special treatment for combined characters field, because it is
- // exported as a style
- const XMLPropertyState* aStates[] = { pCombinedCharactersPropertyState, 0 };
- const XMLPropertyState **pStates =
- FIELD_ID_COMBINED_CHARACTERS == nToken
- ? aStates
- : 0;
-
- // find out whether we need to set the style or hyperlink
- sal_Bool bHasHyperlink;
- sal_Bool bIsUICharStyle;
- OUString sStyle = GetExport().GetTextParagraphExport()->
- FindTextStyleAndHyperlink( xRangePropSet, bHasHyperlink, bIsUICharStyle,
- pStates );
- sal_Bool bHasStyle = (sStyle.getLength() > 0);
-
- // export hyperlink (if we have one)
- Reference < XPropertySetInfo > xRangePropSetInfo;
- if( bHasHyperlink )
- {
- Reference<XPropertyState> xRangePropState( xRangePropSet, UNO_QUERY );
- xRangePropSetInfo = xRangePropSet->getPropertySetInfo();
- bHasHyperlink =
- GetExport().GetTextParagraphExport()->addHyperlinkAttributes(
- xRangePropSet, xRangePropState,
- xRangePropSetInfo );
- }
- SvXMLElementExport aHyperlink( GetExport(), bHasHyperlink,
- XML_NAMESPACE_TEXT, XML_A,
- sal_False, sal_False );
-
- if( bHasHyperlink )
- {
- // export events (if supported)
- OUString sHyperLinkEvents(RTL_CONSTASCII_USTRINGPARAM(
- "HyperLinkEvents"));
- if (xRangePropSetInfo->hasPropertyByName(sHyperLinkEvents))
- {
- Any aAny = xRangePropSet->getPropertyValue(sHyperLinkEvents);
- Reference<XNameReplace> xName;
- aAny >>= xName;
- GetExport().GetEventExport().Export(xName, sal_False);
- }
- }
-
- {
- XMLTextCharStyleNamesElementExport aCharStylesExport(
- GetExport(), bIsUICharStyle &&
- GetExport().GetTextParagraphExport()
- ->GetCharStyleNamesPropInfoCache().hasProperty(
- xRangePropSet, xRangePropSetInfo ),
- xRangePropSet, sPropertyCharStyleNames );
-
- // export span with style (if necessary)
- // (except for combined characters field)
- if( bHasStyle )
- {
- // export <text:span> element
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, sStyle );
- }
- SvXMLElementExport aSpan( GetExport(), bHasStyle,
- XML_NAMESPACE_TEXT, XML_SPAN,
- sal_False, sal_False);
-
- // finally, export the field itself
- ExportFieldHelper( rTextField, xPropSet, xRangePropSet, nToken );
- }
-}
-
-/// export the given field to XML. Called on second pass through document
-void XMLTextFieldExport::ExportFieldHelper(
- const Reference<XTextField> & rTextField,
- const Reference<XPropertySet> & rPropSet,
- const Reference<XPropertySet> & rRangePropSet,
- enum FieldIdEnum nToken)
-{
- // get property set info (because some attributes are not support
- // in all implementations)
- Reference<XPropertySetInfo> xPropSetInfo(rPropSet->getPropertySetInfo());
-
- OUString sPresentation = rTextField->getPresentation(sal_False);
-
- // process each field type
- switch (nToken) {
- case FIELD_ID_AUTHOR:
- // author field: fixed, field (sub-)type
- ProcessBoolean(XML_FIXED,
- GetBoolProperty(sPropertyIsFixed, rPropSet), sal_True);
- ExportElement(MapAuthorFieldName(rPropSet), sPresentation);
- break;
-
- case FIELD_ID_SENDER:
- // sender field: fixed, field (sub-)type
- ProcessBoolean(XML_FIXED,
- GetBoolProperty(sPropertyIsFixed, rPropSet), sal_True);
- ExportElement(MapSenderFieldName(rPropSet), sPresentation);
- break;
-
- case FIELD_ID_PLACEHOLDER:
- // placeholder field: type, name, description
- ProcessString(XML_PLACEHOLDER_TYPE,
- MapPlaceholderType(
- GetInt16Property(sPropertyPlaceholderType, rPropSet)));
- ProcessString(XML_DESCRIPTION,
- GetStringProperty(sPropertyHint,rPropSet), sal_True);
- ExportElement(XML_PLACEHOLDER, sPresentation);
- break;
-
- case FIELD_ID_VARIABLE_SET:
- {
- // variable set field: name, visible, format&value
- ProcessString(XML_NAME,
- GetStringProperty(sPropertyVariableName, rPropSet));
- ProcessDisplay(GetBoolProperty(sPropertyIsVisible, rPropSet),
- sal_False);
- ProcessString(XML_FORMULA,
- GetStringProperty(sPropertyContent, rPropSet),
- sPresentation);
- ProcessValueAndType(IsStringField(nToken, rPropSet),
- GetIntProperty(sPropertyNumberFormat, rPropSet),
- GetStringProperty(sPropertyContent, rPropSet),
- sPresentation,
- GetDoubleProperty(sPropertyValue, rPropSet),
- sal_True, sal_True, sal_True,
- ! GetOptionalBoolProperty(
- sPropertyIsFixedLanguage,
- rPropSet, xPropSetInfo, sal_False ) );
- ExportElement(XML_VARIABLE_SET, sPresentation);
- break;
- }
- case FIELD_ID_VARIABLE_GET:
- {
- // variable get field: name, format&value
- ProcessString(XML_NAME,
- GetStringProperty(sPropertyContent, rPropSet));
- sal_Bool bCmd = GetBoolProperty(sPropertyIsShowFormula, rPropSet);
- ProcessDisplay(sal_True, bCmd);
- // show style, unless name will be shown
- ProcessValueAndType(IsStringField(nToken, rPropSet),
- GetIntProperty(sPropertyNumberFormat, rPropSet),
- sEmpty, sEmpty, 0.0, // values not used
- sal_False, !bCmd, !bCmd,
- ! GetOptionalBoolProperty(
- sPropertyIsFixedLanguage,
- rPropSet, xPropSetInfo, sal_False ) );
- ExportElement(XML_VARIABLE_GET, sPresentation);
- break;
- }
- case FIELD_ID_VARIABLE_INPUT:
- // variable input field: name, description, format&value
- ProcessString(XML_NAME,
- GetStringProperty(sPropertyVariableName, rPropSet));
- ProcessString(XML_DESCRIPTION,
- GetStringProperty(sPropertyHint , rPropSet));
- ProcessDisplay(GetBoolProperty(sPropertyIsVisible, rPropSet),
- sal_False);
- ProcessString(XML_FORMULA,
- GetStringProperty(sPropertyContent, rPropSet),
- sPresentation);
- ProcessValueAndType(IsStringField(nToken, rPropSet),
- GetIntProperty(sPropertyNumberFormat, rPropSet),
- GetStringProperty(sPropertyContent, rPropSet),
- sPresentation,
- GetDoubleProperty(sPropertyValue, rPropSet),
- sal_True, sal_True, sal_True,
- ! GetOptionalBoolProperty(
- sPropertyIsFixedLanguage,
- rPropSet, xPropSetInfo, sal_False ) );
- ExportElement(XML_VARIABLE_INPUT, sPresentation);
- break;
-
- case FIELD_ID_USER_GET:
- // user field: name, hidden, style
- {
- sal_Bool bCmd = GetBoolProperty(sPropertyIsShowFormula, rPropSet);
- ProcessDisplay(GetBoolProperty(sPropertyIsVisible, rPropSet),
- bCmd);
- ProcessValueAndType(IsStringField(nToken, rPropSet),
- GetIntProperty(sPropertyNumberFormat, rPropSet),
- sEmpty, sEmpty, 0.0, // values not used
- sal_False, sal_False, !bCmd,
- ! GetOptionalBoolProperty(
- sPropertyIsFixedLanguage,
- rPropSet, xPropSetInfo, sal_False ) );
-
- // name from FieldMaster
- ProcessString(XML_NAME,
- GetStringProperty(sPropertyName,
- GetMasterPropertySet(rTextField)));
- ExportElement(XML_USER_FIELD_GET, sPresentation);
- break;
- }
-
- case FIELD_ID_USER_INPUT:
- // user input field: name (from FieldMaster), description
-// ProcessString(XML_NAME,
-// GetStringProperty(sPropertyName,
-// GetMasterPropertySet(rTextField)));
- ProcessString(XML_NAME,
- GetStringProperty(sPropertyContent, rPropSet));
- ProcessString(XML_DESCRIPTION,
- GetStringProperty(sPropertyHint, rPropSet));
- ExportElement(XML_USER_FIELD_INPUT, sPresentation);
- break;
-
- case FIELD_ID_SEQUENCE:
- {
- // sequence field: name, formula, seq-format
- OUString sName = GetStringProperty(sPropertyVariableName, rPropSet);
- // TODO: use reference name only if actually beeing referenced.
- ProcessString(XML_REF_NAME,
- MakeSequenceRefName(
- GetInt16Property(sPropertySequenceValue, rPropSet),
- sName));
- ProcessString(XML_NAME, sName);
- ProcessString(XML_FORMULA,
- GetStringProperty(sPropertyContent, rPropSet),
- sPresentation);
- ProcessNumberingType(GetInt16Property(sPropertyNumberingType,
- rPropSet));
- ExportElement(XML_SEQUENCE, sPresentation);
- break;
- }
-
- case FIELD_ID_EXPRESSION:
- {
- // formula field: formula, format&value
- sal_Bool bCmd = GetBoolProperty(sPropertyIsShowFormula, rPropSet);
- ProcessString(XML_FORMULA,
- GetStringProperty(sPropertyContent, rPropSet),
- sPresentation);
- ProcessDisplay(sal_True, bCmd);
- ProcessValueAndType(IsStringField(nToken, rPropSet),
- GetIntProperty(sPropertyNumberFormat, rPropSet),
- GetStringProperty(sPropertyContent, rPropSet),
- sPresentation,
- GetDoubleProperty(sPropertyValue, rPropSet),
- !bCmd, !bCmd, !bCmd,
- ! GetOptionalBoolProperty(
- sPropertyIsFixedLanguage,
- rPropSet, xPropSetInfo, sal_False ) );
- ExportElement(XML_EXPRESSION, sPresentation);
- break;
- }
-
- case FIELD_ID_TEXT_INPUT:
- // text input field: description and string-value
- ProcessString(XML_DESCRIPTION,
- GetStringProperty(sPropertyHint, rPropSet));
- ExportElement(XML_TEXT_INPUT, sPresentation);
- break;
-
- case FIELD_ID_TIME:
- // all properties (except IsDate) are optional!
- if (xPropSetInfo->hasPropertyByName(sPropertyNumberFormat))
- {
- ProcessValueAndType(sal_False,
- GetIntProperty(sPropertyNumberFormat,rPropSet),
- sEmpty, sEmpty, 0.0, // not used
- sal_False, sal_False, sal_True,
- ! GetOptionalBoolProperty(
- sPropertyIsFixedLanguage,
- rPropSet, xPropSetInfo, sal_False ),
- sal_True);
- }
- if (xPropSetInfo->hasPropertyByName(sPropertyDateTimeValue))
- {
- // no value -> current time
- ProcessDateTime(XML_TIME_VALUE,
- GetDateTimeProperty(sPropertyDateTimeValue,
- rPropSet),
- sal_False );
- }
- if (xPropSetInfo->hasPropertyByName(sPropertyDateTime))
- {
- // no value -> current time
- ProcessDateTime(XML_TIME_VALUE,
- GetDateTimeProperty(sPropertyDateTime,rPropSet),
- sal_False );
- }
- if (xPropSetInfo->hasPropertyByName(sPropertyIsFixed))
- {
- ProcessBoolean(XML_FIXED,
- GetBoolProperty(sPropertyIsFixed, rPropSet),
- sal_False);
- }
- if (xPropSetInfo->hasPropertyByName(sPropertyAdjust))
- {
- // adjust value given as integer in minutes
- ProcessDateTime(XML_TIME_ADJUST,
- GetIntProperty(sPropertyAdjust, rPropSet),
- sal_False, sal_True, sal_True);
- }
- ExportElement(XML_TIME, sPresentation);
- break;
-
- case FIELD_ID_DATE:
- // all properties (except IsDate) are optional!
- if (xPropSetInfo->hasPropertyByName(sPropertyNumberFormat))
- {
- ProcessValueAndType(sal_False,
- GetIntProperty(sPropertyNumberFormat,rPropSet),
- sEmpty, sEmpty, 0.0, // not used
- sal_False, sal_False, sal_True,
- ! GetOptionalBoolProperty(
- sPropertyIsFixedLanguage,
- rPropSet, xPropSetInfo, sal_False ) );
- }
- if (xPropSetInfo->hasPropertyByName(sPropertyDateTimeValue))
- {
- // no value -> current date
- ProcessDateTime(XML_DATE_VALUE,
- GetDateTimeProperty(sPropertyDateTimeValue,
- rPropSet),
- // #96457#: date fields should also save time
- sal_False);
- }
- // TODO: remove double-handling after SRC614
- else if (xPropSetInfo->hasPropertyByName(sPropertyDateTime))
- {
- ProcessDateTime(XML_DATE_VALUE,
- GetDateTimeProperty(sPropertyDateTime,rPropSet),
- // #96457#: date fields should also save time
- sal_False);
- }
- if (xPropSetInfo->hasPropertyByName(sPropertyIsFixed))
- {
- ProcessBoolean(XML_FIXED,
- GetBoolProperty(sPropertyIsFixed, rPropSet),
- sal_False);
- }
- if (xPropSetInfo->hasPropertyByName(sPropertyAdjust))
- {
- // adjust value given as number of days
- ProcessDateTime(XML_DATE_ADJUST,
- GetIntProperty(sPropertyAdjust, rPropSet),
- sal_True, sal_True, sal_True);
- }
- ExportElement(XML_DATE, sPresentation);
- break;
-
- case FIELD_ID_PAGENUMBER:
- // all properties are optional
- if (xPropSetInfo->hasPropertyByName(sPropertyNumberingType))
- {
- ProcessNumberingType(GetInt16Property(sPropertyNumberingType,
- rPropSet));
- }
- if (xPropSetInfo->hasPropertyByName(sPropertyOffset))
- {
- sal_Int32 nAdjust = GetIntProperty(sPropertyOffset, rPropSet);
-
- if (xPropSetInfo->hasPropertyByName(sPropertySubType))
- {
- // property SubType used in MapPageNumebrName
- ProcessString(XML_SELECT_PAGE,
- MapPageNumberName(rPropSet, nAdjust));
- }
- ProcessInteger(XML_PAGE_ADJUST, nAdjust, 0);
- }
- ExportElement(XML_PAGE_NUMBER, sPresentation);
- break;
-
- case FIELD_ID_PAGESTRING:
- {
- ProcessString(XML_STRING_VALUE,
- GetStringProperty(sPropertyUserText, rPropSet),
- sPresentation);
- sal_Int32 nDummy = 0; // MapPageNumberName need int
- ProcessString(XML_SELECT_PAGE, MapPageNumberName(rPropSet, nDummy));
- ExportElement(XML_PAGE_CONTINUATION_STRING, sPresentation);
- break;
- }
-
- case FIELD_ID_DATABASE_NAME:
- ProcessString(XML_DATABASE_NAME,
- GetStringProperty(sPropertyDataBaseName, rPropSet));
- ProcessString(XML_TABLE_NAME,
- GetStringProperty(sPropertyDataTableName, rPropSet));
- ProcessCommandType(GetIntProperty(sPropertyDataCommandType, rPropSet));
- ProcessDisplay(GetBoolProperty(sPropertyIsVisible, rPropSet),
- sal_False);
- ExportElement(XML_DATABASE_NAME, sPresentation);
- break;
-
- case FIELD_ID_DATABASE_NUMBER:
- ProcessString(XML_DATABASE_NAME,
- GetStringProperty(sPropertyDataBaseName, rPropSet));
- ProcessString(XML_TABLE_NAME,
- GetStringProperty(sPropertyDataTableName, rPropSet));
- ProcessCommandType(GetIntProperty(sPropertyDataCommandType, rPropSet));
- ProcessNumberingType(
- GetInt16Property(sPropertyNumberingType,rPropSet));
- ProcessInteger(XML_VALUE,
- GetIntProperty(sPropertySetNumber, rPropSet));
- ProcessDisplay(GetBoolProperty(sPropertyIsVisible, rPropSet),
- sal_False);
- ExportElement(XML_DATABASE_ROW_NUMBER, sPresentation);
- break;
-
- case FIELD_ID_DATABASE_NEXT:
- ProcessString(XML_DATABASE_NAME,
- GetStringProperty(sPropertyDataBaseName, rPropSet));
- ProcessString(XML_TABLE_NAME,
- GetStringProperty(sPropertyDataTableName, rPropSet));
- ProcessCommandType(GetIntProperty(sPropertyDataCommandType, rPropSet));
- ProcessString(XML_CONDITION,
- GetStringProperty(sPropertyCondition, rPropSet));
- DBG_ASSERT(sPresentation.equals(sEmpty),
- "Unexpected presentation for database next field");
- ExportElement(XML_DATABASE_NEXT);
- break;
-
- case FIELD_ID_DATABASE_SELECT:
- ProcessString(XML_DATABASE_NAME,
- GetStringProperty(sPropertyDataBaseName, rPropSet));
- ProcessString(XML_TABLE_NAME,
- GetStringProperty(sPropertyDataTableName, rPropSet));
- ProcessCommandType(GetIntProperty(sPropertyDataCommandType, rPropSet));
- ProcessString(XML_CONDITION,
- GetStringProperty(sPropertyCondition, rPropSet));
- ProcessInteger(XML_ROW_NUMBER,
- GetIntProperty(sPropertySetNumber, rPropSet));
- DBG_ASSERT(sPresentation.equals(sEmpty),
- "Unexpected presentation for database select field");
- ExportElement(XML_DATABASE_SELECT);
- break;
-
- case FIELD_ID_DATABASE_DISPLAY:
- {
- // get database, table and column name from field master
- const Reference<XPropertySet> & xMaster = GetMasterPropertySet(rTextField);
- ProcessString(XML_DATABASE_NAME,
- GetStringProperty(sPropertyDataBaseName, xMaster));
- ProcessString(XML_TABLE_NAME,
- GetStringProperty(sPropertyDataTableName, xMaster));
- ProcessCommandType(GetIntProperty(sPropertyDataCommandType, xMaster));
- ProcessString(XML_COLUMN_NAME,
- GetStringProperty(sPropertyDataColumnName, xMaster));
- // export number format if available (happens only for numbers!)
- if (!GetBoolProperty(sPropertyIsDataBaseFormat, rPropSet))
- {
- ProcessValueAndType(sal_False, // doesn't happen for text
- GetIntProperty(sPropertyNumberFormat,rPropSet),
- sEmpty, sEmpty, 0.0, // not used
- sal_False, sal_False, sal_True, sal_False);
- }
- ProcessDisplay(GetBoolProperty(sPropertyIsVisible, rPropSet),
- sal_False);
- ExportElement(XML_DATABASE_DISPLAY, sPresentation);
- break;
- }
-
- case FIELD_ID_DOCINFO_REVISION:
- ProcessBoolean(XML_FIXED,
- GetBoolProperty(sPropertyIsFixed, rPropSet), sal_False);
- ExportElement(MapDocInfoFieldName(nToken), sPresentation);
- break;
-
- case FIELD_ID_DOCINFO_EDIT_DURATION:
- case FIELD_ID_DOCINFO_SAVE_TIME:
- case FIELD_ID_DOCINFO_CREATION_TIME:
- case FIELD_ID_DOCINFO_PRINT_TIME:
- case FIELD_ID_DOCINFO_SAVE_DATE:
- case FIELD_ID_DOCINFO_CREATION_DATE:
- case FIELD_ID_DOCINFO_PRINT_DATE:
- ProcessValueAndType(sal_False,
- GetIntProperty(sPropertyNumberFormat, rPropSet),
- sEmpty, sEmpty, 0.0,
- sal_False, sal_False, sal_True,
- ! GetOptionalBoolProperty(
- sPropertyIsFixedLanguage,
- rPropSet, xPropSetInfo, sal_False ) );
-
- // todo: export date/time value, but values not available -> core bug
- ProcessBoolean(XML_FIXED,
- GetBoolProperty(sPropertyIsFixed, rPropSet), sal_False);
- ExportElement(MapDocInfoFieldName(nToken), sPresentation);
- break;
-
- case FIELD_ID_DOCINFO_CREATION_AUTHOR:
- case FIELD_ID_DOCINFO_DESCRIPTION:
- case FIELD_ID_DOCINFO_PRINT_AUTHOR:
- case FIELD_ID_DOCINFO_TITLE:
- case FIELD_ID_DOCINFO_SUBJECT:
- case FIELD_ID_DOCINFO_KEYWORDS:
- case FIELD_ID_DOCINFO_SAVE_AUTHOR:
- if (xPropSetInfo->hasPropertyByName(sPropertyIsFixed))
- {
- ProcessBoolean(XML_FIXED,
- GetBoolProperty(sPropertyIsFixed, rPropSet), sal_False);
- }
- ExportElement(MapDocInfoFieldName(nToken), sPresentation);
- break;
-
- case FIELD_ID_DOCINFO_INFORMATION0:
- case FIELD_ID_DOCINFO_INFORMATION1:
- case FIELD_ID_DOCINFO_INFORMATION2:
- case FIELD_ID_DOCINFO_INFORMATION3:
- {
- Reference<XDocumentInfoSupplier> xDocInfoSupplier(
- GetExport().GetModel(), UNO_QUERY);
- Reference<XDocumentInfo> xDocInfo =xDocInfoSupplier->getDocumentInfo();
- Any aAny;
- ProcessString(XML_NAME,
- xDocInfo->getUserFieldName(nToken -
- FIELD_ID_DOCINFO_INFORMATION0));
- ProcessBoolean(XML_FIXED,
- GetBoolProperty(sPropertyIsFixed, rPropSet), sal_False);
- ExportElement(XML_USER_DEFINED, sPresentation);
- break;
- }
-
- case FIELD_ID_COUNT_PAGES:
- case FIELD_ID_COUNT_PARAGRAPHS:
- case FIELD_ID_COUNT_WORDS:
- case FIELD_ID_COUNT_CHARACTERS:
- case FIELD_ID_COUNT_TABLES:
- case FIELD_ID_COUNT_GRAPHICS:
- case FIELD_ID_COUNT_OBJECTS:
- // all properties optional (applies to pages only, but I'll do
- // it for all for sake of common implementation)
- if (xPropSetInfo->hasPropertyByName(sPropertyNumberingType))
- {
- ProcessNumberingType(GetInt16Property(sPropertyNumberingType,
- rPropSet));
- }
- ExportElement(MapCountFieldName(nToken), sPresentation);
- break;
-
- case FIELD_ID_CONDITIONAL_TEXT:
- ProcessString(XML_CONDITION,
- GetStringProperty(sPropertyCondition, rPropSet));
- ProcessString(XML_STRING_VALUE_IF_TRUE,
- GetStringProperty(sPropertyTrueContent, rPropSet));
- ProcessString(XML_STRING_VALUE_IF_FALSE,
- GetStringProperty(sPropertyFalseContent, rPropSet));
- ProcessBoolean(XML_CURRENT_VALUE,
- GetBoolProperty(sPropertyIsConditionTrue, rPropSet),
- sal_False);
- ExportElement(XML_CONDITIONAL_TEXT, sPresentation);
- break;
-
- case FIELD_ID_HIDDEN_TEXT:
- ProcessString(XML_CONDITION,
- GetStringProperty(sPropertyCondition, rPropSet));
- ProcessString(XML_STRING_VALUE,
- GetStringProperty(sPropertyContent, rPropSet));
- ProcessBoolean(XML_IS_HIDDEN,
- GetBoolProperty(sPropertyIsHidden, rPropSet),
- sal_False);
- ExportElement(XML_HIDDEN_TEXT, sPresentation);
- break;
-
- case FIELD_ID_HIDDEN_PARAGRAPH:
- ProcessString(XML_CONDITION,
- GetStringProperty(sPropertyCondition, rPropSet));
- ProcessBoolean(XML_IS_HIDDEN,
- GetBoolProperty(sPropertyIsHidden, rPropSet),
- sal_False);
- DBG_ASSERT(sPresentation.equals(sEmpty),
- "Unexpected presentation for hidden paragraph field");
- ExportElement(XML_HIDDEN_PARAGRAPH);
- break;
-
- case FIELD_ID_TEMPLATE_NAME:
- ProcessString(XML_DISPLAY,
- MapTemplateDisplayFormat(
- GetInt16Property(sPropertyFileFormat, rPropSet)));
- ExportElement(XML_TEMPLATE_NAME, sPresentation);
- break;
-
- case FIELD_ID_CHAPTER:
- ProcessString(XML_DISPLAY,
- MapChapterDisplayFormat(
- GetInt16Property(sPropertyChapterFormat, rPropSet)));
- // API numbers 0..9, we number 1..10
- ProcessInteger(XML_OUTLINE_LEVEL,
- GetInt8Property(sPropertyLevel, rPropSet) + 1);
- ExportElement(XML_CHAPTER, sPresentation);
- break;
-
- case FIELD_ID_FILE_NAME:
- // all properties are optional
- if (xPropSetInfo->hasPropertyByName(sPropertyFileFormat))
- {
- ProcessString(XML_DISPLAY,
- MapFilenameDisplayFormat(
- GetInt16Property(sPropertyFileFormat, rPropSet)));
- }
- if (xPropSetInfo->hasPropertyByName(sPropertyIsFixed))
- {
- ProcessBoolean(XML_FIXED,
- GetBoolProperty(sPropertyIsFixed, rPropSet),
- sal_False);
- }
- ExportElement(XML_FILE_NAME, sPresentation);
- break;
-
- case FIELD_ID_REFPAGE_SET:
- ProcessBoolean(XML_ACTIVE,
- GetBoolProperty(sPropertyOn, rPropSet), sal_True);
- ProcessInteger(XML_PAGE_ADJUST,
- GetInt16Property(sPropertyOffset, rPropSet), 0);
- DBG_ASSERT(sPresentation.equals(sEmpty),
- "Unexpected presentation page variable field");
- ExportElement(XML_PAGE_VARIABLE_SET);
- break;
-
- case FIELD_ID_REFPAGE_GET:
- ProcessNumberingType(
- GetInt16Property(sPropertyNumberingType, rPropSet));
- ExportElement(XML_PAGE_VARIABLE_GET, sPresentation);
- break;
-
- case FIELD_ID_MACRO:
- ExportMacro( rPropSet, sPresentation );
- break;
-
- case FIELD_ID_REF_SEQUENCE:
- // reference to sequence: format, name, find value (and element)
- // was: if (nSeqNumber != -1) ...
- ProcessString(XML_REFERENCE_FORMAT,
- MapReferenceType(GetInt16Property(
- sPropertyReferenceFieldPart, rPropSet)),
- XML_TEMPLATE);
- ProcessString(XML_REF_NAME,
- MakeSequenceRefName(
- GetInt16Property(sPropertySequenceNumber, rPropSet),
- GetStringProperty(sPropertySourceName, rPropSet) ) );
- ExportElement(
- MapReferenceSource(
- GetInt16Property(sPropertyReferenceFieldSource, rPropSet)),
- sPresentation);
- break;
-
- case FIELD_ID_REF_REFERENCE:
- case FIELD_ID_REF_BOOKMARK:
- // reference to bookmarks, references: format, name (and element)
- ProcessString(XML_REFERENCE_FORMAT,
- MapReferenceType(GetInt16Property(
- sPropertyReferenceFieldPart, rPropSet)),
- XML_TEMPLATE);
- ProcessString(XML_REF_NAME,
- GetStringProperty(sPropertySourceName, rPropSet));
- ExportElement(
- MapReferenceSource(GetInt16Property(
- sPropertyReferenceFieldSource, rPropSet)),
- sPresentation);
- break;
-
- case FIELD_ID_REF_FOOTNOTE:
- case FIELD_ID_REF_ENDNOTE:
- // reference to end-/footnote: format, generate name, (and element)
- ProcessString(XML_REFERENCE_FORMAT,
- MapReferenceType(GetInt16Property(
- sPropertyReferenceFieldPart, rPropSet)),
- XML_TEMPLATE);
- ProcessString(XML_REF_NAME,
- MakeFootnoteRefName(GetInt16Property(
- sPropertySequenceNumber, rPropSet)));
- ExportElement(
- MapReferenceSource(GetInt16Property(
- sPropertyReferenceFieldSource, rPropSet)),
- sPresentation);
- break;
-
- case FIELD_ID_DDE:
- // name from field master
- ProcessString(XML_CONNECTION_NAME,
-
- GetStringProperty(sPropertyName,
- GetMasterPropertySet(rTextField)));
- ExportElement(XML_DDE_CONNECTION, sPresentation);
- break;
-
- case FIELD_ID_SHEET_NAME:
- // name of spreadsheet (Calc only)
- ExportElement(XML_SHEET_NAME, sPresentation);
- break;
-
- case FIELD_ID_URL:
- {
- // this field is a special case because it gets mapped onto a
- // hyperlink, rather than one of the regular text field.
- ProcessString(XML_HREF, GetExport().GetRelativeReference(GetStringProperty(sPropertyURL, rPropSet)),
- sal_True, XML_NAMESPACE_XLINK);
- ProcessString(XML_TARGET_FRAME_NAME,
- GetStringProperty(sPropertyTargetFrame,rPropSet),
- sal_True, XML_NAMESPACE_OFFICE);
- SvXMLElementExport aUrlField(rExport, XML_NAMESPACE_TEXT, XML_A,
- sal_False, sal_False);
- GetExport().Characters(sPresentation);
- break;
- }
-
- case FIELD_ID_BIBLIOGRAPHY:
- {
- ProcessBibliographyData(rPropSet);
- ExportElement(XML_BIBLIOGRAPHY_MARK, sPresentation);
- break;
- }
-
- case FIELD_ID_SCRIPT:
- ProcessString(XML_LANGUAGE,
- GetStringProperty(sPropertyScriptType, rPropSet),
- sal_True, XML_NAMESPACE_SCRIPT);
- DBG_ASSERT(sPresentation.equals(sEmpty),
- "Unexpected presentation for script field");
- if (GetBoolProperty(sPropertyURLContent, rPropSet))
- {
- ProcessString(XML_HREF,
- GetExport().GetRelativeReference(GetStringProperty(sPropertyContent, rPropSet)),
- sal_False, XML_NAMESPACE_XLINK);
- ExportElement(XML_SCRIPT);
- }
- else
- {
- ExportElement(XML_SCRIPT,
- GetStringProperty(sPropertyContent, rPropSet));
- }
- break;
-
- case FIELD_ID_ANNOTATION:
- {
- // author
- ProcessString(XML_AUTHOR,
- GetStringProperty(sPropertyAuthor, rPropSet),
- sal_True, XML_NAMESPACE_OFFICE);
-
- // date time
- ProcessDate(XML_CREATE_DATE,
- GetDateProperty(sPropertyDate, rPropSet),
- XML_NAMESPACE_OFFICE);
-
- // check for empty presentation (just in case)
- DBG_ASSERT(sPresentation.equals(sEmpty),
- "Unexpected presentation for annotation field");
-
- // annotation element + content
- SvXMLElementExport aElem(GetExport(), XML_NAMESPACE_OFFICE,
- XML_ANNOTATION, sal_False, sal_True);
- ProcessParagraphSequence(GetStringProperty(sPropertyContent,rPropSet));
- break;
- }
-
- case FIELD_ID_COMBINED_CHARACTERS:
- {
- // The style with the combined characters attribute has
- // already been handled in the ExportField method. So all that
- // is left to do now is to exprot the characters.
- GetExport().Characters(sPresentation);
- break;
- }
-
- case FIELD_ID_MEASURE:
- {
- ProcessString(XML_KIND, MapMeasureKind(GetInt16Property(sPropertyMeasureKind, rPropSet)));
- ExportElement( XML_MEASURE, sPresentation );
- break;
- }
-
- case FIELD_ID_TABLE_FORMULA:
- ProcessString( XML_FORMULA,
- GetStringProperty(sPropertyContent, rPropSet) );
- ProcessDisplay( sal_True,
- GetBoolProperty(sPropertyIsShowFormula, rPropSet),
- sal_True );
- ProcessValueAndType( sal_False,
- GetIntProperty(sPropertyNumberFormat, rPropSet),
- sEmpty, sEmpty, 0.0f,
- sal_False, sal_False, sal_True,
- sal_False, sal_False );
- ExportElement( XML_TABLE_FORMULA, sPresentation );
- break;
-
- case FIELD_ID_DROP_DOWN:
- {
- ProcessString(XML_NAME, GetStringProperty(sPropertyName, rPropSet));
- SvXMLElementExport aElem( GetExport(),
- XML_NAMESPACE_TEXT, XML_DROPDOWN,
- sal_False, sal_False );
- ProcessStringSequence(
- GetStringSequenceProperty( sPropertyItems, rPropSet ),
- GetStringProperty( sPropertySelectedItem, rPropSet ) );
- GetExport().Characters( sPresentation );
- }
- break;
-
- case FIELD_ID_UNKNOWN:
- default:
- DBG_ERROR("unkown field type encountered!");
- // always export content
- GetExport().Characters(sPresentation);
- }
-}
-
-
-/// export field declarations / field masters
-void XMLTextFieldExport::ExportFieldDeclarations()
-{
- Reference<XText> xEmptyText;
- ExportFieldDeclarations(xEmptyText);
-}
-
-/// export field declarations / field masters
-void XMLTextFieldExport::ExportFieldDeclarations(
- const Reference<XText> & rText )
-{
- // store lists for decl elements
- vector<OUString> aVarName;
- vector<OUString> aUserName;
- vector<OUString> aSeqName;
- vector<OUString> aDdeName;
-
- // get text fields supplier and field master name access
- Reference<XTextFieldsSupplier> xTextFieldsSupp(GetExport().GetModel(),
- UNO_QUERY);
- if( !xTextFieldsSupp.is() )
- return;
-
- Reference<container::XNameAccess> xFieldMasterNameAccess(
- xTextFieldsSupp->getTextFieldMasters(), UNO_QUERY);
-
- // where to get the text field masters from?
- // a) we get a specific XText: then use pUsedMasters
- // b) the XText is empty: then export all text fields
- Sequence<OUString> aFieldMasters;
- if (rText.is())
- {
- // export only used masters
- DBG_ASSERT(NULL != pUsedMasters,
- "field masters must be recorded in order to be "
- "written out separatly" );
- if (NULL != pUsedMasters)
- {
- map<Reference<XText>, set<OUString> > ::iterator aMapIter =
- pUsedMasters->find(rText);
- if (aMapIter != pUsedMasters->end())
- {
- // found the set of used field masters
- set<OUString> & rOurMasters = aMapIter->second;
-
- // copy set to sequence
- aFieldMasters.realloc( rOurMasters.size() );
- sal_Int32 i = 0;
- for( set<OUString>::iterator aSetIter = rOurMasters.begin();
- aSetIter != rOurMasters.end();
- aSetIter++, i++ )
- {
- aFieldMasters[i] = *aSetIter;
- }
-
- pUsedMasters->erase(rText);
- }
- // else: XText not found -> ignore
- }
- // else: no field masters have been recorded -> ignore
- }
- else
- {
- // no XText: export all!
- aFieldMasters = xFieldMasterNameAccess->getElementNames();
- }
-
- for(sal_Int32 i=0; i<aFieldMasters.getLength(); i++) {
-
- // get field master name
- OUString sFieldMaster = aFieldMasters[i];
-
- // workaround for #no-bug#
- static const sal_Char sDB[] =
- "com.sun.star.text.FieldMaster.DataBase.";
- if (0 == sFieldMaster.compareTo( OUString::createFromAscii(sDB),
- sizeof(sDB)-1))
- {
- break;
- }
-
-
- OUString sFieldMasterType;
- OUString sVarName;
- ExplodeFieldMasterName(sFieldMaster, sFieldMasterType, sVarName);
-
- // get XPropertySet of this field master
- Reference<XPropertySet> xPropSet;
- Any aAny = xFieldMasterNameAccess->getByName(sFieldMaster);
- aAny >>= xPropSet;
-
- // save interesting field masters
- if (0 == sFieldMasterType.compareToAscii(FIELD_SERVICE_SETEXP))
- {
- sal_Int32 nType = GetIntProperty(sPropertySubType, xPropSet);
-
- // sequence or variable?
- if ( SetVariableType::SEQUENCE == nType )
- {
- aSeqName.push_back( sFieldMaster );
- }
- else
- {
- aVarName.push_back( sFieldMaster );
- }
- }
- else if (0 == sFieldMasterType.compareToAscii(FIELD_SERVICE_USER))
- {
- aUserName.push_back( sFieldMaster );
- }
- else if (0 == sFieldMasterType.compareToAscii(FIELD_SERVICE_DDE))
- {
- aDdeName.push_back( sFieldMaster );
- }
- else
- {
- ; // ignore
- }
- }
-
- // now process fields:
-
- // variable field masters:
- if (aVarName.size() > 0)
- {
- SvXMLElementExport aElem( GetExport(),
- XML_NAMESPACE_TEXT,
- XML_VARIABLE_DECLS,
- sal_True, sal_True );
-
- for (vector<OUString>::iterator aVarIter = aVarName.begin();
- aVarIter != aVarName.end();
- aVarIter++) {
-
- OUString sName = *aVarIter;
-
- // get field master property set
- Reference<XPropertySet> xPropSet;
- Any aAny = xFieldMasterNameAccess->getByName(sName);
- aAny >>= xPropSet;
-
- // field name and type
- OUString sFieldMasterType;
- OUString sVarName;
- ExplodeFieldMasterName(sName, sFieldMasterType, sVarName);
-
- // determine string/numeric field
- sal_Bool bIsString = ( GetIntProperty(sPropertySubType, xPropSet)
- == SetVariableType::STRING );
-
- // get dependent field property set
- Reference<XPropertySet> xFieldPropSet;
- if (GetDependentFieldPropertySet(xPropSet, xFieldPropSet))
- {
- // process value and type.
- ProcessValueAndType(
- bIsString,
- GetIntProperty(sPropertyNumberFormat, xFieldPropSet),
- sEmpty, sEmpty, 0.0,
- sal_False, sal_True, sal_False, sal_False);
- }
- else
- {
- // If no dependent field is found, only string and
- // float types can be supported
-
- // number format: 0 is default number format for 1st
- // language. should be: getDefaultNumberFormat(Locale)
- // from NumberFormats
- ProcessValueAndType(
- bIsString,
- 0, sEmpty, sEmpty, 0.0,
- sal_False, sal_True, sal_False, sal_False);
- }
-
- ProcessString(XML_NAME, sVarName);
- ExportElement(XML_VARIABLE_DECL, sal_True);
- }
- }
- // else: no declarations element
-
- // sequence field masters:
- if (aSeqName.size() > 0)
- {
- SvXMLElementExport aElem( GetExport(),
- XML_NAMESPACE_TEXT,
- XML_SEQUENCE_DECLS,
- sal_True, sal_True );
-
- for (vector<OUString>::iterator aSeqIter = aSeqName.begin();
- aSeqIter != aSeqName.end();
- aSeqIter++) {
-
- OUString sName = *aSeqIter;
-
- // get field master property set
- Reference<XPropertySet> xPropSet;
- Any aAny = xFieldMasterNameAccess->getByName(sName);
- aAny >>= xPropSet;
-
- // field name and type
- OUString sFieldMasterType;
- OUString sVarName;
- ExplodeFieldMasterName(sName, sFieldMasterType, sVarName);
-
- // outline level
- sal_Int32 nLevel = 1 + GetIntProperty(
- sPropertyChapterNumberingLevel, xPropSet);
- DBG_ASSERT(nLevel >= 0, "illegal outline level");
- DBG_ASSERT(nLevel < 127, "possible illegal outline level");
- ProcessInteger(XML_DISPLAY_OUTLINE_LEVEL, nLevel);
-
- // separation character
- if (nLevel > 0) {
- ProcessString(XML_SEPARATION_CHARACTER, GetStringProperty(
- sPropertyNumberingSeparator, xPropSet));
- }
- ProcessString(XML_NAME, sVarName);
- ExportElement(XML_SEQUENCE_DECL, sal_True);
- }
- }
- // else: no declarations element
-
- // user field field masters:
- if (aUserName.size() > 0)
- {
- SvXMLElementExport aElem( GetExport(),
- XML_NAMESPACE_TEXT,
- XML_USER_FIELD_DECLS,
- sal_True, sal_True );
-
- for (vector<OUString>::iterator aUserIter = aUserName.begin();
- aUserIter != aUserName.end();
- aUserIter++) {
-
- OUString sName = *aUserIter;
-
- // get field master property set
- Reference<XPropertySet> xPropSet;
- Any aAny = xFieldMasterNameAccess->getByName(sName);
- aAny >>= xPropSet;
-
- // field name and type
- OUString sFieldMasterType;
- OUString sVarName;
- ExplodeFieldMasterName(sName, sFieldMasterType, sVarName);
-
- if (GetBoolProperty(sPropertyIsExpression, xPropSet))
- {
- // expression:
- ProcessValueAndType(
- sal_False,
- 0, sEmpty, sEmpty,
- GetDoubleProperty(sPropertyValue, xPropSet),
- sal_True,
- sal_True,
- sal_False,
- sal_False);
- }
- else
- {
- // string: write regardless of default
- ProcessString(XML_VALUE_TYPE, XML_STRING);
- ProcessString(XML_STRING_VALUE,
- GetStringProperty(sPropertyContent, xPropSet));
- }
- ProcessString(XML_NAME, sVarName);
- ExportElement(XML_USER_FIELD_DECL, sal_True);
- }
- }
- // else: no declarations element
-
- // DDE field field masters:
- if (aDdeName.size() > 0)
- {
- SvXMLElementExport aElem( GetExport(),
- XML_NAMESPACE_TEXT,
- XML_DDE_CONNECTION_DECLS,
- sal_True, sal_True );
-
- for (vector<OUString>::iterator aDdeIter = aDdeName.begin();
- aDdeIter != aDdeName.end();
- aDdeIter++)
- {
- OUString sName = *aDdeIter;
-
- // get field master property set
- Reference<XPropertySet> xPropSet;
- Any aAny = xFieldMasterNameAccess->getByName(sName);
- aAny >>= xPropSet;
-
- // check if this connection is being used by a field
- Reference<XPropertySet> xDummy;
- if (GetDependentFieldPropertySet(xPropSet, xDummy))
- {
-
- ProcessString(XML_NAME,
- GetStringProperty(sPropertyName, xPropSet));
-
- // export elements; can't use ProcessString because
- // elements are in office namespace
- ProcessString(XML_DDE_APPLICATION,
- GetStringProperty(sPropertyDDECommandType,
- xPropSet),
- sal_False, XML_NAMESPACE_OFFICE);
- ProcessString(XML_DDE_TOPIC,
- GetStringProperty(sPropertyDDECommandFile,
- xPropSet),
- sal_False, XML_NAMESPACE_OFFICE);
- ProcessString(XML_DDE_ITEM,
- GetStringProperty(sPropertyDDECommandElement,
- xPropSet),
- sal_False, XML_NAMESPACE_OFFICE);
- sal_Bool bIsAutomaticUpdate = GetBoolProperty(
- sPropertyIsAutomaticUpdate, xPropSet);
- if (bIsAutomaticUpdate)
- {
- GetExport().AddAttribute(XML_NAMESPACE_OFFICE,
- XML_AUTOMATIC_UPDATE,
- XML_TRUE);
- }
-
- ExportElement(XML_DDE_CONNECTION_DECL, sal_True);
- }
- // else: no dependent field -> no export of field declaration
- }
- }
- // else: no declarations element
-}
-
-void XMLTextFieldExport::SetExportOnlyUsedFieldDeclarations(
- sal_Bool bExportOnlyUsed)
-{
- delete pUsedMasters;
- pUsedMasters = NULL;
-
- // create used masters set (if none is used)
- if (bExportOnlyUsed)
- pUsedMasters = new map<Reference<XText>, set<OUString> > ;
-}
-
-void XMLTextFieldExport::ExportElement(enum XMLTokenEnum eElementName,
- sal_Bool bAddSpace)
-{
- // can't call ExportElement(eElementName, const OUString&) with empty
- // string because xmlprinter only uses empty tags if no content
- // (not even empty content) was written.
-
- DBG_ASSERT(XML_TOKEN_INVALID != eElementName, "invalid element name!");
- if (XML_TOKEN_INVALID != eElementName)
- {
- // Element
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT,
- eElementName, bAddSpace, bAddSpace );
- } // else: ignore
-}
-
-void XMLTextFieldExport::ExportElement(enum XMLTokenEnum eElementName,
- const OUString& sContent,
- sal_Bool bAddSpace)
-{
- DBG_ASSERT(eElementName != XML_TOKEN_INVALID, "invalid element name!");
- if (eElementName != XML_TOKEN_INVALID)
- {
- // Element
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT,
- eElementName, bAddSpace, bAddSpace );
- // export content
- GetExport().Characters(sContent);
- } else {
- // always export content
- GetExport().Characters(sContent);
- }
-}
-
-void XMLTextFieldExport::ExportMacro(
- const Reference<XPropertySet> & rPropSet,
- const OUString& rContent )
-{
- // some strings we'll need
- OUString sEventType( RTL_CONSTASCII_USTRINGPARAM( "EventType" ));
- OUString sStarBasic( RTL_CONSTASCII_USTRINGPARAM( "StarBasic" ));
- OUString sLibrary( RTL_CONSTASCII_USTRINGPARAM( "Library" ));
- OUString sMacroName( RTL_CONSTASCII_USTRINGPARAM( "MacroName" ));
- OUString sOnClick( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ));
- OUString sPropertyMacroLibrary( RTL_CONSTASCII_USTRINGPARAM( "MacroLibrary" ));
- OUString sPropertyMacroName( RTL_CONSTASCII_USTRINGPARAM( "MacroName" ));
-
-
- // the description attribute
- ProcessString(XML_DESCRIPTION,
- GetStringProperty(sPropertyHint, rPropSet),
- rContent);
-
- // the element
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT,
- XML_EXECUTE_MACRO, sal_False, sal_False );
-
- // the <office:events>-macro:
-
- // 1) build sequence of PropertyValues
- Sequence<PropertyValue> aSeq(3);
- PropertyValue* pArr = aSeq.getArray();
- pArr[0].Name = sEventType;
- pArr[0].Value <<= sStarBasic;
- pArr[1].Name = sLibrary;
- pArr[1].Value = rPropSet->getPropertyValue( sPropertyMacroLibrary );
- pArr[2].Name = sMacroName;
- pArr[2].Value = rPropSet->getPropertyValue( sPropertyMacroName );
-
- // 2) export the sequence
- GetExport().GetEventExport().ExportSingleEvent( aSeq, sOnClick, sal_False );
-
- // and finally, the field presentation
- GetExport().Characters(rContent);
-}
-
-/// export all data-style related attributes
-void XMLTextFieldExport::ProcessValueAndType(
- sal_Bool bIsString, /// do we process a string or a number?
- sal_Int32 nFormatKey, /// format key for NumberFormatter; inv. if string
- const OUString& sContent, /// string content; possibly invalid
- const OUString& sDefault, /// default string
- double fValue, /// float content; possibly invalid
- sal_Bool bExportValue, /// export value attribute?
- sal_Bool bExportValueType, /// export value-type attribute?
- sal_Bool bExportStyle, /// export style-sttribute?
- sal_Bool bForceSystemLanguage, /// export language attributes?
- sal_Bool bTimeStyle) // exporting a time style?
-{
- // String or number?
- if (bIsString)
- {
-
- // string: attributes value-type=string, string-value=...
-
- if (bExportValue || bExportValueType)
- {
- XMLNumberFormatAttributesExportHelper::SetNumberFormatAttributes(
- GetExport(), sContent, sDefault, XML_NAMESPACE_TEXT,
- bExportValue);
- }
-
- }
- else
- {
-
- // number: value-type=..., value...=..., data-style-name=...
-
- DBG_ASSERT(bExportValueType || ~bExportValue,
- "value w/o value type not supported!");
-
- // take care of illegal formats
- // (shouldn't happen, but does if document is corrupted)
- if (-1 != nFormatKey)
- {
- if (bExportValue || bExportValueType)
- {
- XMLNumberFormatAttributesExportHelper::
- SetNumberFormatAttributes(
- GetExport(), nFormatKey, fValue, XML_NAMESPACE_TEXT,
- bExportValue);
- }
-
- if (bExportStyle)
- {
- // don't export language (if desired)
- if( bForceSystemLanguage )
- nFormatKey =
- GetExport().dataStyleForceSystemLanguage( nFormatKey );
-
- OUString sDataStyleName =
- GetExport().getDataStyleName(nFormatKey, bTimeStyle);
- if( sDataStyleName.getLength() > 0 )
- {
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_DATA_STYLE_NAME,
- sDataStyleName );
- } // else: ignore (no valid number format)
- } // else: ignore (no number format)
- }
- }
-}
-
-
-
-/// process display related properties
-void XMLTextFieldExport::ProcessDisplay(sal_Bool bIsVisible,
- sal_Bool bIsCommand,
- sal_Bool bValueDefault)
-{
- enum XMLTokenEnum eValue;
-
- if (bIsVisible)
- {
- eValue = bIsCommand ? XML_FORMULA : XML_VALUE;
- }
- else
- {
- eValue = XML_NONE;
- }
-
- // omit attribute if default
- if (!bValueDefault || (eValue != XML_VALUE))
- {
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_DISPLAY, eValue);
- }
-}
-
-
-
-/// export boolean property
-void XMLTextFieldExport::ProcessBoolean(enum XMLTokenEnum eName,
- sal_Bool bBool, sal_Bool bDefault)
-{
- DBG_ASSERT( eName != XML_TOKEN_INVALID, "invalid element token");
- if ( XML_TOKEN_INVALID == eName )
- return;
-
- // write attribute (if different than default)
- // negate to force 0/1 values (and make sal_Bool comparable)
- if ((!bBool) != (!bDefault)) {
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, eName,
- (bBool ? XML_TRUE : XML_FALSE) );
- }
-}
-
-
-
-
-/// export string attribute
-void XMLTextFieldExport::ProcessString(enum XMLTokenEnum eName,
- const OUString& sValue,
- sal_Bool bOmitEmpty,
- sal_uInt16 nPrefix)
-{
- DBG_ASSERT( eName != XML_TOKEN_INVALID, "invalid element token");
- if ( XML_TOKEN_INVALID == eName )
- return;
-
- // check for empty string, if applicable
- if ( bOmitEmpty && (sValue.getLength()==0) )
- return;
-
- // write attribute
- GetExport().AddAttribute(nPrefix, eName, sValue);
-}
-
-/// export a string attribute
-void XMLTextFieldExport::ProcessString(enum XMLTokenEnum eName,
- const ::rtl::OUString& sValue,
- const ::rtl::OUString& sDefault,
- sal_uInt16 nPrefix)
-{
- if (sValue != sDefault)
- {
- ProcessString(eName, sValue, sal_False, nPrefix);
- }
-}
-
-
-/// export string attribute
-void XMLTextFieldExport::ProcessString(
- enum XMLTokenEnum eName,
- enum XMLTokenEnum eValue,
- sal_Bool bOmitEmpty,
- sal_uInt16 nPrefix)
-{
- DBG_ASSERT( eName != XML_TOKEN_INVALID, "invalid element token" );
- DBG_ASSERT( bOmitEmpty || (eValue != XML_TOKEN_INVALID),
- "invalid value token" );
- if ( XML_TOKEN_INVALID == eName )
- return;
-
- // check for empty string, if applicable
- if (bOmitEmpty && (eValue == XML_TOKEN_INVALID))
- return;
-
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, eName, eValue);
-}
-
-/// export a string attribute
-void XMLTextFieldExport::ProcessString(
- enum XMLTokenEnum eName,
- enum XMLTokenEnum eValue,
- enum XMLTokenEnum eDefault,
- sal_uInt16 nPrefix)
-{
- if ( eValue != eDefault )
- ProcessString( eName, eValue, sal_False, nPrefix);
-}
-
-
-/// export a string as a sequence of paragraphs
-void XMLTextFieldExport::ProcessParagraphSequence(
- const ::rtl::OUString& sParagraphSequence)
-{
- // iterate over all string-pieces separated by return (0x0a) and
- // put each inside a paragraph element.
- SvXMLTokenEnumerator aEnumerator(sParagraphSequence, sal_Char(0x0a));
- OUString aSubString;
- while (aEnumerator.getNextToken(aSubString))
- {
- SvXMLElementExport aParagraph(
- GetExport(), XML_NAMESPACE_TEXT, XML_P, sal_True, sal_False);
- GetExport().Characters(aSubString);
- }
-}
-
-// export an integer attribute
-void XMLTextFieldExport::ProcessInteger(enum XMLTokenEnum eName,
- sal_Int32 nNum)
-{
- DBG_ASSERT( eName != XML_TOKEN_INVALID, "invalid element token");
- if ( XML_TOKEN_INVALID == eName )
- return;
-
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, eName,
- OUString::valueOf(nNum));
-}
-
-/// export an integer attribute, omit if default
-void XMLTextFieldExport::ProcessInteger(enum XMLTokenEnum eName,
- sal_Int32 nNum, sal_Int32 nDefault)
-{
- if (nNum != nDefault)
- ProcessInteger(eName, nNum);
-}
-
-
-
-/// export a numbering type
-void XMLTextFieldExport::ProcessNumberingType(sal_Int16 nNumberingType)
-{
- // process only if real format (not: like page descriptor)
- if (NumberingType::PAGE_DESCRIPTOR != nNumberingType)
- {
- OUStringBuffer sTmp( 10 );
- // number type: num format
- GetExport().GetMM100UnitConverter().convertNumFormat( sTmp,
- nNumberingType );
- GetExport().AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_FORMAT,
- sTmp.makeStringAndClear() );
- // and letter sync, if applicable
- GetExport().GetMM100UnitConverter().convertNumLetterSync( sTmp,
- nNumberingType );
-
- if (sTmp.getLength())
- {
- GetExport().AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_LETTER_SYNC,
- sTmp.makeStringAndClear() );
- }
- }
- // else: like page descriptor => ignore
-}
-
-
-/// export a date, time, or duration
-void XMLTextFieldExport::ProcessDateTime(enum XMLTokenEnum eName,
- double dValue,
- sal_Bool bIsDate,
- sal_Bool bIsDuration,
- sal_Bool bOmitDurationIfZero,
- sal_uInt16 nPrefix)
-{
- // truncate for date granularity
- if (bIsDate)
- {
- dValue = ::rtl::math::approxFloor(dValue);
- }
-
- OUStringBuffer aBuffer;
- if (bIsDuration)
- {
- // date/time durationM handle bOmitDurationIfZero
- if (!bOmitDurationIfZero || !::rtl::math::approxEqual(dValue, 0.0))
- {
- rExport.GetMM100UnitConverter().convertTime(aBuffer, dValue);
- }
- }
- else
- {
- // date/time value
- rExport.GetMM100UnitConverter().convertDateTime(aBuffer, dValue);
- }
-
- // output attribute
- ProcessString(eName, aBuffer.makeStringAndClear(), sal_True, nPrefix);
-}
-
-/// export a date or time
-void XMLTextFieldExport::ProcessDateTime(enum XMLTokenEnum eName,
- const DateTime& rTime,
- sal_Bool bIsDate,
- sal_uInt16 nPrefix)
-{
- OUStringBuffer aBuffer;
-
- DateTime aDateTime(rTime);
-
- // truncate dates
- if(bIsDate)
- {
- aDateTime.HundredthSeconds = 0;
- aDateTime.Seconds = 0;
- aDateTime.Minutes = 0;
- aDateTime.Hours = 0;
- }
-
- // date/time value
- rExport.GetMM100UnitConverter().convertDateTime(aBuffer, aDateTime);
-
- // output attribute
- ProcessString(eName, aBuffer.makeStringAndClear(), sal_True, nPrefix);
-}
-
-/// export date according to ISO 8601
-void XMLTextFieldExport::ProcessDate(
- enum XMLTokenEnum eName,
- const ::com::sun::star::util::Date& rDate,
- sal_uInt16 nPrefix)
-{
- // the easiest way: delegate to ProcessDateTime (as date)
- DateTime aDateTime;
- aDateTime.Day = rDate.Day;
- aDateTime.Month = rDate.Month;
- aDateTime.Year = rDate.Year;
- ProcessDateTime(eName, aDateTime, sal_True, nPrefix);
-}
-
-
-/// export a date, time, or duration
-void XMLTextFieldExport::ProcessDateTime(enum XMLTokenEnum eName,
- sal_Int32 nMinutes,
- sal_Bool bIsDate,
- sal_Bool bIsDuration,
- sal_Bool bOmitDurationIfZero,
- sal_uInt16 nPrefix)
-{
- // handle bOmitDurationIfZero here, because we can precisely compare ints
- if (!(bIsDuration && bOmitDurationIfZero && (nMinutes==0)))
- {
- ProcessDateTime(eName, (double)nMinutes / (double)(24*60),
- bIsDate, bIsDuration, bOmitDurationIfZero, nPrefix);
- }
-}
-
-
-SvXMLEnumMapEntry __READONLY_DATA aBibliographyDataTypeMap[] =
-{
- { XML_ARTICLE, BibliographyDataType::ARTICLE },
- { XML_BOOK, BibliographyDataType::BOOK },
- { XML_BOOKLET, BibliographyDataType::BOOKLET },
- { XML_CONFERENCE, BibliographyDataType::CONFERENCE },
- { XML_CUSTOM1, BibliographyDataType::CUSTOM1 },
- { XML_CUSTOM2, BibliographyDataType::CUSTOM2 },
- { XML_CUSTOM3, BibliographyDataType::CUSTOM3 },
- { XML_CUSTOM4, BibliographyDataType::CUSTOM4 },
- { XML_CUSTOM5, BibliographyDataType::CUSTOM5 },
- { XML_EMAIL, BibliographyDataType::EMAIL },
- { XML_INBOOK, BibliographyDataType::INBOOK },
- { XML_INCOLLECTION, BibliographyDataType::INCOLLECTION },
- { XML_INPROCEEDINGS, BibliographyDataType::INPROCEEDINGS },
- { XML_JOURNAL, BibliographyDataType::JOURNAL },
- { XML_MANUAL, BibliographyDataType::MANUAL },
- { XML_MASTERSTHESIS, BibliographyDataType::MASTERSTHESIS },
- { XML_MISC, BibliographyDataType::MISC },
- { XML_PHDTHESIS, BibliographyDataType::PHDTHESIS },
- { XML_PROCEEDINGS, BibliographyDataType::PROCEEDINGS },
- { XML_TECHREPORT, BibliographyDataType::TECHREPORT },
- { XML_UNPUBLISHED, BibliographyDataType::UNPUBLISHED },
- { XML_WWW, BibliographyDataType::WWW },
- { XML_TOKEN_INVALID, 0 }
-};
-
-
-
-void XMLTextFieldExport::ProcessBibliographyData(
- const Reference<XPropertySet>& rPropSet)
-{
- // get the values
- Any aAny = rPropSet->getPropertyValue(sPropertyFields);
- Sequence<PropertyValue> aValues;
- aAny >>= aValues;
-
- // one attribute per value (unless empty)
- sal_Int32 nLength = aValues.getLength();
- for (sal_Int32 i = 0; i < nLength; i++)
- {
- if (aValues[i].Name.equalsAsciiL("BibiliographicType",
- sizeof("BibiliographicType")-1))
- {
- sal_Int16 nTypeId;
- aValues[i].Value >>= nTypeId;
- OUStringBuffer sBuf;
-
- if (SvXMLUnitConverter::convertEnum(sBuf, nTypeId,
- aBibliographyDataTypeMap))
- {
- rExport.AddAttribute(XML_NAMESPACE_TEXT,
- XML_BIBLIOGRAPHY_TYPE,
- sBuf.makeStringAndClear());
- }
- // else: ignore this argument
- }
- else
- {
- OUString sStr;
- aValues[i].Value >>= sStr;
-
- if (sStr.getLength() > 0)
- {
- rExport.AddAttribute(XML_NAMESPACE_TEXT,
- MapBibliographyFieldName(aValues[i].Name),
- sStr);
- }
- }
- }
-}
-
-/// export CommandTypeAttribute
-void XMLTextFieldExport::ProcessCommandType(
- sal_Int32 nCommandType)
-{
- enum XMLTokenEnum eToken = XML_TOKEN_INVALID;
- switch( nCommandType )
- {
- case sdb::CommandType::TABLE: eToken = XML_TABLE; break;
- case sdb::CommandType::QUERY: eToken = XML_QUERY; break;
- case sdb::CommandType::COMMAND: eToken = XML_COMMAND; break;
- }
-
- if( eToken != XML_TOKEN_INVALID )
- rExport.AddAttribute( XML_NAMESPACE_TEXT, XML_TABLE_TYPE, eToken );
-}
-
-
-void XMLTextFieldExport::ProcessStringSequence(
- const Sequence<OUString>& rSequence,
- const OUString sSelected )
-{
- // find selected element
- sal_Int32 nSelected = -1;
- sal_Int32 nLength = rSequence.getLength();
- const OUString* pSequence = rSequence.getConstArray();
- for( sal_Int32 i = 0; i < nLength; i++ )
- {
- if( pSequence[i] == sSelected )
- nSelected = i;
- }
-
- // delegate to ProcessStringSequence(OUString,sal_Int32)
- ProcessStringSequence( rSequence, nSelected );
-}
-
-void XMLTextFieldExport::ProcessStringSequence(
- const Sequence<OUString>& rSequence,
- sal_Int32 nSelected )
-{
- sal_Int32 nLength = rSequence.getLength();
- const OUString* pSequence = rSequence.getConstArray();
- for( sal_Int32 i = 0; i < nLength; i++ )
- {
- if( i == nSelected )
- rExport.AddAttribute( XML_NAMESPACE_TEXT,
- XML_CURRENT_SELECTED, XML_TRUE );
- rExport.AddAttribute( XML_NAMESPACE_TEXT, XML_VALUE, pSequence[i] );
- SvXMLElementExport aElement( rExport, XML_NAMESPACE_TEXT, XML_LABEL,
- sal_False, sal_False );
- }
-}
-
-
-
-// explode a field master name into field type and field name
-sal_Bool XMLTextFieldExport::ExplodeFieldMasterName(
- const OUString& sMasterName, OUString& sFieldType, OUString& sVarName)
-{
- sal_Int32 nLength = sFieldMasterPrefix.getLength();
- sal_Int32 nSeparator = sMasterName.indexOf('.', nLength);
- sal_Bool bReturn = sal_True;
-
-#ifdef DBG_UTIL
- // check for service name
- bReturn &= (0 == sFieldMasterPrefix.compareTo(sMasterName, nLength));
-#endif
-
- // '.' found?
- if (nSeparator <= nLength) {
- nSeparator = sMasterName.getLength();
- DBG_WARNING("no field var name!");
- bReturn = sal_False;
- }
- else
- {
- sFieldType = sMasterName.copy(nLength, nSeparator-nLength);
- sVarName = sMasterName.copy(nSeparator+1);
- }
-
- return bReturn;
-}
-
-
-// for XDependentTextFields, get PropertySet of FieldMaster
-Reference<XPropertySet> XMLTextFieldExport::GetMasterPropertySet(
- const Reference<XTextField> & rTextField)
-{
- // name, value => get Property set of TextFieldMaster
- Reference<XDependentTextField> xDep(rTextField, UNO_QUERY);
- return xDep->getTextFieldMaster();
-}
-
-// get PropertySet of (any; the first) dependent field
-sal_Bool XMLTextFieldExport::GetDependentFieldPropertySet(
- const Reference<XPropertySet> & xMaster,
- Reference<XPropertySet> & xField)
-{
- Any aAny;
- Sequence<Reference<XDependentTextField> > aFields;
- aAny = xMaster->getPropertyValue(sPropertyDependentTextFields);
- aAny >>= aFields;
-
- // any fields?
- if (aFields.getLength() > 0)
- {
- // get first one and return
- Reference<XDependentTextField> xTField = aFields[0];
- xField = Reference<XPropertySet>(xTField, UNO_QUERY);
- DBG_ASSERT(xField.is(),
- "Surprisinlgy, this TextField refuses to be a PropertySet!");
- return sal_True;
- }
- else
- {
- return sal_False;
- }
-}
-
-
-/// map placeholder type
-enum XMLTokenEnum XMLTextFieldExport::MapPlaceholderType(sal_uInt16 nType)
-{
- enum XMLTokenEnum eType = XML_TEXT;
-
- switch (nType)
- {
- case PlaceholderType::TEXT:
- eType = XML_TEXT;
- break;
-
- case PlaceholderType::TABLE:
- eType = XML_TABLE;
- break;
-
- case PlaceholderType::TEXTFRAME:
- eType = XML_TEXT_BOX;
- break;
-
- case PlaceholderType::GRAPHIC:
- eType = XML_IMAGE;
- break;
-
- case PlaceholderType::OBJECT:
- eType = XML_OBJECT;
- break;
-
- default:
- // unkown placeholder: XML_TEXT
- DBG_ERROR("unkown placeholder type");
- }
-
- return eType;
-}
-
-
-/// element name for author fields
-enum XMLTokenEnum XMLTextFieldExport::MapAuthorFieldName(
- const Reference<XPropertySet> & xPropSet)
-{
- // Initalen oder voller Name?
- return GetBoolProperty(sPropertyFullName, xPropSet)
- ? XML_AUTHOR_NAME : XML_AUTHOR_INITIALS;
-}
-
-enum XMLTokenEnum XMLTextFieldExport::MapPageNumberName(
- const Reference<XPropertySet> & xPropSet,
- sal_Int32& nOffset)
-{
- enum XMLTokenEnum eName = XML_TOKEN_INVALID;
- PageNumberType ePage;
- Any aAny = xPropSet->getPropertyValue(sPropertySubType);
- ePage = *(PageNumberType*)aAny.getValue();
-
- switch (ePage)
- {
- case PageNumberType_PREV:
- eName = XML_PREVIOUS;
- nOffset += 1;
- break;
- case PageNumberType_CURRENT:
- eName = XML_CURRENT;
- break;
- case PageNumberType_NEXT:
- eName = XML_NEXT;
- nOffset -= 1;
- break;
- default:
- DBG_ERROR("unknown page number type");
- eName = XML_TOKEN_INVALID;
- break;
- }
-
- return eName;
-}
-
-/// map TemplateDisplayFormat to XML
-enum XMLTokenEnum XMLTextFieldExport::MapTemplateDisplayFormat(sal_Int16 nFormat)
-{
- enum XMLTokenEnum eName = XML_TOKEN_INVALID;
-
- switch (nFormat)
- {
- case TemplateDisplayFormat::FULL:
- eName = XML_FULL;
- break;
- case TemplateDisplayFormat::PATH:
- eName = XML_PATH;
- break;
- case TemplateDisplayFormat::NAME:
- eName = XML_NAME;
- break;
- case TemplateDisplayFormat::NAME_AND_EXT:
- eName = XML_NAME_AND_EXTENSION;
- break;
- case TemplateDisplayFormat::AREA:
- eName = XML_AREA;
- break;
- case TemplateDisplayFormat::TITLE:
- eName = XML_TITLE;
- break;
- default:
- DBG_ERROR("unknown template display format");
- eName = XML_TOKEN_INVALID;
- break;
- }
-
- return eName;
-}
-
-/// map count/statistics field token to XML name
-enum XMLTokenEnum XMLTextFieldExport::MapCountFieldName(sal_Int16 nToken)
-{
- enum XMLTokenEnum eElement = XML_TOKEN_INVALID;
-
- switch (nToken)
- {
- case FIELD_ID_COUNT_PAGES:
- eElement = XML_PAGE_COUNT;
- break;
- case FIELD_ID_COUNT_PARAGRAPHS:
- eElement = XML_PARAGRAPH_COUNT;
- break;
- case FIELD_ID_COUNT_WORDS:
- eElement = XML_WORD_COUNT;
- break;
- case FIELD_ID_COUNT_CHARACTERS:
- eElement = XML_CHARACTER_COUNT;
- break;
- case FIELD_ID_COUNT_TABLES:
- eElement = XML_TABLE_COUNT;
- break;
- case FIELD_ID_COUNT_GRAPHICS:
- eElement = XML_IMAGE_COUNT;
- break;
- case FIELD_ID_COUNT_OBJECTS:
- eElement = XML_OBJECT_COUNT;
- break;
- default:
- DBG_ERROR("no count field token");
- eElement = XML_TOKEN_INVALID;
- break;
- }
-
- return eElement;
-}
-
-/// map ChapterDisplayFormat to XML string
-enum XMLTokenEnum XMLTextFieldExport::MapChapterDisplayFormat(sal_Int16 nFormat)
-{
- enum XMLTokenEnum eName = XML_TOKEN_INVALID;
-
- switch (nFormat)
- {
- case ChapterFormat::NAME:
- eName = XML_NAME;
- break;
- case ChapterFormat::NUMBER:
- eName = XML_NUMBER;
- break;
- case ChapterFormat::NAME_NUMBER:
- eName = XML_NUMBER_AND_NAME;
- break;
- case ChapterFormat::NO_PREFIX_SUFFIX:
- eName = XML_PLAIN_NUMBER_AND_NAME;
- break;
- case ChapterFormat::DIGIT:
- eName = XML_PLAIN_NUMBER;
- break;
- default:
- DBG_ERROR("unkown chapter display format");
- eName = XML_TOKEN_INVALID;
- break;
- }
-
- return eName;
-}
-
-
-/// map FilenameDisplayFormat to XML attribute names
-enum XMLTokenEnum XMLTextFieldExport::MapFilenameDisplayFormat(sal_Int16 nFormat)
-{
- enum XMLTokenEnum eName = XML_TOKEN_INVALID;
-
- switch (nFormat)
- {
- case FilenameDisplayFormat::FULL:
- eName = XML_FULL;
- break;
- case FilenameDisplayFormat::PATH:
- eName = XML_PATH;
- break;
- case FilenameDisplayFormat::NAME:
- eName = XML_NAME;
- break;
- case FilenameDisplayFormat::NAME_AND_EXT:
- eName = XML_NAME_AND_EXTENSION;
- break;
- default:
- DBG_ERROR("unknown filename display format");
- }
-
- return eName;
-}
-
-
-/// map ReferenceFieldPart to XML string
-enum XMLTokenEnum XMLTextFieldExport::MapReferenceType(sal_Int16 nType)
-{
- enum XMLTokenEnum eElement = XML_TOKEN_INVALID;
-
- switch (nType)
- {
- case ReferenceFieldPart::PAGE:
- eElement = XML_PAGE;
- break;
- case ReferenceFieldPart::CHAPTER:
- eElement = XML_CHAPTER;
- break;
- case ReferenceFieldPart::TEXT:
- eElement = XML_TEXT;
- break;
- case ReferenceFieldPart::UP_DOWN:
- eElement = XML_DIRECTION;
- break;
- case ReferenceFieldPart::CATEGORY_AND_NUMBER:
- eElement = XML_CATEGORY_AND_VALUE;
- break;
- case ReferenceFieldPart::ONLY_CAPTION:
- eElement = XML_CAPTION;
- break;
- case ReferenceFieldPart::ONLY_SEQUENCE_NUMBER:
- eElement = XML_VALUE;
- break;
- case ReferenceFieldPart::PAGE_DESC:
- // small hack: this value never gets written, because
- // XML_TEMPLATE is default
- eElement = XML_TEMPLATE;
- break;
- default:
- DBG_ERROR("unknown reference type");
- eElement = XML_TEMPLATE;
- break;
- }
-
- return eElement;
-}
-
-/// map ReferenceFieldPart to XML string
-enum XMLTokenEnum XMLTextFieldExport::MapReferenceSource(sal_Int16 nType)
-{
- enum XMLTokenEnum eElement = XML_TOKEN_INVALID;
-
- switch (nType)
- {
- case ReferenceFieldSource::REFERENCE_MARK:
- eElement = XML_REFERENCE_REF;
- break;
- case ReferenceFieldSource::SEQUENCE_FIELD:
- eElement = XML_SEQUENCE_REF;
- break;
- case ReferenceFieldSource::BOOKMARK:
- eElement = XML_BOOKMARK_REF;
- break;
- case ReferenceFieldSource::FOOTNOTE:
- eElement = XML_FOOTNOTE_REF;
- break;
- case ReferenceFieldSource::ENDNOTE:
- eElement = XML_ENDNOTE_REF;
- break;
- default:
- DBG_ERROR("unkown reference source");
- break;
- }
-
- return eElement;
-}
-
-
-/// element name for sender fields
-enum XMLTokenEnum XMLTextFieldExport::MapSenderFieldName(
- const Reference<XPropertySet> & xPropSet)
-{
- enum XMLTokenEnum eName = XML_TOKEN_INVALID;
-
- // sub-field type
- switch (GetInt16Property(sPropertyFieldSubType, xPropSet))
- {
- case UserDataPart::COMPANY :
- eName = XML_SENDER_COMPANY;
- break;
- case UserDataPart::FIRSTNAME :
- eName = XML_SENDER_FIRSTNAME;
- break;
- case UserDataPart::NAME :
- eName = XML_SENDER_LASTNAME;
- break;
- case UserDataPart::SHORTCUT :
- eName = XML_SENDER_INITIALS;
- break;
- case UserDataPart::STREET :
- eName = XML_SENDER_STREET;
- break;
- case UserDataPart::COUNTRY :
- eName = XML_SENDER_COUNTRY;
- break;
- case UserDataPart::ZIP :
- eName = XML_SENDER_POSTAL_CODE;
- break;
- case UserDataPart::CITY :
- eName = XML_SENDER_CITY;
- break;
- case UserDataPart::TITLE :
- eName = XML_SENDER_TITLE;
- break;
- case UserDataPart::POSITION :
- eName = XML_SENDER_POSITION;
- break;
- case UserDataPart::PHONE_PRIVATE :
- eName = XML_SENDER_PHONE_PRIVATE;
- break;
- case UserDataPart::PHONE_COMPANY :
- eName = XML_SENDER_PHONE_WORK;
- break;
- case UserDataPart::FAX :
- eName = XML_SENDER_FAX;
- break;
- case UserDataPart::EMAIL :
- eName = XML_SENDER_EMAIL;
- break;
- case UserDataPart::STATE :
- eName = XML_SENDER_STATE_OR_PROVINCE;
- break;
- default:
- DBG_WARNING("unknown sender type");
- eName = XML_TOKEN_INVALID;
- break;
- }
-
- return eName;
-}
-
-enum XMLTokenEnum XMLTextFieldExport::MapDocInfoFieldName(
- enum FieldIdEnum nToken)
-{
- enum XMLTokenEnum eElement = XML_TOKEN_INVALID;
-
- switch (nToken)
- {
- case FIELD_ID_DOCINFO_CREATION_AUTHOR:
- eElement = XML_INITIAL_CREATOR;
- break;
- case FIELD_ID_DOCINFO_CREATION_DATE:
- eElement = XML_CREATION_DATE;
- break;
- case FIELD_ID_DOCINFO_CREATION_TIME:
- eElement = XML_CREATION_TIME;
- break;
- case FIELD_ID_DOCINFO_DESCRIPTION:
- eElement = XML_DESCRIPTION;
- break;
- case FIELD_ID_DOCINFO_INFORMATION0:
- eElement = XML_USER_INFO_0;
- break;
- case FIELD_ID_DOCINFO_INFORMATION1:
- eElement = XML_USER_INFO_1;
- break;
- case FIELD_ID_DOCINFO_INFORMATION2:
- eElement = XML_USER_INFO_2;
- break;
- case FIELD_ID_DOCINFO_INFORMATION3:
- eElement = XML_USER_INFO_3;
- break;
- case FIELD_ID_DOCINFO_PRINT_TIME:
- eElement = XML_PRINT_TIME;
- break;
- case FIELD_ID_DOCINFO_PRINT_DATE:
- eElement = XML_PRINT_DATE;
- break;
- case FIELD_ID_DOCINFO_PRINT_AUTHOR:
- eElement = XML_PRINTED_BY;
- break;
- case FIELD_ID_DOCINFO_TITLE:
- eElement = XML_TITLE;
- break;
- case FIELD_ID_DOCINFO_SUBJECT:
- eElement = XML_SUBJECT;
- break;
- case FIELD_ID_DOCINFO_KEYWORDS:
- eElement = XML_KEYWORDS;
- break;
- case FIELD_ID_DOCINFO_REVISION:
- eElement = XML_EDITING_CYCLES;
- break;
- case FIELD_ID_DOCINFO_EDIT_DURATION:
- eElement = XML_EDITING_DURATION;
- break;
- case FIELD_ID_DOCINFO_SAVE_TIME:
- eElement = XML_MODIFICATION_TIME;
- break;
- case FIELD_ID_DOCINFO_SAVE_DATE:
- eElement = XML_MODIFICATION_DATE;
- break;
- case FIELD_ID_DOCINFO_SAVE_AUTHOR:
- eElement = XML_CREATOR;
- break;
- default:
- DBG_WARNING("unknown docinfo field type!");
- eElement = XML_TOKEN_INVALID;
- break;
- }
-
- return eElement;
-}
-
-enum XMLTokenEnum XMLTextFieldExport::MapBibliographyFieldName(OUString sName)
-{
- enum XMLTokenEnum eName = XML_TOKEN_INVALID;
-
- if (sName.equalsAsciiL("Identifier", sizeof("Identifier")-1))
- {
- eName = XML_IDENTIFIER;
- }
- else if (sName.equalsAsciiL("BibiliographicType",
- sizeof("BibiliographicType")-1))
- {
- eName = XML_BIBLIOGRAPHY_TYPE;
- }
- else if (sName.equalsAsciiL("Address", sizeof("Address")-1))
- {
- eName = XML_ADDRESS;
- }
- else if (sName.equalsAsciiL("Annote", sizeof("Annote")-1))
- {
- eName = XML_ANNOTE;
- }
- else if (sName.equalsAsciiL("Author", sizeof("Author")-1))
- {
- eName = XML_AUTHOR;
- }
- else if (sName.equalsAsciiL("Booktitle", sizeof("Booktitle")-1))
- {
- eName = XML_BOOKTITLE;
- }
- else if (sName.equalsAsciiL("Chapter", sizeof("Chapter")-1))
- {
- eName = XML_CHAPTER;
- }
- else if (sName.equalsAsciiL("Edition", sizeof("Edition")-1))
- {
- eName = XML_EDITION;
- }
- else if (sName.equalsAsciiL("Editor", sizeof("Editor")-1))
- {
- eName = XML_EDITOR;
- }
- else if (sName.equalsAsciiL("Howpublished", sizeof("Howpublished")-1))
- {
- eName = XML_HOWPUBLISHED;
- }
- else if (sName.equalsAsciiL("Institution", sizeof("Institution")-1))
- {
- eName = XML_INSTITUTION;
- }
- else if (sName.equalsAsciiL("Journal", sizeof("Journal")-1))
- {
- eName = XML_JOURNAL;
- }
- else if (sName.equalsAsciiL("Month", sizeof("Month")-1))
- {
- eName = XML_MONTH;
- }
- else if (sName.equalsAsciiL("Note", sizeof("Note")-1))
- {
- eName = XML_NOTE;
- }
- else if (sName.equalsAsciiL("Number", sizeof("Number")-1))
- {
- eName = XML_NUMBER;
- }
- else if (sName.equalsAsciiL("Organizations", sizeof("Organizations")-1))
- {
- eName = XML_ORGANIZATIONS;
- }
- else if (sName.equalsAsciiL("Pages", sizeof("Pages")-1))
- {
- eName = XML_PAGES;
- }
- else if (sName.equalsAsciiL("Publisher", sizeof("Publisher")-1))
- {
- eName = XML_PUBLISHER;
- }
- else if (sName.equalsAsciiL("School", sizeof("School")-1))
- {
- eName = XML_SCHOOL;
- }
- else if (sName.equalsAsciiL("Series", sizeof("Series")-1))
- {
- eName = XML_SERIES;
- }
- else if (sName.equalsAsciiL("Title", sizeof("Title")-1))
- {
- eName = XML_TITLE;
- }
- else if (sName.equalsAsciiL("Report_Type", sizeof("Report_Type")-1))
- {
- eName = XML_REPORT_TYPE;
- }
- else if (sName.equalsAsciiL("Volume", sizeof("Volume")-1))
- {
- eName = XML_VOLUME;
- }
- else if (sName.equalsAsciiL("Year", sizeof("Year")-1))
- {
- eName = XML_YEAR;
- }
- else if (sName.equalsAsciiL("URL", sizeof("URL")-1))
- {
- eName = XML_URL;
- }
- else if (sName.equalsAsciiL("Custom1", sizeof("Custom1")-1))
- {
- eName = XML_CUSTOM1;
- }
- else if (sName.equalsAsciiL("Custom2", sizeof("Custom2")-1))
- {
- eName = XML_CUSTOM2;
- }
- else if (sName.equalsAsciiL("Custom3", sizeof("Custom3")-1))
- {
- eName = XML_CUSTOM3;
- }
- else if (sName.equalsAsciiL("Custom4", sizeof("Custom4")-1))
- {
- eName = XML_CUSTOM4;
- }
- else if (sName.equalsAsciiL("Custom5", sizeof("Custom5")-1))
- {
- eName = XML_CUSTOM5;
- }
- else if (sName.equalsAsciiL("ISBN", sizeof("ISBN")-1))
- {
- eName = XML_ISBN;
- }
- else
- {
- DBG_ERROR("Unknown bibliography info data");
- eName = XML_TOKEN_INVALID;
- }
-
- return eName;
-}
-
-enum XMLTokenEnum XMLTextFieldExport::MapMeasureKind(sal_Int16 nKind)
-{
- switch( nKind )
- {
- case 0:
- return XML_VALUE;
- case 1:
- return XML_UNIT;
- }
- return XML_GAP;
-}
-
-OUString XMLTextFieldExport::MakeFootnoteRefName(
- sal_Int16 nSeqNo)
-{
- // generate foot-/endnote ID
- OUStringBuffer aBuf;
- aBuf.appendAscii("ftn");
- aBuf.append((sal_Int32)nSeqNo);
- return aBuf.makeStringAndClear();
-}
-
-OUString XMLTextFieldExport::MakeSequenceRefName(
- sal_Int16 nSeqNo,
- const OUString& rSeqName)
-{
- // generate foot-/endnote ID
- OUStringBuffer aBuf;
- aBuf.appendAscii("ref");
- aBuf.append(rSeqName);
- aBuf.append((sal_Int32)nSeqNo);
- return aBuf.makeStringAndClear();
-}
-
-//
-// Property accessor helper functions
-//
-
-// to be relegated (does that word exist?) to a more appropriate place
-//
-
-
-inline sal_Bool GetBoolProperty(
- const OUString& sPropName,
- const Reference<XPropertySet> & xPropSet)
-{
- Any aAny = xPropSet->getPropertyValue(sPropName);
- sal_Bool bBool = *(sal_Bool *)aAny.getValue();
- return bBool;
-}
-
-inline sal_Bool GetOptionalBoolProperty(
- const OUString& sPropName,
- const Reference<XPropertySet> & xPropSet,
- const Reference<XPropertySetInfo> & xPropSetInfo,
- sal_Bool bDefault)
-{
- return xPropSetInfo->hasPropertyByName( sPropName )
- ? GetBoolProperty( sPropName, xPropSet ) : bDefault;
-}
-
-inline double GetDoubleProperty(
- const OUString& sPropName,
- const Reference<XPropertySet> & xPropSet)
-{
- Any aAny = xPropSet->getPropertyValue(sPropName);
- double fDouble = 0.0;
- aAny >>= fDouble;
- return fDouble;
-}
-
-inline OUString const GetStringProperty(
- const OUString& sPropName,
- const Reference<XPropertySet> & xPropSet)
-{
- Any aAny = xPropSet->getPropertyValue(sPropName);
- OUString sString;
- aAny >>= sString;
- return sString;
-}
-
-inline sal_Int32 GetIntProperty(
- const OUString& sPropName,
- const Reference<XPropertySet> & xPropSet)
-{
- Any aAny = xPropSet->getPropertyValue(sPropName);
- sal_Int32 nInt = 0;
- aAny >>= nInt;
- return nInt;
-}
-
-inline sal_Int16 GetInt16Property(
- const OUString& sPropName,
- const Reference<XPropertySet> & xPropSet)
-{
- Any aAny = xPropSet->getPropertyValue(sPropName);
- sal_Int16 nInt = 0;
- aAny >>= nInt;
- return nInt;
-}
-
-inline sal_Int8 GetInt8Property(
- const OUString& sPropName,
- const Reference<XPropertySet> & xPropSet)
-{
- Any aAny = xPropSet->getPropertyValue(sPropName);
- sal_Int8 nInt = 0;
- aAny >>= nInt;
- return nInt;
-}
-
-inline DateTime const GetDateTimeProperty(
- const OUString& sPropName,
- const Reference<XPropertySet> & xPropSet)
-{
- Any aAny = xPropSet->getPropertyValue(sPropName);
- DateTime aTime;
- aAny >>= aTime;
- return aTime;
-}
-
-inline Date const GetDateProperty(
- const OUString& sPropName,
- const Reference<XPropertySet> & xPropSet)
-{
- Any aAny = xPropSet->getPropertyValue(sPropName);
- Date aDate;
- aAny >>= aDate;
- return aDate;
-}
-
-inline Sequence<OUString> const GetStringSequenceProperty(
- const OUString& sPropName,
- const Reference<XPropertySet> & xPropSet)
-{
- Any aAny = xPropSet->getPropertyValue(sPropName);
- Sequence<OUString> aSequence;
- aAny >>= aSequence;
- return aSequence;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_txtfldi.cxx b/binfilter/bf_xmloff/source/text/xmloff_txtfldi.cxx
deleted file mode 100644
index a71c14ee284a..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_txtfldi.cxx
+++ /dev/null
@@ -1,3993 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/** @#file
- *
- * Import of all text fields except those from txtvfldi.cxx
- * (variable related text fields and database display fields)
- */
-
-
-#include "txtvfldi.hxx"
-
-#include "xmlimp.hxx"
-
-#include "xmlnumi.hxx"
-
-
-#include "xmlnmspe.hxx"
-
-#include "nmspmap.hxx"
-
-
-#include "xmluconv.hxx"
-
-
-#include "XMLStringBufferImportContext.hxx"
-
-#include "XMLEventsImportContext.hxx"
-
-
-#include <com/sun/star/text/UserDataPart.hpp>
-
-
-#include <com/sun/star/text/PlaceholderType.hpp>
-
-#include <com/sun/star/text/ReferenceFieldPart.hpp>
-
-#include <com/sun/star/text/ReferenceFieldSource.hpp>
-
-
-
-
-
-
-#include <com/sun/star/text/XTextFieldsSupplier.hpp>
-
-#include <com/sun/star/text/XDependentTextField.hpp>
-
-
-#include <com/sun/star/text/FilenameDisplayFormat.hpp>
-
-#include <com/sun/star/text/ChapterFormat.hpp>
-
-#include <com/sun/star/text/TemplateDisplayFormat.hpp>
-
-#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
-
-
-
-#include <com/sun/star/text/BibliographyDataType.hpp>
-
-
-#include <com/sun/star/util/XUpdatable.hpp>
-
-#include <com/sun/star/sdb/CommandType.hpp>
-
-#include "rtl/ustring.hxx"
-
-
-#include <rtl/math.hxx>
-
-namespace binfilter {
-
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::document;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-
-//
-// SO API string constants
-//
-
-// service prefix and service anems
-const sal_Char sAPI_textfield_prefix[] = "com.sun.star.text.TextField.";
-const sal_Char sAPI_fieldmaster_prefix[] = "com.sun.star.text.FieldMaster.";
-
-const sal_Char sAPI_extended_user[] = "ExtendedUser";
-const sal_Char sAPI_user_data_type[] = "UserDataType";
-const sal_Char sAPI_jump_edit[] = "JumpEdit";
-const sal_Char sAPI_get_expression[] = "GetExpression";
-const sal_Char sAPI_set_expression[] = "SetExpression";
-const sal_Char sAPI_user[] = "User";
-const sal_Char sAPI_date_time[] = "DateTime";
-const sal_Char sAPI_page_number[] = "PageNumber";
-const sal_Char sAPI_database_next[] = "DatabaseNextSet";
-const sal_Char sAPI_database_select[] = "DatabaseNumberOfSet";
-const sal_Char sAPI_database_number[] = "DatabaseSetNumber";
-const sal_Char sAPI_database[] = "Database";
-const sal_Char sAPI_database_name[] = "DatabaseName";
-const sal_Char sAPI_docinfo_change_author[] = "DocInfo.ChangeAuthor";
-const sal_Char sAPI_docinfo_change_date_time[] = "DocInfo.ChangeDateTime";
-const sal_Char sAPI_docinfo_edit_time[] = "DocInfo.EditTime";
-const sal_Char sAPI_docinfo_description[] = "DocInfo.Description";
-const sal_Char sAPI_docinfo_create_author[] = "DocInfo.CreateAuthor";
-const sal_Char sAPI_docinfo_create_date_time[] = "DocInfo.CreateDateTime";
-const sal_Char sAPI_docinfo_info0[] = "DocInfo.Info0";
-const sal_Char sAPI_docinfo_info1[] = "DocInfo.Info1";
-const sal_Char sAPI_docinfo_info2[] = "DocInfo.Info2";
-const sal_Char sAPI_docinfo_info3[] = "DocInfo.Info3";
-const sal_Char sAPI_docinfo_print_author[] = "DocInfo.PrintAuthor";
-const sal_Char sAPI_docinfo_print_date_time[] = "DocInfo.PrintDateTime";
-const sal_Char sAPI_docinfo_keywords[] = "DocInfo.KeyWords";
-const sal_Char sAPI_docinfo_subject[] = "DocInfo.Subject";
-const sal_Char sAPI_docinfo_title[] = "DocInfo.Title";
-const sal_Char sAPI_docinfo_revision[] = "DocInfo.Revision";
-const sal_Char sAPI_hidden_paragraph[] = "HiddenParagraph";
-const sal_Char sAPI_hidden_text[] = "HiddenText";
-const sal_Char sAPI_conditional_text[] = "ConditionalText";
-const sal_Char sAPI_file_name[] = "FileName";
-const sal_Char sAPI_chapter[] = "Chapter";
-const sal_Char sAPI_template_name[] = "TemplateName";
-const sal_Char sAPI_page_count[] = "PageCount";
-const sal_Char sAPI_paragraph_count[] = "ParagraphCount";
-const sal_Char sAPI_word_count[] = "WordCount";
-const sal_Char sAPI_character_count[] = "CharacterCount";
-const sal_Char sAPI_table_count[] = "TableCount";
-const sal_Char sAPI_graphic_object_count[] = "GraphicObjectCount";
-const sal_Char sAPI_embedded_object_count[] = "EmbeddedObjectCount";
-const sal_Char sAPI_reference_page_set[] = "ReferencePageSet";
-const sal_Char sAPI_reference_page_get[] = "ReferencePageGet";
-const sal_Char sAPI_macro[] = "Macro";
-const sal_Char sAPI_dde[] = "DDE";
-const sal_Char sAPI_get_reference[] = "GetReference";
-const sal_Char sAPI_sheet_name[] = "SheetName";
-const sal_Char sAPI_url[] = "URL";
-const sal_Char sAPI_bibliography[] = "Bibliography";
-const sal_Char sAPI_annotation[] = "Annotation";
-const sal_Char sAPI_script[] = "Script";
-const sal_Char sAPI_measure[] = "Measure";
-const sal_Char sAPI_drop_down[] = "DropDown";
-
-
-// property names
-const sal_Char sAPI_is_fixed[] = "IsFixed";
-const sal_Char sAPI_content[] = "Content";
-const sal_Char sAPI_value[] = "Value";
-const sal_Char sAPI_author[] = "Author";
-const sal_Char sAPI_full_name[] = "FullName";
-const sal_Char sAPI_place_holder_type[] = "PlaceHolderType";
-const sal_Char sAPI_place_holder[] = "PlaceHolder";
-const sal_Char sAPI_hint[] = "Hint";
-const sal_Char sAPI_variable_name[] = "VariableName";
-const sal_Char sAPI_name[] = "Name";
-const sal_Char sAPI_sub_type[] = "SubType";
-const sal_Char sAPI_numbering_separator[] = "NumberingSeparator";
-const sal_Char sAPI_chapter_numbering_level[] = "ChapterNumberingLevel";
-const sal_Char sAPI_variable_subtype[] = "VariableSubtype";
-const sal_Char sAPI_formula[] = "Formula";
-const sal_Char sAPI_date_time_value[] = "DateTimeValue";
-const sal_Char sAPI_number_format[] = "NumberFormat";
-const sal_Char sAPI_user_text[] = "UserText";
-const sal_Char sAPI_numbering_type[] = "NumberingType";
-const sal_Char sAPI_offset[] = "Offset";
-const sal_Char sAPI_data_base_name[] = "DataBaseName";
-const sal_Char sAPI_data_table_name[] = "DataTableName";
-const sal_Char sAPI_condition[] = "Condition";
-const sal_Char sAPI_set_number[] = "SetNumber";
-const sal_Char sAPI_is_data_base_format[] = "DataBaseFormat";
-const sal_Char sAPI_true_content[] = "TrueContent";
-const sal_Char sAPI_false_content[] = "FalseContent";
-const sal_Char sAPI_revision[] = "Revision";
-const sal_Char sAPI_file_format[] = "FileFormat";
-const sal_Char sAPI_chapter_format[] = "ChapterFormat";
-const sal_Char sAPI_level[] = "Level";
-const sal_Char sAPI_is_date[] = "IsDate";
-const sal_Char sAPI_adjust[] = "Adjust";
-const sal_Char sAPI_on[] = "On";
-const sal_Char sAPI_is_automatic_update[] = "IsAutomaticUpdate";
-const sal_Char sAPI_source_name[] = "SourceName";
-//STRIP013const sal_Char sAPI_current_presentation[] = "CurrentPresentation";
-const sal_Char sAPI_reference_field_part[] = "ReferenceFieldPart";
-const sal_Char sAPI_reference_field_source[] = "ReferenceFieldSource";
-const sal_Char sAPI_dde_command_type[] = "DDECommandType";
-const sal_Char sAPI_dde_command_file[] = "DDECommandFile";
-const sal_Char sAPI_dde_command_element[] = "DDECommandElement";
-// sAPI_url: also used as service name
-const sal_Char sAPI_target_frame[] = "TargetFrame";
-const sal_Char sAPI_representation[] = "Representation";
-const sal_Char sAPI_date[] = "Date";
-const sal_Char sAPI_url_content[] = "URLContent";
-const sal_Char sAPI_script_type[] = "ScriptType";
-const sal_Char sAPI_is_hidden[] = "IsHidden";
-const sal_Char sAPI_is_condition_true[] = "IsConditionTrue";
-const sal_Char sAPI_data_command_type[] = "DataCommandType";
-const sal_Char sAPI_is_fixed_language[] = "IsFixedLanguage";
-const sal_Char sAPI_is_visible[] = "IsVisible";
-
-const sal_Char sAPI_true[] = "TRUE";
-
-
-static __FAR_DATA SvXMLTokenMapEntry aTextFieldAttrTokenMap[] =
-{
- { XML_NAMESPACE_TEXT, XML_FIXED, XML_TOK_TEXTFIELD_FIXED },
- { XML_NAMESPACE_TEXT, XML_DESCRIPTION, XML_TOK_TEXTFIELD_DESCRIPTION },
- { XML_NAMESPACE_TEXT, XML_PLACEHOLDER_TYPE,
- XML_TOK_TEXTFIELD_PLACEHOLDER_TYPE },
- { XML_NAMESPACE_TEXT, XML_NAME, XML_TOK_TEXTFIELD_NAME },
- { XML_NAMESPACE_TEXT, XML_FORMULA, XML_TOK_TEXTFIELD_FORMULA },
- { XML_NAMESPACE_STYLE, XML_NUM_FORMAT, XML_TOK_TEXTFIELD_NUM_FORMAT },
- { XML_NAMESPACE_STYLE, XML_NUM_LETTER_SYNC,
- XML_TOK_TEXTFIELD_NUM_LETTER_SYNC },
- { XML_NAMESPACE_TEXT, XML_DISPLAY_FORMULA,
- XML_TOK_TEXTFIELD_DISPLAY_FORMULA },
- { XML_NAMESPACE_TEXT, XML_VALUE_TYPE, XML_TOK_TEXTFIELD_VALUE_TYPE },
- { XML_NAMESPACE_TEXT, XML_VALUE, XML_TOK_TEXTFIELD_VALUE },
- { XML_NAMESPACE_TEXT, XML_STRING_VALUE, XML_TOK_TEXTFIELD_STRING_VALUE },
- { XML_NAMESPACE_TEXT, XML_DATE_VALUE, XML_TOK_TEXTFIELD_DATE_VALUE },
- { XML_NAMESPACE_TEXT, XML_TIME_VALUE, XML_TOK_TEXTFIELD_TIME_VALUE },
- { XML_NAMESPACE_TEXT, XML_BOOLEAN_VALUE, XML_TOK_TEXTFIELD_BOOL_VALUE},
- { XML_NAMESPACE_TEXT, XML_CURRENCY, XML_TOK_TEXTFIELD_CURRENCY},
- { XML_NAMESPACE_STYLE, XML_DATA_STYLE_NAME,
- XML_TOK_TEXTFIELD_DATA_STYLE_NAME },
- { XML_NAMESPACE_TEXT, XML_DISPLAY_OUTLINE_LEVEL,
- XML_TOK_TEXTFIELD_NUMBERING_LEVEL },
- { XML_NAMESPACE_TEXT, XML_SEPARATION_CHARACTER,
- XML_TOK_TEXTFIELD_NUMBERING_SEPARATOR },
- { XML_NAMESPACE_TEXT, XML_DISPLAY, XML_TOK_TEXTFIELD_DISPLAY },
- { XML_NAMESPACE_TEXT, XML_TIME_ADJUST, XML_TOK_TEXTFIELD_TIME_ADJUST },
- { XML_NAMESPACE_TEXT, XML_DATE_ADJUST, XML_TOK_TEXTFIELD_DATE_ADJUST },
- { XML_NAMESPACE_TEXT, XML_PAGE_ADJUST, XML_TOK_TEXTFIELD_PAGE_ADJUST },
- { XML_NAMESPACE_TEXT, XML_SELECT_PAGE, XML_TOK_TEXTFIELD_SELECT_PAGE },
- { XML_NAMESPACE_TEXT, XML_DATABASE_NAME, XML_TOK_TEXTFIELD_DATABASE_NAME},
- { XML_NAMESPACE_TEXT, XML_TABLE_NAME, XML_TOK_TEXTFIELD_TABLE_NAME },
- { XML_NAMESPACE_TEXT, XML_COLUMN_NAME, XML_TOK_TEXTFIELD_COLUMN_NAME },
- { XML_NAMESPACE_TEXT, XML_ROW_NUMBER, XML_TOK_TEXTFIELD_ROW_NUMBER },
- { XML_NAMESPACE_TEXT, XML_CONDITION, XML_TOK_TEXTFIELD_CONDITION },
- { XML_NAMESPACE_TEXT, XML_STRING_VALUE_IF_TRUE,
- XML_TOK_TEXTFIELD_STRING_VALUE_IF_TRUE },
- { XML_NAMESPACE_TEXT, XML_STRING_VALUE_IF_FALSE,
- XML_TOK_TEXTFIELD_STRING_VALUE_IF_FALSE },
- { XML_NAMESPACE_TEXT, XML_EDITING_CYCLES, XML_TOK_TEXTFIELD_REVISION },
- { XML_NAMESPACE_TEXT, XML_OUTLINE_LEVEL, XML_TOK_TEXTFIELD_OUTLINE_LEVEL},
- { XML_NAMESPACE_TEXT, XML_ACTIVE, XML_TOK_TEXTFIELD_ACTIVE },
- { XML_NAMESPACE_TEXT, XML_REFERENCE_FORMAT,
- XML_TOK_TEXTFIELD_REFERENCE_FORMAT },
- { XML_NAMESPACE_TEXT, XML_REF_NAME, XML_TOK_TEXTFIELD_REF_NAME },
- { XML_NAMESPACE_TEXT, XML_CONNECTION_NAME,
- XML_TOK_TEXTFIELD_CONNECTION_NAME },
- { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_TEXTFIELD_HREF },
- { XML_NAMESPACE_OFFICE, XML_TARGET_FRAME_NAME,
- XML_TOK_TEXTFIELD_TARGET_FRAME },
- { XML_NAMESPACE_OFFICE, XML_CREATE_DATE,
- XML_TOK_TEXTFIELD_OFFICE_CREATE_DATE },
- { XML_NAMESPACE_OFFICE, XML_AUTHOR, XML_TOK_TEXTFIELD_OFFICE_AUTHOR },
- { XML_NAMESPACE_TEXT, XML_ANNOTATION, XML_TOK_TEXTFIELD_ANNOTATION },
- { XML_NAMESPACE_SCRIPT, XML_LANGUAGE, XML_TOK_TEXTFIELD_LANGUAGE },
- { XML_NAMESPACE_TEXT, XML_KIND, XML_TOK_TEXTFIELD_MEASURE_KIND },
- { XML_NAMESPACE_TEXT, XML_IS_HIDDEN, XML_TOK_TEXTFIELD_IS_HIDDEN },
- { XML_NAMESPACE_TEXT, XML_CURRENT_VALUE,
- XML_TOK_TEXTFIELD_CURRENT_VALUE },
- { XML_NAMESPACE_TEXT, XML_TABLE_TYPE, XML_TOK_TEXTFIELD_TABLE_TYPE },
-
- XML_TOKEN_MAP_END
-};
-
-const SvXMLTokenMap& XMLTextImportHelper::GetTextFieldAttrTokenMap()
-{
- if (NULL == pTextFieldAttrTokenMap) {
- pTextFieldAttrTokenMap = new SvXMLTokenMap(aTextFieldAttrTokenMap);
- }
-
- return *pTextFieldAttrTokenMap;
-
-}
-
-TYPEINIT1( XMLTextFieldImportContext, SvXMLImportContext);
-
-XMLTextFieldImportContext::XMLTextFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- const sal_Char* pService,
- sal_uInt16 nPrefix, const OUString& rElementName)
- : SvXMLImportContext( rImport, nPrefix, rElementName ),
- sContentBuffer(),
- rTextImportHelper(rHlp),
- bValid(sal_False),
- sIsFixed(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_fixed)),
- sServicePrefix(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_textfield_prefix))
-{
- DBG_ASSERT(NULL != pService, "Need service name!");
- sServiceName = OUString::createFromAscii(pService);
-}
-
-void XMLTextFieldImportContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- // process attributes
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 i=0; i<nLength; i++) {
-
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(i), &sLocalName );
-
- ProcessAttribute(rTextImportHelper.GetTextFieldAttrTokenMap().
- Get(nPrefix, sLocalName),
- xAttrList->getValueByIndex(i) );
- }
-}
-
-XMLTextFieldImportContext::~XMLTextFieldImportContext() {
-}
-
-OUString XMLTextFieldImportContext::GetContent()
-{
- if (sContent.getLength()==0)
- {
- sContent = sContentBuffer.makeStringAndClear();
- }
-
- return sContent;
-}
-
-void XMLTextFieldImportContext::EndElement()
-{
- DBG_ASSERT(GetServiceName().getLength()>0, "no service name for element!");
- if (bValid)
- {
-
- // create field/Service
- Reference<XPropertySet> xPropSet;
- if (CreateField(xPropSet, sServicePrefix + GetServiceName()))
- {
- // set field properties
- PrepareField(xPropSet);
-
- // attach field to document
- Reference<XTextContent> xTextContent(xPropSet, UNO_QUERY);
-
- // workaround for #80606#
- try
- {
- rTextImportHelper.InsertTextContent(xTextContent);
- }
- catch (lang::IllegalArgumentException e)
- {
- // ignore
- }
- return;
- }
- }
-
- // in case of error: write element content
- rTextImportHelper.InsertString(GetContent());
-}
-
-void XMLTextFieldImportContext::Characters(const OUString& sContent)
-{
- sContentBuffer.append(sContent);
-}
-
-sal_Bool XMLTextFieldImportContext::CreateField(
- Reference<XPropertySet> & xField,
- const OUString& sServiceName)
-{
- // instantiate new XTextField:
- // ask import for model, model is factory, ask factory to create service
-
- Reference<XMultiServiceFactory> xFactory(GetImport().GetModel(),UNO_QUERY);
- if( xFactory.is() )
- {
- Reference<XInterface> xIfc = xFactory->createInstance(sServiceName);
- if( xIfc.is() )
- {
- Reference<XPropertySet> xTmp( xIfc, UNO_QUERY );
-
- xField = xTmp;
- } else {
- return sal_False; // can't create instance
- }
- } else {
- return sal_False; // can't get MultiServiceFactory
- }
-
- return sal_True;
-}
-
-/// create the appropriate field context from
-XMLTextFieldImportContext*
-XMLTextFieldImportContext::CreateTextFieldImportContext(
- SvXMLImport& rImport,
- XMLTextImportHelper& rHlp,
- sal_uInt16 nPrefix,
- const OUString& rName,
- sal_uInt16 nToken)
-{
- XMLTextFieldImportContext* pContext = NULL;
-
- switch (nToken)
- {
- case XML_TOK_TEXT_SENDER_FIRSTNAME:
- case XML_TOK_TEXT_SENDER_LASTNAME:
- case XML_TOK_TEXT_SENDER_INITIALS:
- case XML_TOK_TEXT_SENDER_TITLE:
- case XML_TOK_TEXT_SENDER_POSITION:
- case XML_TOK_TEXT_SENDER_EMAIL:
- case XML_TOK_TEXT_SENDER_PHONE_PRIVATE:
- case XML_TOK_TEXT_SENDER_FAX:
- case XML_TOK_TEXT_SENDER_COMPANY:
- case XML_TOK_TEXT_SENDER_PHONE_WORK:
- case XML_TOK_TEXT_SENDER_STREET:
- case XML_TOK_TEXT_SENDER_CITY:
- case XML_TOK_TEXT_SENDER_POSTAL_CODE:
- case XML_TOK_TEXT_SENDER_COUNTRY:
- case XML_TOK_TEXT_SENDER_STATE_OR_PROVINCE:
- pContext =
- new XMLSenderFieldImportContext( rImport, rHlp,
- nPrefix, rName, nToken );
- break;
-
- case XML_TOK_TEXT_AUTHOR_NAME:
- case XML_TOK_TEXT_AUTHOR_INITIALS:
- pContext =
- new XMLAuthorFieldImportContext( rImport, rHlp,
- nPrefix, rName, nToken );
- break;
-
- case XML_TOK_TEXT_PLACEHOLDER:
- pContext =
- new XMLPlaceholderFieldImportContext( rImport, rHlp,
- nPrefix, rName);
- break;
- case XML_TOK_TEXT_SEQUENCE:
- pContext =
- new XMLSequenceFieldImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
- case XML_TOK_TEXT_TEXT_INPUT:
- pContext =
- new XMLTextInputFieldImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
- case XML_TOK_TEXT_EXPRESSION:
- pContext =
- new XMLExpressionFieldImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
- case XML_TOK_TEXT_VARIABLE_SET:
- pContext =
- new XMLVariableSetFieldImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
- case XML_TOK_TEXT_VARIABLE_INPUT:
- pContext =
- new XMLVariableInputFieldImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
- case XML_TOK_TEXT_VARIABLE_GET:
- pContext =
- new XMLVariableGetFieldImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
- case XML_TOK_TEXT_USER_FIELD_GET:
- pContext = new XMLUserFieldImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
- case XML_TOK_TEXT_USER_FIELD_INPUT:
- pContext = new XMLUserFieldInputImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
- case XML_TOK_TEXT_TIME:
- pContext = new XMLTimeFieldImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
- case XML_TOK_TEXT_PAGE_CONTINUATION_STRING:
- pContext = new XMLPageContinuationImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
-
- case XML_TOK_TEXT_PAGE_NUMBER:
- pContext = new XMLPageNumberImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
-
- case XML_TOK_TEXT_DATE:
- pContext = new XMLDateFieldImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
-
- case XML_TOK_TEXT_DATABASE_NAME:
- pContext = new XMLDatabaseNameImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
- case XML_TOK_TEXT_DATABASE_NEXT:
- pContext = new XMLDatabaseNextImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
- case XML_TOK_TEXT_DATABASE_SELECT:
- pContext = new XMLDatabaseSelectImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
- case XML_TOK_TEXT_DATABASE_ROW_NUMBER:
- pContext = new XMLDatabaseNumberImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
- case XML_TOK_TEXT_DATABASE_DISPLAY:
- pContext = new XMLDatabaseDisplayImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
- case XML_TOK_TEXT_CONDITIONAL_TEXT:
- pContext = new XMLConditionalTextImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
- case XML_TOK_TEXT_HIDDEN_TEXT:
- pContext = new XMLHiddenTextImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
- case XML_TOK_TEXT_HIDDEN_PARAGRAPH:
- pContext = new XMLHiddenParagraphImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
-
- case XML_TOK_TEXT_DOCUMENT_INFORMATION_0: // info fields only for
- case XML_TOK_TEXT_DOCUMENT_INFORMATION_1: // compatibilty with older
- case XML_TOK_TEXT_DOCUMENT_INFORMATION_2: // versions
- case XML_TOK_TEXT_DOCUMENT_INFORMATION_3:
- case XML_TOK_TEXT_DOCUMENT_DESCRIPTION:
- case XML_TOK_TEXT_DOCUMENT_TITLE:
- case XML_TOK_TEXT_DOCUMENT_SUBJECT:
- case XML_TOK_TEXT_DOCUMENT_KEYWORDS:
- pContext = new XMLSimpleDocInfoImportContext( rImport, rHlp,
- nPrefix, rName,
- nToken, sal_True,
- sal_False );
- break;
- case XML_TOK_TEXT_DOCUMENT_CREATION_AUTHOR:
- case XML_TOK_TEXT_DOCUMENT_PRINT_AUTHOR:
- case XML_TOK_TEXT_DOCUMENT_SAVE_AUTHOR:
- pContext = new XMLSimpleDocInfoImportContext( rImport, rHlp,
- nPrefix, rName,
- nToken, sal_False,
- sal_True );
- break;
-
- case XML_TOK_TEXT_DOCUMENT_CREATION_DATE:
- case XML_TOK_TEXT_DOCUMENT_CREATION_TIME:
- case XML_TOK_TEXT_DOCUMENT_PRINT_DATE:
- case XML_TOK_TEXT_DOCUMENT_PRINT_TIME:
- case XML_TOK_TEXT_DOCUMENT_SAVE_DATE:
- case XML_TOK_TEXT_DOCUMENT_SAVE_TIME:
- case XML_TOK_TEXT_DOCUMENT_EDIT_DURATION:
- pContext = new XMLDateTimeDocInfoImportContext( rImport, rHlp,
- nPrefix, rName,
- nToken );
- break;
-
- case XML_TOK_TEXT_DOCUMENT_REVISION:
- pContext = new XMLRevisionDocInfoImportContext( rImport, rHlp,
- nPrefix, rName,
- nToken );
- break;
-
- case XML_TOK_TEXT_DOCUMENT_USER_DEFINED:
- pContext = new XMLUserDocInfoImportContext( rImport, rHlp,
- nPrefix, rName,
- nToken );
- break;
-
- case XML_TOK_TEXT_FILENAME:
- pContext = new XMLFileNameImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
-
- case XML_TOK_TEXT_CHAPTER:
- pContext = new XMLChapterImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
-
- case XML_TOK_TEXT_TEMPLATENAME:
- pContext = new XMLTemplateNameImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
-
- case XML_TOK_TEXT_WORD_COUNT:
- case XML_TOK_TEXT_PARAGRAPH_COUNT:
- case XML_TOK_TEXT_TABLE_COUNT:
- case XML_TOK_TEXT_CHARACTER_COUNT:
- case XML_TOK_TEXT_IMAGE_COUNT:
- case XML_TOK_TEXT_OBJECT_COUNT:
- case XML_TOK_TEXT_PAGE_COUNT:
- pContext = new XMLCountFieldImportContext( rImport, rHlp,
- nPrefix, rName, nToken);
- break;
-
- case XML_TOK_TEXT_GET_PAGE_VAR:
- pContext = new XMLPageVarGetFieldImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
-
- case XML_TOK_TEXT_SET_PAGE_VAR:
- pContext = new XMLPageVarSetFieldImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
-
- case XML_TOK_TEXT_MACRO:
- pContext = new XMLMacroFieldImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
-
- case XML_TOK_TEXT_DDE:
- pContext = new XMLDdeFieldImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
-
- case XML_TOK_TEXT_REFERENCE_REF:
- case XML_TOK_TEXT_BOOKMARK_REF:
- case XML_TOK_TEXT_FOOTNOTE_REF:
- case XML_TOK_TEXT_ENDNOTE_REF:
- case XML_TOK_TEXT_SEQUENCE_REF:
- pContext = new XMLReferenceFieldImportContext( rImport, rHlp,
- nToken,
- nPrefix, rName );
- break;
-
- case XML_TOK_TEXT_SHEET_NAME:
- pContext = new XMLSheetNameImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
-
- case XML_TOK_TEXT_BIBLIOGRAPHY_MARK:
- pContext = new XMLBibliographyFieldImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
-
- case XML_TOK_TEXT_ANNOTATION:
- pContext = new XMLAnnotationImportContext( rImport, rHlp,
- nPrefix, rName);
- break;
-
- case XML_TOK_TEXT_SCRIPT:
- pContext = new XMLScriptImportContext( rImport, rHlp,
- nPrefix, rName);
- break;
-
- case XML_TOK_TEXT_MEASURE:
- pContext = new XMLMeasureFieldImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
-
- case XML_TOK_TEXT_TABLE_FORMULA:
- pContext = new XMLTableFormulaImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
- case XML_TOK_TEXT_DROPDOWN:
- pContext = new XMLDropDownFieldImportContext( rImport, rHlp,
- nPrefix, rName );
- break;
-
- default:
- // ignore! May not even be a textfield.
- // (Reminder: This method is called inside default:-branch)
- pContext = NULL;
- break;
- }
-
- return pContext;
-}
-
-
-void XMLTextFieldImportContext::ForceUpdate(
- const Reference<XPropertySet> & rPropertySet)
-{
- // force update
- Reference<XUpdatable> xUpdate(rPropertySet, UNO_QUERY);
- if (xUpdate.is())
- {
- xUpdate->update();
- }
- else
- {
- DBG_ERROR("Expected XUpdatable support!");
- }
-}
-
-
-
-//
-// XMLSenderFieldImportContext
-//
-
-TYPEINIT1( XMLSenderFieldImportContext, XMLTextFieldImportContext);
-
-XMLSenderFieldImportContext::XMLSenderFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName,
- sal_uInt16 nToken) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_extended_user,
- nPrfx, sLocalName),
- bFixed(sal_True),
- nElementToken(nToken),
- sEmpty(),
- sPropertyFieldSubType(RTL_CONSTASCII_USTRINGPARAM(sAPI_user_data_type)),
- sPropertyFixed(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_fixed)),
- sPropertyContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_content))
-{
-}
-
-void XMLSenderFieldImportContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- bValid = sal_True;
- switch (nElementToken) {
- case XML_TOK_TEXT_SENDER_FIRSTNAME:
- nSubType = UserDataPart::FIRSTNAME;
- break;
- case XML_TOK_TEXT_SENDER_LASTNAME:
- nSubType = UserDataPart::NAME;
- break;
- case XML_TOK_TEXT_SENDER_INITIALS:
- nSubType = UserDataPart::SHORTCUT;
- break;
- case XML_TOK_TEXT_SENDER_TITLE:
- nSubType = UserDataPart::TITLE;
- break;
- case XML_TOK_TEXT_SENDER_POSITION:
- nSubType = UserDataPart::POSITION;
- break;
- case XML_TOK_TEXT_SENDER_EMAIL:
- nSubType = UserDataPart::EMAIL;
- break;
- case XML_TOK_TEXT_SENDER_PHONE_PRIVATE:
- nSubType = UserDataPart::PHONE_PRIVATE;
- break;
- case XML_TOK_TEXT_SENDER_FAX:
- nSubType = UserDataPart::FAX;
- break;
- case XML_TOK_TEXT_SENDER_COMPANY:
- nSubType = UserDataPart::COMPANY;
- break;
- case XML_TOK_TEXT_SENDER_PHONE_WORK:
- nSubType = UserDataPart::PHONE_COMPANY;
- break;
- case XML_TOK_TEXT_SENDER_STREET:
- nSubType = UserDataPart::STREET;
- break;
- case XML_TOK_TEXT_SENDER_CITY:
- nSubType = UserDataPart::CITY;
- break;
- case XML_TOK_TEXT_SENDER_POSTAL_CODE:
- nSubType = UserDataPart::ZIP;
- break;
- case XML_TOK_TEXT_SENDER_COUNTRY:
- nSubType = UserDataPart::COUNTRY;
- break;
- case XML_TOK_TEXT_SENDER_STATE_OR_PROVINCE:
- nSubType = UserDataPart::STATE;
- break;
- default:
- bValid = sal_False;
- break;
- }
-
- // process Attributes
- XMLTextFieldImportContext::StartElement(xAttrList);
-}
-
-void XMLSenderFieldImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue)
-{
- if (XML_TOK_TEXTFIELD_FIXED == nAttrToken) {
-
- // set bVal
- sal_Bool bVal;
- sal_Bool bRet = GetImport().GetMM100UnitConverter().
- convertBool(bVal, sAttrValue);
-
- // set bFixed if successfull
- if (bRet) {
- bFixed = bVal;
- }
- }
-}
-
-void XMLSenderFieldImportContext::PrepareField(
- const Reference<XPropertySet> & rPropSet)
-{
- // set members
- Any aAny;
- aAny <<= nSubType;
- rPropSet->setPropertyValue(sPropertyFieldSubType, aAny);
-
- // set fixed
- aAny.setValue( &bFixed, ::getBooleanCppuType() );
- rPropSet->setPropertyValue(sPropertyFixed, aAny);
-
- // set content if fixed
- if (bFixed)
- {
- // in organizer or styles-only mode: force update
- if (GetImport().GetTextImport()->IsOrganizerMode() ||
- GetImport().GetTextImport()->IsStylesOnlyMode() )
- {
- ForceUpdate(rPropSet);
- }
- else
- {
- aAny <<= GetContent();
- rPropSet->setPropertyValue(sPropertyContent, aAny);
- }
- }
-}
-
-
-
-//
-// XMLAuthorFieldImportContext
-//
-
-TYPEINIT1( XMLAuthorFieldImportContext, XMLSenderFieldImportContext);
-
-XMLAuthorFieldImportContext::XMLAuthorFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName,
- sal_uInt16 nToken) :
- XMLSenderFieldImportContext(rImport, rHlp, nPrfx, sLocalName, nToken),
- bAuthorFullName(sal_True),
- sPropertyAuthorFullName(RTL_CONSTASCII_USTRINGPARAM(sAPI_full_name)),
- sPropertyContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_content)),
- sPropertyFixed(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_fixed)),
- sServiceAuthor(RTL_CONSTASCII_USTRINGPARAM(sAPI_author))
-{
- // overwrite service name from XMLSenderFieldImportContext
- SetServiceName(sServiceAuthor);
-}
-
-void XMLAuthorFieldImportContext::StartElement(
- const Reference<XAttributeList> & xAttrList) {
-
- bAuthorFullName = (XML_TOK_TEXT_AUTHOR_INITIALS != nElementToken);
- bValid = sal_True;
-
- // process Attributes
- XMLTextFieldImportContext::StartElement(xAttrList);
-}
-
-void XMLAuthorFieldImportContext::PrepareField(
- const Reference<XPropertySet> & rPropSet)
-{
- // set members
- Any aAny;
- aAny.setValue( &bAuthorFullName, ::getBooleanCppuType() );
- rPropSet->setPropertyValue(sPropertyAuthorFullName, aAny);
-
- aAny.setValue( &bFixed, ::getBooleanCppuType() );
- rPropSet->setPropertyValue(sPropertyFixed, aAny);
-
- // set content if fixed
- if (bFixed)
- {
- // organizer or styles-only mode: force update
- if (GetImport().GetTextImport()->IsOrganizerMode() ||
- GetImport().GetTextImport()->IsStylesOnlyMode() )
- {
- ForceUpdate(rPropSet);
- }
- else
- {
- aAny <<= GetContent();
- rPropSet->setPropertyValue(sPropertyContent, aAny);
- }
- }
-}
-
-
-//
-// page continuation string
-//
-
-TYPEINIT1( XMLPageContinuationImportContext, XMLTextFieldImportContext );
-
-static SvXMLEnumMapEntry __READONLY_DATA lcl_aSelectPageAttrMap[] =
-{
- { XML_PREVIOUS, PageNumberType_PREV },
- { XML_CURRENT, PageNumberType_CURRENT },
- { XML_NEXT, PageNumberType_NEXT },
- { XML_TOKEN_INVALID, 0 },
-};
-
-XMLPageContinuationImportContext::XMLPageContinuationImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
- const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_page_number,
- nPrfx, sLocalName),
- sString(),
- sStringOK(sal_False),
- eSelectPage(PageNumberType_CURRENT),
- sPropertySubType(RTL_CONSTASCII_USTRINGPARAM(sAPI_sub_type)),
- sPropertyUserText(RTL_CONSTASCII_USTRINGPARAM(sAPI_user_text)),
- sPropertyNumberingType(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_numbering_type))
-{
- bValid = sal_True;
-}
-
-void XMLPageContinuationImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken, const OUString& sAttrValue )
-{
- switch(nAttrToken)
- {
- case XML_TOK_TEXTFIELD_SELECT_PAGE:
- {
- sal_uInt16 nTmp;
- if (SvXMLUnitConverter::convertEnum(nTmp, sAttrValue,
- lcl_aSelectPageAttrMap)
- && (PageNumberType_CURRENT != nTmp) )
- {
- eSelectPage = (PageNumberType)nTmp;
- }
- break;
- }
- case XML_TOK_TEXTFIELD_STRING_VALUE:
- sString = sAttrValue;
- sStringOK = sal_True;
- break;
- }
-}
-
-void XMLPageContinuationImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- aAny <<= eSelectPage;
- xPropertySet->setPropertyValue(sPropertySubType, aAny);
-
- aAny <<= (sStringOK ? sString : GetContent());
- xPropertySet->setPropertyValue(sPropertyUserText, aAny);
-
- aAny <<= style::NumberingType::CHAR_SPECIAL;
- xPropertySet->setPropertyValue(sPropertyNumberingType, aAny);
-}
-
-
-
-//
-// page number field
-//
-
-TYPEINIT1( XMLPageNumberImportContext, XMLTextFieldImportContext );
-
-XMLPageNumberImportContext::XMLPageNumberImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
- const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_page_number,
- nPrfx, sLocalName),
- sPropertySubType(RTL_CONSTASCII_USTRINGPARAM(sAPI_sub_type)),
- sPropertyNumberingType(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_numbering_type)),
- sPropertyOffset(RTL_CONSTASCII_USTRINGPARAM(sAPI_offset)),
- sNumberFormat(),
- sNumberSync(GetXMLToken(XML_FALSE)),
- nPageAdjust(0),
- eSelectPage(PageNumberType_CURRENT),
- sNumberFormatOK(sal_False)
-{
- bValid = sal_True;
-}
-
-void XMLPageNumberImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_NUM_FORMAT:
- sNumberFormat = sAttrValue;
- sNumberFormatOK = sal_True;
- break;
- case XML_TOK_TEXTFIELD_NUM_LETTER_SYNC:
- sNumberSync = sAttrValue;
- break;
- case XML_TOK_TEXTFIELD_SELECT_PAGE:
- {
- sal_uInt16 nTmp;
- if (SvXMLUnitConverter::convertEnum(nTmp, sAttrValue,
- lcl_aSelectPageAttrMap))
- {
- eSelectPage = (PageNumberType)nTmp;
- }
- break;
- }
- case XML_TOK_TEXTFIELD_PAGE_ADJUST:
- {
- sal_Int32 nTmp;
- if (SvXMLUnitConverter::convertNumber(nTmp, sAttrValue))
- {
- nPageAdjust = (sal_Int16)nTmp;
- }
- break;
- }
- }
-}
-
-void XMLPageNumberImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- // all properties are optional
- Reference<XPropertySetInfo> xPropertySetInfo(
- xPropertySet->getPropertySetInfo());
-
- if (xPropertySetInfo->hasPropertyByName(sPropertyNumberingType))
- {
- sal_Int16 nNumType;
- if( sNumberFormatOK )
- {
- nNumType= style::NumberingType::ARABIC;
- GetImport().GetMM100UnitConverter().convertNumFormat( nNumType,
- sNumberFormat,
- sNumberSync );
- }
- else
- nNumType = style::NumberingType::PAGE_DESCRIPTOR;
-
- aAny <<= nNumType;
- xPropertySet->setPropertyValue(sPropertyNumberingType, aAny);
- }
-
- if (xPropertySetInfo->hasPropertyByName(sPropertyOffset))
- {
- // adjust offset
- switch (eSelectPage)
- {
- case PageNumberType_PREV:
- nPageAdjust--;
- break;
- case PageNumberType_CURRENT:
- break;
- case PageNumberType_NEXT:
- nPageAdjust++;
- break;
- default:
- DBG_WARNING("unknown page number type");
- }
- aAny <<= nPageAdjust;
- xPropertySet->setPropertyValue(sPropertyOffset, aAny);
- }
-
- if (xPropertySetInfo->hasPropertyByName(sPropertySubType))
- {
- aAny <<= eSelectPage;
- xPropertySet->setPropertyValue(sPropertySubType, aAny);
- }
-}
-
-
-
-//
-// Placeholder
-//
-
-TYPEINIT1( XMLPlaceholderFieldImportContext, XMLTextFieldImportContext);
-
-XMLPlaceholderFieldImportContext::XMLPlaceholderFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_jump_edit,
- nPrfx, sLocalName),
- sPropertyPlaceholderType(
- RTL_CONSTASCII_USTRINGPARAM(sAPI_place_holder_type)),
- sPropertyPlaceholder(RTL_CONSTASCII_USTRINGPARAM(sAPI_place_holder)),
- sPropertyHint(RTL_CONSTASCII_USTRINGPARAM(sAPI_hint)),
- sDescription()
-{
-}
-
-/// process attribute values
-void XMLPlaceholderFieldImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken, const OUString& sAttrValue )
-{
- switch (nAttrToken) {
- case XML_TOK_TEXTFIELD_DESCRIPTION:
- sDescription = sAttrValue;
- break;
-
- case XML_TOK_TEXTFIELD_PLACEHOLDER_TYPE:
- bValid = sal_True;
- if (IsXMLToken(sAttrValue, XML_TABLE))
- {
- nPlaceholderType = PlaceholderType::TABLE;
- }
- else if (IsXMLToken(sAttrValue, XML_TEXT))
- {
- nPlaceholderType = PlaceholderType::TEXT;
- }
- else if (IsXMLToken(sAttrValue, XML_TEXT_BOX))
- {
- nPlaceholderType = PlaceholderType::TEXTFRAME;
- }
- else if (IsXMLToken(sAttrValue, XML_IMAGE))
- {
- nPlaceholderType = PlaceholderType::GRAPHIC;
- }
- else if (IsXMLToken(sAttrValue, XML_OBJECT))
- {
- nPlaceholderType = PlaceholderType::OBJECT;
- }
- else
- {
- bValid = sal_False;
- }
- break;
-
- default:
- ; // ignore
- }
-}
-
-void XMLPlaceholderFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet) {
-
- Any aAny;
- aAny <<= sDescription;
- xPropertySet->setPropertyValue(sPropertyHint, aAny);
-
- // remove <...> around content (if present)
- OUString sContent = GetContent();
- sal_Int32 nStart = 0;
- sal_Int32 nLength = sContent.getLength();
- if ((nLength > 0) && (sContent.getStr()[0] == '<'))
- {
- --nLength;
- ++nStart;
- }
- if ((nLength > 0) && (sContent.getStr()[sContent.getLength()-1] == '>'))
- {
- --nLength;
- }
- aAny <<= sContent.copy(nStart, nLength);
- xPropertySet->setPropertyValue(sPropertyPlaceholder, aAny);
-
- aAny <<= nPlaceholderType;
- xPropertySet->setPropertyValue(sPropertyPlaceholderType, aAny);
-}
-
-
-//
-// time field
-//
-
-TYPEINIT1( XMLTimeFieldImportContext, XMLTextFieldImportContext);
-
-XMLTimeFieldImportContext::XMLTimeFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_date_time,
- nPrfx, sLocalName),
- fTimeValue(0.0),
- nAdjust(0),
- bTimeOK(sal_False),
- bFixed(sal_False),
- nFormatKey(0),
- bFormatOK(sal_False),
- bIsDate(sal_False),
- bIsDefaultLanguage( sal_True ),
- sPropertyNumberFormat(RTL_CONSTASCII_USTRINGPARAM(sAPI_number_format)),
- sPropertyFixed(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_fixed)),
- sPropertyDateTimeValue(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_date_time_value)),
- sPropertyDateTime(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_date_time)),
- sPropertyAdjust(RTL_CONSTASCII_USTRINGPARAM(sAPI_adjust)),
- sPropertyIsDate(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_date)),
- sPropertyIsFixedLanguage(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_fixed_language))
-{
- bValid = sal_True; // always valid!
-}
-
-void XMLTimeFieldImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken, const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_TIME_VALUE:
- {
- double fTmp;
- if (GetImport().GetMM100UnitConverter().
- convertDateTime(fTmp, sAttrValue))
- {
- fTimeValue = fTmp;
- bTimeOK = sal_True;
- }
-
- if (GetImport().GetMM100UnitConverter().
- convertDateTime(aDateTimeValue, sAttrValue ))
- {
- bTimeOK = sal_True;
- }
- break;
- }
- case XML_TOK_TEXTFIELD_FIXED:
- {
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(bTmp, sAttrValue))
- {
- bFixed = bTmp;
- }
- break;
- }
- case XML_TOK_TEXTFIELD_DATA_STYLE_NAME:
- {
- sal_Int32 nKey = GetImportHelper().GetDataStyleKey(
- sAttrValue, &bIsDefaultLanguage);
- if (-1 != nKey)
- {
- nFormatKey = nKey;
- bFormatOK = sal_True;
- }
- break;
- }
- case XML_TOK_TEXTFIELD_TIME_ADJUST:
- {
- double fTmp;
-
- if (SvXMLUnitConverter::convertTime(fTmp, sAttrValue))
- {
- // convert to minutes
- nAdjust = (sal_Int32)::rtl::math::approxFloor(fTmp * 60 * 24);
- }
- break;
- }
- }
-}
-
-void XMLTimeFieldImportContext::PrepareField(
- const Reference<XPropertySet> & rPropertySet)
-{
- Any aAny;
-
- // all properties are optional (except IsDate)
- Reference<XPropertySetInfo> xPropertySetInfo(
- rPropertySet->getPropertySetInfo());
-
- if (xPropertySetInfo->hasPropertyByName(sPropertyFixed))
- {
- aAny.setValue( &bFixed, ::getBooleanCppuType() );
- rPropertySet->setPropertyValue(sPropertyFixed, aAny);
- }
-
- aAny.setValue( &bIsDate, ::getBooleanCppuType() );
- rPropertySet->setPropertyValue(sPropertyIsDate, aAny);
-
- if (xPropertySetInfo->hasPropertyByName(sPropertyAdjust))
- {
- aAny <<= nAdjust;
- rPropertySet->setPropertyValue(sPropertyAdjust, aAny);
- }
-
- // set value
- if (bFixed)
- {
- // organizer or styles-only mode: force update
- if (GetImport().GetTextImport()->IsOrganizerMode() ||
- GetImport().GetTextImport()->IsStylesOnlyMode() )
- {
- ForceUpdate(rPropertySet);
- }
- else
- {
- // normal mode: set value (if present)
- if (bTimeOK)
- {
- if (xPropertySetInfo->hasPropertyByName(sPropertyDateTimeValue))
- {
- aAny <<= aDateTimeValue;
- rPropertySet->setPropertyValue(sPropertyDateTimeValue,aAny);
- }
- else if (xPropertySetInfo->hasPropertyByName(sPropertyDateTime))
- {
- aAny <<= aDateTimeValue;
- rPropertySet->setPropertyValue(sPropertyDateTime, aAny);
- }
- }
- }
- }
-
- if (bFormatOK &&
- xPropertySetInfo->hasPropertyByName(sPropertyNumberFormat))
- {
- aAny <<= nFormatKey;
- rPropertySet->setPropertyValue(sPropertyNumberFormat, aAny);
-
- if( xPropertySetInfo->hasPropertyByName( sPropertyIsFixedLanguage ) )
- {
- sal_Bool bIsFixedLanguage = ! bIsDefaultLanguage;
- aAny.setValue( &bIsFixedLanguage, ::getBooleanCppuType() );
- rPropertySet->setPropertyValue( sPropertyIsFixedLanguage, aAny );
- }
- }
-}
-
-
-
-//
-// date field
-//
-
-TYPEINIT1( XMLDateFieldImportContext, XMLTimeFieldImportContext );
-
-XMLDateFieldImportContext::XMLDateFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName) :
- XMLTimeFieldImportContext(rImport, rHlp, nPrfx, sLocalName)
-{
- bIsDate = sal_True; // always a date!
-}
-
-void XMLDateFieldImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const ::rtl::OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_DATE_VALUE:
- {
- double fTmp;
-
- if (GetImport().GetMM100UnitConverter().
- convertDateTime(fTmp, sAttrValue))
- {
- // #96457#: don't truncate in order to read date+time
- fTimeValue = fTmp;
- bTimeOK = sal_True;
- }
-
- if (GetImport().GetMM100UnitConverter().
- convertDateTime(aDateTimeValue, sAttrValue ))
- {
- bTimeOK = sal_True;
- }
- break;
- }
- case XML_TOK_TEXTFIELD_DATE_ADJUST:
- // delegate to superclass, pretending it was a time-adjust attr.
- XMLTimeFieldImportContext::ProcessAttribute(
- XML_TOK_TEXTFIELD_TIME_ADJUST,
- sAttrValue);
- break;
- case XML_TOK_TEXTFIELD_TIME_VALUE:
- case XML_TOK_TEXTFIELD_TIME_ADJUST:
- ; // ignore time-adjust and time-value attributes
- break;
- default:
- // all others: delegate to super-class
- XMLTimeFieldImportContext::ProcessAttribute(nAttrToken,
- sAttrValue);
- break;
- }
-}
-
-
-
-
-//
-// database field superclass
-//
-
-TYPEINIT1( XMLDatabaseFieldImportContext, XMLTextFieldImportContext );
-
-XMLDatabaseFieldImportContext::XMLDatabaseFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- const sal_Char* pServiceName, sal_uInt16 nPrfx,
- const OUString& sLocalName, bool bUseDisply) :
- XMLTextFieldImportContext(rImport, rHlp, pServiceName,
- nPrfx, sLocalName),
- sPropertyDatabaseName(
- RTL_CONSTASCII_USTRINGPARAM(sAPI_data_base_name)),
- sPropertyTableName(RTL_CONSTASCII_USTRINGPARAM(sAPI_data_table_name)),
- sPropertyDataCommandType(
- RTL_CONSTASCII_USTRINGPARAM(sAPI_data_command_type)),
- sPropertyIsVisible(
- RTL_CONSTASCII_USTRINGPARAM(sAPI_is_visible)),
- sDatabaseName(),
- sTableName(),
- nCommandType( sdb::CommandType::TABLE ),
- bDatabaseOK(sal_False),
- bCommandTypeOK(sal_False),
- bTableOK(sal_False),
- bUseDisplay( bUseDisply ),
- bDisplay( sal_True ),
- bDisplayOK( false )
-{
-}
-
-void XMLDatabaseFieldImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken, const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_DATABASE_NAME:
- sDatabaseName = sAttrValue;
- bDatabaseOK = sal_True;
- break;
- case XML_TOK_TEXTFIELD_TABLE_NAME:
- sTableName = sAttrValue;
- bTableOK = sal_True;
- break;
- case XML_TOK_TEXTFIELD_TABLE_TYPE:
- if( IsXMLToken( sAttrValue, XML_TABLE ) )
- {
- nCommandType = sdb::CommandType::TABLE;
- bCommandTypeOK = sal_True;
- }
- else if( IsXMLToken( sAttrValue, XML_QUERY ) )
- {
- nCommandType = sdb::CommandType::QUERY;
- bCommandTypeOK = sal_True;
- }
- else if( IsXMLToken( sAttrValue, XML_COMMAND ) )
- {
- nCommandType = sdb::CommandType::COMMAND;
- bCommandTypeOK = sal_True;
- }
- break;
- case XML_TOK_TEXTFIELD_DISPLAY:
- if( IsXMLToken( sAttrValue, XML_NONE ) )
- {
- bDisplay = sal_False;
- bDisplayOK = true;
- }
- else if( IsXMLToken( sAttrValue, XML_VALUE ) )
- {
- bDisplay = sal_True;
- bDisplayOK = true;
- }
- break;
- }
-}
-
-void XMLDatabaseFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- aAny <<= sTableName;
- xPropertySet->setPropertyValue(sPropertyTableName, aAny);
-
- aAny <<= sDatabaseName;
- xPropertySet->setPropertyValue(sPropertyDatabaseName, aAny);
-
- // #99980# load/save command type for all fields; also load
- // old documents without command type
- if( bCommandTypeOK )
- {
- aAny <<= nCommandType;
- xPropertySet->setPropertyValue( sPropertyDataCommandType, aAny );
- }
-
- if( bUseDisplay && bDisplayOK )
- {
- aAny.setValue( &bDisplay, ::getBooleanCppuType() );
- xPropertySet->setPropertyValue( sPropertyIsVisible, aAny );
- }
-}
-
-
-
-//
-// database name field
-//
-
-TYPEINIT1( XMLDatabaseNameImportContext, XMLDatabaseFieldImportContext );
-
-XMLDatabaseNameImportContext::XMLDatabaseNameImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName) :
- XMLDatabaseFieldImportContext(rImport, rHlp, sAPI_database_name,
- nPrfx, sLocalName, true)
-{
-}
-
-void XMLDatabaseNameImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken, const OUString& sAttrValue )
-{
- // delegate to superclass and check for success
- XMLDatabaseFieldImportContext::ProcessAttribute(nAttrToken, sAttrValue);
- bValid = bDatabaseOK && bTableOK;
-}
-
-
-
-//
-// database next field
-//
-
-TYPEINIT1( XMLDatabaseNextImportContext, XMLDatabaseFieldImportContext );
-
-XMLDatabaseNextImportContext::XMLDatabaseNextImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- const sal_Char* pServiceName, sal_uInt16 nPrfx,
- const OUString& sLocalName) :
- XMLDatabaseFieldImportContext(rImport, rHlp, pServiceName,
- nPrfx, sLocalName, false),
- sPropertyCondition(RTL_CONSTASCII_USTRINGPARAM(sAPI_condition)),
- sTrue(RTL_CONSTASCII_USTRINGPARAM(sAPI_true)),
- sCondition(),
- bConditionOK(sal_False)
-{
-}
-
-XMLDatabaseNextImportContext::XMLDatabaseNextImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName) :
- XMLDatabaseFieldImportContext(rImport, rHlp, sAPI_database_next,
- nPrfx, sLocalName, false),
- sPropertyCondition(RTL_CONSTASCII_USTRINGPARAM(sAPI_condition)),
- sTrue(RTL_CONSTASCII_USTRINGPARAM(sAPI_true)),
- sCondition(),
- bConditionOK(sal_False)
-{
-}
-
-void XMLDatabaseNextImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken, const OUString& sAttrValue )
-{
- if (XML_TOK_TEXTFIELD_CONDITION == nAttrToken)
- {
- sCondition = sAttrValue;
- bConditionOK = sal_True;
- }
- else
- {
- XMLDatabaseFieldImportContext::ProcessAttribute(nAttrToken,
- sAttrValue);
- }
-
- bValid = bDatabaseOK && bTableOK;
-}
-
-void XMLDatabaseNextImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- aAny <<= bConditionOK ? sCondition : sTrue;
- xPropertySet->setPropertyValue(sPropertyCondition, aAny);
-
- XMLDatabaseFieldImportContext::PrepareField(xPropertySet);
-}
-
-
-
-//
-// database select field
-//
-
-TYPEINIT1( XMLDatabaseSelectImportContext, XMLDatabaseNextImportContext );
-
-XMLDatabaseSelectImportContext::XMLDatabaseSelectImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const ::rtl::OUString& sLocalName) :
- XMLDatabaseNextImportContext(rImport, rHlp, sAPI_database_select,
- nPrfx, sLocalName),
- sPropertySetNumber(RTL_CONSTASCII_USTRINGPARAM(sAPI_set_number)),
- nNumber(0),
- bNumberOK(sal_False)
-{
-}
-
-void XMLDatabaseSelectImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const ::rtl::OUString& sAttrValue )
-{
- if (XML_TOK_TEXTFIELD_ROW_NUMBER == nAttrToken)
- {
- sal_Int32 nTmp;
- if (SvXMLUnitConverter::convertNumber( nTmp, sAttrValue
- /* , nMin, nMax ??? */ ))
- {
- nNumber = nTmp;
- bNumberOK = sal_True;
- }
- }
- else
- {
- XMLDatabaseNextImportContext::ProcessAttribute(nAttrToken, sAttrValue);
- }
-
- bValid = bTableOK && bDatabaseOK && bNumberOK;
-}
-
-void XMLDatabaseSelectImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- aAny <<= nNumber;
- xPropertySet->setPropertyValue(sPropertySetNumber, aAny);
-
- XMLDatabaseNextImportContext::PrepareField(xPropertySet);
-}
-
-
-
-//
-// database display row number field
-//
-
-TYPEINIT1( XMLDatabaseNumberImportContext, XMLDatabaseFieldImportContext );
-
-XMLDatabaseNumberImportContext::XMLDatabaseNumberImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName) :
- XMLDatabaseFieldImportContext(rImport, rHlp, sAPI_database_number,
- nPrfx, sLocalName, true),
- sPropertyNumberingType(
- RTL_CONSTASCII_USTRINGPARAM(sAPI_numbering_type)),
- sPropertySetNumber(RTL_CONSTASCII_USTRINGPARAM(sAPI_set_number)),
- sNumberFormat(RTL_CONSTASCII_USTRINGPARAM("1")),
- sNumberSync(GetXMLToken(XML_FALSE)),
- nValue(0),
- bValueOK(sal_False)
-{
-}
-
-void XMLDatabaseNumberImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_NUM_FORMAT:
- sNumberFormat = sAttrValue;
- break;
- case XML_TOK_TEXTFIELD_NUM_LETTER_SYNC:
- sNumberSync = sAttrValue;
- break;
- case XML_TOK_TEXTFIELD_VALUE:
- {
- sal_Int32 nTmp;
- if (SvXMLUnitConverter::convertNumber( nTmp, sAttrValue ))
- {
- nValue = nTmp;
- bValueOK = sal_True;
- }
- break;
- }
- default:
- XMLDatabaseFieldImportContext::ProcessAttribute(nAttrToken,
- sAttrValue);
- break;
- }
-
- bValid = bTableOK && bDatabaseOK;
-}
-
-void XMLDatabaseNumberImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- sal_Int16 nNumType = style::NumberingType::ARABIC;
- GetImport().GetMM100UnitConverter().convertNumFormat( nNumType,
- sNumberFormat,
- sNumberSync );
- aAny <<= nNumType;
- xPropertySet->setPropertyValue(sPropertyNumberingType, aAny);
-
- if (bValueOK)
- {
- aAny <<= nValue;
- xPropertySet->setPropertyValue(sPropertySetNumber, aAny);
- }
-
- XMLDatabaseFieldImportContext::PrepareField(xPropertySet);
-}
-
-
-
-//
-// Simple doc info fields
-//
-
-TYPEINIT1( XMLSimpleDocInfoImportContext, XMLTextFieldImportContext );
-
-XMLSimpleDocInfoImportContext::XMLSimpleDocInfoImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName, sal_uInt16 nToken,
- sal_Bool bContent, sal_Bool bAuthor) :
- XMLTextFieldImportContext(rImport, rHlp, MapTokenToServiceName(nToken),
- nPrfx, sLocalName),
- bFixed(sal_False),
- bHasAuthor(bAuthor),
- bHasContent(bContent),
- sPropertyFixed(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_fixed)),
- sPropertyContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_content)),
- sPropertyAuthor(RTL_CONSTASCII_USTRINGPARAM(sAPI_author))
-//STRIP013 ,sPropertyCurrentPresentation(
-//STRIP013 RTL_CONSTASCII_USTRINGPARAM(sAPI_current_presentation))
-{
- bValid = sal_True;
-}
-
-void XMLSimpleDocInfoImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- if (XML_TOK_TEXTFIELD_FIXED == nAttrToken)
- {
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(bTmp, sAttrValue))
- {
- bFixed = bTmp;
- }
- }
-}
-
-void XMLSimpleDocInfoImportContext::PrepareField(
- const Reference<XPropertySet> & rPropertySet)
-{
- // title field in Calc has no Fixed property
- Reference<XPropertySetInfo> xPropertySetInfo(rPropertySet->getPropertySetInfo());
- if (xPropertySetInfo->hasPropertyByName(sPropertyFixed))
- {
- Any aAny;
- aAny.setValue(&bFixed, ::getBooleanCppuType() );
- rPropertySet->setPropertyValue(sPropertyFixed, aAny);
-
- // set Content and CurrentPresentation (if fixed)
- if (bFixed)
- {
- // in organizer-mode or styles-only-mode, only force update
- if (GetImport().GetTextImport()->IsOrganizerMode() ||
- GetImport().GetTextImport()->IsStylesOnlyMode() )
- {
- ForceUpdate(rPropertySet);
- }
- else
- {
- // set content (author, if that's the name) and current
- // presentation
- aAny <<= GetContent();
-
- if (bFixed && bHasAuthor)
- {
- rPropertySet->setPropertyValue(sPropertyAuthor, aAny);
- }
-
- if (bFixed && bHasContent)
- {
- rPropertySet->setPropertyValue(sPropertyContent, aAny);
- }
-
-//STRIP013 // #111880#-4
-//STRIP013 // The API for binfilter does not have this property, so test it first
-//STRIP013 // before using it to not throw exceptions
-//STRIP013 if (xPropertySetInfo->hasPropertyByName(sPropertyCurrentPresentation))
-//STRIP013 {
-//STRIP013 rPropertySet->setPropertyValue(sPropertyCurrentPresentation, aAny);
-//STRIP013 }
- }
- }
- }
-}
-
-const sal_Char* XMLSimpleDocInfoImportContext::MapTokenToServiceName(
- sal_uInt16 nToken)
-{
- const sal_Char* pServiceName = NULL;
-
- switch(nToken)
- {
- case XML_TOK_TEXT_DOCUMENT_CREATION_AUTHOR:
- pServiceName = sAPI_docinfo_create_author;
- break;
- case XML_TOK_TEXT_DOCUMENT_CREATION_DATE:
- pServiceName = sAPI_docinfo_create_date_time;
- break;
- case XML_TOK_TEXT_DOCUMENT_CREATION_TIME:
- pServiceName = sAPI_docinfo_create_date_time;
- break;
- case XML_TOK_TEXT_DOCUMENT_DESCRIPTION:
- pServiceName = sAPI_docinfo_description;
- break;
- case XML_TOK_TEXT_DOCUMENT_EDIT_DURATION:
- pServiceName = sAPI_docinfo_edit_time;
- break;
- case XML_TOK_TEXT_DOCUMENT_INFORMATION_0:
- pServiceName = sAPI_docinfo_info0;
- break;
- case XML_TOK_TEXT_DOCUMENT_INFORMATION_1:
- pServiceName = sAPI_docinfo_info1;
- break;
- case XML_TOK_TEXT_DOCUMENT_INFORMATION_2:
- pServiceName = sAPI_docinfo_info2;
- break;
- case XML_TOK_TEXT_DOCUMENT_INFORMATION_3:
- pServiceName = sAPI_docinfo_info3;
- break;
- case XML_TOK_TEXT_DOCUMENT_PRINT_AUTHOR:
- pServiceName = sAPI_docinfo_print_author;
- break;
- case XML_TOK_TEXT_DOCUMENT_PRINT_DATE:
- pServiceName = sAPI_docinfo_print_date_time;
- break;
- case XML_TOK_TEXT_DOCUMENT_PRINT_TIME:
- pServiceName = sAPI_docinfo_print_date_time;
- break;
- case XML_TOK_TEXT_DOCUMENT_KEYWORDS:
- pServiceName = sAPI_docinfo_keywords;
- break;
- case XML_TOK_TEXT_DOCUMENT_SUBJECT:
- pServiceName = sAPI_docinfo_subject;
- break;
- case XML_TOK_TEXT_DOCUMENT_REVISION:
- pServiceName = sAPI_docinfo_revision;
- break;
- case XML_TOK_TEXT_DOCUMENT_SAVE_AUTHOR:
- pServiceName = sAPI_docinfo_change_author;
- break;
- case XML_TOK_TEXT_DOCUMENT_SAVE_DATE:
- pServiceName = sAPI_docinfo_change_date_time;
- break;
- case XML_TOK_TEXT_DOCUMENT_SAVE_TIME:
- pServiceName = sAPI_docinfo_change_date_time;
- break;
- case XML_TOK_TEXT_DOCUMENT_TITLE:
- pServiceName = sAPI_docinfo_title;
- break;
- case XML_TOK_TEXT_DOCUMENT_USER_DEFINED:
- // hack: service name not used in XMLUserDocInfoImportContext
- pServiceName = sAPI_docinfo_info0;
- break;
-
- default:
- DBG_ERROR("no docinfo field token");
- pServiceName = NULL;
- break;
- }
-
- return pServiceName;
-}
-
-
-//
-// revision field
-//
-
-TYPEINIT1( XMLRevisionDocInfoImportContext, XMLSimpleDocInfoImportContext );
-
-XMLRevisionDocInfoImportContext::XMLRevisionDocInfoImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
- const OUString& sLocalName, sal_uInt16 nToken) :
- XMLSimpleDocInfoImportContext(rImport, rHlp, nPrfx, sLocalName,
- nToken, sal_False, sal_False),
- sPropertyRevision(RTL_CONSTASCII_USTRINGPARAM(sAPI_revision))
-{
- bValid = sal_True;
-}
-
-void XMLRevisionDocInfoImportContext::PrepareField(
- const Reference<XPropertySet> & rPropertySet)
-{
- XMLSimpleDocInfoImportContext::PrepareField(rPropertySet);
-
- // set revision number
- // if fixed, if not in organizer-mode, if not in styles-only-mode
- if (bFixed)
- {
- if ( GetImport().GetTextImport()->IsOrganizerMode() ||
- GetImport().GetTextImport()->IsStylesOnlyMode() )
- {
- ForceUpdate(rPropertySet);
- }
- else
- {
- sal_Int32 nTmp;
- if (SvXMLUnitConverter::convertNumber(nTmp, GetContent()))
- {
- Any aAny;
- aAny <<= nTmp;
- rPropertySet->setPropertyValue(sPropertyRevision, aAny);
- }
- }
- }
-}
-
-
-
-//
-// DocInfo fields with date/time attributes
-//
-
-TYPEINIT1( XMLDateTimeDocInfoImportContext, XMLSimpleDocInfoImportContext );
-
-XMLDateTimeDocInfoImportContext::XMLDateTimeDocInfoImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
- const OUString& sLocalName, sal_uInt16 nToken) :
- XMLSimpleDocInfoImportContext(rImport, rHlp, nPrfx, sLocalName,
- nToken, sal_False, sal_False),
- sPropertyNumberFormat(RTL_CONSTASCII_USTRINGPARAM(sAPI_number_format)),
- sPropertyIsDate(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_date)),
- sPropertyIsFixedLanguage(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_fixed_language)),
- nFormat(0),
- bFormatOK(sal_False),
- bIsDefaultLanguage(sal_True)
-{
- // we allow processing of EDIT_DURATION here, because import of actual
- // is not supported anyway. If it was, we'd need an extra import class
- // because times and time durations are presented differently!
-
- bValid = sal_True;
- switch (nToken)
- {
- case XML_TOK_TEXT_DOCUMENT_CREATION_DATE:
- case XML_TOK_TEXT_DOCUMENT_PRINT_DATE:
- case XML_TOK_TEXT_DOCUMENT_SAVE_DATE:
- bIsDate = sal_True;
- bHasDateTime = sal_True;
- break;
- case XML_TOK_TEXT_DOCUMENT_CREATION_TIME:
- case XML_TOK_TEXT_DOCUMENT_PRINT_TIME:
- case XML_TOK_TEXT_DOCUMENT_SAVE_TIME:
- bIsDate = sal_False;
- bHasDateTime = sal_True;
- break;
- case XML_TOK_TEXT_DOCUMENT_EDIT_DURATION:
- bIsDate = sal_False;
- bHasDateTime = sal_False;
- break;
- default:
- DBG_ERROR(
- "XMLDateTimeDocInfoImportContext needs date/time doc. fields");
- bValid = sal_False;
- break;
- }
-}
-
-void XMLDateTimeDocInfoImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_DATA_STYLE_NAME:
- {
- sal_Int32 nKey = GetImportHelper().GetDataStyleKey(sAttrValue,
- &bIsDefaultLanguage);
- if (-1 != nKey)
- {
- nFormat = nKey;
- bFormatOK = sal_True;
- }
- break;
- }
- case XML_TOK_TEXTFIELD_FIXED:
- XMLSimpleDocInfoImportContext::ProcessAttribute(nAttrToken,
- sAttrValue);
- break;
- default:
- // ignore -> we can't set date/time value anyway!
- break;
- }
-}
-
-void XMLDateTimeDocInfoImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- // process fixed and presentation
- XMLSimpleDocInfoImportContext::PrepareField(xPropertySet);
-
- Any aAny;
-
- if (bHasDateTime)
- {
- aAny.setValue( &bIsDate, ::getBooleanCppuType());
- xPropertySet->setPropertyValue(sPropertyIsDate, aAny);
- }
-
- if (bFormatOK)
- {
- aAny <<= nFormat;
- xPropertySet->setPropertyValue(sPropertyNumberFormat, aAny);
-
- if( xPropertySet->getPropertySetInfo()->
- hasPropertyByName( sPropertyIsFixedLanguage ) )
- {
- sal_Bool bIsFixedLanguage = ! bIsDefaultLanguage;
- aAny.setValue( &bIsFixedLanguage, ::getBooleanCppuType() );
- xPropertySet->setPropertyValue( sPropertyIsFixedLanguage, aAny );
- }
- }
-
- // can't set date/time/duration value! Sorry.
-}
-
-
-//
-// user defined docinfo fields
-//
-
-TYPEINIT1( XMLUserDocInfoImportContext, XMLSimpleDocInfoImportContext );
-
-XMLUserDocInfoImportContext::XMLUserDocInfoImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName, sal_uInt16 nToken) :
- XMLSimpleDocInfoImportContext(rImport, rHlp, nPrfx,
- sLocalName, nToken,
- sal_False, sal_False)
-{
-}
-
-void XMLUserDocInfoImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- static const sal_Char* aUserDocInfoServiceNames[] =
- {
- sAPI_docinfo_info0,
- sAPI_docinfo_info1,
- sAPI_docinfo_info2,
- sAPI_docinfo_info3
- };
-
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_NAME:
- {
- // iterate over user field names, until match is found
- Reference<XDocumentInfoSupplier> xDocInfoSupp(
- GetImport().GetModel(), UNO_QUERY);
- Reference<XDocumentInfo> xDocInfo =
- xDocInfoSupp->getDocumentInfo();
- sal_Int16 nCount = xDocInfo->getUserFieldCount();
- DBG_ASSERT((nCount*sizeof(sal_Char*) <=
- sizeof(aUserDocInfoServiceNames)), "unknown service");
- for(sal_Int16 i = 0; i<nCount; i++)
- {
- if (0 == sAttrValue.compareTo(xDocInfo->getUserFieldName(i)))
- {
- SetServiceName(OUString::createFromAscii(
- aUserDocInfoServiceNames[i]));
- bValid = sal_True;
- break; // for loop; no need to check remainder
- }
- }
- break;
- }
-
- default:
- XMLSimpleDocInfoImportContext::ProcessAttribute(nAttrToken,
- sAttrValue);
- break;
- }
-}
-
-
-
-//
-// import hidden paragraph fields
-//
-
-TYPEINIT1( XMLHiddenParagraphImportContext, XMLTextFieldImportContext );
-
-XMLHiddenParagraphImportContext::XMLHiddenParagraphImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_hidden_paragraph,
- nPrfx, sLocalName),
- sPropertyCondition(RTL_CONSTASCII_USTRINGPARAM(sAPI_condition)),
- sPropertyIsHidden(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_hidden)),
- sCondition(),
- bIsHidden(sal_False)
-{
-}
-
-void XMLHiddenParagraphImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- if (XML_TOK_TEXTFIELD_CONDITION == nAttrToken)
- {
- sCondition = sAttrValue;
- bValid = sal_True;
- }
- else if (XML_TOK_TEXTFIELD_IS_HIDDEN == nAttrToken)
- {
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(bTmp, sAttrValue))
- {
- bIsHidden = bTmp;
- }
- }
-}
-
-void XMLHiddenParagraphImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
- aAny <<= sCondition;
- xPropertySet->setPropertyValue(sPropertyCondition, aAny);
-
- aAny.setValue( &bIsHidden, ::getBooleanCppuType() );
- xPropertySet->setPropertyValue(sPropertyIsHidden, aAny);
-}
-
-
-
-//
-// import conditional text (<text:conditional-text>)
-//
-
-TYPEINIT1( XMLConditionalTextImportContext, XMLTextFieldImportContext );
-
-XMLConditionalTextImportContext::XMLConditionalTextImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_conditional_text,
- nPrfx, sLocalName),
- sPropertyCondition(RTL_CONSTASCII_USTRINGPARAM(sAPI_condition)),
- sPropertyTrueContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_true_content)),
- sPropertyFalseContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_false_content)),
- sPropertyIsConditionTrue(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_condition_true)),
-//STRIP013 sPropertyCurrentPresentation(RTL_CONSTASCII_USTRINGPARAM(sAPI_current_presentation)),
- sCondition(),
- sTrueContent(),
- sFalseContent(),
- bConditionOK(sal_False),
- bTrueOK(sal_False),
- bFalseOK(sal_False),
- bCurrentValue(sal_False)
-{
-}
-
-void XMLConditionalTextImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_CONDITION:
- sCondition = sAttrValue;
- bConditionOK = sal_True;
- break;
- case XML_TOK_TEXTFIELD_STRING_VALUE_IF_FALSE:
- sFalseContent = sAttrValue;
- bFalseOK = sal_True;
- break;
- case XML_TOK_TEXTFIELD_STRING_VALUE_IF_TRUE:
- sTrueContent = sAttrValue;
- bTrueOK = sal_True;
- break;
- case XML_TOK_TEXTFIELD_CURRENT_VALUE:
- {
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(bTmp, sAttrValue))
- {
- bCurrentValue = bTmp;
- }
- break;
- }
- }
-
- bValid = bConditionOK && bFalseOK && bTrueOK;
-}
-
-void XMLConditionalTextImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- aAny <<= sCondition;
- xPropertySet->setPropertyValue(sPropertyCondition, aAny);
-
- aAny <<= sFalseContent;
- xPropertySet->setPropertyValue(sPropertyFalseContent, aAny);
-
- aAny <<= sTrueContent;
- xPropertySet->setPropertyValue(sPropertyTrueContent, aAny);
-
- aAny.setValue( &bCurrentValue, ::getBooleanCppuType() );
- xPropertySet->setPropertyValue(sPropertyIsConditionTrue, aAny);
-
-//STRIP013 // #111880#-4
-//STRIP013 // The API for binfilter does not have this property, so test it first
-//STRIP013 // before using it to not throw exceptions
-//STRIP013 // properties are optional
-//STRIP013 Reference<XPropertySetInfo> xPropertySetInfo(xPropertySet->getPropertySetInfo());
-//STRIP013
-//STRIP013 if (xPropertySetInfo->hasPropertyByName(sPropertyCurrentPresentation))
-//STRIP013 {
-//STRIP013 aAny <<= GetContent();
-//STRIP013 xPropertySet->setPropertyValue(sPropertyCurrentPresentation, aAny);
-//STRIP013 }
-}
-
-
-
-//
-// hidden text
-//
-
-TYPEINIT1( XMLHiddenTextImportContext, XMLTextFieldImportContext);
-
-XMLHiddenTextImportContext::XMLHiddenTextImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_hidden_text,
- nPrfx, sLocalName),
- sPropertyCondition(RTL_CONSTASCII_USTRINGPARAM(sAPI_condition)),
- sPropertyContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_content)),
- sPropertyIsHidden(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_hidden)),
- sCondition(),
- sString(),
- bConditionOK(sal_False),
- bStringOK(sal_False),
- bIsHidden(sal_False)
-{
-}
-
-void XMLHiddenTextImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_CONDITION:
- sCondition = sAttrValue;
- bConditionOK = sal_True;
- break;
- case XML_TOK_TEXTFIELD_STRING_VALUE:
- sString = sAttrValue;
- bStringOK = sal_True;
- break;
- case XML_TOK_TEXTFIELD_IS_HIDDEN:
- {
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(bTmp, sAttrValue))
- {
- bIsHidden = bTmp;
- }
- break;
- }
- }
-
- bValid = bConditionOK && bStringOK;
-}
-
-void XMLHiddenTextImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- aAny <<= sCondition;
- xPropertySet->setPropertyValue(sPropertyCondition, aAny);
-
- aAny <<= sString;
- xPropertySet->setPropertyValue(sPropertyContent, aAny);
-
- aAny.setValue( &bIsHidden, ::getBooleanCppuType() );
- xPropertySet->setPropertyValue(sPropertyIsHidden, aAny);
-}
-
-
-
-//
-// file name fields
-//
-
-TYPEINIT1( XMLFileNameImportContext, XMLTextFieldImportContext );
-
-static const SvXMLEnumMapEntry aFilenameDisplayMap[] =
-{
- { XML_PATH, FilenameDisplayFormat::PATH },
- { XML_NAME, FilenameDisplayFormat::NAME },
- { XML_NAME_AND_EXTENSION, FilenameDisplayFormat::NAME_AND_EXT },
- { XML_FULL, FilenameDisplayFormat::FULL },
- { XML_TOKEN_INVALID, 0 }
-};
-
-XMLFileNameImportContext::XMLFileNameImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
- const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_file_name,
- nPrfx, sLocalName),
- sPropertyFixed(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_fixed)),
- sPropertyFileFormat(RTL_CONSTASCII_USTRINGPARAM(sAPI_file_format)),
-//STRIP013 sPropertyCurrentPresentation(
-//STRIP013 RTL_CONSTASCII_USTRINGPARAM(sAPI_current_presentation)),
- nFormat(FilenameDisplayFormat::FULL),
- bFixed(sal_False)
-{
- bValid = sal_True;
-}
-
-void XMLFileNameImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const ::rtl::OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_FIXED:
- {
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(bTmp, sAttrValue))
- {
- bFixed = bTmp;
- }
- break;
- }
- case XML_TOK_TEXTFIELD_DISPLAY:
- {
- sal_uInt16 nTmp;
- if (SvXMLUnitConverter::convertEnum(nTmp, sAttrValue,
- aFilenameDisplayMap))
- {
- nFormat = (sal_uInt16)nTmp;
- }
- break;
- }
- default:
- ; // unkown attribute: ignore
- break;
- }
-}
-
-void XMLFileNameImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- // properties are optional
- Reference<XPropertySetInfo> xPropertySetInfo(
- xPropertySet->getPropertySetInfo());
-
- if (xPropertySetInfo->hasPropertyByName(sPropertyFixed))
- {
- aAny <<= bFixed;
- xPropertySet->setPropertyValue(sPropertyFixed, aAny);
- }
-
- if (xPropertySetInfo->hasPropertyByName(sPropertyFileFormat))
- {
- aAny <<= nFormat;
- xPropertySet->setPropertyValue(sPropertyFileFormat, aAny);
- }
-
-//STRIP013 if (xPropertySetInfo->hasPropertyByName(sPropertyCurrentPresentation))
-//STRIP013 {
-//STRIP013 aAny <<= GetContent();
-//STRIP013 xPropertySet->setPropertyValue(sPropertyCurrentPresentation, aAny);
-//STRIP013 }
-}
-
-
-//
-// template name field
-//
-
-static const SvXMLEnumMapEntry aTemplateDisplayMap[] =
-{
- { XML_FULL, TemplateDisplayFormat::FULL },
- { XML_PATH, TemplateDisplayFormat::PATH },
- { XML_NAME, TemplateDisplayFormat::NAME },
- { XML_NAME_AND_EXTENSION, TemplateDisplayFormat::NAME_AND_EXT },
- { XML_AREA, TemplateDisplayFormat::AREA },
- { XML_TITLE, TemplateDisplayFormat::TITLE },
- { XML_TOKEN_INVALID, 0 }
-};
-
-TYPEINIT1( XMLTemplateNameImportContext, XMLTextFieldImportContext );
-
-XMLTemplateNameImportContext::XMLTemplateNameImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
- const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_template_name,
- nPrfx, sLocalName),
- sPropertyFileFormat(RTL_CONSTASCII_USTRINGPARAM(sAPI_file_format)),
- nFormat(TemplateDisplayFormat::FULL)
-{
- bValid = sal_True;
-}
-
-void XMLTemplateNameImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_DISPLAY:
- {
- sal_uInt16 nTmp;
- if (SvXMLUnitConverter::convertEnum(nTmp, sAttrValue,
- aTemplateDisplayMap))
- {
- nFormat = (sal_uInt16)nTmp;
- }
- break;
- }
- default:
- ; // unknown attribute: ignore
- break;
- }
-}
-
-void XMLTemplateNameImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- aAny <<= nFormat;
- xPropertySet->setPropertyValue(sPropertyFileFormat, aAny);
-}
-
-
-//
-// import chapter fields
-//
-
-TYPEINIT1( XMLChapterImportContext, XMLTextFieldImportContext );
-
-static const SvXMLEnumMapEntry aChapterDisplayMap[] =
-{
- { XML_NAME, ChapterFormat::NAME },
- { XML_NUMBER, ChapterFormat::NUMBER },
- { XML_NUMBER_AND_NAME, ChapterFormat::NAME_NUMBER },
- { XML_PLAIN_NUMBER_AND_NAME, ChapterFormat::NO_PREFIX_SUFFIX },
- { XML_PLAIN_NUMBER, ChapterFormat::DIGIT },
- { XML_TOKEN_INVALID, 0 }
-};
-
-XMLChapterImportContext::XMLChapterImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_chapter,
- nPrfx, sLocalName),
- sPropertyChapterFormat(
- RTL_CONSTASCII_USTRINGPARAM(sAPI_chapter_format)),
- sPropertyLevel(RTL_CONSTASCII_USTRINGPARAM(sAPI_level)),
- nFormat(ChapterFormat::NAME_NUMBER),
- nLevel(0)
-{
- bValid = sal_True;
-}
-
-void XMLChapterImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_DISPLAY:
- {
- sal_uInt16 nTmp;
- if (SvXMLUnitConverter::convertEnum(nTmp, sAttrValue,
- aChapterDisplayMap))
- {
- nFormat = (sal_Int16)nTmp;
- }
- break;
- }
- case XML_TOK_TEXTFIELD_OUTLINE_LEVEL:
- {
- sal_Int32 nTmp;
- if (SvXMLUnitConverter::convertNumber(
- nTmp, sAttrValue, 1,
- GetImport().GetTextImport()->GetChapterNumbering()->getCount()
- ))
- {
- // API numbers 0..9, we number 1..10
- nLevel = (sal_Int8)nTmp;
- nLevel--;
- }
- break;
- }
- default:
- ; // unknown attribute: ignore
- break;
- }
-}
-
-void XMLChapterImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- aAny <<= nFormat;
- xPropertySet->setPropertyValue(sPropertyChapterFormat, aAny);
-
- aAny <<= nLevel;
- xPropertySet->setPropertyValue(sPropertyLevel, aAny);
-}
-
-
-//
-// counting fields
-//
-
-TYPEINIT1( XMLCountFieldImportContext, XMLTextFieldImportContext );
-
-XMLCountFieldImportContext::XMLCountFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName, sal_uInt16 nToken) :
- XMLTextFieldImportContext(rImport, rHlp, MapTokenToServiceName(nToken),
- nPrfx, sLocalName),
- sPropertyNumberingType(
- RTL_CONSTASCII_USTRINGPARAM(sAPI_numbering_type)),
- sNumberFormat(),
- sLetterSync(),
- bNumberFormatOK(sal_False)
-{
- bValid = sal_True;
-}
-
-void XMLCountFieldImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_NUM_FORMAT:
- sNumberFormat = sAttrValue;
- bNumberFormatOK = sal_True;
- break;
- case XML_TOK_TEXTFIELD_NUM_LETTER_SYNC:
- sLetterSync = sAttrValue;
- break;
- }
-}
-
-void XMLCountFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- // properties optional
- // (only page count, but do for all to save common implementation)
-
- if (xPropertySet->getPropertySetInfo()->
- hasPropertyByName(sPropertyNumberingType))
- {
- sal_Int16 nNumType;
- if( bNumberFormatOK )
- {
- nNumType= style::NumberingType::ARABIC;
- GetImport().GetMM100UnitConverter().convertNumFormat( nNumType,
- sNumberFormat,
- sLetterSync );
- }
- else
- nNumType = style::NumberingType::PAGE_DESCRIPTOR;
- aAny <<= nNumType;
- xPropertySet->setPropertyValue(sPropertyNumberingType, aAny);
- }
-}
-
-const sal_Char* XMLCountFieldImportContext::MapTokenToServiceName(
- sal_uInt16 nToken)
-{
- const sal_Char* pServiceName = NULL;
-
- switch (nToken)
- {
- case XML_TOK_TEXT_WORD_COUNT:
- pServiceName = sAPI_word_count;
- break;
- case XML_TOK_TEXT_PARAGRAPH_COUNT:
- pServiceName = sAPI_paragraph_count;
- break;
- case XML_TOK_TEXT_TABLE_COUNT:
- pServiceName = sAPI_table_count;
- break;
- case XML_TOK_TEXT_CHARACTER_COUNT:
- pServiceName = sAPI_character_count;
- break;
- case XML_TOK_TEXT_IMAGE_COUNT:
- pServiceName = sAPI_graphic_object_count;
- break;
- case XML_TOK_TEXT_OBJECT_COUNT:
- pServiceName = sAPI_embedded_object_count;
- break;
- case XML_TOK_TEXT_PAGE_COUNT:
- pServiceName = sAPI_page_count;
- break;
- default:
- pServiceName = NULL;
- DBG_ERROR("unknown count field!");
- break;
- }
-
- return pServiceName;
-}
-
-
-
-//
-// page variable import
-//
-
-TYPEINIT1( XMLPageVarGetFieldImportContext, XMLTextFieldImportContext );
-
-XMLPageVarGetFieldImportContext::XMLPageVarGetFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_reference_page_get,
- nPrfx, sLocalName),
- sPropertyNumberingType(
- RTL_CONSTASCII_USTRINGPARAM(sAPI_numbering_type)),
- sNumberFormat(),
- sLetterSync(),
- bNumberFormatOK(sal_False)
-{
- bValid = sal_True;
-}
-
-void XMLPageVarGetFieldImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_NUM_FORMAT:
- sNumberFormat = sAttrValue;
- bNumberFormatOK = sal_True;
- break;
- case XML_TOK_TEXTFIELD_NUM_LETTER_SYNC:
- sLetterSync = sAttrValue;
- break;
- }
-}
-
-void XMLPageVarGetFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- sal_Int16 nNumType;
- if( bNumberFormatOK )
- {
- nNumType= style::NumberingType::ARABIC;
- GetImport().GetMM100UnitConverter().convertNumFormat( nNumType,
- sNumberFormat,
- sLetterSync );
- }
- else
- nNumType = style::NumberingType::PAGE_DESCRIPTOR;
- aAny <<= nNumType;
- xPropertySet->setPropertyValue(sPropertyNumberingType, aAny);
-
-//STRIP013 // display old content (#96657#)
-//STRIP013 aAny <<= GetContent();
-//STRIP013 xPropertySet->setPropertyValue(
-//STRIP013 OUString(RTL_CONSTASCII_USTRINGPARAM(sAPI_current_presentation)),
-//STRIP013 aAny );
-}
-
-
-
-//
-// page variable set fields
-//
-
-TYPEINIT1(XMLPageVarSetFieldImportContext, XMLTextFieldImportContext);
-
-XMLPageVarSetFieldImportContext::XMLPageVarSetFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
- const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_reference_page_set,
- nPrfx, sLocalName),
- sPropertyOn(RTL_CONSTASCII_USTRINGPARAM(sAPI_on)),
- sPropertyOffset(RTL_CONSTASCII_USTRINGPARAM(sAPI_offset)),
- nAdjust(0),
- bActive(sal_True)
-{
- bValid = sal_True;
-}
-
-void XMLPageVarSetFieldImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const ::rtl::OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_ACTIVE:
- {
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(bTmp, sAttrValue))
- {
- bActive = bTmp;
- }
- }
- case XML_TOK_TEXTFIELD_PAGE_ADJUST:
- {
- sal_Int32 nTmp;
- if (SvXMLUnitConverter::convertNumber(nTmp, sAttrValue))
- {
- nAdjust = (sal_Int16)nTmp;
- }
- }
- }
-}
-
-void XMLPageVarSetFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- aAny.setValue(&bActive, ::getBooleanCppuType());
- xPropertySet->setPropertyValue(sPropertyOn, aAny);
-
- aAny <<= nAdjust;
- xPropertySet->setPropertyValue(sPropertyOffset, aAny);
-}
-
-
-
-//
-// macro fields
-//
-
-TYPEINIT1( XMLMacroFieldImportContext, XMLTextFieldImportContext );
-
-XMLMacroFieldImportContext::XMLMacroFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
- const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_macro,
- nPrfx, sLocalName),
- sPropertyHint(RTL_CONSTASCII_USTRINGPARAM(sAPI_hint)),
- sPropertyMacroName(RTL_CONSTASCII_USTRINGPARAM("MacroName")),
- sMacro(),
- sDescription(),
- bDescriptionOK(sal_False)
-{
-}
-
-SvXMLImportContext* XMLMacroFieldImportContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- SvXMLImportContext* pContext = NULL;
-
- if ( (nPrefix == XML_NAMESPACE_OFFICE) &&
- IsXMLToken( rLocalName, XML_EVENTS ) )
- {
- // create events context and remember it!
- pContext = new XMLEventsImportContext(
- GetImport(), nPrefix, rLocalName );
- xEventContext = pContext;
- bValid = sal_True;
- }
- else
- pContext = SvXMLImportContext::CreateChildContext(
- nPrefix, rLocalName, xAttrList);
-
- return pContext;
-}
-
-
-void XMLMacroFieldImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_DESCRIPTION:
- sDescription = sAttrValue;
- bDescriptionOK = sal_True;
- break;
- case XML_TOK_TEXTFIELD_NAME:
- sMacro = sAttrValue;
- bValid = sal_True;
- break;
- }
-}
-
-void XMLMacroFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- OUString sOnClick(RTL_CONSTASCII_USTRINGPARAM("OnClick"));
- OUString sPropertyMacroLibrary(RTL_CONSTASCII_USTRINGPARAM("MacroLibrary"));
-
- aAny <<= (bDescriptionOK ? sDescription : GetContent());
- xPropertySet->setPropertyValue(sPropertyHint, aAny);
-
- // if we have an events child element, we'll look for the OnClick
- // event if not, it may be an old (pre-638i) document. Then, we'll
- // have to look at the name attribute.
- OUString sMacroName;
- OUString sLibraryName;
-
- if ( xEventContext.Is() )
- {
- // get event sequence
- XMLEventsImportContext* pEvents =
- (XMLEventsImportContext*)&xEventContext;
- Sequence<PropertyValue> aValues;
- pEvents->GetEventSequence( sOnClick, aValues );
-
- const PropertyValue* pValues = aValues.getConstArray();
- sal_Int32 nLength = aValues.getLength();
- for( sal_Int32 i = 0; i < nLength; i++ )
- {
- if ( aValues[i].Name.equalsAsciiL( "ScriptType",
- sizeof("ScriptType")-1 ) )
- {
- // ignore ScriptType
- }
- else if ( aValues[i].Name.equalsAsciiL( "Library",
- sizeof("Library")-1 ) )
- {
- aValues[i].Value >>= sLibraryName;
- }
- else if ( aValues[i].Name.equalsAsciiL( "MacroName",
- sizeof("MacroName")-1 ) )
- {
- aValues[i].Value >>= sMacroName;
- }
- }
- }
- else
- {
- // disassemble old-style macro-name: Everything before the
- // third-last dot is the library
- sal_Int32 nPos = sMacro.getLength() + 1; // the loop starts with nPos--
- const sal_Unicode* pBuf = sMacro.getStr();
- for( sal_Int32 i = 0; (i < 3) && (nPos > 0); i++ )
- {
- nPos--;
- while ( (pBuf[nPos] != '.') && (nPos > 0) )
- nPos--;
- }
-
- if (nPos > 0)
- {
- sLibraryName = sMacro.copy(0, nPos);
- sMacroName = sMacro.copy(nPos+1);
- }
- else
- sMacroName = sMacro;
- }
-
- aAny <<= sMacroName;
- xPropertySet->setPropertyValue(sPropertyMacroName, aAny);
-
- aAny <<= sLibraryName;
- xPropertySet->setPropertyValue(sPropertyMacroLibrary, aAny);
-}
-
-
-
-//
-// reference field import
-//
-
-TYPEINIT1( XMLReferenceFieldImportContext, XMLTextFieldImportContext );
-
-XMLReferenceFieldImportContext::XMLReferenceFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nToken, sal_uInt16 nPrfx, const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_get_reference,
- nPrfx, sLocalName),
- nType(ReferenceFieldPart::PAGE_DESC),
- sName(),
- bNameOK(sal_False),
- bTypeOK(sal_False),
- bSeqNumberOK(sal_False),
- nElementToken(nToken),
- sPropertyReferenceFieldPart(
- RTL_CONSTASCII_USTRINGPARAM(sAPI_reference_field_part)),
- sPropertyReferenceFieldSource(
- RTL_CONSTASCII_USTRINGPARAM(sAPI_reference_field_source)),
- sPropertySourceName(RTL_CONSTASCII_USTRINGPARAM(sAPI_source_name))
-//STRIP013 ,sPropertyCurrentPresentation(
-//STRIP013 RTL_CONSTASCII_USTRINGPARAM(sAPI_current_presentation))
-{
-}
-
-static SvXMLEnumMapEntry __READONLY_DATA lcl_aReferenceTypeTokenMap[] =
-{
- { XML_PAGE, ReferenceFieldPart::PAGE},
- { XML_CHAPTER, ReferenceFieldPart::CHAPTER },
- { XML_TEXT, ReferenceFieldPart::TEXT },
- { XML_DIRECTION, ReferenceFieldPart::UP_DOWN },
- { XML_CATEGORY_AND_VALUE, ReferenceFieldPart::CATEGORY_AND_NUMBER },
- { XML_CAPTION, ReferenceFieldPart::ONLY_CAPTION },
- { XML_VALUE, ReferenceFieldPart::ONLY_SEQUENCE_NUMBER },
- { XML_TOKEN_INVALID, 0 }
-};
-
-void XMLReferenceFieldImportContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- bTypeOK = sal_True;
- switch (nElementToken)
- {
- case XML_TOK_TEXT_REFERENCE_REF:
- nSource = ReferenceFieldSource::REFERENCE_MARK;
- break;
- case XML_TOK_TEXT_BOOKMARK_REF:
- nSource = ReferenceFieldSource::BOOKMARK;
- break;
- case XML_TOK_TEXT_FOOTNOTE_REF:
- nSource = ReferenceFieldSource::FOOTNOTE;
- break;
- case XML_TOK_TEXT_ENDNOTE_REF:
- nSource = ReferenceFieldSource::ENDNOTE;
- break;
- case XML_TOK_TEXT_SEQUENCE_REF:
- nSource = ReferenceFieldSource::SEQUENCE_FIELD;
- break;
- default:
- bTypeOK = sal_False;
- DBG_ERROR("unknown reference field");
- break;
- }
-
- XMLTextFieldImportContext::StartElement(xAttrList);
-}
-
-
-void XMLReferenceFieldImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_REF_NAME:
- sName = sAttrValue;
- bNameOK = sal_True;
- break;
- case XML_TOK_TEXTFIELD_REFERENCE_FORMAT:
- {
- sal_uInt16 nToken;
- if (SvXMLUnitConverter::convertEnum(nToken, sAttrValue,
- lcl_aReferenceTypeTokenMap))
- {
- nType = nToken;
- }
-
- // check for sequence-only-attributes
- if ( (XML_TOK_TEXT_SEQUENCE_REF != nElementToken) &&
- ( (nType == ReferenceFieldPart::CATEGORY_AND_NUMBER) ||
- (nType == ReferenceFieldPart::ONLY_CAPTION) ||
- (nType == ReferenceFieldPart::ONLY_SEQUENCE_NUMBER) ) )
- {
- nType = ReferenceFieldPart::PAGE_DESC;
- }
-
- break;
- }
- }
-
- // bValid: we need proper element type and name
- bValid = bTypeOK && bNameOK;
-}
-
-void XMLReferenceFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- aAny <<= nType;
- xPropertySet->setPropertyValue(sPropertyReferenceFieldPart, aAny);
-
- aAny <<= nSource;
- xPropertySet->setPropertyValue(sPropertyReferenceFieldSource, aAny);
-
- switch (nElementToken)
- {
- case XML_TOK_TEXT_REFERENCE_REF:
- case XML_TOK_TEXT_BOOKMARK_REF:
- aAny <<= sName;
- xPropertySet->setPropertyValue(sPropertySourceName, aAny);
- break;
-
- case XML_TOK_TEXT_FOOTNOTE_REF:
- case XML_TOK_TEXT_ENDNOTE_REF:
- GetImportHelper().ProcessFootnoteReference(sName, xPropertySet);
- break;
-
- case XML_TOK_TEXT_SEQUENCE_REF:
- GetImportHelper().ProcessSequenceReference(sName, xPropertySet);
- break;
- }
-
-//STRIP013 // #111880#-4
-//STRIP013 // The API for binfilter does not have this property, so test it first
-//STRIP013 // before using it to not throw exceptions
-//STRIP013 Reference<XPropertySetInfo> xPropertySetInfo(xPropertySet->getPropertySetInfo());
-//STRIP013
-//STRIP013 if (xPropertySetInfo->hasPropertyByName(sPropertyCurrentPresentation))
-//STRIP013 {
-//STRIP013 aAny <<= GetContent();
-//STRIP013 xPropertySet->setPropertyValue(sPropertyCurrentPresentation, aAny);
-//STRIP013 }
-}
-
-
-
-//
-// field declarations container
-//
-
-enum DdeFieldDeclAttrs
-{
- XML_TOK_DDEFIELD_NAME,
- XML_TOK_DDEFIELD_APPLICATION,
- XML_TOK_DDEFIELD_TOPIC,
- XML_TOK_DDEFIELD_ITEM,
- XML_TOK_DDEFIELD_UPDATE
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aDdeDeclAttrTokenMap[] =
-{
- { XML_NAMESPACE_TEXT, XML_NAME, XML_TOK_DDEFIELD_NAME },
- { XML_NAMESPACE_OFFICE, XML_DDE_APPLICATION, XML_TOK_DDEFIELD_APPLICATION },
- { XML_NAMESPACE_OFFICE, XML_DDE_TOPIC, XML_TOK_DDEFIELD_TOPIC },
- { XML_NAMESPACE_OFFICE, XML_DDE_ITEM, XML_TOK_DDEFIELD_ITEM },
- { XML_NAMESPACE_OFFICE, XML_AUTOMATIC_UPDATE, XML_TOK_DDEFIELD_UPDATE },
- XML_TOKEN_MAP_END
-};
-
-TYPEINIT1( XMLDdeFieldDeclsImportContext, SvXMLImportContext );
-
-XMLDdeFieldDeclsImportContext::XMLDdeFieldDeclsImportContext(
- SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& sLocalName) :
- SvXMLImportContext(rImport, nPrfx, sLocalName),
- aTokenMap(aDdeDeclAttrTokenMap)
-{
-}
-
-SvXMLImportContext * XMLDdeFieldDeclsImportContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList> & xAttrList )
-{
- if ( (XML_NAMESPACE_TEXT == nPrefix) &&
- (IsXMLToken(rLocalName, XML_DDE_CONNECTION_DECL)) )
- {
- return new XMLDdeFieldDeclImportContext(GetImport(), nPrefix,
- rLocalName, aTokenMap);
- }
- else
- {
- return SvXMLImportContext::CreateChildContext(nPrefix,
- rLocalName,
- xAttrList);
- }
-}
-
-
-
-//
-// import dde field declaration
-//
-
-TYPEINIT1( XMLDdeFieldDeclImportContext, SvXMLImportContext );
-
-XMLDdeFieldDeclImportContext::XMLDdeFieldDeclImportContext(
- SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& sLocalName, const SvXMLTokenMap& rMap) :
- SvXMLImportContext(rImport, nPrfx, sLocalName),
- rTokenMap(rMap),
- sPropertyName(RTL_CONSTASCII_USTRINGPARAM(sAPI_name)),
- sPropertyDDECommandType(RTL_CONSTASCII_USTRINGPARAM(sAPI_dde_command_type)),
- sPropertyDDECommandFile(RTL_CONSTASCII_USTRINGPARAM(sAPI_dde_command_file)),
- sPropertyDDECommandElement(RTL_CONSTASCII_USTRINGPARAM(sAPI_dde_command_element)),
- sPropertyIsAutomaticUpdate(
- RTL_CONSTASCII_USTRINGPARAM(sAPI_is_automatic_update))
-{
- DBG_ASSERT(XML_NAMESPACE_TEXT == nPrfx, "wrong prefix");
- DBG_ASSERT(IsXMLToken(sLocalName, XML_DDE_CONNECTION_DECL), "wrong name");
-}
-
-void XMLDdeFieldDeclImportContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- OUString sName;
- OUString sCommandApplication;
- OUString sCommandTopic;
- OUString sCommandItem;
-
- sal_Bool bUpdate = sal_False;
- sal_Bool bNameOK = sal_False;
- sal_Bool bCommandApplicationOK = sal_False;
- sal_Bool bCommandTopicOK = sal_False;
- sal_Bool bCommandItemOK = sal_False;
-
- // process attributes
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 i=0; i<nLength; i++)
- {
-
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(i), &sLocalName );
-
- switch (rTokenMap.Get(nPrefix, sLocalName))
- {
- case XML_TOK_DDEFIELD_NAME:
- sName = xAttrList->getValueByIndex(i);
- bNameOK = sal_True;
- break;
- case XML_TOK_DDEFIELD_APPLICATION:
- sCommandApplication = xAttrList->getValueByIndex(i);
- bCommandApplicationOK = sal_True;
- break;
- case XML_TOK_DDEFIELD_TOPIC:
- sCommandTopic = xAttrList->getValueByIndex(i);
- bCommandTopicOK = sal_True;
- break;
- case XML_TOK_DDEFIELD_ITEM:
- sCommandItem = xAttrList->getValueByIndex(i);
- bCommandItemOK = sal_True;
- break;
- case XML_TOK_DDEFIELD_UPDATE:
- {
- sal_Bool bTmp;
- if ( SvXMLUnitConverter::convertBool(
- bTmp, xAttrList->getValueByIndex(i)) )
- {
- bUpdate = bTmp;
- }
- break;
- }
- }
- }
-
- // valid data?
- if (bNameOK && bCommandApplicationOK && bCommandTopicOK && bCommandItemOK)
- {
- // make service name
- OUStringBuffer sBuf;
- sBuf.appendAscii(sAPI_fieldmaster_prefix);
- sBuf.appendAscii(sAPI_dde);
-
- // create DDE TextFieldMaster
- Reference<XMultiServiceFactory> xFactory(GetImport().GetModel(),
- UNO_QUERY);
- if( xFactory.is() )
- {
- /* #i6432# There might be multiple occurances of one DDE
- declaration if it is used in more than one of
- header/footer/body. createInstance will throw an exception if we
- try to create the second, third, etc. instance of such a
- declaration. Thus we ignore the exception. Otherwise this will
- lead to an unloadable document. */
- try
- {
- Reference<XInterface> xIfc =
- xFactory->createInstance(sBuf.makeStringAndClear());
- if( xIfc.is() )
- {
- Reference<XPropertySet> xPropSet( xIfc, UNO_QUERY );
- if (xPropSet.is() &&
- xPropSet->getPropertySetInfo()->hasPropertyByName(
- sPropertyDDECommandType))
- {
- Any aAny;
-
- aAny <<= sName;
- xPropSet->setPropertyValue(sPropertyName, aAny);
-
- aAny <<= sCommandApplication;
- xPropSet->setPropertyValue(sPropertyDDECommandType, aAny);
-
- aAny <<= sCommandTopic;
- xPropSet->setPropertyValue(sPropertyDDECommandFile, aAny);
-
- aAny <<= sCommandItem;
- xPropSet->setPropertyValue(sPropertyDDECommandElement,
- aAny);
-
- aAny.setValue(&bUpdate, ::getBooleanCppuType());
- xPropSet->setPropertyValue(sPropertyIsAutomaticUpdate,
- aAny);
- }
- // else: ignore (can't get XPropertySet, or DDE
- // properties are not supported)
- }
- // else: ignore
- }
- catch ( const Exception& )
- {
- //ignore
- }
- }
- // else: ignore
- }
- // else: ignore
-}
-
-
-
-//
-// DDE field import
-//
-
-TYPEINIT1( XMLDdeFieldImportContext, XMLTextFieldImportContext );
-
-XMLDdeFieldImportContext::XMLDdeFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_dde,
- nPrfx, sLocalName),
- sName()
-{
-}
-
-void XMLDdeFieldImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const ::rtl::OUString& sAttrValue )
-{
- if (XML_TOK_TEXTFIELD_CONNECTION_NAME == nAttrToken)
- {
- sName = sAttrValue;
- bValid = sal_True;
- }
-}
-
-void XMLDdeFieldImportContext::EndElement()
-{
- if (bValid)
- {
- // find master
- OUStringBuffer sBuf;
- sBuf.appendAscii(sAPI_fieldmaster_prefix);
- sBuf.appendAscii(sAPI_dde);
- sBuf.append(sal_Unicode('.'));
- sBuf.append(sName);
- OUString sMasterName = sBuf.makeStringAndClear();
-
- Reference<XTextFieldsSupplier> xTextFieldsSupp(GetImport().GetModel(),
- UNO_QUERY);
- Reference<container::XNameAccess> xFieldMasterNameAccess(
- xTextFieldsSupp->getTextFieldMasters(), UNO_QUERY);
-
- if (xFieldMasterNameAccess->hasByName(sMasterName))
- {
- Reference<XPropertySet> xMaster;
- Any aAny = xFieldMasterNameAccess->getByName(sMasterName);
- aAny >>= xMaster;
-
- // master exists: create text field and attach
- Reference<XPropertySet> xField;
- sBuf.appendAscii(sAPI_textfield_prefix);
- sBuf.appendAscii(sAPI_dde);
- if (CreateField(xField, sBuf.makeStringAndClear()))
- {
- Reference<XDependentTextField> xDepTextField(xField,UNO_QUERY);
- xDepTextField->attachTextFieldMaster(xMaster);
-
- // attach field to document
- Reference<XTextContent> xTextContent(xField, UNO_QUERY);
- if (xTextContent.is())
- {
- GetImportHelper().InsertTextContent(xTextContent);
-
- // we're lucky. nothing else to prepare.
- }
- // else: fail, because text content could not be created
- }
- // else: fail, because field could not be created
- }
- // else: fail, because no master was found (faulty document?!)
- }
- // not valid: ignore
-}
-
-void XMLDdeFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- // empty, since not needed.
-}
-
-
-//
-// sheet name fields
-//
-
-TYPEINIT1(XMLSheetNameImportContext, XMLTextFieldImportContext);
-
-XMLSheetNameImportContext::XMLSheetNameImportContext(
- SvXMLImport& rImport,
- XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx,
- const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_sheet_name,
- nPrfx, sLocalName)
-{
- bValid = sal_True; // always valid!
-}
-
-void XMLSheetNameImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const ::rtl::OUString& sAttrValue )
-{
- // no attributes -> nothing to be done
-}
-
-void XMLSheetNameImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- // no attributes -> nothing to be done
-}
-
-
-//
-// URL fields (Calc, Impress, Draw)
-//
-
-TYPEINIT1(XMLUrlFieldImportContext, XMLTextFieldImportContext);
-
-XMLUrlFieldImportContext::XMLUrlFieldImportContext(
- SvXMLImport& rImport,
- XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx,
- const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_url,
- nPrfx, sLocalName),
- sPropertyURL(RTL_CONSTASCII_USTRINGPARAM(sAPI_url)),
- sPropertyTargetFrame(RTL_CONSTASCII_USTRINGPARAM(sAPI_target_frame)),
- sPropertyRepresentation(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_representation)),
- bFrameOK(sal_False)
-{
-}
-
-void XMLUrlFieldImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_HREF:
- sURL = GetImport().GetAbsoluteReference( sAttrValue );
- bValid = sal_True;
- break;
- case XML_TOK_TEXTFIELD_TARGET_FRAME:
- sFrame = sAttrValue;
- bFrameOK = sal_True;
- break;
- default:
- // ignore
- break;
- }
-}
-
-void XMLUrlFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- aAny <<= sURL;
- xPropertySet->setPropertyValue(sPropertyURL, aAny);
-
- if (bFrameOK)
- {
- aAny <<= sFrame;
- xPropertySet->setPropertyValue(sPropertyTargetFrame, aAny);
- }
-
- aAny <<= GetContent();
- xPropertySet->setPropertyValue(sPropertyRepresentation, aAny);
-}
-
-
-TYPEINIT1(XMLBibliographyFieldImportContext, XMLTextFieldImportContext);
-
-
-XMLBibliographyFieldImportContext::XMLBibliographyFieldImportContext(
- SvXMLImport& rImport,
- XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx,
- const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_bibliography,
- nPrfx, sLocalName),
- sPropertyFields(RTL_CONSTASCII_USTRINGPARAM("Fields")),
- aValues()
-{
- bValid = sal_True;
-}
-
-// TODO: this is the same map as is used in the text field export
-SvXMLEnumMapEntry __READONLY_DATA aBibliographyDataTypeMap[] =
-{
- { XML_ARTICLE, BibliographyDataType::ARTICLE },
- { XML_BOOK, BibliographyDataType::BOOK },
- { XML_BOOKLET, BibliographyDataType::BOOKLET },
- { XML_CONFERENCE, BibliographyDataType::CONFERENCE },
- { XML_CUSTOM1, BibliographyDataType::CUSTOM1 },
- { XML_CUSTOM2, BibliographyDataType::CUSTOM2 },
- { XML_CUSTOM3, BibliographyDataType::CUSTOM3 },
- { XML_CUSTOM4, BibliographyDataType::CUSTOM4 },
- { XML_CUSTOM5, BibliographyDataType::CUSTOM5 },
- { XML_EMAIL, BibliographyDataType::EMAIL },
- { XML_INBOOK, BibliographyDataType::INBOOK },
- { XML_INCOLLECTION, BibliographyDataType::INCOLLECTION },
- { XML_INPROCEEDINGS, BibliographyDataType::INPROCEEDINGS },
- { XML_JOURNAL, BibliographyDataType::JOURNAL },
- { XML_MANUAL, BibliographyDataType::MANUAL },
- { XML_MASTERSTHESIS, BibliographyDataType::MASTERSTHESIS },
- { XML_MISC, BibliographyDataType::MISC },
- { XML_PHDTHESIS, BibliographyDataType::PHDTHESIS },
- { XML_PROCEEDINGS, BibliographyDataType::PROCEEDINGS },
- { XML_TECHREPORT, BibliographyDataType::TECHREPORT },
- { XML_UNPUBLISHED, BibliographyDataType::UNPUBLISHED },
- { XML_WWW, BibliographyDataType::WWW },
- { XML_TOKEN_INVALID, 0 }
-};
-
-
-// we'll process attributes on our own and forfit the standard
-// tecfield mechanism, because our attributes have zero overlp with
-// all the oher textfields.
-void XMLBibliographyFieldImportContext::StartElement(
- const Reference<XAttributeList> & xAttrList)
-{
- // iterate over attributes
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 i=0; i<nLength; i++) {
-
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(i), &sLocalName );
-
- if (nPrefix == XML_NAMESPACE_TEXT)
- {
- PropertyValue aValue;
- aValue.Name = OUString::createFromAscii(
- MapBibliographyFieldName(sLocalName));
- Any aAny;
-
- // special treatment for bibliography type
- // biblio vs bibilio: #96658#; also read old documents
- if (IsXMLToken(sLocalName, XML_BIBILIOGRAPHIC_TYPE) ||
- IsXMLToken(sLocalName, XML_BIBLIOGRAPHY_TYPE) )
- {
- sal_uInt16 nTmp;
- if (SvXMLUnitConverter::convertEnum(
- nTmp, xAttrList->getValueByIndex(i),
- aBibliographyDataTypeMap))
- {
- aAny <<= (sal_Int16)nTmp;
- aValue.Value = aAny;
-
- aValues.push_back(aValue);
- }
- }
- else
- {
- aAny <<= xAttrList->getValueByIndex(i);
- aValue.Value = aAny;
-
- aValues.push_back(aValue);
- }
- }
- // else: unknown namespace -> ignore
- }
-}
-
-void XMLBibliographyFieldImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- // attributes are handled in StartElement
- DBG_ERROR("This should not have happened.");
-}
-
-
-void XMLBibliographyFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- // convert vector into sequence
- sal_Int32 nCount = aValues.size();
- Sequence<PropertyValue> aValueSequence(nCount);
- for(sal_Int32 i = 0; i < nCount; i++)
- {
- aValueSequence[i] = aValues[i];
- }
-
- // set sequence
- Any aAny;
- aAny <<= aValueSequence;
- xPropertySet->setPropertyValue(sPropertyFields, aAny);
-}
-
-const sal_Char* XMLBibliographyFieldImportContext::MapBibliographyFieldName(
- OUString sName)
-{
- sal_Char* pName = NULL;
-
- if (IsXMLToken(sName, XML_IDENTIFIER))
- {
- pName = "Identifier";
- }
- else if (IsXMLToken(sName, XML_BIBILIOGRAPHIC_TYPE) ||
- IsXMLToken(sName, XML_BIBLIOGRAPHY_TYPE) )
- {
- // biblio... vs bibilio...: #96658#: also read old documents
- pName = "BibiliographicType";
- }
- else if (IsXMLToken(sName, XML_ADDRESS))
- {
- pName = "Address";
- }
- else if (IsXMLToken(sName, XML_ANNOTE))
- {
- pName = "Annote";
- }
- else if (IsXMLToken(sName, XML_AUTHOR))
- {
- pName = "Author";
- }
- else if (IsXMLToken(sName, XML_BOOKTITLE))
- {
- pName = "Booktitle";
- }
- else if (IsXMLToken(sName, XML_CHAPTER))
- {
- pName = "Chapter";
- }
- else if (IsXMLToken(sName, XML_EDITION))
- {
- pName = "Edition";
- }
- else if (IsXMLToken(sName, XML_EDITOR))
- {
- pName = "Editor";
- }
- else if (IsXMLToken(sName, XML_HOWPUBLISHED))
- {
- pName = "Howpublished";
- }
- else if (IsXMLToken(sName, XML_INSTITUTION))
- {
- pName = "Institution";
- }
- else if (IsXMLToken(sName, XML_JOURNAL))
- {
- pName = "Journal";
- }
- else if (IsXMLToken(sName, XML_MONTH))
- {
- pName = "Month";
- }
- else if (IsXMLToken(sName, XML_NOTE))
- {
- pName = "Note";
- }
- else if (IsXMLToken(sName, XML_NUMBER))
- {
- pName = "Number";
- }
- else if (IsXMLToken(sName, XML_ORGANIZATIONS))
- {
- pName = "Organizations";
- }
- else if (IsXMLToken(sName, XML_PAGES))
- {
- pName = "Pages";
- }
- else if (IsXMLToken(sName, XML_PUBLISHER))
- {
- pName = "Publisher";
- }
- else if (IsXMLToken(sName, XML_SCHOOL))
- {
- pName = "School";
- }
- else if (IsXMLToken(sName, XML_SERIES))
- {
- pName = "Series";
- }
- else if (IsXMLToken(sName, XML_TITLE))
- {
- pName = "Title";
- }
- else if (IsXMLToken(sName, XML_REPORT_TYPE))
- {
- pName = "Report_Type";
- }
- else if (IsXMLToken(sName, XML_VOLUME))
- {
- pName = "Volume";
- }
- else if (IsXMLToken(sName, XML_YEAR))
- {
- pName = "Year";
- }
- else if (IsXMLToken(sName, XML_URL))
- {
- pName = "URL";
- }
- else if (IsXMLToken(sName, XML_CUSTOM1))
- {
- pName = "Custom1";
- }
- else if (IsXMLToken(sName, XML_CUSTOM2))
- {
- pName = "Custom2";
- }
- else if (IsXMLToken(sName, XML_CUSTOM3))
- {
- pName = "Custom3";
- }
- else if (IsXMLToken(sName, XML_CUSTOM4))
- {
- pName = "Custom4";
- }
- else if (IsXMLToken(sName, XML_CUSTOM5))
- {
- pName = "Custom5";
- }
- else if (IsXMLToken(sName, XML_ISBN))
- {
- pName = "ISBN";
- }
- else
- {
- DBG_ERROR("Unknown bibliography info data");
- pName = NULL;
- }
-
- return pName;
-}
-
-
-//
-// Annotation Field
-//
-
-TYPEINIT1(XMLAnnotationImportContext, XMLTextFieldImportContext);
-
-XMLAnnotationImportContext::XMLAnnotationImportContext(
- SvXMLImport& rImport,
- XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx,
- const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_annotation,
- nPrfx, sLocalName),
- sPropertyAuthor(RTL_CONSTASCII_USTRINGPARAM(sAPI_author)),
- sPropertyContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_content)),
- sPropertyDate(RTL_CONSTASCII_USTRINGPARAM(sAPI_date)),
- bDateOK(sal_False)
-{
- bValid = sal_True;
-}
-
-void XMLAnnotationImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_OFFICE_CREATE_DATE:
- {
- DateTime aDateTime;
- if (SvXMLUnitConverter::convertDateTime(aDateTime, sAttrValue))
- {
- aDate.Year = aDateTime.Year;
- aDate.Month = aDateTime.Month;
- aDate.Day = aDateTime.Day;
- bDateOK = sal_True;
- }
- break;
- }
-
- case XML_TOK_TEXTFIELD_OFFICE_AUTHOR:
- sAuthor = sAttrValue;
- break;
-
- default:
- // ignore
- break;
- }
-}
-
-SvXMLImportContext* XMLAnnotationImportContext::CreateChildContext(
- USHORT nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList >& xAttrList )
-{
- return new XMLStringBufferImportContext(GetImport(), nPrefix,
- rLocalName, aTextBuffer);
-}
-
-void XMLAnnotationImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- // import (possibly empty) author
- aAny <<= sAuthor;
- xPropertySet->setPropertyValue(sPropertyAuthor, aAny);
-
- if (bDateOK)
- {
- aAny <<= aDate;
- xPropertySet->setPropertyValue(sPropertyDate, aAny);
- }
-
- // delete last paragraph mark (if necessary)
- OUString sBuffer = aTextBuffer.makeStringAndClear();
- if (sal_Char(0x0a) == sBuffer.getStr()[sBuffer.getLength()-1])
- {
- sBuffer = sBuffer.copy(0, sBuffer.getLength()-1);
- }
- aAny <<= sBuffer;
- xPropertySet->setPropertyValue(sPropertyContent, aAny);
-}
-
-
-
-//
-// script field
-//
-
-TYPEINIT1(XMLScriptImportContext, XMLTextFieldImportContext);
-
-XMLScriptImportContext::XMLScriptImportContext(
- SvXMLImport& rImport,
- XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx,
- const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_script,
- nPrfx, sLocalName),
- sPropertyContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_content)),
- sPropertyScriptType(RTL_CONSTASCII_USTRINGPARAM(sAPI_script_type)),
- sPropertyURLContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_url_content)),
- bContentOK(sal_False),
- bUrlContent(sal_False),
- bScriptTypeOK(sal_False)
-{
-}
-
-void XMLScriptImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_HREF:
- sContent = GetImport().GetAbsoluteReference( sAttrValue );
- bContentOK = sal_True;
- break;
-
- case XML_TOK_TEXTFIELD_LANGUAGE:
- sScriptType = sAttrValue;
- bScriptTypeOK = sal_True;
- break;
-
- default:
- // ignore
- break;
- }
-
- // always valid (even without ScriptType; cf- #96531#)
- bValid = sal_True;
-}
-
-void XMLScriptImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- // if href attribute was present, we use it. Else we use element content
- if (! bContentOK)
- {
- sContent = GetContent();
- }
- aAny <<= sContent;
- xPropertySet->setPropertyValue(sPropertyContent, aAny);
-
- // URL or script text? We use URL if we have an href-attribute
- aAny.setValue(&bContentOK, ::getBooleanCppuType());
- xPropertySet->setPropertyValue(sPropertyURLContent, aAny);
-
- aAny <<= sScriptType;
- xPropertySet->setPropertyValue(sPropertyScriptType, aAny);
-}
-
-//
-// measure field
-//
-
-TYPEINIT1(XMLMeasureFieldImportContext, XMLTextFieldImportContext);
-
-XMLMeasureFieldImportContext::XMLMeasureFieldImportContext(
- SvXMLImport& rImport,
- XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx,
- const OUString& sLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_measure,
- nPrfx, sLocalName),
- mnKind( 0 )
-{
-}
-
-void XMLMeasureFieldImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_MEASURE_KIND:
- if( IsXMLToken( sAttrValue, XML_VALUE ) )
- {
- mnKind = 0; bValid = sal_True;
- }
- else if( IsXMLToken( sAttrValue, XML_UNIT ) )
- {
- mnKind = 1; bValid = sal_True;
- }
- else if( IsXMLToken( sAttrValue, XML_GAP ) )
- {
- mnKind = 2; bValid = sal_True;
- }
- break;
- }
-}
-
-void XMLMeasureFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
- aAny <<= mnKind;
- xPropertySet->setPropertyValue(OUString::createFromAscii("Kind"), aAny);
-}
-
-
-
-//
-// dropdown field
-//
-
-
-TYPEINIT1( XMLDropDownFieldImportContext, XMLTextFieldImportContext );
-
-XMLDropDownFieldImportContext::XMLDropDownFieldImportContext(
- SvXMLImport& rImport,
- XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx,
- const ::rtl::OUString& sLocalName) :
- XMLTextFieldImportContext( rImport, rHlp, sAPI_drop_down,
- nPrfx, sLocalName ),
- aLabels(),
- sName(),
- nSelected( -1 ),
- bNameOK( false ),
- sPropertyItems( RTL_CONSTASCII_USTRINGPARAM( "Items" ) ),
- sPropertySelectedItem( RTL_CONSTASCII_USTRINGPARAM( "SelectedItem" ) ),
- sPropertyName( RTL_CONSTASCII_USTRINGPARAM( "Name" ) )
-{
- bValid = sal_True;
-}
-
-bool lcl_ProcessLabel( const SvXMLImport& rImport,
- const Reference<XAttributeList>& xAttrList,
- OUString& rLabel,
- bool& rIsSelected )
-{
- bool bValid = false;
- sal_Int16 nLength = xAttrList->getLength();
- for( sal_Int16 n = 0; n < nLength; n++ )
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = rImport.GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(n), &sLocalName );
- OUString sValue = xAttrList->getValueByIndex(n);
-
- if( nPrefix == XML_NAMESPACE_TEXT )
- {
- if( IsXMLToken( sLocalName, XML_VALUE ) )
- {
- rLabel = sValue;
- bValid = true;
- }
- else if( IsXMLToken( sLocalName, XML_CURRENT_SELECTED ) )
- {
- sal_Bool bTmp;
- if( SvXMLUnitConverter::convertBool( bTmp, sValue ) )
- rIsSelected = bTmp;
- }
- }
- }
- return bValid;
-}
-
-SvXMLImportContext* XMLDropDownFieldImportContext::CreateChildContext(
- USHORT nPrefix,
- const OUString& rLocalName,
- const Reference<XAttributeList>& xAttrList )
-{
- if( nPrefix == XML_NAMESPACE_TEXT &&
- IsXMLToken( rLocalName, XML_LABEL ) )
- {
- OUString sLabel;
- bool bIsSelected;
- if( lcl_ProcessLabel( GetImport(), xAttrList, sLabel, bIsSelected ) )
- {
- if( bIsSelected )
- nSelected = static_cast<sal_Int32>( aLabels.size() );
- aLabels.push_back( sLabel );
- }
- }
- return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-}
-
-void XMLDropDownFieldImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const ::rtl::OUString& sAttrValue )
-{
- if( nAttrToken == XML_TOK_TEXTFIELD_NAME )
- {
- sName = sAttrValue;
- bNameOK = true;
- }
-}
-
-
-void XMLDropDownFieldImportContext::PrepareField(
- const Reference<XPropertySet>& xPropertySet)
-{
- // create sequence
- sal_Int32 nLength = static_cast<sal_Int32>( aLabels.size() );
- Sequence<OUString> aSequence( nLength );
- OUString* pSequence = aSequence.getArray();
- for( sal_Int32 n = 0; n < nLength; n++ )
- pSequence[n] = aLabels[n];
-
- // now set values:
- Any aAny;
-
- aAny <<= aSequence;
- xPropertySet->setPropertyValue( sPropertyItems, aAny );
-
- if( nSelected >= 0 && nSelected < nLength )
- {
- aAny <<= pSequence[nSelected];
- xPropertySet->setPropertyValue( sPropertySelectedItem, aAny );
- }
-
- // set name
- if( bNameOK )
- {
- aAny <<= sName;
- xPropertySet->setPropertyValue( sPropertyName, aAny );
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_txtftne.cxx b/binfilter/bf_xmloff/source/text/xmloff_txtftne.cxx
deleted file mode 100644
index 609b324d30dc..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_txtftne.cxx
+++ /dev/null
@@ -1,380 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-/** @#file
- *
- * This file implements XMLTextParagraphExport methods to export
- * - footnotes
- * - endnotes
- * - footnote configuration elements
- * - endnote configuration elements
- */
-
-#include <tools/debug.hxx>
-
-
-
-#include <com/sun/star/beans/XPropertyState.hpp>
-
-
-
-
-#include <com/sun/star/text/XFootnote.hpp>
-
-#include <com/sun/star/text/XFootnotesSupplier.hpp>
-
-#include <com/sun/star/text/XEndnotesSupplier.hpp>
-
-#include <com/sun/star/text/FootnoteNumbering.hpp>
-#include <com/sun/star/container/XNameReplace.hpp>
-
-#include "xmlnmspe.hxx"
-#include "xmluconv.hxx"
-#include "xmlexp.hxx"
-#include "XMLTextCharStyleNamesElementExport.hxx"
-#include "XMLEventExport.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::container;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-
-void XMLTextParagraphExport::exportTextFootnote(
- const Reference<XPropertySet> & rPropSet,
- const OUString& sText,
- sal_Bool bAutoStyles, sal_Bool bProgress )
-{
- // get footnote and associated text
- Any aAny;
- aAny = rPropSet->getPropertyValue(sFootnote);
- Reference<XFootnote> xFootnote;
- aAny >>= xFootnote;
- Reference<XText> xText(xFootnote, UNO_QUERY);
-
- // are we an endnote?
- Reference<XServiceInfo> xServiceInfo( xFootnote, UNO_QUERY );
- sal_Bool bIsEndnote = xServiceInfo->supportsService(sTextEndnoteService);
-
- if (bAutoStyles)
- {
- // handle formatting of citation mark
- Add( XML_STYLE_FAMILY_TEXT_TEXT, rPropSet );
-
- // handle formatting within footnote
- exportTextFootnoteHelper(xFootnote, xText, sText,
- bAutoStyles, bIsEndnote, bProgress );
- }
- else
- {
- // create span (for citation mark) if necessary; footnote content
- // wil be handled via exportTextFootnoteHelper, exportText
- sal_Bool bHasHyperlink;
- sal_Bool bIsUICharStyle = sal_False;
- OUString sStyle = FindTextStyleAndHyperlink( rPropSet, bHasHyperlink,
- bIsUICharStyle );
- sal_Bool bHasStyle = (sStyle.getLength() > 0);
- // export hyperlink (if we have one)
- Reference < XPropertySetInfo > xPropSetInfo;
- if( bHasHyperlink )
- {
- Reference<XPropertyState> xPropState( rPropSet, UNO_QUERY );
- xPropSetInfo = rPropSet->getPropertySetInfo();
- bHasHyperlink =
- addHyperlinkAttributes( rPropSet, xPropState, xPropSetInfo );
- }
- SvXMLElementExport aHyperlink( GetExport(), bHasHyperlink,
- XML_NAMESPACE_TEXT, XML_A,
- sal_False, sal_False );
-
- if( bHasHyperlink )
- {
- // export events (if supported)
- OUString sHyperLinkEvents(RTL_CONSTASCII_USTRINGPARAM(
- "HyperLinkEvents"));
- if (xPropSetInfo->hasPropertyByName(sHyperLinkEvents))
- {
- Any aAny = rPropSet->getPropertyValue(sHyperLinkEvents);
- Reference<XNameReplace> xName;
- aAny >>= xName;
- GetExport().GetEventExport().Export(xName, sal_False);
- }
- }
-
- {
- XMLTextCharStyleNamesElementExport aCharStylesExport(
- GetExport(), bIsUICharStyle &&
- aCharStyleNamesPropInfoCache.hasProperty(
- rPropSet ),
- rPropSet, sCharStyleNames );
- if( sStyle.getLength() )
- {
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME,
- sStyle );
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT,
- XML_SPAN, sal_False, sal_False );
- exportTextFootnoteHelper(xFootnote, xText, sText,
- bAutoStyles, bIsEndnote, bProgress );
- }
- else
- {
- exportTextFootnoteHelper(xFootnote, xText, sText,
- bAutoStyles, bIsEndnote, bProgress );
- }
- }
- }
-}
-
-
-void XMLTextParagraphExport::exportTextFootnoteHelper(
- const Reference<XFootnote> & rFootnote,
- const Reference<XText> & rText,
- const OUString& sText,
- sal_Bool bAutoStyles,
- sal_Bool bIsEndnote,
- sal_Bool bProgress )
-{
- if (bAutoStyles)
- {
- exportText(rText, bAutoStyles, bProgress, sal_True );
- }
- else
- {
- // export reference Id (for reference fields)
- Reference<XPropertySet> xPropSet(rFootnote, UNO_QUERY);
- Any aAny = xPropSet->getPropertyValue(sReferenceId);
- sal_Int32 nNumber;
- aAny >>= nNumber;
- OUStringBuffer aBuf;
- aBuf.appendAscii("ftn");
- aBuf.append(nNumber);
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_ID,
- aBuf.makeStringAndClear());
-
- SvXMLElementExport aNote(GetExport(), XML_NAMESPACE_TEXT,
- (bIsEndnote ? XML_ENDNOTE : XML_FOOTNOTE),
- sal_False, sal_False);
- {
- // handle label vs. automatic numbering
- OUString sLabel = rFootnote->getLabel();
- if (sLabel.getLength()>0)
- {
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_LABEL,
- sLabel);
- }
- // else: automatic numbering -> no attribute
-
- SvXMLElementExport aCite(GetExport(), XML_NAMESPACE_TEXT,
- (bIsEndnote ? XML_ENDNOTE_CITATION :
- XML_FOOTNOTE_CITATION),
- sal_False, sal_False);
- GetExport().Characters(sText);
- }
-
- {
- SvXMLElementExport aBody(GetExport(), XML_NAMESPACE_TEXT,
- (bIsEndnote ? XML_ENDNOTE_BODY :
- XML_FOOTNOTE_BODY),
- sal_False, sal_False);
- exportText(rText, bAutoStyles, bProgress, sal_True );
- }
- }
-}
-
-
-void XMLTextParagraphExport::exportTextFootnoteConfiguration()
-{
- // footnote settings
- Reference<XFootnotesSupplier> aFootnotesSupplier(GetExport().GetModel(),
- UNO_QUERY);
- Reference<XPropertySet> aFootnoteConfiguration(
- aFootnotesSupplier->getFootnoteSettings());
- exportTextFootnoteConfigurationHelper(aFootnoteConfiguration, sal_False);
-
- // endnote settings
- Reference<XEndnotesSupplier> aEndnotesSupplier(GetExport().GetModel(),
- UNO_QUERY);
- Reference<XPropertySet> aEndnoteConfiguration(
- aEndnotesSupplier->getEndnoteSettings());
- exportTextFootnoteConfigurationHelper(aEndnoteConfiguration, sal_True);
-}
-
-
-void lcl_exportString(
- SvXMLExport& rExport,
- const Reference<XPropertySet> & rPropSet,
- const OUString& sProperty,
- sal_uInt16 nPrefix,
- enum XMLTokenEnum eElement,
- sal_Bool bOmitIfEmpty = sal_True)
-{
- DBG_ASSERT( eElement != XML_TOKEN_INVALID, "need element token");
-
- Any aAny = rPropSet->getPropertyValue(sProperty);
- OUString sTmp;
- aAny >>= sTmp;
- if (!bOmitIfEmpty || (sTmp.getLength() > 0))
- {
- rExport.AddAttribute(nPrefix, eElement, sTmp);
- }
-}
-
-void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper(
- const Reference<XPropertySet> & rFootnoteConfig,
- sal_Bool bIsEndnote)
-{
- // default/paragraph style
- lcl_exportString( GetExport(), rFootnoteConfig, sParaStyleName,
- XML_NAMESPACE_TEXT, XML_DEFAULT_STYLE_NAME, sal_True);
-
- // citation style
- lcl_exportString( GetExport(), rFootnoteConfig, sCharStyleName,
- XML_NAMESPACE_TEXT, XML_CITATION_STYLE_NAME, sal_True);
-
- // citation body style
- lcl_exportString( GetExport(), rFootnoteConfig, sAnchorCharStyleName,
- XML_NAMESPACE_TEXT, XML_CITATION_BODY_STYLE_NAME,
- sal_True);
-
- // page style
- lcl_exportString( GetExport(), rFootnoteConfig, sPageStyleName,
- XML_NAMESPACE_TEXT, XML_MASTER_PAGE_NAME, sal_True);
-
- // prefix
- lcl_exportString( GetExport(), rFootnoteConfig, sPrefix,
- XML_NAMESPACE_STYLE, XML_NUM_PREFIX, sal_True);
-
- // suffix
- lcl_exportString( GetExport(), rFootnoteConfig, sSuffix,
- XML_NAMESPACE_STYLE, XML_NUM_SUFFIX, sal_True);
-
-
-
- Any aAny;
-
- // numbering style
- OUStringBuffer sBuffer;
- aAny = rFootnoteConfig->getPropertyValue(sNumberingType);
- sal_Int16 nNumbering;
- aAny >>= nNumbering;
- GetExport().GetMM100UnitConverter().convertNumFormat( sBuffer, nNumbering);
- GetExport().AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_FORMAT,
- sBuffer.makeStringAndClear() );
- GetExport().GetMM100UnitConverter().convertNumLetterSync( sBuffer, nNumbering);
- if (sBuffer.getLength() )
- {
- GetExport().AddAttribute(XML_NAMESPACE_STYLE, XML_NUM_LETTER_SYNC,
- sBuffer.makeStringAndClear());
- }
-
- // StartAt / start-value
- aAny = rFootnoteConfig->getPropertyValue(sStartAt);
- sal_Int16 nOffset;
- aAny >>= nOffset;
- SvXMLUnitConverter::convertNumber(sBuffer, (sal_Int32)nOffset);
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_START_VALUE,
- sBuffer.makeStringAndClear());
-
- // some properties are for footnotes only
- if (!bIsEndnote)
- {
- // footnotes position
- aAny = rFootnoteConfig->getPropertyValue(
- sPositionEndOfDoc);
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_FOOTNOTES_POSITION,
- ( (*(sal_Bool *)aAny.getValue()) ?
- XML_DOCUMENT : XML_PAGE ) );
-
- aAny = rFootnoteConfig->getPropertyValue(sFootnoteCounting);
- sal_Int16 nTmp;
- aAny >>= nTmp;
- enum XMLTokenEnum eElement;
- switch (nTmp)
- {
- case FootnoteNumbering::PER_PAGE:
- eElement = XML_PAGE;
- break;
- case FootnoteNumbering::PER_CHAPTER:
- eElement = XML_CHAPTER;
- break;
- case FootnoteNumbering::PER_DOCUMENT:
- default:
- eElement = XML_DOCUMENT;
- break;
- }
- GetExport().AddAttribute(XML_NAMESPACE_TEXT,
- XML_START_NUMBERING_AT, eElement);
- }
-
- // element
- SvXMLElementExport aFootnoteConfigElement(
- GetExport(), XML_NAMESPACE_TEXT,
- ( bIsEndnote ? XML_ENDNOTES_CONFIGURATION:XML_FOOTNOTES_CONFIGURATION),
- sal_True, sal_True);
-
- // two element for footnote content
- if (!bIsEndnote)
- {
- OUString sTmp;
-
- // end notice / quo vadis
- aAny = rFootnoteConfig->getPropertyValue(sEndNotice);
- aAny >>= sTmp;
-
- if (sTmp.getLength() > 0)
- {
- SvXMLElementExport aElem(GetExport(), XML_NAMESPACE_TEXT,
- XML_FOOTNOTE_CONTINUATION_NOTICE_FORWARD,
- sal_True, sal_False);
- GetExport().Characters(sTmp);
- }
-
- // begin notice / ergo sum
- aAny = rFootnoteConfig->getPropertyValue(sBeginNotice);
- aAny >>= sTmp;
-
- if (sTmp.getLength() > 0)
- {
- SvXMLElementExport aElem(GetExport(), XML_NAMESPACE_TEXT,
- XML_FOOTNOTE_CONTINUATION_NOTICE_BACKWARD,
- sal_True, sal_False);
- GetExport().Characters(sTmp);
- }
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_txtimp.cxx b/binfilter/bf_xmloff/source/text/xmloff_txtimp.cxx
deleted file mode 100644
index 50b60b33b472..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_txtimp.cxx
+++ /dev/null
@@ -1,1971 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/solar.h>
-#ifndef _SVSTDARR_STRINGSDTOR_DECL
-#define _SVSTDARR_STRINGSDTOR
-#include <bf_svtools/svstdarr.hxx>
-#endif
-
-#include <com/sun/star/container/XEnumerationAccess.hpp>
-#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-#include <com/sun/star/text/XChapterNumberingSupplier.hpp>
-#include <com/sun/star/text/XTextFramesSupplier.hpp>
-#include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
-#include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp>
-#include <com/sun/star/ucb/XAnyCompareFactory.hpp>
-
-#include "xmlnmspe.hxx"
-#include "txtstyli.hxx"
-
-#include "xmlnumi.hxx"
-
-#include "txtparai.hxx"
-#include "txtprmap.hxx"
-#include "txtimppr.hxx"
-#include "xmlimp.hxx"
-#include "txtvfldi.hxx"
-#include "i18nmap.hxx"
-#include "XMLTextListItemContext.hxx"
-#include "XMLTextListBlockContext.hxx"
-#include "XMLTextFrameContext.hxx"
-#include "XMLTextFrameHyperlinkContext.hxx"
-#include "XMLSectionImportContext.hxx"
-#include "XMLIndexTOCContext.hxx"
-#include "XMLFontStylesContext.hxx"
-#include "nmspmap.hxx"
-#include "XMLEventsImportContext.hxx"
-#include "XMLTrackedChangesImportContext.hxx"
-#include "XMLChangeImportContext.hxx"
-#include "XMLAutoMarkFileContext.hxx"
-
-#include "XMLCalculationSettingsContext.hxx"
-#include "XMLNumberStylesImport.hxx"
-namespace binfilter {
-
-using namespace ::std;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::drawing;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::lang;
-using namespace ::binfilter::xmloff::token;
-using ::com::sun::star::util::DateTime;
-using namespace ::com::sun::star::ucb;
-using ::comphelper::UStringLess;
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-
-static __FAR_DATA SvXMLTokenMapEntry aTextElemTokenMap[] =
-{
- { XML_NAMESPACE_TEXT, XML_P, XML_TOK_TEXT_P },
- { XML_NAMESPACE_TEXT, XML_H, XML_TOK_TEXT_H },
- { XML_NAMESPACE_TEXT, XML_ORDERED_LIST, XML_TOK_TEXT_ORDERED_LIST },
- { XML_NAMESPACE_TEXT, XML_UNORDERED_LIST, XML_TOK_TEXT_UNORDERED_LIST },
- { XML_NAMESPACE_DRAW, XML_TEXT_BOX, XML_TOK_TEXT_TEXTBOX_PAGE },
- { XML_NAMESPACE_DRAW, XML_IMAGE, XML_TOK_TEXT_IMAGE_PAGE },
- { XML_NAMESPACE_DRAW, XML_OBJECT, XML_TOK_TEXT_OBJECT_PAGE },
- { XML_NAMESPACE_DRAW, XML_OBJECT_OLE, XML_TOK_TEXT_OBJECT_OLE_PAGE },
- { XML_NAMESPACE_DRAW, XML_APPLET, XML_TOK_TEXT_APPLET_PAGE },
- { XML_NAMESPACE_DRAW, XML_PLUGIN, XML_TOK_TEXT_PLUGIN_PAGE },
- { XML_NAMESPACE_DRAW, XML_FLOATING_FRAME, XML_TOK_TEXT_FLOATING_FRAME_PAGE },
- { XML_NAMESPACE_DRAW, XML_A, XML_TOK_DRAW_A_PAGE },
- { XML_NAMESPACE_TABLE,XML_TABLE, XML_TOK_TABLE_TABLE },
-// { XML_NAMESPACE_TABLE,XML_SUB_TABLE, XML_TOK_TABLE_SUBTABLE },
- { XML_NAMESPACE_TEXT, XML_VARIABLE_DECLS, XML_TOK_TEXT_VARFIELD_DECLS },
- { XML_NAMESPACE_TEXT, XML_USER_FIELD_DECLS, XML_TOK_TEXT_USERFIELD_DECLS },
- { XML_NAMESPACE_TEXT, XML_SEQUENCE_DECLS, XML_TOK_TEXT_SEQUENCE_DECLS },
- { XML_NAMESPACE_TEXT, XML_DDE_CONNECTION_DECLS, XML_TOK_TEXT_DDE_DECLS },
- { XML_NAMESPACE_TEXT, XML_SECTION, XML_TOK_TEXT_SECTION },
- { XML_NAMESPACE_TEXT, XML_TABLE_OF_CONTENT, XML_TOK_TEXT_TOC },
- { XML_NAMESPACE_TEXT, XML_OBJECT_INDEX, XML_TOK_TEXT_OBJECT_INDEX },
- { XML_NAMESPACE_TEXT, XML_TABLE_INDEX, XML_TOK_TEXT_TABLE_INDEX },
- { XML_NAMESPACE_TEXT, XML_ILLUSTRATION_INDEX, XML_TOK_TEXT_ILLUSTRATION_INDEX },
- { XML_NAMESPACE_TEXT, XML_USER_INDEX, XML_TOK_TEXT_USER_INDEX },
- { XML_NAMESPACE_TEXT, XML_ALPHABETICAL_INDEX, XML_TOK_TEXT_ALPHABETICAL_INDEX },
- { XML_NAMESPACE_TEXT, XML_BIBLIOGRAPHY, XML_TOK_TEXT_BIBLIOGRAPHY_INDEX },
- { XML_NAMESPACE_TEXT, XML_INDEX_TITLE, XML_TOK_TEXT_INDEX_TITLE },
- { XML_NAMESPACE_TEXT, XML_TRACKED_CHANGES, XML_TOK_TEXT_TRACKED_CHANGES },
- { XML_NAMESPACE_TEXT, XML_CHANGE_START, XML_TOK_TEXT_CHANGE_START },
- { XML_NAMESPACE_TEXT, XML_CHANGE_END, XML_TOK_TEXT_CHANGE_END },
- { XML_NAMESPACE_TEXT, XML_CHANGE, XML_TOK_TEXT_CHANGE },
- { XML_NAMESPACE_OFFICE, XML_FORMS, XML_TOK_TEXT_FORMS },
- { XML_NAMESPACE_TABLE, XML_CALCULATION_SETTINGS, XML_TOK_TEXT_CALCULATION_SETTINGS },
- { XML_NAMESPACE_TEXT, XML_ALPHABETICAL_INDEX_AUTO_MARK_FILE, XML_TOK_TEXT_AUTOMARK },
-
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aTextPElemTokenMap[] =
-{
- { XML_NAMESPACE_TEXT, XML_SPAN, XML_TOK_TEXT_SPAN },
- { XML_NAMESPACE_TEXT, XML_TAB_STOP, XML_TOK_TEXT_TAB_STOP },
- { XML_NAMESPACE_TEXT, XML_LINE_BREAK, XML_TOK_TEXT_LINE_BREAK },
- { XML_NAMESPACE_TEXT, XML_S, XML_TOK_TEXT_S },
- { XML_NAMESPACE_TEXT, XML_A, XML_TOK_TEXT_HYPERLINK },
- { XML_NAMESPACE_TEXT, XML_RUBY, XML_TOK_TEXT_RUBY },
-
- { XML_NAMESPACE_TEXT, XML_FOOTNOTE, XML_TOK_TEXT_FOOTNOTE },
- { XML_NAMESPACE_TEXT, XML_ENDNOTE, XML_TOK_TEXT_ENDNOTE },
- { XML_NAMESPACE_TEXT, XML_BOOKMARK, XML_TOK_TEXT_BOOKMARK },
- { XML_NAMESPACE_TEXT, XML_BOOKMARK_START, XML_TOK_TEXT_BOOKMARK_START },
- { XML_NAMESPACE_TEXT, XML_BOOKMARK_END, XML_TOK_TEXT_BOOKMARK_END },
- { XML_NAMESPACE_TEXT, XML_REFERENCE_MARK, XML_TOK_TEXT_REFERENCE },
- { XML_NAMESPACE_TEXT, XML_REFERENCE_MARK_START,
- XML_TOK_TEXT_REFERENCE_START },
- { XML_NAMESPACE_TEXT, XML_REFERENCE_MARK_END,
- XML_TOK_TEXT_REFERENCE_END },
-
- { XML_NAMESPACE_DRAW, XML_TEXT_BOX, XML_TOK_TEXT_TEXTBOX },
- { XML_NAMESPACE_DRAW, XML_IMAGE, XML_TOK_TEXT_IMAGE },
- { XML_NAMESPACE_DRAW, XML_OBJECT, XML_TOK_TEXT_OBJECT },
- { XML_NAMESPACE_DRAW, XML_OBJECT_OLE, XML_TOK_TEXT_OBJECT_OLE },
- { XML_NAMESPACE_DRAW, XML_APPLET, XML_TOK_TEXT_APPLET },
- { XML_NAMESPACE_DRAW, XML_FLOATING_FRAME, XML_TOK_TEXT_FLOATING_FRAME },
- { XML_NAMESPACE_DRAW, XML_PLUGIN, XML_TOK_TEXT_PLUGIN },
- { XML_NAMESPACE_DRAW, XML_A, XML_TOK_DRAW_A },
-
- // index marks
- { XML_NAMESPACE_TEXT, XML_TOC_MARK, XML_TOK_TEXT_TOC_MARK },
- { XML_NAMESPACE_TEXT, XML_TOC_MARK_START, XML_TOK_TEXT_TOC_MARK_START },
- { XML_NAMESPACE_TEXT, XML_TOC_MARK_END, XML_TOK_TEXT_TOC_MARK_END },
- { XML_NAMESPACE_TEXT, XML_USER_INDEX_MARK, XML_TOK_TEXT_USER_INDEX_MARK },
- { XML_NAMESPACE_TEXT, XML_USER_INDEX_MARK_START,
- XML_TOK_TEXT_USER_INDEX_MARK_START },
- { XML_NAMESPACE_TEXT, XML_USER_INDEX_MARK_END,
- XML_TOK_TEXT_USER_INDEX_MARK_END },
- { XML_NAMESPACE_TEXT, XML_ALPHABETICAL_INDEX_MARK,
- XML_TOK_TEXT_ALPHA_INDEX_MARK },
- { XML_NAMESPACE_TEXT, XML_ALPHABETICAL_INDEX_MARK_START,
- XML_TOK_TEXT_ALPHA_INDEX_MARK_START },
- { XML_NAMESPACE_TEXT, XML_ALPHABETICAL_INDEX_MARK_END,
- XML_TOK_TEXT_ALPHA_INDEX_MARK_END },
-
- // sender fields
- { XML_NAMESPACE_TEXT, XML_SENDER_FIRSTNAME,XML_TOK_TEXT_SENDER_FIRSTNAME},
- { XML_NAMESPACE_TEXT, XML_SENDER_LASTNAME, XML_TOK_TEXT_SENDER_LASTNAME },
- { XML_NAMESPACE_TEXT, XML_SENDER_INITIALS, XML_TOK_TEXT_SENDER_INITIALS },
- { XML_NAMESPACE_TEXT, XML_SENDER_TITLE, XML_TOK_TEXT_SENDER_TITLE },
- { XML_NAMESPACE_TEXT, XML_SENDER_POSITION, XML_TOK_TEXT_SENDER_POSITION },
- { XML_NAMESPACE_TEXT, XML_SENDER_EMAIL, XML_TOK_TEXT_SENDER_EMAIL },
- { XML_NAMESPACE_TEXT, XML_SENDER_PHONE_PRIVATE,
- XML_TOK_TEXT_SENDER_PHONE_PRIVATE },
- { XML_NAMESPACE_TEXT, XML_SENDER_FAX, XML_TOK_TEXT_SENDER_FAX },
- { XML_NAMESPACE_TEXT, XML_SENDER_COMPANY, XML_TOK_TEXT_SENDER_COMPANY },
- { XML_NAMESPACE_TEXT, XML_SENDER_PHONE_WORK,
- XML_TOK_TEXT_SENDER_PHONE_WORK },
- { XML_NAMESPACE_TEXT, XML_SENDER_STREET, XML_TOK_TEXT_SENDER_STREET },
- { XML_NAMESPACE_TEXT, XML_SENDER_CITY, XML_TOK_TEXT_SENDER_CITY },
- { XML_NAMESPACE_TEXT, XML_SENDER_POSTAL_CODE,
- XML_TOK_TEXT_SENDER_POSTAL_CODE },
- { XML_NAMESPACE_TEXT, XML_SENDER_COUNTRY, XML_TOK_TEXT_SENDER_COUNTRY },
- { XML_NAMESPACE_TEXT, XML_SENDER_STATE_OR_PROVINCE,
- XML_TOK_TEXT_SENDER_STATE_OR_PROVINCE },
-
- // misc. document fields
- { XML_NAMESPACE_TEXT, XML_AUTHOR_NAME, XML_TOK_TEXT_AUTHOR_NAME },
- { XML_NAMESPACE_TEXT, XML_AUTHOR_INITIALS, XML_TOK_TEXT_AUTHOR_INITIALS },
- { XML_NAMESPACE_TEXT, XML_DATE, XML_TOK_TEXT_DATE },
- { XML_NAMESPACE_TEXT, XML_TIME, XML_TOK_TEXT_TIME },
- { XML_NAMESPACE_TEXT, XML_PAGE_NUMBER, XML_TOK_TEXT_PAGE_NUMBER },
- { XML_NAMESPACE_TEXT, XML_PAGE_CONTINUATION_STRING,
- XML_TOK_TEXT_PAGE_CONTINUATION_STRING },
-
- // variable fields
- { XML_NAMESPACE_TEXT, XML_VARIABLE_SET, XML_TOK_TEXT_VARIABLE_SET },
- { XML_NAMESPACE_TEXT, XML_VARIABLE_GET, XML_TOK_TEXT_VARIABLE_GET },
- { XML_NAMESPACE_TEXT, XML_VARIABLE_INPUT, XML_TOK_TEXT_VARIABLE_INPUT },
- { XML_NAMESPACE_TEXT, XML_USER_FIELD_GET, XML_TOK_TEXT_USER_FIELD_GET },
- { XML_NAMESPACE_TEXT, XML_USER_FIELD_INPUT,XML_TOK_TEXT_USER_FIELD_INPUT},
- { XML_NAMESPACE_TEXT, XML_SEQUENCE, XML_TOK_TEXT_SEQUENCE },
- { XML_NAMESPACE_TEXT, XML_EXPRESSION, XML_TOK_TEXT_EXPRESSION },
- { XML_NAMESPACE_TEXT, XML_TEXT_INPUT, XML_TOK_TEXT_TEXT_INPUT },
-
- // database fields
- { XML_NAMESPACE_TEXT, XML_DATABASE_DISPLAY,
- XML_TOK_TEXT_DATABASE_DISPLAY },
- { XML_NAMESPACE_TEXT, XML_DATABASE_NEXT,
- XML_TOK_TEXT_DATABASE_NEXT },
- { XML_NAMESPACE_TEXT, XML_DATABASE_SELECT,
- XML_TOK_TEXT_DATABASE_SELECT },
- { XML_NAMESPACE_TEXT, XML_DATABASE_ROW_NUMBER,
- XML_TOK_TEXT_DATABASE_ROW_NUMBER },
- { XML_NAMESPACE_TEXT, XML_DATABASE_NAME, XML_TOK_TEXT_DATABASE_NAME },
-
- // docinfo fields
- { XML_NAMESPACE_TEXT, XML_INITIAL_CREATOR,
- XML_TOK_TEXT_DOCUMENT_CREATION_AUTHOR },
- { XML_NAMESPACE_TEXT, XML_DESCRIPTION, XML_TOK_TEXT_DOCUMENT_DESCRIPTION},
- { XML_NAMESPACE_TEXT, XML_USER_INFO_0,
- XML_TOK_TEXT_DOCUMENT_INFORMATION_0 },
- { XML_NAMESPACE_TEXT, XML_USER_INFO_1,
- XML_TOK_TEXT_DOCUMENT_INFORMATION_1 },
- { XML_NAMESPACE_TEXT, XML_USER_INFO_2,
- XML_TOK_TEXT_DOCUMENT_INFORMATION_2 },
- { XML_NAMESPACE_TEXT, XML_USER_INFO_3,
- XML_TOK_TEXT_DOCUMENT_INFORMATION_3 },
- { XML_NAMESPACE_TEXT, XML_PRINTED_BY, XML_TOK_TEXT_DOCUMENT_PRINT_AUTHOR},
- { XML_NAMESPACE_TEXT, XML_TITLE, XML_TOK_TEXT_DOCUMENT_TITLE },
- { XML_NAMESPACE_TEXT, XML_SUBJECT, XML_TOK_TEXT_DOCUMENT_SUBJECT },
- { XML_NAMESPACE_TEXT, XML_KEYWORDS, XML_TOK_TEXT_DOCUMENT_KEYWORDS },
- { XML_NAMESPACE_TEXT, XML_CREATOR, XML_TOK_TEXT_DOCUMENT_SAVE_AUTHOR },
- { XML_NAMESPACE_TEXT, XML_EDITING_CYCLES,
- XML_TOK_TEXT_DOCUMENT_REVISION },
- { XML_NAMESPACE_TEXT, XML_CREATION_DATE,
- XML_TOK_TEXT_DOCUMENT_CREATION_DATE },
- { XML_NAMESPACE_TEXT, XML_CREATION_TIME,
- XML_TOK_TEXT_DOCUMENT_CREATION_TIME },
- { XML_NAMESPACE_TEXT, XML_PRINT_DATE, XML_TOK_TEXT_DOCUMENT_PRINT_DATE },
- { XML_NAMESPACE_TEXT, XML_PRINT_TIME, XML_TOK_TEXT_DOCUMENT_PRINT_TIME },
- { XML_NAMESPACE_TEXT, XML_MODIFICATION_DATE,
- XML_TOK_TEXT_DOCUMENT_SAVE_DATE },
- { XML_NAMESPACE_TEXT, XML_MODIFICATION_TIME,
- XML_TOK_TEXT_DOCUMENT_SAVE_TIME },
- { XML_NAMESPACE_TEXT, XML_EDITING_DURATION,
- XML_TOK_TEXT_DOCUMENT_EDIT_DURATION },
- { XML_NAMESPACE_TEXT, XML_USER_DEFINED,
- XML_TOK_TEXT_DOCUMENT_USER_DEFINED },
-
- // misc fields
- { XML_NAMESPACE_TEXT, XML_PLACEHOLDER, XML_TOK_TEXT_PLACEHOLDER },
- { XML_NAMESPACE_TEXT, XML_HIDDEN_TEXT, XML_TOK_TEXT_HIDDEN_TEXT },
- { XML_NAMESPACE_TEXT, XML_HIDDEN_PARAGRAPH,
- XML_TOK_TEXT_HIDDEN_PARAGRAPH },
- { XML_NAMESPACE_TEXT, XML_CONDITIONAL_TEXT,
- XML_TOK_TEXT_CONDITIONAL_TEXT },
- { XML_NAMESPACE_TEXT, XML_FILE_NAME, XML_TOK_TEXT_FILENAME },
- { XML_NAMESPACE_TEXT, XML_CHAPTER, XML_TOK_TEXT_CHAPTER },
- { XML_NAMESPACE_TEXT, XML_TEMPLATE_NAME, XML_TOK_TEXT_TEMPLATENAME },
- { XML_NAMESPACE_TEXT, XML_PARAGRAPH_COUNT, XML_TOK_TEXT_PARAGRAPH_COUNT },
- { XML_NAMESPACE_TEXT, XML_WORD_COUNT, XML_TOK_TEXT_WORD_COUNT },
- { XML_NAMESPACE_TEXT, XML_TABLE_COUNT, XML_TOK_TEXT_TABLE_COUNT },
- { XML_NAMESPACE_TEXT, XML_CHARACTER_COUNT, XML_TOK_TEXT_CHARACTER_COUNT },
- { XML_NAMESPACE_TEXT, XML_IMAGE_COUNT, XML_TOK_TEXT_IMAGE_COUNT },
- { XML_NAMESPACE_TEXT, XML_OBJECT_COUNT, XML_TOK_TEXT_OBJECT_COUNT },
- { XML_NAMESPACE_TEXT, XML_PAGE_COUNT, XML_TOK_TEXT_PAGE_COUNT },
- { XML_NAMESPACE_TEXT, XML_PAGE_VARIABLE_GET, XML_TOK_TEXT_GET_PAGE_VAR },
- { XML_NAMESPACE_TEXT, XML_PAGE_VARIABLE_SET, XML_TOK_TEXT_SET_PAGE_VAR },
- { XML_NAMESPACE_TEXT, XML_EXECUTE_MACRO, XML_TOK_TEXT_MACRO },
- { XML_NAMESPACE_TEXT, XML_DDE_CONNECTION, XML_TOK_TEXT_DDE },
- { XML_NAMESPACE_TEXT, XML_REFERENCE_REF, XML_TOK_TEXT_REFERENCE_REF },
- { XML_NAMESPACE_TEXT, XML_BOOKMARK_REF, XML_TOK_TEXT_BOOKMARK_REF },
- { XML_NAMESPACE_TEXT, XML_SEQUENCE_REF, XML_TOK_TEXT_SEQUENCE_REF },
- { XML_NAMESPACE_TEXT, XML_FOOTNOTE_REF, XML_TOK_TEXT_FOOTNOTE_REF },
- { XML_NAMESPACE_TEXT, XML_ENDNOTE_REF, XML_TOK_TEXT_ENDNOTE_REF },
- { XML_NAMESPACE_TEXT, XML_BIBLIOGRAPHY_MARK,
- XML_TOK_TEXT_BIBLIOGRAPHY_MARK },
- { XML_NAMESPACE_OFFICE, XML_ANNOTATION, XML_TOK_TEXT_ANNOTATION },
- { XML_NAMESPACE_TEXT, XML_SCRIPT, XML_TOK_TEXT_SCRIPT },
- { XML_NAMESPACE_TEXT, XML_TABLE_FORMULA, XML_TOK_TEXT_TABLE_FORMULA },
- { XML_NAMESPACE_TEXT, XML_DROPDOWN, XML_TOK_TEXT_DROPDOWN },
-
- // Calc fields
- { XML_NAMESPACE_TEXT, XML_SHEET_NAME, XML_TOK_TEXT_SHEET_NAME },
-
- // draw fields
- { XML_NAMESPACE_TEXT, XML_MEASURE, XML_TOK_TEXT_MEASURE },
-
- // redlining (aka change tracking)
- { XML_NAMESPACE_TEXT, XML_CHANGE_START, XML_TOK_TEXTP_CHANGE_START },
- { XML_NAMESPACE_TEXT, XML_CHANGE_END , XML_TOK_TEXTP_CHANGE_END },
- { XML_NAMESPACE_TEXT, XML_CHANGE, XML_TOK_TEXTP_CHANGE },
-
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aTextPAttrTokenMap[] =
-{
- { XML_NAMESPACE_TEXT, XML_STYLE_NAME, XML_TOK_TEXT_P_STYLE_NAME },
- { XML_NAMESPACE_TEXT, XML_COND_STYLE_NAME,
- XML_TOK_TEXT_P_COND_STYLE_NAME },
- { XML_NAMESPACE_TEXT, XML_LEVEL, XML_TOK_TEXT_P_LEVEL },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aTextListBlockAttrTokenMap[] =
-{
- { XML_NAMESPACE_TEXT, XML_STYLE_NAME,
- XML_TOK_TEXT_LIST_BLOCK_STYLE_NAME },
- { XML_NAMESPACE_TEXT, XML_CONTINUE_NUMBERING,
- XML_TOK_TEXT_LIST_BLOCK_CONTINUE_NUMBERING },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aTextListBlockElemTokenMap[] =
-{
- { XML_NAMESPACE_TEXT, XML_LIST_HEADER, XML_TOK_TEXT_LIST_HEADER },
- { XML_NAMESPACE_TEXT, XML_LIST_ITEM, XML_TOK_TEXT_LIST_ITEM },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aTextFrameAttrTokenMap[] =
-{
- { XML_NAMESPACE_DRAW, XML_STYLE_NAME, XML_TOK_TEXT_FRAME_STYLE_NAME },
- { XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_TEXT_FRAME_NAME },
- { XML_NAMESPACE_TEXT, XML_ANCHOR_TYPE, XML_TOK_TEXT_FRAME_ANCHOR_TYPE },
- { XML_NAMESPACE_TEXT, XML_ANCHOR_PAGE_NUMBER, XML_TOK_TEXT_FRAME_ANCHOR_PAGE_NUMBER },
- { XML_NAMESPACE_SVG, XML_X, XML_TOK_TEXT_FRAME_X },
- { XML_NAMESPACE_SVG, XML_Y, XML_TOK_TEXT_FRAME_Y },
- { XML_NAMESPACE_SVG, XML_WIDTH, XML_TOK_TEXT_FRAME_WIDTH },
- { XML_NAMESPACE_STYLE, XML_REL_WIDTH, XML_TOK_TEXT_FRAME_REL_WIDTH },
- { XML_NAMESPACE_SVG, XML_HEIGHT, XML_TOK_TEXT_FRAME_HEIGHT },
- { XML_NAMESPACE_FO, XML_MIN_HEIGHT, XML_TOK_TEXT_FRAME_MIN_HEIGHT },
- { XML_NAMESPACE_STYLE, XML_REL_HEIGHT, XML_TOK_TEXT_FRAME_REL_HEIGHT },
- { XML_NAMESPACE_DRAW, XML_CHAIN_NEXT_NAME, XML_TOK_TEXT_FRAME_NEXT_CHAIN_NAME },
- { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_TEXT_FRAME_HREF },
- { XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_TEXT_FRAME_FILTER_NAME },
- { XML_NAMESPACE_DRAW, XML_ZINDEX, XML_TOK_TEXT_FRAME_Z_INDEX },
- { XML_NAMESPACE_SVG, XML_TRANSFORM, XML_TOK_TEXT_FRAME_TRANSFORM },
- { XML_NAMESPACE_DRAW, XML_CLASS_ID, XML_TOK_TEXT_FRAME_CLASS_ID },
- { XML_NAMESPACE_DRAW, XML_CODE, XML_TOK_TEXT_FRAME_CODE },
- { XML_NAMESPACE_DRAW, XML_OBJECT, XML_TOK_TEXT_FRAME_OBJECT },
- { XML_NAMESPACE_DRAW, XML_ARCHIVE, XML_TOK_TEXT_FRAME_ARCHIVE },
- { XML_NAMESPACE_DRAW, XML_MAY_SCRIPT, XML_TOK_TEXT_FRAME_MAY_SCRIPT },
- { XML_NAMESPACE_DRAW, XML_MIME_TYPE, XML_TOK_TEXT_FRAME_MIME_TYPE },
- { XML_NAMESPACE_DRAW, XML_APPLET_NAME, XML_TOK_TEXT_FRAME_APPLET_NAME },
- { XML_NAMESPACE_DRAW, XML_FRAME_NAME, XML_TOK_TEXT_FRAME_FRAME_NAME },
- { XML_NAMESPACE_DRAW, XML_NOTIFY_ON_UPDATE_OF_RANGES, XML_TOK_TEXT_FRAME_NOTIFY_ON_UPDATE },
- { XML_NAMESPACE_DRAW, XML_NOTIFY_ON_UPDATE_OF_TABLE, XML_TOK_TEXT_FRAME_NOTIFY_ON_UPDATE },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aTextContourAttrTokenMap[] =
-{
- { XML_NAMESPACE_SVG, XML_WIDTH, XML_TOK_TEXT_CONTOUR_WIDTH },
- { XML_NAMESPACE_SVG, XML_HEIGHT, XML_TOK_TEXT_CONTOUR_HEIGHT },
- { XML_NAMESPACE_SVG, XML_VIEWBOX, XML_TOK_TEXT_CONTOUR_VIEWBOX },
- { XML_NAMESPACE_SVG, XML_D, XML_TOK_TEXT_CONTOUR_D },
- { XML_NAMESPACE_DRAW,XML_POINTS, XML_TOK_TEXT_CONTOUR_POINTS },
- { XML_NAMESPACE_DRAW,XML_RECREATE_ON_EDIT, XML_TOK_TEXT_CONTOUR_AUTO },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aTextHyperlinkAttrTokenMap[] =
-{
- { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_TEXT_HYPERLINK_HREF },
- { XML_NAMESPACE_OFFICE, XML_NAME, XML_TOK_TEXT_HYPERLINK_NAME },
- { XML_NAMESPACE_XLINK, XML_SHOW, XML_TOK_TEXT_HYPERLINK_SHOW },
- { XML_NAMESPACE_OFFICE, XML_TARGET_FRAME_NAME, XML_TOK_TEXT_HYPERLINK_TARGET_FRAME },
- { XML_NAMESPACE_TEXT, XML_STYLE_NAME, XML_TOK_TEXT_HYPERLINK_STYLE_NAME },
- { XML_NAMESPACE_TEXT, XML_VISITED_STYLE_NAME, XML_TOK_TEXT_HYPERLINK_VIS_STYLE_NAME },
- { XML_NAMESPACE_OFFICE, XML_SERVER_MAP, XML_TOK_TEXT_HYPERLINK_SERVER_MAP },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aTextMasterPageElemTokenMap[] =
-{
- { XML_NAMESPACE_STYLE, XML_HEADER, XML_TOK_TEXT_MP_HEADER },
- { XML_NAMESPACE_STYLE, XML_FOOTER, XML_TOK_TEXT_MP_FOOTER },
- { XML_NAMESPACE_STYLE, XML_HEADER_LEFT, XML_TOK_TEXT_MP_HEADER_LEFT },
- { XML_NAMESPACE_STYLE, XML_FOOTER_LEFT, XML_TOK_TEXT_MP_FOOTER_LEFT },
-
- XML_TOKEN_MAP_END
-};
-
-// maximum allowed length of combined characters field
-#define MAX_COMBINED_CHARACTERS 6
-
-
-XMLTextImportHelper::XMLTextImportHelper(
- const Reference < XModel >& rModel,
- SvXMLImport& rImport,
- sal_Bool bInsertM, sal_Bool bStylesOnlyM,
- sal_Bool bPrg,
- sal_Bool bBlockM,
- sal_Bool bOrganizerM ) :
- pTextElemTokenMap( 0 ),
- pTextPElemTokenMap( 0 ),
- pTextPAttrTokenMap( 0 ),
- pTextListBlockAttrTokenMap( 0 ),
- pTextListBlockElemTokenMap( 0 ),
- pTextFieldAttrTokenMap( 0 ),
- pTextFrameAttrTokenMap( 0 ),
- pTextContourAttrTokenMap( 0 ),
- pTextHyperlinkAttrTokenMap( 0 ),
- pTextMasterPageElemTokenMap( 0 ),
- pPrevFrmNames( 0 ),
- pNextFrmNames( 0 ),
- pRenameMap( 0 ),
- pOutlineStyles( 0 ),
- bInsertMode( bInsertM ),
- bBlockMode( bBlockM ),
- bStylesOnlyMode( bStylesOnlyM ),
- bProgress( bPrg ),
- bOrganizerMode( bOrganizerM ),
- bBodyContentStarted( sal_True ),
-
- // #107848#
- // Initialize inside_deleted_section flag correctly
- bInsideDeleteContext( sal_False ),
-
- 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" ); for clipboard there may be documents without styles
-
- 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, rImport );
-
- pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT );
- xTextImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport );
-
- pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME );
- xFrameImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport );
-
- pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_SECTION );
- xSectionImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport );
-
- pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_RUBY );
- xRubyImpPrMap = new SvXMLImportPropertyMapper( pPropMapper, rImport );
-}
-
-XMLTextImportHelper::~XMLTextImportHelper()
-{
- delete pTextElemTokenMap;
- delete pTextPElemTokenMap;
- delete pTextPAttrTokenMap;
- delete pTextListBlockAttrTokenMap;
- delete pTextListBlockElemTokenMap;
- delete pTextFieldAttrTokenMap;
- delete pTextFrameAttrTokenMap;
- delete pTextContourAttrTokenMap;
- delete pTextHyperlinkAttrTokenMap;
- delete pTextMasterPageElemTokenMap;
-
- delete pRenameMap;
-
- delete pPrevFrmNames;
- delete pNextFrmNames;
- delete [] pOutlineStyles;
-
- _FinitBackpatcher();
-}
-
-SvXMLImportPropertyMapper *XMLTextImportHelper::CreateShapeExtPropMapper(SvXMLImport& rImport)
-{
- XMLPropertySetMapper *pPropMapper =
- new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME );
- return new XMLTextImportPropertyMapper( pPropMapper, rImport,
- const_cast<XMLFontStylesContext*>(rImport.GetFontDecls()) );
-}
-
-SvXMLImportPropertyMapper *XMLTextImportHelper::CreateCharExtPropMapper(SvXMLImport& rImport, XMLFontStylesContext *pFontDecls)
-{
- XMLPropertySetMapper *pPropMapper =
- new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT );
- if (!pFontDecls)
- pFontDecls = const_cast<XMLFontStylesContext*>(rImport.GetFontDecls());
- return new XMLTextImportPropertyMapper( pPropMapper, rImport, pFontDecls );
-}
-
-SvXMLImportPropertyMapper *XMLTextImportHelper::CreateParaExtPropMapper(SvXMLImport& rImport, XMLFontStylesContext *pFontDecls)
-{
- XMLPropertySetMapper *pPropMapper =
- new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA );
- if (!pFontDecls)
- pFontDecls = const_cast<XMLFontStylesContext*>(rImport.GetFontDecls());
- return new XMLTextImportPropertyMapper( pPropMapper, rImport, pFontDecls );
-}
-
-void XMLTextImportHelper::SetCursor( const Reference < XTextCursor > & rCursor )
-{
- xCursor = rCursor;
- xText = rCursor->getText();
- xCursorAsRange = Reference < XTextRange >( rCursor, UNO_QUERY );
-}
-
-void XMLTextImportHelper::ResetCursor()
-{
- xCursor = 0;
- xText = 0;
- xCursorAsRange = 0;
-}
-
-SvXMLTokenMap *XMLTextImportHelper::_GetTextElemTokenMap()
-{
- return new SvXMLTokenMap( aTextElemTokenMap );
-}
-
-SvXMLTokenMap *XMLTextImportHelper::_GetTextPElemTokenMap()
-{
- return new SvXMLTokenMap( aTextPElemTokenMap );
-}
-
-SvXMLTokenMap *XMLTextImportHelper::_GetTextPAttrTokenMap()
-{
- return new SvXMLTokenMap( aTextPAttrTokenMap );
-}
-
-SvXMLTokenMap *XMLTextImportHelper::_GetTextFrameAttrTokenMap()
-{
- return new SvXMLTokenMap( aTextFrameAttrTokenMap );
-}
-
-SvXMLTokenMap *XMLTextImportHelper::_GetTextContourAttrTokenMap()
-{
- return new SvXMLTokenMap( aTextContourAttrTokenMap );
-}
-
-
-SvXMLTokenMap *XMLTextImportHelper::_GetTextHyperlinkAttrTokenMap()
-{
- return new SvXMLTokenMap( aTextHyperlinkAttrTokenMap );
-}
-
-SvXMLTokenMap *XMLTextImportHelper::_GetTextMasterPageElemTokenMap()
-{
- return new SvXMLTokenMap( aTextMasterPageElemTokenMap );
-}
-
-sal_Bool XMLTextImportHelper::HasFrameByName( const OUString& rName ) const
-{
- return ( xTextFrames.is() && xTextFrames->hasByName( rName ) ) ||
- ( xGraphics.is() && xGraphics->hasByName( rName ) ) ||
- ( xObjects.is() && xObjects->hasByName( rName ) );
-}
-
-void XMLTextImportHelper::InsertString( const OUString& rChars )
-{
- DBG_ASSERT( xText.is(), "no text" );
- DBG_ASSERT( xCursorAsRange.is(), "no range" );
- if( xText.is() )
- xText->insertString( xCursorAsRange, rChars, sal_False );
-}
-
-void XMLTextImportHelper::InsertString( const OUString& rChars,
- sal_Bool& rIgnoreLeadingSpace )
-{
- DBG_ASSERT( xText.is(), "no text" );
- DBG_ASSERT( xCursorAsRange.is(), "no range" );
- if( xText.is() )
- {
- sal_Int32 nLen = rChars.getLength();
- OUStringBuffer sChars( nLen );
-
- for( sal_Int32 i=0; i < nLen; i++ )
- {
- sal_Unicode c = rChars[i];
- switch( c )
- {
- case 0x20:
- case 0x09:
- case 0x0a:
- case 0x0d:
- if( !rIgnoreLeadingSpace )
- sChars.append( (sal_Unicode)0x20 );
- rIgnoreLeadingSpace = sal_True;
- break;
- default:
- rIgnoreLeadingSpace = sal_False;
- sChars.append( c );
- break;
- }
- }
- xText->insertString( xCursorAsRange, sChars.makeStringAndClear(),
- sal_False );
- }
-}
-void XMLTextImportHelper::InsertControlCharacter( sal_Int16 nControl )
-{
- DBG_ASSERT( xText.is(), "no text" );
- DBG_ASSERT( xCursorAsRange.is(), "no range" );
- if( xText.is() )
- xText->insertControlCharacter( xCursorAsRange, nControl, sal_False );
-}
-
-void XMLTextImportHelper::InsertTextContent(
- Reference < XTextContent > & xContent )
-{
- DBG_ASSERT( xText.is(), "no text" );
- DBG_ASSERT( xCursorAsRange.is(), "no range" );
- if( xText.is() )
- xText->insertTextContent( xCursorAsRange, xContent, sal_False );
-}
-
-void XMLTextImportHelper::DeleteParagraph()
-{
- DBG_ASSERT( xText.is(), "no text" );
- DBG_ASSERT( xCursor.is(), "no cursor" );
- DBG_ASSERT( xCursorAsRange.is(), "no range" );
-
- sal_Bool bDelete = sal_True;
- Reference < XEnumerationAccess > xEnumAccess( xCursor, UNO_QUERY );
- if( xEnumAccess.is() )
- {
- Reference < XEnumeration > xEnum = xEnumAccess->createEnumeration();
- DBG_ASSERT( xEnum->hasMoreElements(), "empty text enumeration" );
- if( xEnum->hasMoreElements() )
- {
- Any aAny = xEnum->nextElement();
- Reference < XTextRange > xTxtRange;
- aAny >>= xTxtRange;
- Reference < XComponent > xComp( xTxtRange, UNO_QUERY );
- DBG_ASSERT( xComp.is(), "got no component" );
- if( xComp.is() )
- {
- xComp->dispose();
- bDelete = sal_False;
- }
- }
- }
- if( bDelete )
- {
- if( xCursor->goLeft( 1, sal_True ) )
- {
- OUString sEmpty;
- xText->insertString( xCursorAsRange, sEmpty, sal_True );
- }
- }
-}
-
-#ifdef CONV_STAR_FONTS
-OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars,
- const OUString& rStyleName,
- sal_uInt8& rFlags,
- sal_Bool bPara,
- SvXMLImport& rImport ) const
-{
- OUStringBuffer sChars( rChars );
- sal_Bool bConverted = sal_False;
- for( sal_Int32 i=0; i<rChars.getLength(); i++ )
- {
- sal_Unicode c = rChars[i];
- if( c >= 0xf000 && c <= 0xf0ff )
- {
- if( (rFlags & CONV_STAR_FONT_FLAGS_VALID) == 0 )
- {
- XMLTextStyleContext *pStyle = 0;
- sal_uInt16 nFamily = bPara ? XML_STYLE_FAMILY_TEXT_PARAGRAPH
- : XML_STYLE_FAMILY_TEXT_TEXT;
- if( rStyleName.getLength() && xAutoStyles.Is() )
- {
- pStyle = PTR_CAST( XMLTextStyleContext,
- ((SvXMLStylesContext *)&xAutoStyles)->
- FindStyleChildContext( nFamily, rStyleName,
- sal_True ) );
- }
-
- if( pStyle )
- {
- sal_Int32 nCount = pStyle->_GetProperties().size();
- if( nCount )
- {
- UniReference < SvXMLImportPropertyMapper > xImpPrMap =
- ((SvXMLStylesContext *)&xAutoStyles)->GetImportPropertyMapper(nFamily);
- if( xImpPrMap.is() )
- {
- UniReference<XMLPropertySetMapper> rPropMapper =
- xImpPrMap->getPropertySetMapper();
- for( sal_Int32 i=0; i < nCount; i++ )
- {
- const XMLPropertyState& rProp = pStyle->_GetProperties()[i];
- sal_Int32 nIdx = rProp.mnIndex;
- sal_uInt32 nContextId = rPropMapper->GetEntryContextId(nIdx);
- if( CTF_FONTFAMILYNAME == nContextId )
- {
- rFlags &= ~(CONV_FROM_STAR_BATS|CONV_FROM_STAR_MATH);
- OUString sFontName;
- rProp.maValue >>= sFontName;
- OUString sStarBats( RTL_CONSTASCII_USTRINGPARAM("StarBats" ) );
- OUString sStarMath( RTL_CONSTASCII_USTRINGPARAM("StarMath" ) );
- if( sFontName.equalsIgnoreAsciiCase( sStarBats ) )
- rFlags |= CONV_FROM_STAR_BATS;
- else if( sFontName.equalsIgnoreAsciiCase( sStarMath ) )
- rFlags |= CONV_FROM_STAR_MATH;
- break;
- }
- }
- }
- }
-
- }
-
- rFlags |= CONV_STAR_FONT_FLAGS_VALID;
- }
- if( (rFlags & CONV_FROM_STAR_BATS ) != 0 )
- {
- sChars.setCharAt( i, rImport.ConvStarBatsCharToStarSymbol( c ) );
- bConverted = sal_True;
- }
- else if( (rFlags & CONV_FROM_STAR_MATH ) != 0 )
- {
- sChars.setCharAt( i, rImport.ConvStarMathCharToStarSymbol( c ) );
- bConverted = sal_True;
- }
- }
- }
-
- return bConverted ? sChars.makeStringAndClear() : rChars;
-}
-#endif
-
-OUString XMLTextImportHelper::SetStyleAndAttrs(
- const Reference < XTextCursor >& rCursor,
- const OUString& rStyleName,
- sal_Bool bPara )
-{
- XMLTextStyleContext *pStyle = 0;
- OUString sStyleName( rStyleName );
- if( sStyleName.getLength() && xAutoStyles.Is() )
- {
- sal_uInt16 nFamily = bPara ? XML_STYLE_FAMILY_TEXT_PARAGRAPH
- : XML_STYLE_FAMILY_TEXT_TEXT;
- pStyle = PTR_CAST( XMLTextStyleContext,
- ((SvXMLStylesContext *)&xAutoStyles)->
- FindStyleChildContext( nFamily, sStyleName, sal_True ) );
- }
- if( pStyle )
- sStyleName = pStyle->GetParent();
-
- Reference < XPropertySet > xPropSet( rCursor, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
-
- // style
- if( sStyleName.getLength() )
- {
- const String& rPropName = bPara ? sParaStyleName : sCharStyleName;
- const Reference < XNameContainer > & rStyles = bPara ? xParaStyles
- : xTextStyles;
- if( rStyles.is() &&
- xPropSetInfo->hasPropertyByName( rPropName ) &&
- rStyles->hasByName( sStyleName ) )
- {
- Any aAny;
- aAny <<= sStyleName;
- xPropSet->setPropertyValue( rPropName, aAny );
- }
- else
- sStyleName = OUString();
- }
-
- if( bPara && xPropSetInfo->hasPropertyByName( sNumberingRules ) )
- {
- // Set numbering rules
- Reference < XIndexReplace > xNumRules;
- Any aAny = xPropSet->getPropertyValue( sNumberingRules );
- aAny >>= xNumRules;
-
- if( IsInList() )
- {
- XMLTextListBlockContext *pListBlock = GetListBlock();
- Reference < XIndexReplace > xNewNumRules =
- pListBlock->GetNumRules();
-
- sal_Bool bSameNumRules = xNewNumRules == xNumRules;
- if( !bSameNumRules && xNewNumRules.is() && xNumRules.is() )
- {
- // If the interface pointers are different then this does
- // not mean that the num rules are different. Further tests
- // are rquired then. However, if only one num rule is
- // set, no tests are required of course.
- Reference< XNamed > xNewNamed( xNewNumRules, UNO_QUERY );
- Reference< XNamed > xNamed( xNumRules, UNO_QUERY );
- if( xNewNamed.is() && xNamed.is() )
- {
- bSameNumRules = xNewNamed->getName() == xNamed->getName();
- }
- else
- {
- if( !xNumRuleCompare.is() )
- {
- Reference<XAnyCompareFactory> xCompareFac( xServiceFactory, UNO_QUERY );
- OSL_ENSURE( xCompareFac.is(), "got no XAnyCompareFactory" );
- if( xCompareFac.is() )
- {
- xNumRuleCompare =
- xCompareFac->createAnyCompareByName(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "NumberingRules" ) ) );
- OSL_ENSURE( xNumRuleCompare .is(),
- "got no Numbering Rules comparison" );
- }
- }
- if( xNumRuleCompare.is() )
- {
- Any aNewAny;
- aNewAny <<= xNewNumRules;
- bSameNumRules = (xNumRuleCompare->compare( aAny,
- aNewAny ) == 0);
- }
- }
- }
-
- if( !bSameNumRules )
- {
- aAny <<= xNewNumRules;
-
- // #102607# This may except when xNewNumRules contains
- // a Writer-NumRule-Implementation bug gets applied to
- // a shape. Since this may occur inside a document
- // (e.g. when edited), this must be handled
- // gracefully.
- try
- {
- xPropSet->setPropertyValue( sNumberingRules, aAny );
- }
- catch( Exception e )
- {
- ; // I would really like to use a warning here,
- // but I can't access the XMLErrorHandler from
- // here.
- }
- }
-
- XMLTextListItemContext *pListItem = GetListItem();
-
- sal_Int8 nLevel = (sal_Int8)pListBlock->GetLevel();
- if( !pListItem &&
- xPropSetInfo->hasPropertyByName( sNumberingIsNumber ) )
- {
- sal_Bool bTmp = sal_False;
- aAny.setValue( &bTmp, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( sNumberingIsNumber, aAny );
- }
-
- aAny <<= nLevel;
- xPropSet->setPropertyValue( sNumberingLevel, aAny );
-
- if( pListBlock->IsRestartNumbering() )
- {
- // TODO: property missing
- if( xPropSetInfo->hasPropertyByName( sParaIsNumberingRestart ) )
- {
- sal_Bool bTmp = sal_True;
- aAny.setValue( &bTmp, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( sParaIsNumberingRestart, aAny );
- }
- pListBlock->ResetRestartNumbering();
- }
- if( pListItem && pListItem->HasStartValue() &&
- xPropSetInfo->hasPropertyByName( sNumberingStartValue ) )
- {
- aAny <<= pListItem->GetStartValue();
- xPropSet->setPropertyValue( sNumberingStartValue, aAny );
- }
- SetListItem( (XMLTextListItemContext *)0 );
- }
- else
- {
- // If the paragraph is not in a list but its style, remove it from
- // the list.
- if( xNumRules.is() )
- {
- aAny.clear();
- xPropSet->setPropertyValue( sNumberingRules, aAny );
- }
- }
- }
-
- // hard paragraph properties
- if( pStyle )
- {
- pStyle->FillPropertySet( xPropSet );
- if( bPara && pStyle->HasMasterPageName() &&
- xPropSetInfo->hasPropertyByName( sPageDescName ) )
- {
- const OUString& rMasterPageName = pStyle->GetMasterPageName();
- if( !rMasterPageName.getLength() ||
- (xPageStyles.is() &&
- xPageStyles->hasByName( rMasterPageName )) )
- {
- Any aAny;
- aAny <<= rMasterPageName;
- xPropSet->setPropertyValue( sPageDescName, aAny );
- }
- }
- if( bPara && pStyle->GetDropCapStyleName().getLength() &&
- xTextStyles.is() &&
- xTextStyles->hasByName( pStyle->GetDropCapStyleName() ) &&
- xPropSetInfo->hasPropertyByName( pStyle->sDropCapCharStyleName ) )
- {
- Any aAny;
- aAny <<= pStyle->GetDropCapStyleName();
- xPropSet->setPropertyValue( pStyle->sDropCapCharStyleName, aAny );
- }
-
- // combined characters special treatment
- if (!bPara && pStyle->HasCombinedCharactersLetter())
- {
- // insert combined characters text field
- if( xServiceFactory.is() )
- {
- Reference<XInterface> xIfc =
- xServiceFactory->createInstance(sServiceCombinedCharacters);
- if( xIfc.is() )
- {
- // fix cursor if larger than possible for
- // combined characters field
- if (rCursor->getString().getLength() >
- MAX_COMBINED_CHARACTERS)
- {
- rCursor->gotoRange(rCursor->getStart(), sal_False);
- rCursor->goRight(MAX_COMBINED_CHARACTERS, sal_True);
- }
-
- // set field value (the combined character string)
- Reference<XPropertySet> xTmp( xIfc, UNO_QUERY );
- Any aAny;
- aAny <<= rCursor->getString();
- xTmp->setPropertyValue(sContent, aAny);
-
- // insert the field over it's original text
- Reference<XTextRange> xRange(rCursor, UNO_QUERY);
- Reference<XTextContent> xTextContent(xTmp, UNO_QUERY);
- if (xText.is() && xRange.is())
- {
- xText->insertTextContent( xRange, xTextContent,
- sal_True );
- }
- }
- }
- }
- }
-
- return sStyleName;
-}
-
-void XMLTextImportHelper::FindOutlineStyleName(
- ::rtl::OUString& rStyleName,
- sal_Int8 nLevel )
-{
- // style name empty?
- if( rStyleName.getLength() == 0 )
- {
- // Empty? Then we need o do stuff. Let's do error checking first.
- if( xChapterNumbering.is() &&
- ( nLevel > 0 ) &&
- ( nLevel <= xChapterNumbering->getCount() ) )
- {
- nLevel--; // for the remainder, the level's are 0-based
-
- // empty style name: look-up previously used name
-
- // if we don't have a previously used name, we'll use the default
- if( pOutlineStyles == NULL )
- pOutlineStyles = new OUString[xChapterNumbering->getCount()];
-
- if( pOutlineStyles[nLevel] == NULL )
- {
- // no other name used previously? Then use default
-
- // iterate over property value sequence to find the style name
- Sequence<PropertyValue> aProperties;
- xChapterNumbering->getByIndex( nLevel ) >>= aProperties;
- for( sal_Int32 i = 0; i < aProperties.getLength(); i++ )
- {
- if( aProperties[i].Name == sHeadingStyleName )
- {
- aProperties[i].Value >>= pOutlineStyles[nLevel];
- break; // early out, if we found it!.
- }
- }
- }
-
- // finally, we'll use the previously used style name for this
- // format (or the default we've just put into that style)
- rStyleName = pOutlineStyles[nLevel];
- }
- // else: nothing we can do, so we'll leave it empty
- }
- // else: we already had a style name, so we let it pass.
-}
-
-void XMLTextImportHelper::SetOutlineStyle(
- sal_Int8 nLevel,
- const OUString& rStyleName )
-{
- if( rStyleName.getLength() &&
- xChapterNumbering.is() &&
- nLevel > 0 && nLevel <= xChapterNumbering->getCount() )
- {
- if( !pOutlineStyles )
- {
- pOutlineStyles = new OUString[xChapterNumbering->getCount()];
- }
- pOutlineStyles[nLevel-1] = rStyleName;
- }
-}
-
-void XMLTextImportHelper::SetOutlineStyles()
-{
- if( pOutlineStyles &&
- xChapterNumbering.is() &&
- !( IsInsertMode() || IsStylesOnlyMode() ) )
- {
- sal_Int32 nCount = xChapterNumbering->getCount();
- for( sal_Int32 i=0; i < nCount; i++ )
- {
- Sequence < PropertyValue > aProps( 1 );
- PropertyValue *pProps = aProps.getArray();
- pProps->Name = sHeadingStyleName;
- pProps->Value <<= pOutlineStyles[i];
-
- Any aAny;
- aAny <<= aProps;
- xChapterNumbering->replaceByIndex( i, aAny );
- }
- }
-}
-
-void XMLTextImportHelper::SetHyperlink(
- const Reference < XTextCursor >& rCursor,
- const OUString& rHRef,
- const OUString& rName,
- const OUString& rTargetFrameName,
- const OUString& rStyleName,
- const OUString& rVisitedStyleName,
- XMLEventsImportContext* pEvents)
-{
- Reference < XPropertySet > xPropSet( rCursor, UNO_QUERY );
- Reference < XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
- if( !xPropSetInfo.is() || !xPropSetInfo->hasPropertyByName(sHyperLinkURL) )
- return;
-
- Any aAny;
- aAny <<= rHRef;
- xPropSet->setPropertyValue( sHyperLinkURL, aAny );
-
- if( xPropSetInfo->hasPropertyByName( sHyperLinkName ) )
- {
- aAny <<= rName;
- xPropSet->setPropertyValue( sHyperLinkName, aAny );
- }
-
- if( xPropSetInfo->hasPropertyByName( sHyperLinkTarget ) )
- {
- aAny <<= rTargetFrameName;
- xPropSet->setPropertyValue( sHyperLinkTarget, aAny );
- }
-
- if ( (pEvents != NULL) &&
- xPropSetInfo->hasPropertyByName( sHyperLinkEvents ))
- {
- // The API treats events at hyperlinks differently from most
- // other properties: You have to set a name replace with the
- // events in it. The easiest way to to this is to 1) get
- // events, 2) set new ones, and 3) then put events back.
- aAny = xPropSet->getPropertyValue( sHyperLinkEvents );
- Reference<XNameReplace> xReplace;
- aAny >>= xReplace;
- if (xReplace.is())
- {
- // set events
- pEvents->SetEvents(xReplace);
-
- // put events
- aAny <<= xReplace;
- xPropSet->setPropertyValue( sHyperLinkEvents, aAny );
- }
- }
-
- if( xTextStyles.is() )
- {
- if( rStyleName.getLength() &&
- xPropSetInfo->hasPropertyByName( sUnvisitedCharStyleName ) &&
- xTextStyles->hasByName( rStyleName ) )
- {
- aAny <<= rStyleName;
- xPropSet->setPropertyValue( sUnvisitedCharStyleName, aAny );
- }
-
- if( rVisitedStyleName.getLength() &&
- xPropSetInfo->hasPropertyByName( sVisitedCharStyleName ) &&
- xTextStyles->hasByName( rVisitedStyleName ) )
- {
- aAny <<= rVisitedStyleName;
- xPropSet->setPropertyValue( sVisitedCharStyleName, aAny );
- }
- }
-}
-
-void XMLTextImportHelper::SetRuby(
- const Reference < XTextCursor >& rCursor,
- const OUString& rStyleName,
- const OUString& rTextStyleName,
- const OUString& rText )
-{
- Reference<XPropertySet> xPropSet(rCursor, UNO_QUERY);
-
- OUString sRubyText(RTL_CONSTASCII_USTRINGPARAM("RubyText"));
- OUString sRubyCharStyleName(RTL_CONSTASCII_USTRINGPARAM("RubyCharStyleName"));
-
- // if we have one Ruby property, we assume all of them are present
- if (xPropSet.is() &&
- xPropSet->getPropertySetInfo()->hasPropertyByName( sRubyText ))
- {
- Any aAny;
-
- // the ruby text
- aAny <<= rText;
- xPropSet->setPropertyValue(sRubyText, aAny);
-
- // the ruby style (ruby-adjust)
- XMLPropStyleContext *pStyle = 0;
- if( rStyleName.getLength() && xAutoStyles.Is() )
- {
- pStyle = PTR_CAST(
- XMLPropStyleContext,
- ((SvXMLStylesContext *)&xAutoStyles)->
- FindStyleChildContext( XML_STYLE_FAMILY_TEXT_RUBY,
- rStyleName, sal_True ) );
-
- if (NULL != pStyle)
- pStyle->FillPropertySet( xPropSet );
- }
-
- // the ruby text character style
- if( xTextStyles.is() )
- {
- if( (rTextStyleName.getLength() > 0) &&
-// xPropSetInfo->hasPropertyByName( sRubyCharStyleName ) &&
- xTextStyles->hasByName( rTextStyleName ) )
- {
- aAny <<= rTextStyleName;
- xPropSet->setPropertyValue(sRubyCharStyleName, aAny);
- }
- }
- }
-}
-
-void XMLTextImportHelper::SetAutoStyles( SvXMLStylesContext *pStyles )
-{
- xAutoStyles = pStyles;
-}
-
-void XMLTextImportHelper::SetFontDecls( XMLFontStylesContext *pFontDecls )
-{
- xFontDecls = pFontDecls;
- ((XMLTextImportPropertyMapper *)xParaImpPrMap.get())
- ->SetFontDecls( pFontDecls );
- ((XMLTextImportPropertyMapper *)xTextImpPrMap.get())
- ->SetFontDecls( pFontDecls );
-}
-
-const XMLFontStylesContext *XMLTextImportHelper::GetFontDecls() const
-{
- return (XMLFontStylesContext *)&xFontDecls;
-}
-
-sal_Bool XMLTextImportHelper::HasDrawNameAttribute(
- const Reference< XAttributeList > & xAttrList,
- SvXMLNamespaceMap& rNamespaceMap )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
-
- OUString aLocalName;
- sal_uInt16 nPrefix =
- rNamespaceMap.GetKeyByAttrName( rAttrName, &aLocalName );
- if( XML_NAMESPACE_DRAW == nPrefix &&
- IsXMLToken( aLocalName, XML_NAME ) )
- {
- return xAttrList->getValueByIndex(i).getLength() != 0;
- }
- }
-
- return sal_False;
-}
-
-SvXMLImportContext *XMLTextImportHelper::CreateTextChildContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< XAttributeList > & xAttrList,
- XMLTextType eType )
-{
- SvXMLImportContext *pContext = 0;
-
- const SvXMLTokenMap& rTokenMap = GetTextElemTokenMap();
- sal_Bool bOrdered = sal_False;
- sal_Bool bHeading = sal_False;
- sal_Bool bContent = sal_True;
- sal_Bool bObjectOLE = sal_False;
- sal_uInt16 nToken = rTokenMap.Get( nPrefix, rLocalName );
- switch( nToken )
- {
- case XML_TOK_TEXT_H:
- bHeading = sal_True;
- case XML_TOK_TEXT_P:
- pContext = new XMLParaContext( rImport,
- nPrefix, rLocalName,
- xAttrList, bHeading );
- if( bProgress && XML_TEXT_TYPE_SHAPE != eType )
- {
- rImport.GetProgressBarHelper()->Increment();
- }
- break;
- case XML_TOK_TEXT_ORDERED_LIST:
- bOrdered = sal_True;
- case XML_TOK_TEXT_UNORDERED_LIST:
- pContext = new XMLTextListBlockContext( rImport, *this,
- nPrefix, rLocalName,
- xAttrList, bOrdered );
- break;
- case XML_TOK_TABLE_TABLE:
- if( XML_TEXT_TYPE_BODY == eType ||
- XML_TEXT_TYPE_TEXTBOX == eType ||
- XML_TEXT_TYPE_SECTION == eType ||
- XML_TEXT_TYPE_HEADER_FOOTER == eType ||
- XML_TEXT_TYPE_CHANGED_REGION == eType)
- pContext = CreateTableChildContext( rImport, nPrefix, rLocalName,
- xAttrList );
- break;
- case XML_TOK_TEXT_SEQUENCE_DECLS:
- if( (XML_TEXT_TYPE_BODY == eType && bBodyContentStarted) ||
- XML_TEXT_TYPE_HEADER_FOOTER == eType )
- {
- pContext = new XMLVariableDeclsImportContext(
- rImport, *this, nPrefix, rLocalName, VarTypeSequence);
- bContent = sal_False;
- }
- break;
-
- case XML_TOK_TEXT_VARFIELD_DECLS:
- if( (XML_TEXT_TYPE_BODY == eType && bBodyContentStarted) ||
- XML_TEXT_TYPE_HEADER_FOOTER == eType )
- {
- pContext = new XMLVariableDeclsImportContext(
- rImport, *this, nPrefix, rLocalName, VarTypeSimple);
- bContent = sal_False;
- }
- break;
-
- case XML_TOK_TEXT_USERFIELD_DECLS:
- if( (XML_TEXT_TYPE_BODY == eType && bBodyContentStarted)||
- XML_TEXT_TYPE_HEADER_FOOTER == eType )
- {
- pContext = new XMLVariableDeclsImportContext(
- rImport, *this, nPrefix, rLocalName, VarTypeUserField);
- bContent = sal_False;
- }
- break;
-
- case XML_TOK_TEXT_DDE_DECLS:
- if( (XML_TEXT_TYPE_BODY == eType && bBodyContentStarted) ||
- XML_TEXT_TYPE_HEADER_FOOTER == eType )
- {
- pContext = new XMLDdeFieldDeclsImportContext(
- rImport, nPrefix, rLocalName);
- bContent = sal_False;
- }
- break;
-
- case XML_TOK_TEXT_TEXTBOX_PAGE:
- if( (XML_TEXT_TYPE_BODY == eType && bBodyContentStarted) ||
- XML_TEXT_TYPE_TEXTBOX == eType ||
- XML_TEXT_TYPE_CHANGED_REGION == eType )
- {
- if( HasDrawNameAttribute( xAttrList, rImport.GetNamespaceMap() ) )
- {
- TextContentAnchorType eAnchorType =
- XML_TEXT_TYPE_TEXTBOX == eType ? TextContentAnchorType_AT_FRAME
- : TextContentAnchorType_AT_PAGE;
- pContext = new XMLTextFrameContext( rImport, nPrefix,
- rLocalName, xAttrList,
- eAnchorType,
- XML_TEXT_FRAME_TEXTBOX );
- }
- else
- {
- Reference < XShapes > xShapes;
- pContext = rImport.GetShapeImport()->CreateGroupChildContext(
- rImport, nPrefix, rLocalName, xAttrList, xShapes );
- }
- bContent = sal_False;
- }
- break;
-
- case XML_TOK_TEXT_IMAGE_PAGE:
- if( (XML_TEXT_TYPE_BODY == eType && bBodyContentStarted) ||
- XML_TEXT_TYPE_TEXTBOX == eType ||
- XML_TEXT_TYPE_CHANGED_REGION == eType )
- {
- if( HasDrawNameAttribute( xAttrList, rImport.GetNamespaceMap() ) )
- {
- TextContentAnchorType eAnchorType =
- XML_TEXT_TYPE_TEXTBOX == eType ? TextContentAnchorType_AT_FRAME
- : TextContentAnchorType_AT_PAGE;
- pContext = new XMLTextFrameContext( rImport, nPrefix,
- rLocalName, xAttrList,
- eAnchorType,
- XML_TEXT_FRAME_GRAPHIC );
- }
- else
- {
- Reference < XShapes > xShapes;
- pContext = rImport.GetShapeImport()->CreateGroupChildContext(
- rImport, nPrefix, rLocalName, xAttrList, xShapes );
- }
- bContent = sal_False;
- }
- break;
-
- case XML_TOK_TEXT_OBJECT_OLE_PAGE:
- bObjectOLE = sal_True;
- case XML_TOK_TEXT_OBJECT_PAGE:
- if( (XML_TEXT_TYPE_BODY == eType && bBodyContentStarted) ||
- XML_TEXT_TYPE_TEXTBOX == eType ||
- XML_TEXT_TYPE_CHANGED_REGION == eType )
- {
- TextContentAnchorType eAnchorType =
- XML_TEXT_TYPE_TEXTBOX == eType ? TextContentAnchorType_AT_FRAME
- : TextContentAnchorType_AT_PAGE;
- pContext = new XMLTextFrameContext( rImport, nPrefix,
- rLocalName, xAttrList, eAnchorType,
- bObjectOLE ? XML_TEXT_FRAME_OBJECT_OLE
- : XML_TEXT_FRAME_OBJECT );
- bContent = sal_False;
- }
- break;
-
- case XML_TOK_TEXT_APPLET_PAGE:
- case XML_TOK_TEXT_PLUGIN_PAGE:
- case XML_TOK_TEXT_FLOATING_FRAME_PAGE:
- if( (XML_TEXT_TYPE_BODY == eType && bBodyContentStarted) ||
- XML_TEXT_TYPE_TEXTBOX == eType ||
- XML_TEXT_TYPE_CHANGED_REGION == eType )
- {
- TextContentAnchorType eAnchorType =
- XML_TEXT_TYPE_TEXTBOX == eType ? TextContentAnchorType_AT_FRAME
- : TextContentAnchorType_AT_PAGE;
- sal_uInt16 nType;
- switch( nToken )
- {
- case XML_TOK_TEXT_APPLET_PAGE:
- nType = XML_TEXT_FRAME_APPLET;
- break;
- case XML_TOK_TEXT_PLUGIN_PAGE:
- nType = XML_TEXT_FRAME_PLUGIN;
- break;
- case XML_TOK_TEXT_FLOATING_FRAME_PAGE:
- nType = XML_TEXT_FRAME_FLOATING_FRAME;
- break;
- }
- pContext = new XMLTextFrameContext( rImport, nPrefix,
- rLocalName, xAttrList, eAnchorType,
- nType );
- bContent = sal_False;
- }
- break;
-
- case XML_TOK_DRAW_A_PAGE:
- if( (XML_TEXT_TYPE_BODY == eType && bBodyContentStarted) ||
- XML_TEXT_TYPE_TEXTBOX == eType ||
- XML_TEXT_TYPE_CHANGED_REGION == eType)
- {
- TextContentAnchorType eAnchorType =
- XML_TEXT_TYPE_TEXTBOX == eType ? TextContentAnchorType_AT_FRAME
- : TextContentAnchorType_AT_PAGE;
- pContext = new XMLTextFrameHyperlinkContext( rImport, nPrefix,
- rLocalName, xAttrList,
- eAnchorType );
- bContent = sal_False;
- }
- break;
-
- case XML_TOK_TEXT_INDEX_TITLE:
- case XML_TOK_TEXT_SECTION:
-#ifndef SVX_LIGHT
- pContext = new XMLSectionImportContext( rImport, nPrefix, rLocalName );
-#else
- // create default context to skip content
- pContext = new SvXMLImportContext( rImport, nPrefix, rLocalName );
-#endif // #ifndef SVX_LIGHT
- break;
-
- case XML_TOK_TEXT_TOC:
- case XML_TOK_TEXT_OBJECT_INDEX:
- case XML_TOK_TEXT_TABLE_INDEX:
- case XML_TOK_TEXT_ILLUSTRATION_INDEX:
- case XML_TOK_TEXT_USER_INDEX:
- case XML_TOK_TEXT_ALPHABETICAL_INDEX:
- case XML_TOK_TEXT_BIBLIOGRAPHY_INDEX:
-#ifndef SVX_LIGHT
- if( XML_TEXT_TYPE_SHAPE != eType )
- pContext = new XMLIndexTOCContext( rImport, nPrefix, rLocalName );
-#else
- // create default context to skip content
- pContext = new SvXMLImportContext( rImport, nPrefix, rLocalName );
-#endif // #ifndef SVX_LIGHT
- break;
-
- case XML_TOK_TEXT_TRACKED_CHANGES:
-#ifndef SVX_LIGHT
- pContext = new XMLTrackedChangesImportContext( rImport, nPrefix,
- rLocalName);
-#else
- // create default context to skip content
- pContext = new SvXMLImportContext( rImport, nPrefix, rLocalName );
-#endif // #ifndef SVX_LIGHT
- bContent = sal_False;
- break;
-
- case XML_TOK_TEXT_CHANGE:
- case XML_TOK_TEXT_CHANGE_START:
- case XML_TOK_TEXT_CHANGE_END:
- pContext = new XMLChangeImportContext(
- rImport, nPrefix, rLocalName,
- (XML_TOK_TEXT_CHANGE_END != nToken),
- (XML_TOK_TEXT_CHANGE_START != nToken),
- sal_True);
- break;
-
- case XML_TOK_TEXT_FORMS:
-#ifndef SVX_LIGHT
- pContext = rImport.GetFormImport()->createOfficeFormsContext(rImport, nPrefix, rLocalName);
-#else
- // create default context to skip content
- pContext = new SvXMLImportContext( rImport, nPrefix, rLocalName );
-#endif // #ifndef SVX_LIGHT
- bContent = sal_False;
- break;
-
- case XML_TOK_TEXT_AUTOMARK:
- if( XML_TEXT_TYPE_BODY == eType )
- {
- pContext = new XMLAutoMarkFileContext(rImport, nPrefix,rLocalName);
- }
- bContent = sal_False;
- break;
-
- case XML_TOK_TEXT_CALCULATION_SETTINGS:
-#ifndef SVX_LIGHT
- pContext = new XMLCalculationSettingsContext ( rImport, nPrefix, rLocalName, xAttrList);
-#else
- // create default context to skip content
- pContext = new SvXMLImportContext( rImport, nPrefix, rLocalName );
-#endif // #ifndef SVX_LIGHT
- bContent = sal_False;
- break;
-
- default:
- if( (XML_TEXT_TYPE_BODY == eType && bBodyContentStarted) ||
- XML_TEXT_TYPE_TEXTBOX == eType ||
- XML_TEXT_TYPE_CHANGED_REGION == eType )
- {
- Reference < XShapes > xShapes;
- pContext = rImport.GetShapeImport()->CreateGroupChildContext(
- rImport, nPrefix, rLocalName, xAttrList, xShapes );
- bContent = sal_False;
- }
- }
-
-// if( !pContext )
-// pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
- // handle open redlines
- if ( (XML_TOK_TEXT_CHANGE != nToken) &&
- (XML_TOK_TEXT_CHANGE_END != nToken) &&
- (XML_TOK_TEXT_CHANGE_START != nToken) )
- {
-// ResetOpenRedlineId();
- }
-
- if( XML_TEXT_TYPE_BODY == eType && bContent )
- bBodyContentStarted = sal_False;
-
- return pContext;
-}
-
-SvXMLImportContext *XMLTextImportHelper::CreateTableChildContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< XAttributeList > & xAttrList )
-{
- return 0;
-}
-
-/// get data style key for use with NumberFormat property
-sal_Int32 XMLTextImportHelper::GetDataStyleKey(const OUString& sStyleName,
- sal_Bool* pIsSystemLanguage )
-{
- const SvXMLStyleContext* pStyle = ((SvXMLStylesContext *)&xAutoStyles)->
- FindStyleChildContext( XML_STYLE_FAMILY_DATA_STYLE,
- sStyleName, sal_True );
-
- // get appropriate context
-
-
- // first check if its a impress and draw only number format
- // this is needed since its also a SvXMLNumFormatContext,
- // that was needed to support them for controls in impress/draw also
- SdXMLNumberFormatImportContext* pSdNumStyle = PTR_CAST( SdXMLNumberFormatImportContext, pStyle );
- if( pSdNumStyle )
- {
- return pSdNumStyle->GetDrawKey();
- }
- else
- {
- SvXMLNumFormatContext* pNumStyle = PTR_CAST( SvXMLNumFormatContext, pStyle );
- if( pNumStyle )
- {
- if( pIsSystemLanguage != NULL )
- *pIsSystemLanguage = pNumStyle->IsSystemLanguage();
-
- // return key
- return pNumStyle->GetKey();
- }
- }
- return -1;
-}
-
-const SvxXMLListStyleContext *XMLTextImportHelper::FindAutoListStyle( const OUString& rName ) const
-{
- const SvxXMLListStyleContext *pStyle = 0;
- if( xAutoStyles.Is() )
- {
- pStyle = PTR_CAST( SvxXMLListStyleContext ,
- ((SvXMLStylesContext *)&xAutoStyles)->
- FindStyleChildContext( XML_STYLE_FAMILY_TEXT_LIST, rName,
- sal_True ) );
- }
-
- return pStyle;
-}
-
-XMLPropStyleContext *XMLTextImportHelper::FindAutoFrameStyle( const OUString& rName ) const
-{
- XMLPropStyleContext *pStyle = 0;
- if( xAutoStyles.Is() )
- {
- pStyle = PTR_CAST( XMLPropStyleContext ,
- ((SvXMLStylesContext *)&xAutoStyles)->
- FindStyleChildContext( XML_STYLE_FAMILY_SD_GRAPHICS_ID, rName,
- sal_True ) );
- }
-
- return pStyle;
-}
-
-XMLPropStyleContext* XMLTextImportHelper::FindSectionStyle(
- const OUString& rName ) const
-{
- XMLPropStyleContext* pStyle = NULL;
- if (xAutoStyles.Is() )
- {
- pStyle = PTR_CAST( XMLPropStyleContext,
- ((SvXMLStylesContext *)&xAutoStyles)->
- FindStyleChildContext(
- XML_STYLE_FAMILY_TEXT_SECTION,
- rName, sal_True ) );
- }
-
- return pStyle;
-}
-
-XMLPropStyleContext* XMLTextImportHelper::FindPageMaster(
- const OUString& rName ) const
-{
- XMLPropStyleContext* pStyle = NULL;
- if (xAutoStyles.Is() )
- {
- pStyle = PTR_CAST( XMLPropStyleContext,
- ((SvXMLStylesContext *)&xAutoStyles)->
- FindStyleChildContext(
- XML_STYLE_FAMILY_PAGE_MASTER,
- rName, sal_True ) );
- }
-
- return pStyle;
-}
-
-XMLTextListItemContext *XMLTextImportHelper::GetListItem()
-{
- return (XMLTextListItemContext *)&xListItem;
-}
-
-void XMLTextImportHelper::SetListItem( XMLTextListItemContext *pListItem )
-{
- xListItem = pListItem;
-}
-
-void XMLTextImportHelper::_SetListItem( SvXMLImportContext *pListItem )
-{
- xListItem = PTR_CAST( XMLTextListItemContext, pListItem );
-}
-
-XMLTextListBlockContext *XMLTextImportHelper::GetListBlock()
-{
- return (XMLTextListBlockContext *)&xListBlock;
-}
-
-void XMLTextImportHelper::SetListBlock( XMLTextListBlockContext *pListBlock )
-{
- xListBlock = pListBlock;
-}
-
-void XMLTextImportHelper::_SetListBlock( SvXMLImportContext *pListBlock )
-{
- xListBlock = PTR_CAST( XMLTextListBlockContext, pListBlock );
-}
-
-const SvXMLTokenMap& XMLTextImportHelper::GetTextListBlockAttrTokenMap()
-{
- if( !pTextListBlockAttrTokenMap )
- pTextListBlockAttrTokenMap =
- new SvXMLTokenMap( aTextListBlockAttrTokenMap );
-
- return *pTextListBlockAttrTokenMap;
-}
-
-const SvXMLTokenMap& XMLTextImportHelper::GetTextListBlockElemTokenMap()
-{
- if( !pTextListBlockElemTokenMap )
- pTextListBlockElemTokenMap =
- new SvXMLTokenMap( aTextListBlockElemTokenMap );
-
- return *pTextListBlockElemTokenMap;
-}
-
-SvI18NMap& XMLTextImportHelper::GetRenameMap()
-{
- if( 0 == pRenameMap )
- pRenameMap = new SvI18NMap();
- return *pRenameMap;
-}
-
-void XMLTextImportHelper::InsertBookmarkStartRange(
- const OUString sName,
- const Reference<XTextRange> & rRange)
-{
- aBookmarkStartRanges[sName] = rRange;
-}
-
-sal_Bool XMLTextImportHelper::FindAndRemoveBookmarkStartRange(
- Reference<XTextRange> & rRange,
- const OUString sName)
-{
- if (aBookmarkStartRanges.count(sName))
- {
- rRange = aBookmarkStartRanges[sName];
- aBookmarkStartRanges.erase(sName);
- return sal_True;
- }
- else
- {
- return sal_False;
- }
-}
-
-
-void XMLTextImportHelper::ConnectFrameChains(
- const OUString& rFrmName,
- const OUString& rNextFrmName,
- const Reference < XPropertySet >& rFrmPropSet )
-{
- if( !rFrmName.getLength() )
- return;
-
- if( rNextFrmName.getLength() )
- {
- OUString sNextFrmName = GetRenameMap().Get( XML_TEXT_RENAME_TYPE_FRAME,
- rNextFrmName );
- if( xTextFrames.is() && xTextFrames->hasByName( sNextFrmName ) )
- {
- Any aAny;
- aAny <<= sNextFrmName;
- rFrmPropSet->setPropertyValue( sChainNextName, aAny );
- }
- else
- {
- if( !pPrevFrmNames )
- {
- pPrevFrmNames = new SvStringsDtor;
- pNextFrmNames = new SvStringsDtor;
- }
- pPrevFrmNames->Insert( new String( rFrmName ),
- pPrevFrmNames->Count() );
- pNextFrmNames->Insert( new String( sNextFrmName ),
- pNextFrmNames->Count() );
- }
- }
- if( pPrevFrmNames && pPrevFrmNames->Count() )
- {
- sal_uInt16 nCount = pPrevFrmNames->Count();
- for( sal_uInt16 i=0; i<nCount; i++ )
- {
- String *pNext = (*pNextFrmNames)[i];
- if( OUString(*pNext) == rFrmName )
- {
- // The previuous frame must exist, because it existing than
- // inserting the entry
- String *pPrev = (*pPrevFrmNames)[i];
-
- Any aAny;
- aAny <<= OUString( *pPrev );
- rFrmPropSet->setPropertyValue( sChainPrevName, aAny );
-
- pPrevFrmNames->Remove( i, 1 );
- pNextFrmNames->Remove( i, 1 );
- delete pPrev;
- delete pNext;
-
- // There cannot be more than one previous frames
- break;
- }
- }
- }
-}
-
-sal_Bool XMLTextImportHelper::IsInFrame() const
-{
- sal_Bool bIsInFrame = sal_False;
-
- // are we currently in a text frame? yes, if the cursor has a
- // TextFrame property and it's non-NULL
- Reference<XPropertySet> xPropSet(((XMLTextImportHelper *)this)->GetCursor(), UNO_QUERY);
- if (xPropSet.is())
- {
- if (xPropSet->getPropertySetInfo()->hasPropertyByName(sTextFrame))
- {
- Any aAny = xPropSet->getPropertyValue(sTextFrame);
- Reference<XTextFrame> xFrame;
- aAny >>= xFrame;
-
- if (xFrame.is())
- {
- bIsInFrame = sal_True;
- }
- }
- }
-
- return bIsInFrame;
-}
-
-sal_Bool XMLTextImportHelper::IsInHeaderFooter() const
-{
- return sal_False;
-}
-
-Reference< XPropertySet> XMLTextImportHelper::createAndInsertOLEObject(
- SvXMLImport& rImport,
- const OUString& rHRef,
- const OUString& rStyleName,
- const OUString& rTblName,
- sal_Int32 nWidth, sal_Int32 nHeight )
-{
- Reference< XPropertySet> xPropSet;
- return xPropSet;
-}
-
-
-Reference< XPropertySet> XMLTextImportHelper::createAndInsertApplet(
- const OUString& rCode,
- const OUString& rName,
- sal_Bool bMayScript,
- const OUString& rHRef,
- sal_Int32 nWidth, sal_Int32 nHeight )
-{
- Reference< XPropertySet> xPropSet;
- return xPropSet;
-}
-Reference< XPropertySet> XMLTextImportHelper::createAndInsertPlugin(
- const OUString& rMimeType,
- const OUString& rHRef,
- sal_Int32 nWidth, sal_Int32 nHeight )
-{
- Reference< XPropertySet> xPropSet;
- return xPropSet;
-}
-Reference< XPropertySet> XMLTextImportHelper::createAndInsertFloatingFrame(
- const OUString& rName,
- const OUString& rHRef,
- const OUString& rStyleName,
- sal_Int32 nWidth, sal_Int32 nHeight )
-{
- Reference< XPropertySet> xPropSet;
- return xPropSet;
-}
-
-void XMLTextImportHelper::endAppletOrPlugin(
- Reference < XPropertySet> & rPropSet,
- ::std::map < const ::rtl::OUString, ::rtl::OUString, UStringLess > &rParamMap)
-{
-}
-// redline helper: dummy implementation to be overridden in sw/filter/xml
-void XMLTextImportHelper::RedlineAdd(
- const OUString& rType,
- const OUString& rId,
- const OUString& rAuthor,
- const OUString& rComment,
- const DateTime& rDateTime,
- sal_Bool bMergeLastPara)
-{
- // dummy implementation: do nothing
-}
-
-Reference<XTextCursor> XMLTextImportHelper::RedlineCreateText(
- Reference<XTextCursor> & rOldCursor,
- const OUString& rId)
-{
- // dummy implementation: do nothing
- Reference<XTextCursor> xRet;
- return xRet;
-}
-
-void XMLTextImportHelper::RedlineSetCursor(
- const OUString& rId,
- sal_Bool bStart,
- sal_Bool bIsOutsideOfParagraph)
-{
- // dummy implementation: do nothing
-}
-
-void XMLTextImportHelper::RedlineAdjustStartNodeCursor(
- sal_Bool bStart)
-{
- // dummy implementation: do nothing
-}
-
-void XMLTextImportHelper::SetShowChanges( sal_Bool bShowChanges )
-{
- // dummy implementation: do nothing
-}
-
-void XMLTextImportHelper::SetRecordChanges( sal_Bool bRecordChanges )
-{
- // dummy implementation: do nothing
-}
-void XMLTextImportHelper::SetChangesProtectionKey(
- const Sequence<sal_Int8> & rProtectionKey )
-{
- // dummy implementation: do nothing
-}
-
-
-OUString XMLTextImportHelper::GetOpenRedlineId()
-{
- return sOpenRedlineIdentifier;
-}
-
-void XMLTextImportHelper::SetOpenRedlineId( ::rtl::OUString& rId)
-{
- sOpenRedlineIdentifier = rId;
-}
-
-void XMLTextImportHelper::ResetOpenRedlineId()
-{
- OUString sEmpty;
- SetOpenRedlineId(sEmpty);
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_txtimppr.cxx b/binfilter/bf_xmloff/source/text/xmloff_txtimppr.cxx
deleted file mode 100644
index 41bcbe81af4f..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_txtimppr.cxx
+++ /dev/null
@@ -1,684 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include <com/sun/star/awt/FontFamily.hpp>
-#include <com/sun/star/awt/FontPitch.hpp>
-#include <com/sun/star/table/BorderLine.hpp>
-#include <com/sun/star/text/VertOrientation.hpp>
-#include <com/sun/star/text/SizeType.hpp>
-
-#include <tools/string.hxx>
-
-#include "XMLFontStylesContext.hxx"
-
-#include "txtprmap.hxx"
-
-#include "txtimppr.hxx"
-namespace binfilter {
-
-#define XML_LINE_LEFT 0
-#define XML_LINE_RIGHT 1
-#define XML_LINE_TOP 2
-#define XML_LINE_BOTTOM 3
-#define MIN_BORDER_DIST 49
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::table;
-using namespace ::com::sun::star::text;
-
-sal_Bool XMLTextImportPropertyMapper::handleSpecialItem(
- XMLPropertyState& rProperty,
- ::std::vector< XMLPropertyState >& rProperties,
- const ::rtl::OUString& rValue,
- const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int32 nIndex = rProperty.mnIndex;
- switch( getPropertySetMapper()->GetEntryContextId( nIndex ) )
- {
- case CTF_FONTNAME:
- case CTF_FONTNAME_CJK:
- case CTF_FONTNAME_CTL:
- if( xFontDecls.Is() )
- {
- DBG_ASSERT(
- ( CTF_FONTFAMILYNAME ==
- getPropertySetMapper()->GetEntryContextId(nIndex+1) &&
- CTF_FONTSTYLENAME ==
- getPropertySetMapper()->GetEntryContextId(nIndex+2) &&
- CTF_FONTFAMILY ==
- getPropertySetMapper()->GetEntryContextId(nIndex+3) &&
- CTF_FONTPITCH ==
- getPropertySetMapper()->GetEntryContextId(nIndex+4) &&
- CTF_FONTCHARSET ==
- getPropertySetMapper()->GetEntryContextId(nIndex+5) ) ||
- ( CTF_FONTFAMILYNAME_CJK ==
- getPropertySetMapper()->GetEntryContextId(nIndex+1) &&
- CTF_FONTSTYLENAME_CJK ==
- getPropertySetMapper()->GetEntryContextId(nIndex+2) &&
- CTF_FONTFAMILY_CJK ==
- getPropertySetMapper()->GetEntryContextId(nIndex+3) &&
- CTF_FONTPITCH_CJK ==
- getPropertySetMapper()->GetEntryContextId(nIndex+4) &&
- CTF_FONTCHARSET_CJK ==
- getPropertySetMapper()->GetEntryContextId(nIndex+5) ) ||
- ( CTF_FONTFAMILYNAME_CTL ==
- getPropertySetMapper()->GetEntryContextId(nIndex+1) &&
- CTF_FONTSTYLENAME_CTL ==
- getPropertySetMapper()->GetEntryContextId(nIndex+2) &&
- CTF_FONTFAMILY_CTL ==
- getPropertySetMapper()->GetEntryContextId(nIndex+3) &&
- CTF_FONTPITCH_CTL ==
- getPropertySetMapper()->GetEntryContextId(nIndex+4) &&
- CTF_FONTCHARSET_CTL ==
- getPropertySetMapper()->GetEntryContextId(nIndex+5) ),
- "illegal property map" );
-
- ((XMLFontStylesContext *)&xFontDecls)->FillProperties(
- rValue, rProperties,
- rProperty.mnIndex+1, rProperty.mnIndex+2,
- rProperty.mnIndex+3, rProperty.mnIndex+4,
- rProperty.mnIndex+5 );
- bRet = sal_False; // the property hasn't been filled
- }
- break;
-
-#ifdef CONV_STAR_FONTS
- // If we want to do StarMath/StarSymbol font conversion, then we'll
- // want these special items to be treated just like regular ones...
- // For the Writer, we'll catch and convert them in _FillPropertySet;
- // the other apps probably don't care. For the other apps, we just
- // imitate the default non-special-item mechanism.
- case CTF_FONTFAMILYNAME:
- case CTF_FONTFAMILYNAME_CJK:
- case CTF_FONTFAMILYNAME_CTL:
- bRet = getPropertySetMapper()->importXML( rValue, rProperty,
- rUnitConverter );
- break;
-#endif
-
- default:
- bRet = SvXMLImportPropertyMapper::handleSpecialItem( rProperty,
- rProperties, rValue, rUnitConverter, rNamespaceMap );
- break;
- }
-
- return bRet;
-}
-
-XMLTextImportPropertyMapper::XMLTextImportPropertyMapper(
- const UniReference< XMLPropertySetMapper >& rMapper,
- SvXMLImport& rImport,
- XMLFontStylesContext *pFontDecls ) :
- SvXMLImportPropertyMapper( rMapper, rImport ),
- nSizeTypeIndex( -2 ),
- xFontDecls( pFontDecls )
-{
-}
-
-XMLTextImportPropertyMapper::~XMLTextImportPropertyMapper()
-{
-}
-
-void XMLTextImportPropertyMapper::SetFontDecls(
- XMLFontStylesContext *pFontDecls )
-{
- xFontDecls = pFontDecls;
-}
-
-void XMLTextImportPropertyMapper::FontFinished(
- XMLPropertyState *pFontFamilyNameState,
- XMLPropertyState *pFontStyleNameState,
- XMLPropertyState *pFontFamilyState,
- XMLPropertyState *pFontPitchState,
- XMLPropertyState *pFontCharsetState ) const
-{
- if( pFontFamilyNameState && pFontFamilyNameState->mnIndex != -1 )
- {
- OUString sName;
- pFontFamilyNameState->maValue >>= sName;
- if( !sName.getLength() )
- pFontFamilyNameState->mnIndex = -1;
- }
- if( !pFontFamilyNameState || pFontFamilyNameState->mnIndex == -1 )
- {
- if( pFontStyleNameState )
- pFontStyleNameState->mnIndex = -1;
- if( pFontFamilyState )
- pFontFamilyState->mnIndex = -1;
- if( pFontPitchState )
- pFontPitchState->mnIndex = -1;
- if( pFontCharsetState )
- pFontCharsetState->mnIndex = -1;
- }
-}
-
-/** since the properties "CharFontFamilyName", "CharFontStyleName", "CharFontFamily",
- "CharFontPitch" and "CharFontSet" and theire CJK and CTL counterparts are only
- usable as a union, we add defaults to all values that are not set as long as we
- have an "CharFontFamilyName"
-
- #99928# CL */
-void XMLTextImportPropertyMapper::FontDefaultsCheck(
- XMLPropertyState* pFontFamilyName,
- XMLPropertyState* pFontStyleName,
- XMLPropertyState* pFontFamily,
- XMLPropertyState* pFontPitch,
- XMLPropertyState* pFontCharSet,
- XMLPropertyState** ppNewFontStyleName,
- XMLPropertyState** ppNewFontFamily,
- XMLPropertyState** ppNewFontPitch,
- XMLPropertyState** ppNewFontCharSet ) const
-{
- if( pFontFamilyName )
- {
- OUString sEmpty;
- Any aAny;
-
- if( !pFontStyleName )
- {
- aAny <<= sEmpty;
- #ifdef DBG_UTIL
- sal_Int16 nTmp = getPropertySetMapper()->GetEntryContextId(
- pFontFamilyName->mnIndex + 1 );
- DBG_ASSERT( nTmp == CTF_FONTSTYLENAME || nTmp == CTF_FONTSTYLENAME_CJK || nTmp == CTF_FONTSTYLENAME_CTL,
- "wrong property context id" );
- #endif
- *ppNewFontStyleName = new XMLPropertyState( pFontFamilyName->mnIndex + 1,
- aAny );
- }
-
- if( !pFontFamily )
- {
- aAny <<= (sal_Int16)com::sun::star::awt::FontFamily::DONTKNOW;
-
- #ifdef DBG_UTIL
- sal_Int16 nTmp = getPropertySetMapper()->GetEntryContextId(
- pFontFamilyName->mnIndex + 2 );
- DBG_ASSERT( nTmp == CTF_FONTFAMILY || nTmp == CTF_FONTFAMILY_CJK || nTmp == CTF_FONTFAMILY_CTL,
- "wrong property context id" );
- #endif
- *ppNewFontFamily = new XMLPropertyState( pFontFamilyName->mnIndex + 2,
- aAny );
- }
-
- if( !pFontPitch )
- {
- aAny <<= (sal_Int16)com::sun::star::awt::FontPitch::DONTKNOW;
- #ifdef DBG_UTIL
- sal_Int16 nTmp = getPropertySetMapper()->GetEntryContextId(
- pFontFamilyName->mnIndex + 3 );
- DBG_ASSERT( nTmp == CTF_FONTPITCH || nTmp == CTF_FONTPITCH_CJK || nTmp == CTF_FONTPITCH_CTL,
- "wrong property context id" );
- #endif
- *ppNewFontPitch = new XMLPropertyState( pFontFamilyName->mnIndex + 3,
- aAny );
- }
-
- if( !pFontCharSet )
- {
- aAny <<= (sal_Int16)gsl_getSystemTextEncoding();
- #ifdef DBG_UTIL
- sal_Int16 nTmp = getPropertySetMapper()->GetEntryContextId(
- pFontFamilyName->mnIndex + 4 );
- DBG_ASSERT( nTmp == CTF_FONTCHARSET || nTmp == CTF_FONTCHARSET_CJK || nTmp == CTF_FONTCHARSET_CTL,
- "wrong property context id" );
- #endif
- *ppNewFontCharSet = new XMLPropertyState( pFontFamilyName->mnIndex + 4,
- aAny );
- }
- }
-}
-
-void XMLTextImportPropertyMapper::finished(
- ::std::vector< XMLPropertyState >& rProperties,
- sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const
-{
- sal_Bool bHasAnyHeight = sal_False;
- sal_Bool bHasAnyMinHeight = sal_False;
-
- XMLPropertyState* pFontFamilyName = 0;
- XMLPropertyState* pFontStyleName = 0;
- XMLPropertyState* pFontFamily = 0;
- XMLPropertyState* pFontPitch = 0;
- XMLPropertyState* pFontCharSet = 0;
- XMLPropertyState* pNewFontStyleName = 0;
- XMLPropertyState* pNewFontFamily = 0;
- XMLPropertyState* pNewFontPitch = 0;
- XMLPropertyState* pNewFontCharSet = 0;
- XMLPropertyState* pFontFamilyNameCJK = 0;
- XMLPropertyState* pFontStyleNameCJK = 0;
- XMLPropertyState* pFontFamilyCJK = 0;
- XMLPropertyState* pFontPitchCJK = 0;
- XMLPropertyState* pFontCharSetCJK = 0;
- XMLPropertyState* pNewFontStyleNameCJK = 0;
- XMLPropertyState* pNewFontFamilyCJK = 0;
- XMLPropertyState* pNewFontPitchCJK = 0;
- XMLPropertyState* pNewFontCharSetCJK = 0;
- XMLPropertyState* pFontFamilyNameCTL = 0;
- XMLPropertyState* pFontStyleNameCTL = 0;
- XMLPropertyState* pFontFamilyCTL = 0;
- XMLPropertyState* pFontPitchCTL = 0;
- XMLPropertyState* pFontCharSetCTL = 0;
- XMLPropertyState* pNewFontStyleNameCTL = 0;
- XMLPropertyState* pNewFontFamilyCTL = 0;
- XMLPropertyState* pNewFontPitchCTL = 0;
- XMLPropertyState* pNewFontCharSetCTL = 0;
- XMLPropertyState* pAllBorderDistance = 0;
- XMLPropertyState* pBorderDistances[4] = { 0, 0, 0, 0 };
- XMLPropertyState* pNewBorderDistances[4] = { 0, 0, 0, 0 };
- XMLPropertyState* pAllBorder = 0;
- XMLPropertyState* pBorders[4] = { 0, 0, 0, 0 };
- XMLPropertyState* pNewBorders[4] = { 0, 0, 0, 0 };
- XMLPropertyState* pAllBorderWidth = 0;
- XMLPropertyState* pBorderWidths[4] = { 0, 0, 0, 0 };
- XMLPropertyState* pAnchorType = 0;
- XMLPropertyState* pVertOrient = 0;
- XMLPropertyState* pVertOrientRelAsChar = 0;
- XMLPropertyState* pBackTransparency = NULL; // transparency in %
- XMLPropertyState* pBackTransparent = NULL; // transparency as boolean
-
- for( ::std::vector< XMLPropertyState >::iterator property = rProperties.begin();
- property != rProperties.end();
- property++ )
- {
- switch( getPropertySetMapper()->GetEntryContextId( property->mnIndex ) )
- {
- case CTF_FONTFAMILYNAME: pFontFamilyName = &(*property); break;
- case CTF_FONTSTYLENAME: pFontStyleName = &(*property); break;
- case CTF_FONTFAMILY: pFontFamily = &(*property); break;
- case CTF_FONTPITCH: pFontPitch = &(*property); break;
- case CTF_FONTCHARSET: pFontCharSet = &(*property); break;
-
- case CTF_FONTFAMILYNAME_CJK: pFontFamilyNameCJK = &(*property); break;
- case CTF_FONTSTYLENAME_CJK: pFontStyleNameCJK = &(*property); break;
- case CTF_FONTFAMILY_CJK: pFontFamilyCJK = &(*property); break;
- case CTF_FONTPITCH_CJK: pFontPitchCJK = &(*property); break;
- case CTF_FONTCHARSET_CJK: pFontCharSetCJK = &(*property); break;
-
- case CTF_FONTFAMILYNAME_CTL: pFontFamilyNameCTL = &(*property); break;
- case CTF_FONTSTYLENAME_CTL: pFontStyleNameCTL = &(*property); break;
- case CTF_FONTFAMILY_CTL: pFontFamilyCTL = &(*property); break;
- case CTF_FONTPITCH_CTL: pFontPitchCTL = &(*property); break;
- case CTF_FONTCHARSET_CTL: pFontCharSetCTL = &(*property); break;
-
- case CTF_ALLBORDERDISTANCE: pAllBorderDistance = &(*property); break;
- case CTF_LEFTBORDERDISTANCE: pBorderDistances[XML_LINE_LEFT] = &(*property); break;
- case CTF_RIGHTBORDERDISTANCE: pBorderDistances[XML_LINE_RIGHT] = &(*property); break;
- case CTF_TOPBORDERDISTANCE: pBorderDistances[XML_LINE_TOP] = &(*property); break;
- case CTF_BOTTOMBORDERDISTANCE: pBorderDistances[XML_LINE_BOTTOM] = &(*property); break;
- case CTF_ALLBORDER: pAllBorder = &(*property); break;
- case CTF_LEFTBORDER: pBorders[XML_LINE_LEFT] = &(*property); break;
- case CTF_RIGHTBORDER: pBorders[XML_LINE_RIGHT] = &(*property); break;
- case CTF_TOPBORDER: pBorders[XML_LINE_TOP] = &(*property); break;
- case CTF_BOTTOMBORDER: pBorders[XML_LINE_BOTTOM] = &(*property); break;
-
- case CTF_ALLBORDERWIDTH: pAllBorderWidth = &(*property); break;
- case CTF_LEFTBORDERWIDTH: pBorderWidths[XML_LINE_LEFT] = &(*property); break;
- case CTF_RIGHTBORDERWIDTH: pBorderWidths[XML_LINE_RIGHT] = &(*property); break;
- case CTF_TOPBORDERWIDTH: pBorderWidths[XML_LINE_TOP] = &(*property); break;
- case CTF_BOTTOMBORDERWIDTH: pBorderWidths[XML_LINE_BOTTOM] = &(*property); break;
- case CTF_ANCHORTYPE: pAnchorType = &(*property); break;
- case CTF_VERTICALPOS: pVertOrient = &(*&(*property)); break;
- case CTF_VERTICALREL_ASCHAR: pVertOrientRelAsChar = &(*property); break;
-
- case CTF_FRAMEHEIGHT_MIN_ABS:
- case CTF_FRAMEHEIGHT_MIN_REL:
-// case CTF_SYNCHEIGHT_MIN:
- bHasAnyMinHeight = sal_True;
- // no break here!
- case CTF_FRAMEHEIGHT_ABS:
- case CTF_FRAMEHEIGHT_REL:
-// case CTF_SYNCHEIGHT:
- bHasAnyHeight = sal_True; break;
- case CTF_BACKGROUND_TRANSPARENCY: pBackTransparency = &(*property); break;
- case CTF_BACKGROUND_TRANSPARENT: pBackTransparent = &(*property); break;
-
- }
- }
-
- if( pFontFamilyName || pFontStyleName || pFontFamily ||
- pFontPitch || pFontCharSet )
- FontFinished( pFontFamilyName, pFontStyleName, pFontFamily,
- pFontPitch, pFontCharSet );
- if( pFontFamilyNameCJK || pFontStyleNameCJK || pFontFamilyCJK ||
- pFontPitchCJK || pFontCharSetCJK )
- FontFinished( pFontFamilyNameCJK, pFontStyleNameCJK, pFontFamilyCJK,
- pFontPitchCJK, pFontCharSetCJK );
- if( pFontFamilyNameCTL || pFontStyleNameCTL || pFontFamilyCTL ||
- pFontPitchCTL || pFontCharSetCTL )
- FontFinished( pFontFamilyNameCTL, pFontStyleNameCTL, pFontFamilyCTL,
- pFontPitchCTL, pFontCharSetCTL );
-
- sal_uInt16 i;
-
- for( i=0; i<4; i++ )
- {
- if( pAllBorderDistance && !pBorderDistances[i] )
- {
-#ifdef DBG_UTIL
- sal_Int16 nTmp = getPropertySetMapper()->GetEntryContextId(
- pAllBorderDistance->mnIndex + i + 1 );
- DBG_ASSERT( nTmp >= CTF_LEFTBORDERDISTANCE &&
- nTmp <= CTF_BOTTOMBORDERDISTANCE,
- "wrong property context id" );
-#endif
- pNewBorderDistances[i] =
- new XMLPropertyState( pAllBorderDistance->mnIndex + i + 1,
- pAllBorderDistance->maValue );
- pBorderDistances[i] = pNewBorderDistances[i];
- }
- if( pAllBorder && !pBorders[i] )
- {
-#ifdef DBG_UTIL
- sal_Int16 nTmp = getPropertySetMapper()->GetEntryContextId(
- pAllBorder->mnIndex + i + 1 );
- DBG_ASSERT( nTmp >= CTF_LEFTBORDER && nTmp <= CTF_BOTTOMBORDER,
- "wrong property context id" );
-#endif
- pNewBorders[i] = new XMLPropertyState( pAllBorder->mnIndex + i + 1,
- pAllBorder->maValue );
- pBorders[i] = pNewBorders[i];
- }
- if( !pBorderWidths[i] )
- pBorderWidths[i] = pAllBorderWidth;
- else
- pBorderWidths[i]->mnIndex = -1;
-
-#ifdef XML_CHECK_UI_CONSTRAINS
- sal_Bool bHasBorder = sal_False;
- if( pBorders[i] )
- {
- table::BorderLine aBorderLine;
- pBorders[i]->maValue >>= aBorderLine;
-
- if( pBorderWidths[i] )
- {
- table::BorderLine aBorderLineWidth;
- pBorderWidths[i]->maValue >>= aBorderLineWidth;
- aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
- aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
- aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
-
- pBorders[i]->maValue <<= aBorderLine;
- }
- bHasBorder = (aBorderLine.OuterLineWidth +
- aBorderLine.InnerLineWidth) > 0;
- }
- if( bHasBorder )
- {
- if( !pBorderDistances[i] )
- {
-#ifdef DBG_UTIL
- sal_Int16 nTmp = getPropertySetMapper()->GetEntryContextId(
- pBorders[i]->mnIndex + 5 );
- DBG_ASSERT( nTmp >= CTF_LEFTBORDERDISTANCE &&
- nTmp <= CTF_BOTTOMBORDERDISTANCE,
- "wrong property context id" );
-#endif
-
- pNewBorderDistances[i] =
- new XMLPropertyState( pBorders[i]->mnIndex + 5 );
- pNewBorderDistances[i]->maValue <<= (sal_Int32)MIN_BORDER_DIST;
- pBorderDistances[i] = pNewBorderDistances[i];
- }
- else
- {
- sal_Int32 nDist;
- pBorderDistances[i]->maValue >>= nDist;
- if( nDist < MIN_BORDER_DIST )
- pBorderDistances[i]->maValue <<= (sal_Int32)MIN_BORDER_DIST;
- }
- }
- else
- {
- if( pBorderDistances[i] )
- {
- sal_Int32 nDist;
- pBorderDistances[i]->maValue >>= nDist;
- if( nDist > 0 )
- pBorderDistances[i]->maValue <<= (sal_Int32)0;
- }
- }
-#else
- if( pBorders[i] && pBorderWidths[i] )
- {
- table::BorderLine aBorderLine;
- pBorders[i]->maValue >>= aBorderLine;
-
- table::BorderLine aBorderLineWidth;
- pBorderWidths[i]->maValue >>= aBorderLineWidth;
-
- aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
- aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
- aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
-
- pBorders[i]->maValue <<= aBorderLine;
- }
-#endif
- }
- if( pAllBorderDistance )
- pAllBorderDistance->mnIndex = -1;
-
- if( pAllBorder )
- pAllBorder->mnIndex = -1;
-
- if( pAllBorderWidth )
- pAllBorderWidth->mnIndex = -1;
-
- if( pVertOrient && pVertOrientRelAsChar )
- {
- sal_Int16 nVertOrient;
- pVertOrient->maValue >>= nVertOrient;
- sal_Int16 nVertOrientRel;
- pVertOrientRelAsChar->maValue >>= nVertOrientRel;
- switch( nVertOrient )
- {
- case VertOrientation::TOP:
- nVertOrient = nVertOrientRel;
- break;
- case VertOrientation::CENTER:
- switch( nVertOrientRel )
- {
- case VertOrientation::CHAR_TOP:
- nVertOrient = VertOrientation::CHAR_CENTER;
- break;
- case VertOrientation::LINE_TOP:
- nVertOrient = VertOrientation::LINE_CENTER;
- break;
- }
- break;
- case VertOrientation::BOTTOM:
- switch( nVertOrientRel )
- {
- case VertOrientation::CHAR_TOP:
- nVertOrient = VertOrientation::CHAR_BOTTOM;
- break;
- case VertOrientation::LINE_TOP:
- nVertOrient = VertOrientation::LINE_BOTTOM;
- break;
- }
- break;
- }
- pVertOrient->maValue <<= nVertOrient;
- pVertOrientRelAsChar->mnIndex = -1;
- }
-
- FontDefaultsCheck( pFontFamilyName,
- pFontStyleName, pFontFamily, pFontPitch, pFontCharSet,
- &pNewFontStyleName, &pNewFontFamily, &pNewFontPitch, &pNewFontCharSet );
-
- FontDefaultsCheck( pFontFamilyNameCJK,
- pFontStyleNameCJK, pFontFamilyCJK, pFontPitchCJK, pFontCharSetCJK,
- &pNewFontStyleNameCJK, &pNewFontFamilyCJK, &pNewFontPitchCJK, &pNewFontCharSetCJK );
-
- FontDefaultsCheck( pFontFamilyNameCTL,
- pFontStyleNameCTL, pFontFamilyCTL, pFontPitchCTL, pFontCharSetCTL,
- &pNewFontStyleNameCTL, &pNewFontFamilyCTL, &pNewFontPitchCTL, &pNewFontCharSetCTL );
-
- // #i5775# don't overwrite %transparency with binary transparency
- if( ( pBackTransparency != NULL ) && ( pBackTransparent != NULL ) )
- {
- if( ! *(sal_Bool*)(pBackTransparent->maValue.getValue()) )
- pBackTransparent->mnIndex = -1;
- }
-
-
- // insert newly created properties. This inavlidates all iterators!
- // Most of the pXXX variables in this method are iterators and will be
- // invalidated!!!
-
- if( pNewFontStyleName )
- {
- rProperties.push_back( *pNewFontStyleName );
- delete pNewFontStyleName;
- }
-
- if( pNewFontFamily )
- {
- rProperties.push_back( *pNewFontFamily );
- delete pNewFontFamily;
- }
-
- if( pNewFontPitch )
- {
- rProperties.push_back( *pNewFontPitch );
- delete pNewFontPitch;
- }
-
- if( pNewFontCharSet )
- {
- rProperties.push_back( *pNewFontCharSet );
- delete pNewFontCharSet;
- }
-
- if( pNewFontStyleNameCJK )
- {
- rProperties.push_back( *pNewFontStyleNameCJK );
- delete pNewFontStyleNameCJK;
- }
-
- if( pNewFontFamilyCJK )
- {
- rProperties.push_back( *pNewFontFamilyCJK );
- delete pNewFontFamilyCJK;
- }
-
- if( pNewFontPitchCJK )
- {
- rProperties.push_back( *pNewFontPitchCJK );
- delete pNewFontPitchCJK;
- }
-
- if( pNewFontCharSetCJK )
- {
- rProperties.push_back( *pNewFontCharSetCJK );
- delete pNewFontCharSetCJK;
- }
-
- if( pNewFontStyleNameCTL)
- {
- rProperties.push_back( *pNewFontStyleNameCTL );
- delete pNewFontStyleNameCTL;
- }
-
- if( pNewFontFamilyCTL )
- {
- rProperties.push_back( *pNewFontFamilyCTL );
- delete pNewFontFamilyCTL;
- }
-
- if( pNewFontPitchCTL )
- {
- rProperties.push_back( *pNewFontPitchCTL );
- delete pNewFontPitchCTL;
- }
-
- if( pNewFontCharSetCTL )
- {
- rProperties.push_back( *pNewFontCharSetCTL );
- delete pNewFontCharSetCTL;
- }
-
- for( i=0; i<4; i++ )
- {
- if( pNewBorderDistances[i] )
- {
- rProperties.push_back( *pNewBorderDistances[i] );
- delete pNewBorderDistances[i];
- }
- if( pNewBorders[i] )
- {
- rProperties.push_back( *pNewBorders[i] );
- delete pNewBorders[i];
- }
- }
-
- if( bHasAnyHeight )
- {
- if( nSizeTypeIndex == -2 )
- {
- const_cast < XMLTextImportPropertyMapper * > ( this )
- ->nSizeTypeIndex = -1;
- sal_Int32 nCount = getPropertySetMapper()->GetEntryCount();
- for( sal_Int32 i=0; i < nCount; i++ )
- {
- if( CTF_SIZETYPE == getPropertySetMapper()
- ->GetEntryContextId( i ) )
- {
- const_cast < XMLTextImportPropertyMapper * > ( this )
- ->nSizeTypeIndex = i;
- break;
- }
- }
- }
- if( nSizeTypeIndex != -1 )
- {
- XMLPropertyState aSizeTypeState( nSizeTypeIndex );
- aSizeTypeState.maValue <<= (sal_Int16)( bHasAnyMinHeight
- ? SizeType::MIN
- : SizeType::FIX);
- rProperties.push_back( aSizeTypeState );
- }
- }
-
- // DO NOT USE ITERATORS/POINTERS INTO THE rProperties-VECTOR AFTER
- // THIS LINE. All iterators into the rProperties-vector, especially all
- // pXXX-type variables set in the first switch statement of this method,
- // may have been invalidated by the above push_back() calls!
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_txtparae.cxx b/binfilter/bf_xmloff/source/text/xmloff_txtparae.cxx
deleted file mode 100644
index 67d55521f2c0..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_txtparae.cxx
+++ /dev/null
@@ -1,2991 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVSTDARR_LONGS_DECL
-#define _SVSTDARR_LONGS
-#include <bf_svtools/svstdarr.hxx>
-#endif
-
-
-#include <vector>
-
-
-
-#include <com/sun/star/container/XEnumerationAccess.hpp>
-
-
-#include <com/sun/star/beans/XMultiPropertySet.hpp>
-#include <com/sun/star/beans/XPropertyState.hpp>
-
-#include <com/sun/star/text/XTextField.hpp>
-#include <com/sun/star/container/XContentEnumerationAccess.hpp>
-#include <com/sun/star/text/XTextFrame.hpp>
-#include <com/sun/star/text/SizeType.hpp>
-#include <com/sun/star/text/HoriOrientation.hpp>
-#include <com/sun/star/text/VertOrientation.hpp>
-#include <com/sun/star/text/XTextFramesSupplier.hpp>
-#include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
-#include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp>
-#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
-#include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
-#include <com/sun/star/document/XEventsSupplier.hpp>
-
-#include <com/sun/star/text/XTextSection.hpp>
-#include <com/sun/star/drawing/XControlShape.hpp>
-
-
-#include "txtexppr.hxx"
-#include "xmluconv.hxx"
-#include "XMLAnchorTypePropHdl.hxx"
-#include "xexptran.hxx"
-
-#include "nmspmap.hxx"
-#include "xmlexp.hxx"
-#include "txtflde.hxx"
-#include "txtprmap.hxx"
-#include "XMLImageMapExport.hxx"
-
-#include "XMLTextNumRuleInfo.hxx"
-#include "XMLTextListAutoStylePool.hxx"
-#include "XMLSectionExport.hxx"
-#include "XMLIndexMarkExport.hxx"
-#include "XMLEventExport.hxx"
-#include "XMLRedlineExport.hxx"
-#include "MultiPropertySetHelper.hxx"
-#include "XMLTextCharStyleNamesElementExport.hxx"
-namespace binfilter {
-
-
-using namespace ::std;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::drawing;
-using namespace ::com::sun::star::document;
-using namespace ::com::sun::star::frame;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-
-typedef OUString *OUStringPtr;
-SV_DECL_PTRARR_DEL( OUStrings_Impl, OUStringPtr, 20, 10 )
-SV_IMPL_PTRARR( OUStrings_Impl, OUStringPtr )
-
-SV_DECL_PTRARR_SORT_DEL( OUStringsSort_Impl, OUStringPtr, 20, 10 )
-SV_IMPL_OP_PTRARR_SORT( OUStringsSort_Impl, OUStringPtr )
-
-#ifdef DBG_UTIL
-static int txtparae_bContainsIllegalCharacters = sal_False;
-#endif
-
-// The following map shows which property values are required:
-//
-// property auto style pass export
-// --------------------------------------------------------
-// ParaStyleName if style exists always
-// ParaConditionalStyleName if style exists always
-// NumberingRules if style exists always
-// TextSection always always
-// ParaChapterNumberingLevel never always
-
-// The conclusion is that for auto styles the first three properties
-// should be queried using a multi property set if, and only if, an
-// auto style needs to be exported. TextSection should be queried by
-// an individual call to getPropertyvalue, because this seems to be
-// less expensive than querying the first three properties if they aren't
-// required.
-
-// For the export pass all properties can be queried using a multi property
-// set.
-
-static const sal_Char* aParagraphPropertyNamesAuto[] =
-{
- "NumberingRules",
- "ParaConditionalStyleName",
- "ParaStyleName",
- NULL
-};
-
-enum eParagraphPropertyNamesEnumAuto
-{
- NUMBERING_RULES_AUTO = 0,
- PARA_CONDITIONAL_STYLE_NAME_AUTO = 1,
- PARA_STYLE_NAME_AUTO = 2
-};
-
-static const sal_Char* aParagraphPropertyNames[] =
-{
- "ParaChapterNumberingLevel",
- "ParaConditionalStyleName",
- "ParaStyleName",
- "TextSection",
- NULL
-};
-
-enum eParagraphPropertyNamesEnum
-{
- PARA_CHAPTER_NUMERBING_LEVEL = 0,
- PARA_CONDITIONAL_STYLE_NAME = 1,
- PARA_STYLE_NAME = 2,
- TEXT_SECTION = 3
-};
-
-
-
-void XMLTextParagraphExport::Add( sal_uInt16 nFamily,
- const Reference < XPropertySet > & rPropSet,
- const XMLPropertyState** ppAddStates)
-{
- UniReference < SvXMLExportPropertyMapper > xPropMapper;
- switch( nFamily )
- {
- case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
- xPropMapper = GetParaPropMapper();
- break;
- case XML_STYLE_FAMILY_TEXT_TEXT:
- xPropMapper = GetTextPropMapper();
- break;
- case XML_STYLE_FAMILY_TEXT_FRAME:
- xPropMapper = GetAutoFramePropMapper();
- break;
- case XML_STYLE_FAMILY_TEXT_SECTION:
- xPropMapper = GetSectionPropMapper();
- break;
- case XML_STYLE_FAMILY_TEXT_RUBY:
- xPropMapper = GetRubyPropMapper();
- break;
- }
- DBG_ASSERT( xPropMapper.is(), "There is the property mapper?" );
-
- vector< XMLPropertyState > xPropStates =
- xPropMapper->Filter( rPropSet );
- if( ppAddStates )
- {
- while( *ppAddStates )
- {
- xPropStates.push_back( **ppAddStates );
- ppAddStates++;
- }
- }
-
- if( xPropStates.size() > 0L )
- {
- Reference< XPropertySetInfo > xPropSetInfo =
- rPropSet->getPropertySetInfo();
- OUString sParent, sCondParent;
- Any aAny;
- sal_uInt16 nIgnoreProps = 0;
- switch( nFamily )
- {
- case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
- if( xPropSetInfo->hasPropertyByName( sParaStyleName ) )
- {
- aAny = rPropSet->getPropertyValue( sParaStyleName );
- aAny >>= sParent;
- }
- if( xPropSetInfo->hasPropertyByName( sParaConditionalStyleName ) )
- {
- aAny = rPropSet->getPropertyValue( sParaConditionalStyleName );
- aAny >>= sCondParent;
- }
- if( xPropSetInfo->hasPropertyByName( sNumberingRules ) )
- {
- aAny = rPropSet->getPropertyValue( sNumberingRules );
- Reference < XIndexReplace > xNumRule;
- aAny >>= xNumRule;
- if( xNumRule.is() && xNumRule->getCount() )
- {
- Reference < XNamed > xNamed( xNumRule, UNO_QUERY );
- OUString sName;
- if( xNamed.is() )
- sName = xNamed->getName();
- sal_Bool bAdd = !sName.getLength();
- if( !bAdd )
- {
- Reference < XPropertySet > xNumPropSet( xNumRule,
- UNO_QUERY );
- OUString sIsAutomatic( RTL_CONSTASCII_USTRINGPARAM( "IsAutomatic" ) );
- if( xNumPropSet.is() &&
- xNumPropSet->getPropertySetInfo()
- ->hasPropertyByName( sIsAutomatic ) )
- {
- aAny = xNumPropSet->getPropertyValue( sIsAutomatic );
- bAdd = *(sal_Bool *)aAny.getValue();
- }
- else
- {
- bAdd = sal_True;
- }
- }
- if( bAdd )
- pListAutoPool->Add( xNumRule );
- }
- }
- break;
- case XML_STYLE_FAMILY_TEXT_TEXT:
- {
- // Get parent and remove hyperlinks (they aren't of interest)
- UniReference< XMLPropertySetMapper > xPM =
- xPropMapper->getPropertySetMapper();
- for( ::std::vector< XMLPropertyState >::iterator i
- = xPropStates.begin();
- nIgnoreProps < 2 && i != xPropStates.end();
- i++ )
- {
- switch( xPM->GetEntryContextId(i->mnIndex) )
- {
- case CTF_CHAR_STYLE_NAME:
- i->maValue >>= sParent;
- i->mnIndex = -1;
- nIgnoreProps++;
- break;
- case CTF_HYPERLINK_URL:
- i->mnIndex = -1;
- nIgnoreProps++;
- break;
- }
- }
- }
- break;
- case XML_STYLE_FAMILY_TEXT_FRAME:
- if( xPropSetInfo->hasPropertyByName( sFrameStyleName ) )
- {
- aAny = rPropSet->getPropertyValue( sFrameStyleName );
- aAny >>= sParent;
- }
- break;
- case XML_STYLE_FAMILY_TEXT_SECTION:
- case XML_STYLE_FAMILY_TEXT_RUBY:
- ; // section styles have no parents
- break;
- }
- if( (xPropStates.size() - nIgnoreProps) > 0 )
- {
- GetAutoStylePool().Add( nFamily, sParent, xPropStates );
- if( sCondParent.getLength() && sParent != sCondParent )
- GetAutoStylePool().Add( nFamily, sCondParent, xPropStates );
- }
- }
-}
-
-void XMLTextParagraphExport::Add( sal_uInt16 nFamily,
- MultiPropertySetHelper& rPropSetHelper,
- const Reference < XPropertySet > & rPropSet,
- const XMLPropertyState** ppAddStates)
-{
- UniReference < SvXMLExportPropertyMapper > xPropMapper;
- switch( nFamily )
- {
- case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
- xPropMapper = GetParaPropMapper();
- break;
- }
- DBG_ASSERT( xPropMapper.is(), "There is the property mapper?" );
-
- vector< XMLPropertyState > xPropStates =
- xPropMapper->Filter( rPropSet );
- if( ppAddStates )
- {
- while( *ppAddStates )
- {
- xPropStates.push_back( **ppAddStates );
- ppAddStates++;
- }
- }
-
- if( xPropStates.size() > 0L )
- {
- OUString sParent, sCondParent;
- Any aAny;
- switch( nFamily )
- {
- case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
- if( rPropSetHelper.hasProperty( PARA_STYLE_NAME_AUTO ) )
- {
- aAny = rPropSetHelper.getValue( PARA_STYLE_NAME_AUTO, rPropSet,
- sal_True );
- aAny >>= sParent;
- }
- if( rPropSetHelper.hasProperty( PARA_CONDITIONAL_STYLE_NAME_AUTO ) )
- {
- aAny = rPropSetHelper.getValue( PARA_CONDITIONAL_STYLE_NAME_AUTO,
- rPropSet, sal_True );
- aAny >>= sCondParent;
- }
- if( rPropSetHelper.hasProperty( NUMBERING_RULES_AUTO ) )
- {
- aAny = rPropSetHelper.getValue( NUMBERING_RULES_AUTO,
- rPropSet, sal_True );
- Reference < XIndexReplace > xNumRule;
- aAny >>= xNumRule;
- if( xNumRule.is() && xNumRule->getCount() )
- {
- Reference < XNamed > xNamed( xNumRule, UNO_QUERY );
- OUString sName;
- if( xNamed.is() )
- sName = xNamed->getName();
- sal_Bool bAdd = !sName.getLength();
- if( !bAdd )
- {
- Reference < XPropertySet > xNumPropSet( xNumRule,
- UNO_QUERY );
- OUString sIsAutomatic( RTL_CONSTASCII_USTRINGPARAM( "IsAutomatic" ) );
- if( xNumPropSet.is() &&
- xNumPropSet->getPropertySetInfo()
- ->hasPropertyByName( sIsAutomatic ) )
- {
- aAny = xNumPropSet->getPropertyValue( sIsAutomatic );
- bAdd = *(sal_Bool *)aAny.getValue();
- }
- else
- {
- bAdd = sal_True;
- }
- }
- if( bAdd )
- pListAutoPool->Add( xNumRule );
- }
- }
- break;
- }
- if( xPropStates.size() > 0 )
- {
- GetAutoStylePool().Add( nFamily, sParent, xPropStates );
- if( sCondParent.getLength() && sParent != sCondParent )
- GetAutoStylePool().Add( nFamily, sCondParent, xPropStates );
- }
- }
-}
-
-OUString XMLTextParagraphExport::Find(
- sal_uInt16 nFamily,
- const Reference < XPropertySet > & rPropSet,
- const OUString& rParent,
- const XMLPropertyState** ppAddStates) const
-{
- OUString sName( rParent );
- UniReference < SvXMLExportPropertyMapper > xPropMapper;
- switch( nFamily )
- {
- case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
- xPropMapper = GetParaPropMapper();
- break;
- case XML_STYLE_FAMILY_TEXT_FRAME:
- xPropMapper = GetAutoFramePropMapper();
- break;
- case XML_STYLE_FAMILY_TEXT_SECTION:
- xPropMapper = GetSectionPropMapper();
- break;
- case XML_STYLE_FAMILY_TEXT_RUBY:
- xPropMapper = GetRubyPropMapper();
- break;
- }
- DBG_ASSERT( xPropMapper.is(), "There is the property mapper?" );
- if( !xPropMapper.is() )
- return sName;
- vector< XMLPropertyState > xPropStates =
- xPropMapper->Filter( rPropSet );
- if( ppAddStates )
- {
- while( *ppAddStates )
- {
- xPropStates.push_back( **ppAddStates );
- ppAddStates++;
- }
- }
-
- if( xPropStates.size() > 0L )
- sName = GetAutoStylePool().Find( nFamily, sName, xPropStates );
-
- return sName;
-}
-
-OUString XMLTextParagraphExport::FindTextStyleAndHyperlink(
- const Reference < XPropertySet > & rPropSet,
- sal_Bool& rHyperlink,
- sal_Bool& rHasCharStyle,
- const XMLPropertyState** ppAddStates ) const
-{
- UniReference < SvXMLExportPropertyMapper > xPropMapper
- = GetTextPropMapper();
- vector< XMLPropertyState > xPropStates =
- xPropMapper->Filter( rPropSet );
-
- // Get parent and remove hyperlinks (they aren't of interest)
- OUString sName;
- rHyperlink = rHasCharStyle = sal_False;
- sal_uInt16 nIgnoreProps = 0;
- UniReference< XMLPropertySetMapper > xPM =
- xPropMapper->getPropertySetMapper();
- for( ::std::vector< XMLPropertyState >::iterator
- i = xPropStates.begin();
- nIgnoreProps < 2 && i != xPropStates.end();
- i++ )
- {
- switch( xPM->GetEntryContextId(i->mnIndex) )
- {
- case CTF_CHAR_STYLE_NAME:
- i->maValue >>= sName;
- i->mnIndex = -1;
- rHasCharStyle = sName.getLength() > 0;
- nIgnoreProps++;
- break;
- case CTF_HYPERLINK_URL:
- rHyperlink = sal_True;
- i->mnIndex = -1;
- nIgnoreProps++;
- break;
- }
- }
- if( ppAddStates )
- {
- while( *ppAddStates )
- {
- xPropStates.push_back( **ppAddStates );
- ppAddStates++;
- }
- }
- if( (xPropStates.size() - nIgnoreProps) > 0L )
- sName = GetAutoStylePool().Find( XML_STYLE_FAMILY_TEXT_TEXT, sName, xPropStates );
-
- return sName;
-}
-
-OUString XMLTextParagraphExport::FindTextStyle(
- const Reference < XPropertySet > & rPropSet,
- sal_Bool& rHasCharStyle ) const
-{
- sal_Bool bDummy;
- return FindTextStyleAndHyperlink( rPropSet, bDummy, rHasCharStyle );
-}
-
-
-void XMLTextParagraphExport::exportListChange(
- const XMLTextNumRuleInfo& rPrevInfo,
- const XMLTextNumRuleInfo& rNextInfo )
-{
- // end a list
- if( rPrevInfo.GetLevel() > 0 &&
- ( !rNextInfo.HasSameNumRules( rPrevInfo ) ||
- rNextInfo.GetLevel() < rPrevInfo.GetLevel() ||
- rNextInfo.IsRestart() ) )
- {
- sal_Int16 nPrevLevel = rPrevInfo.GetLevel();
- sal_Int16 nNextLevel =
- ( !rNextInfo.HasSameNumRules( rPrevInfo ) ||
- rNextInfo.IsRestart() ) ? 0 : rNextInfo.GetLevel();
-
- DBG_ASSERT( pListElements &&
- pListElements->Count() >= 2*(nNextLevel-nPrevLevel),
- "SwXMLExport::ExportListChange: list elements missing" );
-
- for( sal_Int16 i=nPrevLevel; i > nNextLevel; i-- )
- {
- for( sal_uInt16 j=0; j<2; j++ )
- {
- OUString *pElem = (*pListElements)[pListElements->Count()-1];
- pListElements->Remove( pListElements->Count()-1 );
-
- GetExport().EndElement( *pElem, sal_True );
-
- delete pElem;
- }
- }
- }
-
- // start a new list
- if( rNextInfo.GetLevel() > 0 &&
- ( !rPrevInfo.HasSameNumRules( rNextInfo ) ||
- rPrevInfo.GetLevel() < rNextInfo.GetLevel() ||
- rNextInfo.IsRestart() ) )
- {
- sal_Int16 nPrevLevel =
- ( !rNextInfo.HasSameNumRules( rPrevInfo ) ||
- rNextInfo.IsRestart() ) ? 0 : rPrevInfo.GetLevel();
- sal_Int16 nNextLevel = rNextInfo.GetLevel();
-
- // Find out whether this is the first application of the list or not.
- // For named lists, we use the internal name. For unnamed lists, we
- // use the generated name. This works well, because there are either
- // unnamed or either named lists only.
- sal_Bool bListExported = sal_False;
- OUString sName;
- if( rNextInfo.IsNamed() )
- sName = rNextInfo.GetName();
- else
- sName = pListAutoPool->Find( rNextInfo.GetNumRules() );
- DBG_ASSERT( sName.getLength(), "list without a name" );
- if( sName.getLength() )
- {
- bListExported = pExportedLists &&
- pExportedLists->Seek_Entry( (OUString *)&sName );
- if( !bListExported )
- {
- if( !pExportedLists )
- pExportedLists = new OUStringsSort_Impl;
- pExportedLists->Insert( new OUString(sName) );
- }
- }
- sal_Bool bContinue = !rNextInfo.IsRestart() && bListExported &&
- !rPrevInfo.HasSameNumRules( rNextInfo );
-
- for( sal_Int16 i=nPrevLevel; i < nNextLevel; i++)
- {
- // <text:ordered-list> or <text:unordered-list>
- GetExport().CheckAttrList();
- if( 0 == i )
- {
- // For named list, the name might be the name of an automatic
- // rule, so we have to take a look into the style pool.
- // For unnamed lists, we have done this already.
- if( rNextInfo.IsNamed() )
- {
- OUString sTmp( pListAutoPool->Find(
- rNextInfo.GetNumRules() ) );
- if( sTmp.getLength() )
- sName = sTmp;
- }
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME,
- sName );
- }
- if( bContinue && rNextInfo.IsOrdered() )
- GetExport().AddAttribute( XML_NAMESPACE_TEXT,
- XML_CONTINUE_NUMBERING, XML_TRUE );
-
- enum XMLTokenEnum eLName =
- rNextInfo.IsOrdered() ? XML_ORDERED_LIST
- : XML_UNORDERED_LIST;
-
- OUString *pElem = new OUString(
- GetExport().GetNamespaceMap().GetQNameByKey(
- XML_NAMESPACE_TEXT,
- GetXMLToken(eLName) ) );
- GetExport().IgnorableWhitespace();
- GetExport().StartElement( *pElem, sal_False );
-
- if( !pListElements )
- pListElements = new OUStrings_Impl;
- pListElements->Insert( pElem, pListElements->Count() );
-
- // <text:list-header> or <text:list-item>
- GetExport().CheckAttrList();
- if( rNextInfo.HasStartValue() )
- {
- OUStringBuffer aBuffer;
- aBuffer.append( (sal_Int32)rNextInfo.GetStartValue() );
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE,
- aBuffer.makeStringAndClear() );
- }
- eLName = (rNextInfo.IsNumbered() || i+1 < nNextLevel)
- ? XML_LIST_ITEM
- : XML_LIST_HEADER;
- pElem = new OUString( GetExport().GetNamespaceMap().GetQNameByKey(
- XML_NAMESPACE_TEXT,
- GetXMLToken(eLName) ) );
- GetExport().IgnorableWhitespace();
- GetExport().StartElement( *pElem, sal_False );
-
- pListElements->Insert( pElem, pListElements->Count() );
- }
- }
-
- if( rNextInfo.GetLevel() > 0 && rNextInfo.IsNumbered() &&
- rPrevInfo.HasSameNumRules( rNextInfo ) &&
- rPrevInfo.GetLevel() >= rNextInfo.GetLevel() &&
- !rNextInfo.IsRestart() )
- {
- // </text:list-item> or </text:list-header>
- DBG_ASSERT( pListElements && pListElements->Count() >= 2,
- "SwXMLExport::ExportListChange: list elements missing" );
-
- OUString *pElem = (*pListElements)[pListElements->Count()-1];
- GetExport().EndElement( *pElem, sal_True );
-
- pListElements->Remove( pListElements->Count()-1 );
- delete pElem;
-
- // <text:list-item>
- GetExport().CheckAttrList();
- if( rNextInfo.HasStartValue() )
- {
- OUStringBuffer aBuffer;
- aBuffer.append( (sal_Int32)rNextInfo.GetStartValue() );
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE,
- aBuffer.makeStringAndClear() );
- }
- pElem = new OUString( GetExport().GetNamespaceMap().GetQNameByKey(
- XML_NAMESPACE_TEXT,
- GetXMLToken(XML_LIST_ITEM) ) );
- GetExport().IgnorableWhitespace();
- GetExport().StartElement( *pElem, sal_False );
-
- pListElements->Insert( pElem, pListElements->Count() );
- }
-}
-
-
-XMLTextParagraphExport::XMLTextParagraphExport(
- SvXMLExport& rExp,
- SvXMLAutoStylePoolP & rASP
- ) :
- XMLStyleExport( rExp, OUString(), &rASP ),
-// rExport( rExp ),
- rAutoStylePool( rASP ),
- pListElements( 0 ),
- pExportedLists( 0 ),
- pListAutoPool( new XMLTextListAutoStylePool( this->GetExport() ) ),
- pFieldExport( 0 ),
- pPageTextFrameIdxs( 0 ),
- pPageGraphicIdxs( 0 ),
- pPageEmbeddedIdxs( 0 ),
- pPageShapeIdxs( 0 ),
- pFrameTextFrameIdxs( 0 ),
- pFrameGraphicIdxs( 0 ),
- pFrameEmbeddedIdxs( 0 ),
- pSectionExport( NULL ),
- pIndexMarkExport( NULL ),
- pRedlineExport( NULL ),
- pFrameShapeIdxs( 0 ),
- bBlock( sal_False ),
- bOpenRuby( sal_False ),
- sParagraphService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Paragraph")),
- sTableService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextTable")),
- sTextFieldService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextField")),
- sTextFrameService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextFrame")),
- sTextGraphicService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextGraphicObject")),
- sTextEmbeddedService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextEmbeddedObject")),
- sTextEndnoteService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Endnote")),
- sTextContentService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextContent")),
- sShapeService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Shape")),
- sParaStyleName(RTL_CONSTASCII_USTRINGPARAM("ParaStyleName")),
- sParaConditionalStyleName(RTL_CONSTASCII_USTRINGPARAM("ParaConditionalStyleName")),
- sParaChapterNumberingLevel(RTL_CONSTASCII_USTRINGPARAM("ParaChapterNumberingLevel")),
- sCharStyleName(RTL_CONSTASCII_USTRINGPARAM("CharStyleName")),
- sCharStyleNames(RTL_CONSTASCII_USTRINGPARAM("CharStyleNames")),
- sFrameStyleName(RTL_CONSTASCII_USTRINGPARAM("FrameStyleName")),
- sTextField(RTL_CONSTASCII_USTRINGPARAM("TextField")),
- sText(RTL_CONSTASCII_USTRINGPARAM("Text")),
- sFrame(RTL_CONSTASCII_USTRINGPARAM("Frame")),
- sCategory(RTL_CONSTASCII_USTRINGPARAM("Category")),
- sNumberingRules(RTL_CONSTASCII_USTRINGPARAM("NumberingRules")),
- sTextPortionType(RTL_CONSTASCII_USTRINGPARAM("TextPortionType")),
- sFootnote(RTL_CONSTASCII_USTRINGPARAM("Footnote")),
- sBookmark(RTL_CONSTASCII_USTRINGPARAM("Bookmark")),
- sReferenceMark(RTL_CONSTASCII_USTRINGPARAM("ReferenceMark")),
- sIsCollapsed(RTL_CONSTASCII_USTRINGPARAM("IsCollapsed")),
- sIsStart(RTL_CONSTASCII_USTRINGPARAM("IsStart")),
- sReferenceId(RTL_CONSTASCII_USTRINGPARAM("ReferenceId")),
- sNumberingType(RTL_CONSTASCII_USTRINGPARAM("NumberingType")),
- sPageStyleName(RTL_CONSTASCII_USTRINGPARAM("PageStyleName")),
- sPageDescName(RTL_CONSTASCII_USTRINGPARAM("PageDescName")),
- sPrefix(RTL_CONSTASCII_USTRINGPARAM("Prefix")),
- sStartAt(RTL_CONSTASCII_USTRINGPARAM("StartAt")),
- sSuffix(RTL_CONSTASCII_USTRINGPARAM("Suffix")),
- sPositionEndOfDoc(RTL_CONSTASCII_USTRINGPARAM("PositionEndOfDoc")),
- sFootnoteCounting(RTL_CONSTASCII_USTRINGPARAM("FootnoteCounting")),
- sEndNotice(RTL_CONSTASCII_USTRINGPARAM("EndNotice")),
- sBeginNotice(RTL_CONSTASCII_USTRINGPARAM("BeginNotice")),
- sFrameWidthAbsolute(RTL_CONSTASCII_USTRINGPARAM("FrameWidthAbsolute")),
- sFrameWidthPercent(RTL_CONSTASCII_USTRINGPARAM("FrameWidthPercent")),
- sFrameHeightAbsolute(RTL_CONSTASCII_USTRINGPARAM("FrameHeightAbsolute")),
- sFrameHeightPercent(RTL_CONSTASCII_USTRINGPARAM("FrameHeightPercent")),
- sWidth(RTL_CONSTASCII_USTRINGPARAM("Width")),
- sRelativeWidth(RTL_CONSTASCII_USTRINGPARAM("RelativeWidth")),
- sHeight(RTL_CONSTASCII_USTRINGPARAM("Height")),
- sRelativeHeight(RTL_CONSTASCII_USTRINGPARAM("RelativeHeight")),
- sSizeType(RTL_CONSTASCII_USTRINGPARAM("SizeType")),
- sIsSyncWidthToHeight(RTL_CONSTASCII_USTRINGPARAM("IsSyncWidthToHeight")),
- sIsSyncHeightToWidth(RTL_CONSTASCII_USTRINGPARAM("IsSyncHeightToWidth")),
- sHoriOrient(RTL_CONSTASCII_USTRINGPARAM("HoriOrient")),
- sHoriOrientPosition(RTL_CONSTASCII_USTRINGPARAM("HoriOrientPosition")),
- sVertOrient(RTL_CONSTASCII_USTRINGPARAM("VertOrient")),
- sVertOrientPosition(RTL_CONSTASCII_USTRINGPARAM("VertOrientPosition")),
- sChainNextName(RTL_CONSTASCII_USTRINGPARAM("ChainNextName")),
- sAnchorType(RTL_CONSTASCII_USTRINGPARAM("AnchorType")),
- sAnchorPageNo(RTL_CONSTASCII_USTRINGPARAM("AnchorPageNo")),
- sGraphicURL(RTL_CONSTASCII_USTRINGPARAM("GraphicURL")),
- sGraphicFilter(RTL_CONSTASCII_USTRINGPARAM("GraphicFilter")),
- sGraphicRotation(RTL_CONSTASCII_USTRINGPARAM("GraphicRotation")),
- sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText")),
- 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")),
- sTextSection(RTL_CONSTASCII_USTRINGPARAM("TextSection")),
- sDocumentIndex(RTL_CONSTASCII_USTRINGPARAM("DocumentIndex")),
- sDocumentIndexMark(RTL_CONSTASCII_USTRINGPARAM("DocumentIndexMark")),
- sActualSize(RTL_CONSTASCII_USTRINGPARAM("ActualSize")),
- sContourPolyPolygon(RTL_CONSTASCII_USTRINGPARAM("ContourPolyPolygon")),
- sIsPixelContour(RTL_CONSTASCII_USTRINGPARAM("IsPixelContour")),
- sIsAutomaticContour(RTL_CONSTASCII_USTRINGPARAM("IsAutomaticContour")),
- sAnchorCharStyleName(RTL_CONSTASCII_USTRINGPARAM("AnchorCharStyleName")),
- sServerMap(RTL_CONSTASCII_USTRINGPARAM("ServerMap")),
- sRedline(RTL_CONSTASCII_USTRINGPARAM("Redline")),
- sRuby(RTL_CONSTASCII_USTRINGPARAM("Ruby")),
- sRubyText(RTL_CONSTASCII_USTRINGPARAM("RubyText")),
- sRubyAdjust(RTL_CONSTASCII_USTRINGPARAM("RubyAdjust")),
- sRubyCharStyleName(RTL_CONSTASCII_USTRINGPARAM("RubyCharStyleName")),
- bProgress( sal_False ),
- aCharStyleNamesPropInfoCache( sCharStyleNames )
-{
- UniReference < XMLPropertySetMapper > xPropMapper =
- new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA );
- xParaPropMapper = new XMLTextExportPropertySetMapper( xPropMapper,
- GetExport() );
-
- OUString sFamily( GetXMLToken(XML_PARAGRAPH) );
- OUString sPrefix( 'P' );
- rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_PARAGRAPH, sFamily,
- xParaPropMapper, sPrefix );
-
- xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT );
- xTextPropMapper = new XMLTextExportPropertySetMapper( xPropMapper,
- GetExport() );
- sFamily = OUString( GetXMLToken(XML_TEXT) );
- sPrefix = OUString( 'T' );
- rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_TEXT, sFamily,
- xTextPropMapper, sPrefix );
-
- xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_AUTO_FRAME );
- xAutoFramePropMapper = new XMLTextExportPropertySetMapper( xPropMapper,
- GetExport() );
- sFamily = OUString( RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME) );
- sPrefix = OUString( RTL_CONSTASCII_USTRINGPARAM( "fr" ) );
- rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_FRAME, sFamily,
- xAutoFramePropMapper, sPrefix );
-
- xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_SECTION );
- xSectionPropMapper = new XMLTextExportPropertySetMapper( xPropMapper,
- GetExport() );
- sFamily = OUString( GetXMLToken( XML_SECTION ) );
- sPrefix = OUString( RTL_CONSTASCII_USTRINGPARAM( "Sect" ) );
- rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_SECTION, sFamily,
- xSectionPropMapper, sPrefix );
-
- xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_RUBY );
- xRubyPropMapper = new SvXMLExportPropertyMapper( xPropMapper );
- sFamily = OUString( GetXMLToken( XML_RUBY ) );
- sPrefix = OUString( RTL_CONSTASCII_USTRINGPARAM( "Ru" ) );
- rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_RUBY, sFamily,
- xRubyPropMapper, sPrefix );
-
- xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME );
- xFramePropMapper = new XMLTextExportPropertySetMapper( xPropMapper,
- GetExport() );
- pSectionExport = new XMLSectionExport( rExp, *this );
- pIndexMarkExport = new XMLIndexMarkExport( rExp, *this );
- pRedlineExport = IsBlockMode() ? NULL : new XMLRedlineExport( rExp );
-
- // The text field helper needs a pre-constructed XMLPropertyState
- // to export the combined characters field. We construct that
- // here, because we need the text property mapper to do it.
-
- // construct Any value, then find index
- Any aAny;
- sal_Bool bTmp = sal_True;
- aAny.setValue(&bTmp, ::getBooleanCppuType());
- sal_Int32 nIndex = xTextPropMapper->getPropertySetMapper()->FindEntryIndex(
- "", XML_NAMESPACE_STYLE,
- GetXMLToken(XML_TEXT_COMBINE));
- pFieldExport = new XMLTextFieldExport( rExp, new XMLPropertyState( nIndex, aAny ) );
-}
-
-XMLTextParagraphExport::~XMLTextParagraphExport()
-{
- delete pRedlineExport;
- delete pIndexMarkExport;
- delete pSectionExport;
- delete pFieldExport;
- delete pListElements;
- delete pExportedLists;
- delete pListAutoPool;
- delete pPageTextFrameIdxs;
- delete pPageGraphicIdxs;
- delete pPageEmbeddedIdxs;
- delete pPageShapeIdxs;
- delete pFrameTextFrameIdxs;
- delete pFrameGraphicIdxs;
- delete pFrameEmbeddedIdxs;
- delete pFrameShapeIdxs;
-#ifdef DBG_UTIL
- txtparae_bContainsIllegalCharacters = sal_False;
-#endif
-}
-
-SvXMLExportPropertyMapper *XMLTextParagraphExport::CreateShapeExtPropMapper(
- SvXMLExport& rExport )
-{
- UniReference < XMLPropertySetMapper > xPropMapper =
- new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE );
- return new XMLTextExportPropertySetMapper( xPropMapper, rExport );
-}
-
-SvXMLExportPropertyMapper *XMLTextParagraphExport::CreateCharExtPropMapper(
- SvXMLExport& rExport)
-{
- XMLPropertySetMapper *pPropMapper =
- new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT );
- return new XMLTextExportPropertySetMapper( pPropMapper, rExport );
-}
-
-SvXMLExportPropertyMapper *XMLTextParagraphExport::CreateParaExtPropMapper(
- SvXMLExport& rExport)
-{
- XMLPropertySetMapper *pPropMapper =
- new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA );
- return new XMLTextExportPropertySetMapper( pPropMapper, rExport );
-}
-
-void XMLTextParagraphExport::collectFrames( sal_Bool bBoundToFrameOnly )
-{
- Reference < XTextFramesSupplier > xTFS( GetExport().GetModel(), UNO_QUERY );
- if( xTFS.is() )
- {
- xTextFrames = Reference < XIndexAccess >( xTFS->getTextFrames(),
- UNO_QUERY );
- sal_Int32 nCount = xTextFrames->getCount();
- for( sal_Int32 i = 0; i < nCount; i++ )
- {
- Any aAny = xTextFrames->getByIndex( i );
- Reference < XTextFrame > xTxtFrame;
- aAny >>= xTxtFrame;
- Reference < XPropertySet > xPropSet( xTxtFrame, UNO_QUERY );
-
- aAny = xPropSet->getPropertyValue( sAnchorType );
- TextContentAnchorType eAnchor;
- aAny >>= eAnchor;
-
- switch( eAnchor )
- {
- case TextContentAnchorType_AT_PAGE:
- if( !bBoundToFrameOnly )
- {
- if( !pPageTextFrameIdxs )
- pPageTextFrameIdxs = new SvLongs;
- pPageTextFrameIdxs->Insert( i, pPageTextFrameIdxs->Count() );
- }
- break;
- case TextContentAnchorType_AT_FRAME:
- if( !pFrameTextFrameIdxs )
- pFrameTextFrameIdxs = new SvLongs;
- pFrameTextFrameIdxs->Insert( i, pFrameTextFrameIdxs->Count() );
- break;
- }
- }
- }
-
- Reference < XTextGraphicObjectsSupplier > xTGOS( GetExport().GetModel(),
- UNO_QUERY );
- if( xTGOS.is() )
- {
- xGraphics = Reference < XIndexAccess >( xTGOS->getGraphicObjects(),
- UNO_QUERY );
- sal_Int32 nCount = xGraphics->getCount();
- for( sal_Int32 i = 0; i < nCount; i++ )
- {
- Any aAny = xGraphics->getByIndex( i );
- Reference < XTextContent > xTxtCntnt;
- aAny >>= xTxtCntnt;
- Reference < XPropertySet > xPropSet( xTxtCntnt, UNO_QUERY );
-
- aAny = xPropSet->getPropertyValue( sAnchorType );
- TextContentAnchorType eAnchor;
- aAny >>= eAnchor;
-
- switch( eAnchor )
- {
- case TextContentAnchorType_AT_PAGE:
- if( !bBoundToFrameOnly )
- {
- if( !pPageGraphicIdxs )
- pPageGraphicIdxs = new SvLongs;
- pPageGraphicIdxs->Insert( i, pPageGraphicIdxs->Count() );
- }
- break;
- case TextContentAnchorType_AT_FRAME:
- if( !pFrameGraphicIdxs )
- pFrameGraphicIdxs = new SvLongs;
- pFrameGraphicIdxs->Insert( i, pFrameGraphicIdxs->Count() );
- break;
- }
- }
- }
-
- Reference < XTextEmbeddedObjectsSupplier > xTEOS( GetExport().GetModel(),
- UNO_QUERY );
- if( xTEOS.is() )
- {
- xEmbeddeds = Reference < XIndexAccess >( xTEOS->getEmbeddedObjects(),
- UNO_QUERY );
- sal_Int32 nCount = xEmbeddeds->getCount();
- for( sal_Int32 i = 0; i < nCount; i++ )
- {
- Any aAny = xEmbeddeds->getByIndex( i );
- Reference < XTextContent > xTxtCntnt;
- aAny >>= xTxtCntnt;
- Reference < XPropertySet > xPropSet( xTxtCntnt, UNO_QUERY );
-
- aAny = xPropSet->getPropertyValue( sAnchorType );
- TextContentAnchorType eAnchor;
- aAny >>= eAnchor;
-
- switch( eAnchor )
- {
- case TextContentAnchorType_AT_PAGE:
- if( !bBoundToFrameOnly )
- {
- if( !pPageEmbeddedIdxs )
- pPageEmbeddedIdxs = new SvLongs;
- pPageEmbeddedIdxs->Insert( i, pPageEmbeddedIdxs->Count() );
- }
- break;
- case TextContentAnchorType_AT_FRAME:
- if( !pFrameEmbeddedIdxs )
- pFrameEmbeddedIdxs = new SvLongs;
- pFrameEmbeddedIdxs->Insert( i, pFrameEmbeddedIdxs->Count() );
- break;
- }
- }
- }
-
- Reference < XDrawPageSupplier > xDPS( GetExport().GetModel(),
- UNO_QUERY );
- if( xDPS.is() )
- {
- xShapes = Reference < XIndexAccess >( xDPS->getDrawPage(),
- UNO_QUERY );
- sal_Int32 nCount = xShapes->getCount();
- for( sal_Int32 i = 0; i < nCount; i++ )
- {
- Any aAny = xShapes->getByIndex( i );
- Reference < XShape > xShape;
- aAny >>= xShape;
- if( !xShape.is() )
- continue;
-
- Reference < XPropertySet > xPropSet( xShape, UNO_QUERY );
-
- aAny = xPropSet->getPropertyValue( sAnchorType );
- TextContentAnchorType eAnchor;
- aAny >>= eAnchor;
-
- if( (TextContentAnchorType_AT_PAGE != eAnchor &&
- TextContentAnchorType_AT_FRAME != eAnchor) ||
- (TextContentAnchorType_AT_PAGE == eAnchor &&
- bBoundToFrameOnly ) )
- continue;
-
- Reference<XServiceInfo> xServiceInfo( xShape,
- UNO_QUERY );
- if( xServiceInfo->supportsService( sTextFrameService ) ||
- xServiceInfo->supportsService( sTextGraphicService ) ||
- xServiceInfo->supportsService( sTextEmbeddedService ) )
- continue;
-
- if( TextContentAnchorType_AT_PAGE == eAnchor )
- {
- if( !pPageShapeIdxs )
- pPageShapeIdxs = new SvLongs;
- pPageShapeIdxs->Insert( i, pPageShapeIdxs->Count() );
- }
- else
- {
- if( !pFrameShapeIdxs )
- pFrameShapeIdxs = new SvLongs;
- pFrameShapeIdxs->Insert( i, pFrameShapeIdxs->Count() );
- }
- }
- }
-}
-
-void XMLTextParagraphExport::exportPageFrames( sal_Bool bAutoStyles,
- sal_Bool bProgress )
-{
- if( pPageTextFrameIdxs )
- {
- for( sal_uInt16 i = 0; i < pPageTextFrameIdxs->Count(); i++ )
- {
- Any aAny = xTextFrames->getByIndex( (*pPageTextFrameIdxs)[i] );
- Reference < XTextFrame > xTxtFrame;
- aAny >>= xTxtFrame;
- Reference < XTextContent > xTxtCntnt( xTxtFrame, UNO_QUERY );
- exportTextFrame( xTxtCntnt, bAutoStyles, bProgress );
- }
- }
- if( pPageGraphicIdxs )
- {
- for( sal_uInt16 i = 0; i < pPageGraphicIdxs->Count(); i++ )
- {
- Any aAny = xGraphics->getByIndex( (*pPageGraphicIdxs)[i] );
- Reference < XTextContent > xTxtCntnt;
- aAny >>= xTxtCntnt;
- exportTextGraphic( xTxtCntnt, bAutoStyles );
- }
- }
- if( pPageEmbeddedIdxs )
- {
- for( sal_uInt16 i = 0; i < pPageEmbeddedIdxs->Count(); i++ )
- {
- Any aAny = xEmbeddeds->getByIndex( (*pPageEmbeddedIdxs)[i] );
- Reference < XTextContent > xTxtCntnt;
- aAny >>= xTxtCntnt;
- exportTextEmbedded( xTxtCntnt, bAutoStyles );
- }
- }
- if( pPageShapeIdxs )
- {
- for( sal_uInt16 i = 0; i < pPageShapeIdxs->Count(); i++ )
- {
- Any aAny = xShapes->getByIndex( (*pPageShapeIdxs)[i] );
- Reference < XShape > xShape;
- aAny >>= xShape;
- Reference < XTextContent > xTxtCntnt( xShape, UNO_QUERY );
- exportShape( xTxtCntnt, bAutoStyles );
- }
- }
-}
-
-sal_Bool lcl_txtpara_isFrameAnchor(
- const Reference < XPropertySet > rPropSet,
- const Reference < XTextFrame >& rParentTxtFrame )
-{
- Any aAny = rPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("AnchorFrame") ) );
- Reference < XTextFrame > xAnchorTxtFrame;
- aAny >>= xAnchorTxtFrame;
-
- return xAnchorTxtFrame == rParentTxtFrame;
-}
-
-void XMLTextParagraphExport::exportFrameFrames(
- sal_Bool bAutoStyles,
- sal_Bool bProgress,
- const Reference < XTextFrame > *pParentTxtFrame )
-{
- if( pFrameTextFrameIdxs && pFrameTextFrameIdxs->Count() )
- {
- Any aAny;
- sal_uInt16 i = 0;
- while( i < pFrameTextFrameIdxs->Count() )
- {
- aAny = xTextFrames->getByIndex( (*pFrameTextFrameIdxs)[i] );
- Reference < XTextFrame > xTxtFrame;
- aAny >>= xTxtFrame;
- Reference < XPropertySet > xPropSet( xTxtFrame, UNO_QUERY );
- if( lcl_txtpara_isFrameAnchor( xPropSet, *pParentTxtFrame ) )
- {
- if( !bAutoStyles )
- pFrameTextFrameIdxs->Remove( i );
- sal_uInt16 nOldCount = pFrameTextFrameIdxs->Count();
- Reference < XTextContent > xTxtCntnt( xTxtFrame, UNO_QUERY );
- exportTextFrame( xTxtCntnt, bAutoStyles, bProgress );
- if( bAutoStyles )
- i++;
- else if( pFrameTextFrameIdxs->Count() != nOldCount )
- i = 0;
- }
- else
- i++;
- }
- }
- if( pFrameGraphicIdxs && pFrameGraphicIdxs->Count() )
- {
- Any aAny;
- sal_uInt16 i = 0;
- while( i < pFrameGraphicIdxs->Count() )
- {
- aAny = xGraphics->getByIndex( (*pFrameGraphicIdxs)[i] );
- Reference < XTextContent > xTxtCntnt;
- aAny >>= xTxtCntnt;
- Reference < XPropertySet > xPropSet( xTxtCntnt, UNO_QUERY );
- if( lcl_txtpara_isFrameAnchor( xPropSet, *pParentTxtFrame ) )
- {
- if( !bAutoStyles )
- pFrameGraphicIdxs->Remove( i );
- sal_uInt16 nOldCount = pFrameGraphicIdxs->Count();
- exportTextGraphic( xTxtCntnt, bAutoStyles );
- if( bAutoStyles )
- i++;
- else if( pFrameGraphicIdxs->Count() != nOldCount )
- i = 0;
- }
- else
- i++;
- }
- }
- if( pFrameEmbeddedIdxs && pFrameEmbeddedIdxs->Count() )
- {
- Any aAny;
- sal_uInt16 i = 0;
- while( i < pFrameEmbeddedIdxs->Count() )
- {
- aAny = xEmbeddeds->getByIndex( (*pFrameEmbeddedIdxs)[i] );
- Reference < XEmbeddedObjectSupplier > xEOS;
- aAny >>= xEOS;
- Reference < XPropertySet > xPropSet( xEOS, UNO_QUERY );
- if( lcl_txtpara_isFrameAnchor( xPropSet, *pParentTxtFrame ) )
- {
- if( !bAutoStyles )
- pFrameEmbeddedIdxs->Remove( i );
- sal_uInt16 nOldCount = pFrameEmbeddedIdxs->Count();
- Reference < XTextContent > xTxtCntnt( xEOS, UNO_QUERY );
- exportTextEmbedded( xTxtCntnt, bAutoStyles );
- if( bAutoStyles )
- i++;
- else if( pFrameEmbeddedIdxs->Count() != nOldCount )
- i = 0;
- }
- else
- i++;
- }
- }
- if( pFrameShapeIdxs && pFrameShapeIdxs->Count() )
- {
- Any aAny;
- sal_uInt16 i = 0;
- while( i < pFrameShapeIdxs->Count() )
- {
- aAny = xShapes->getByIndex( (*pFrameShapeIdxs)[i] );
- Reference < XShape > xShape;
- aAny >>= xShape;
- Reference < XPropertySet > xPropSet( xShape, UNO_QUERY );
- if( lcl_txtpara_isFrameAnchor( xPropSet, *pParentTxtFrame ) )
- {
- if( !bAutoStyles )
- pFrameShapeIdxs->Remove( i );
- sal_uInt16 nOldCount = pFrameShapeIdxs->Count();
- Reference < XTextContent > xTxtCntnt( xShape, UNO_QUERY );
- exportShape( xTxtCntnt, bAutoStyles );
- if( bAutoStyles )
- i++;
- else if( pFrameShapeIdxs->Count() != nOldCount )
- i = 0;
- }
- else
- i++;
- }
- }
-}
-
-void XMLTextParagraphExport::exportText(
- const Reference < XText > & rText,
- sal_Bool bAutoStyles,
- sal_Bool bProgress,
- sal_Bool bExportParagraph )
-{
- if( bAutoStyles )
- GetExport().GetShapeExport(); // make sure the graphics styles family
- // is added
- Reference < XEnumerationAccess > xEA( rText, UNO_QUERY );
- Reference < XEnumeration > xParaEnum = xEA->createEnumeration();
- Reference < XPropertySet > xPropertySet( rText, UNO_QUERY );
- Reference < XTextSection > xBaseSection;
-
- // #97718# footnotes don't supply paragraph enumerations in some cases
- // This is always a bug, but at least we don't want to crash.
- DBG_ASSERT( xParaEnum.is(), "We need a paragraph enumeration" );
- if( ! xParaEnum.is() )
- return;
-
- sal_Bool bExportLevels = sal_True;
-
- if (xPropertySet.is())
- {
- Reference < XPropertySetInfo > xInfo ( xPropertySet->getPropertySetInfo() );
-
- if( xInfo.is() )
- {
- if (xInfo->hasPropertyByName( sTextSection ))
- {
- xPropertySet->getPropertyValue(sTextSection) >>= xBaseSection ;
- }
-
- // for applications that use the outliner we need to check if
- // the current text object needs the level information exported
- if( !bAutoStyles )
- {
- // fixme: move string to class member, couldn't do now because
- // of no incompatible build
- OUString sHasLevels( RTL_CONSTASCII_USTRINGPARAM("HasLevels") );
- if (xInfo->hasPropertyByName( sHasLevels ) )
- {
- xPropertySet->getPropertyValue(sHasLevels) >>= bExportLevels;
- }
- }
- }
- }
-
- // #96530# Export redlines at start & end of XText before & after
- // exporting the text content enumeration
- if( !bAutoStyles && (pRedlineExport != NULL) )
- pRedlineExport->ExportStartOrEndRedline( xPropertySet, sal_True );
- exportTextContentEnumeration( xParaEnum, bAutoStyles, xBaseSection,
- bProgress, bExportParagraph, 0, bExportLevels );
- if( !bAutoStyles && (pRedlineExport != NULL) )
- pRedlineExport->ExportStartOrEndRedline( xPropertySet, sal_False );
-}
-
-void XMLTextParagraphExport::exportText(
- const Reference < XText > & rText,
- const Reference < XTextSection > & rBaseSection,
- sal_Bool bAutoStyles,
- sal_Bool bProgress,
- sal_Bool bExportParagraph )
-{
- if( bAutoStyles )
- GetExport().GetShapeExport(); // make sure the graphics styles family
- // is added
- Reference < XEnumerationAccess > xEA( rText, UNO_QUERY );
- Reference < XEnumeration > xParaEnum = xEA->createEnumeration();
-
- // #98165# don't continue without a paragraph enumeration
- if( ! xParaEnum.is() )
- return;
-
- // #96530# Export redlines at start & end of XText before & after
- // exporting the text content enumeration
- Reference<XPropertySet> xPropertySet;
- if( !bAutoStyles && (pRedlineExport != NULL) )
- {
- xPropertySet = Reference<XPropertySet>::query( rText );
- pRedlineExport->ExportStartOrEndRedline( xPropertySet, sal_True );
- }
- exportTextContentEnumeration( xParaEnum, bAutoStyles, rBaseSection,
- bProgress, bExportParagraph );
- if( !bAutoStyles && (pRedlineExport != NULL) )
- pRedlineExport->ExportStartOrEndRedline( xPropertySet, sal_False );
-}
-
-sal_Bool XMLTextParagraphExport::exportTextContentEnumeration(
- const Reference < XEnumeration > & rContEnum,
- sal_Bool bAutoStyles,
- const Reference < XTextSection > & rBaseSection,
- sal_Bool bProgress,
- sal_Bool bExportParagraph,
- const Reference < XPropertySet > *pRangePropSet,
- sal_Bool bExportLevels)
-{
- DBG_ASSERT( rContEnum.is(), "No enumeration to export!" );
- sal_Bool bHasMoreElements = rContEnum->hasMoreElements();
- if( !bHasMoreElements )
- return sal_False;
-
- XMLTextNumRuleInfo aPrevNumInfo;
- XMLTextNumRuleInfo aNextNumInfo;
-
- sal_Bool bHasContent sal_False;
- Reference<XTextSection> xCurrentTextSection = rBaseSection;
-
- MultiPropertySetHelper aPropSetHelper(
- bAutoStyles ? aParagraphPropertyNamesAuto :
- aParagraphPropertyNames );
-
- Any aAny;
- sal_Bool bHoldElement = sal_False;
- Reference < XTextContent > xTxtCntnt;
- while( bHoldElement || bHasMoreElements )
- {
- if (bHoldElement)
- {
- bHoldElement = sal_False;
- }
- else
- {
- aAny = rContEnum->nextElement();
- aAny >>= xTxtCntnt;
-
- aPropSetHelper.resetValues();
-
- }
-
- Reference<XServiceInfo> xServiceInfo( xTxtCntnt, UNO_QUERY );
- if( xServiceInfo->supportsService( sParagraphService ) )
- {
- if( bExportLevels )
- {
- if( bAutoStyles )
- {
- exportListAndSectionChange( xCurrentTextSection, xTxtCntnt,
- aPrevNumInfo, aNextNumInfo,
- bAutoStyles );
- }
- else
- {
- aNextNumInfo.Set( xTxtCntnt );
-
- exportListAndSectionChange( xCurrentTextSection, aPropSetHelper,
- TEXT_SECTION, xTxtCntnt,
- aPrevNumInfo, aNextNumInfo,
- bAutoStyles );
- }
- }
-
- // if we found a mute section: skip all section content
- if (pSectionExport->IsMuteSection(xCurrentTextSection))
- {
- // Make sure headings are exported anyway.
- if( !bAutoStyles )
- pSectionExport->ExportMasterDocHeadingDummies();
-
- while (rContEnum->hasMoreElements() &&
- pSectionExport->IsInSection( xCurrentTextSection,
- xTxtCntnt, sal_True ))
- {
- aAny = rContEnum->nextElement();
- aAny >>= xTxtCntnt;
- aPropSetHelper.resetValues();
- aNextNumInfo.Reset();
- }
- // the first non-mute element still needs to be processed
- bHoldElement =
- ! pSectionExport->IsInSection( xCurrentTextSection,
- xTxtCntnt, sal_False );
- }
- else
- exportParagraph( xTxtCntnt, bAutoStyles, bProgress,
- bExportParagraph, aPropSetHelper );
- bHasContent = sal_True;
- }
- else if( xServiceInfo->supportsService( sTableService ) )
- {
- if( !bAutoStyles )
- {
- aNextNumInfo.Reset();
- }
-
- exportListAndSectionChange( xCurrentTextSection, xTxtCntnt,
- aPrevNumInfo, aNextNumInfo,
- bAutoStyles );
-
- if (! pSectionExport->IsMuteSection(xCurrentTextSection))
- {
- // export start + end redlines (for wholly redlined tables)
- if ((! bAutoStyles) && (NULL != pRedlineExport))
- pRedlineExport->ExportStartOrEndRedline(xTxtCntnt, sal_True);
-
- exportTable( xTxtCntnt, bAutoStyles, bProgress );
-
- if ((! bAutoStyles) && (NULL != pRedlineExport))
- pRedlineExport->ExportStartOrEndRedline(xTxtCntnt, sal_False);
- }
- else if( !bAutoStyles )
- {
- // Make sure headings are exported anyway.
- pSectionExport->ExportMasterDocHeadingDummies();
- }
-
- bHasContent = sal_True;
- }
- else if( xServiceInfo->supportsService( sTextFrameService ) )
- {
- exportTextFrame( xTxtCntnt, bAutoStyles, bProgress, pRangePropSet );
- }
- else if( xServiceInfo->supportsService( sTextGraphicService ) )
- {
- exportTextGraphic( xTxtCntnt, bAutoStyles, pRangePropSet );
- }
- else if( xServiceInfo->supportsService( sTextEmbeddedService ) )
- {
- exportTextEmbedded( xTxtCntnt, bAutoStyles, pRangePropSet );
- }
- else if( xServiceInfo->supportsService( sShapeService ) )
- {
- exportShape( xTxtCntnt, bAutoStyles, pRangePropSet );
- }
- else
- {
- DBG_ASSERT( !xTxtCntnt.is(), "unknown text content" );
- }
-
- if( !bAutoStyles )
- {
- aPrevNumInfo = aNextNumInfo;
- }
-
- bHasMoreElements = rContEnum->hasMoreElements();
- }
-
- if( bExportLevels && bHasContent && !bAutoStyles )
- {
- aNextNumInfo.Reset();
-
- // close open lists and sections; no new styles
- exportListAndSectionChange( xCurrentTextSection, rBaseSection,
- aPrevNumInfo, aNextNumInfo,
- bAutoStyles );
- }
-
- return sal_True;
-}
-
-void XMLTextParagraphExport::exportParagraph(
- const Reference < XTextContent > & rTextContent,
- sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportParagraph,
- MultiPropertySetHelper& rPropSetHelper)
-{
- sal_Int8 nOutlineLevel = -1;
-
- if( bProgress )
- {
- ProgressBarHelper *pProgress = GetExport().GetProgressBarHelper();
- pProgress->SetValue( pProgress->GetValue()+1 );
- }
-
- // get property set or multi property set and initialize helper
- Reference<XMultiPropertySet> xMultiPropSet( rTextContent, UNO_QUERY );
- Reference<XPropertySet> xPropSet( rTextContent, UNO_QUERY );
-
- // check for supported properties
- if( !rPropSetHelper.checkedProperties() )
- rPropSetHelper.hasProperties( xPropSet->getPropertySetInfo() );
-
-// if( xMultiPropSet.is() )
-// rPropSetHelper.getValues( xMultiPropSet );
-// else
-// rPropSetHelper.getValues( xPropSet );
-
- Any aAny;
-
- if( bExportParagraph )
- {
- if( bAutoStyles )
- {
- Add( XML_STYLE_FAMILY_TEXT_PARAGRAPH, rPropSetHelper, xPropSet );
- }
- else
- {
- OUString sStyle;
- if( rPropSetHelper.hasProperty( PARA_STYLE_NAME ) )
- {
- if( xMultiPropSet.is() )
- aAny = rPropSetHelper.getValue( PARA_STYLE_NAME,
- xMultiPropSet );
- else
- aAny = rPropSetHelper.getValue( PARA_STYLE_NAME,
- xPropSet );
- aAny >>= sStyle;
- }
-
- OUString sAutoStyle( sStyle );
- sAutoStyle = Find( XML_STYLE_FAMILY_TEXT_PARAGRAPH, xPropSet, sStyle );
- if( sAutoStyle.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME,
- sAutoStyle );
-
- if( rPropSetHelper.hasProperty( PARA_CONDITIONAL_STYLE_NAME ) )
- {
- OUString sCondStyle;
- if( xMultiPropSet.is() )
- aAny = rPropSetHelper.getValue( PARA_CONDITIONAL_STYLE_NAME,
- xMultiPropSet );
- else
- aAny = rPropSetHelper.getValue( PARA_CONDITIONAL_STYLE_NAME,
- xPropSet );
- aAny >>= sCondStyle;
- if( sCondStyle != sStyle )
- {
- sCondStyle = Find( XML_STYLE_FAMILY_TEXT_PARAGRAPH, xPropSet,
- sCondStyle );
- if( sCondStyle.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_TEXT,
- XML_COND_STYLE_NAME,
- sCondStyle );
- }
- }
-
- if( rPropSetHelper.hasProperty( PARA_CHAPTER_NUMERBING_LEVEL ) )
- {
- if( xMultiPropSet.is() )
- aAny = rPropSetHelper.getValue( PARA_CHAPTER_NUMERBING_LEVEL,
- xMultiPropSet );
- else
- aAny = rPropSetHelper.getValue( PARA_CHAPTER_NUMERBING_LEVEL,
- xPropSet );
-
- aAny >>= nOutlineLevel;
- if( -1 != nOutlineLevel )
- {
- OUStringBuffer sTmp;
- sTmp.append( (sal_Int32)nOutlineLevel+1L );
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_LEVEL,
- sTmp.makeStringAndClear() );
- }
- }
- }
- }
-
- Reference < XEnumerationAccess > xEA( rTextContent, UNO_QUERY );
- Reference < XEnumeration > xTextEnum = xEA->createEnumeration();
-
- Reference < XEnumeration> xContentEnum;
- Reference < XContentEnumerationAccess > xCEA( rTextContent, UNO_QUERY );
- if( xCEA.is() )
- xContentEnum = xCEA->createContentEnumeration( sTextContentService );
- sal_Bool bHasContentEnum = xContentEnum.is() &&
- xContentEnum->hasMoreElements();
-
- Reference < XTextSection > xSection;
- if( bHasContentEnum )
- {
- // For the auto styles, the multi property set helper is only used
- // if hard attributes are existing. Therfor, it seems to be a better
- // strategy to have the TextSection property seperate, because otherwise
- // we always retrieve the style names even if they are not required.
- if( bAutoStyles )
- {
- if( xPropSet->getPropertySetInfo()->hasPropertyByName( sTextSection ) )
- {
- aAny = xPropSet->getPropertyValue( sTextSection );
- aAny >>= xSection;
- }
- }
- else
- {
- if( rPropSetHelper.hasProperty( TEXT_SECTION ) )
- {
- aAny = rPropSetHelper.getValue( TEXT_SECTION );
- aAny >>= xSection;
- }
- }
- }
-
- if( bAutoStyles )
- {
- sal_Bool bPrevCharIsSpace = sal_True;
- if( bHasContentEnum )
- bPrevCharIsSpace = !exportTextContentEnumeration(
- xContentEnum, bAutoStyles, xSection,
- bProgress );
- exportTextRangeEnumeration( xTextEnum, bAutoStyles, bProgress );
- }
- else
- {
- sal_Bool bPrevCharIsSpace = sal_True;
- enum XMLTokenEnum eElem =
- -1 == nOutlineLevel ? XML_P : XML_H;
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, eElem,
- sal_True, sal_False );
- if( bHasContentEnum )
- bPrevCharIsSpace = !exportTextContentEnumeration(
- xContentEnum, bAutoStyles, xSection,
- bProgress );
- exportTextRangeEnumeration( xTextEnum, bAutoStyles, bProgress,
- bPrevCharIsSpace );
- }
-}
-
-// bookmarks, reference marks (and TOC marks) are the same except for the
-// element names. We use the same method for export and it an array with
-// the proper element names
-static const enum XMLTokenEnum lcl_XmlReferenceElements[] = {
- XML_REFERENCE_MARK, XML_REFERENCE_MARK_START, XML_REFERENCE_MARK_END };
-static const enum XMLTokenEnum lcl_XmlBookmarkElements[] = {
- XML_BOOKMARK, XML_BOOKMARK_START, XML_BOOKMARK_END };
-
-
-void XMLTextParagraphExport::exportTextRangeEnumeration(
- const Reference < XEnumeration > & rTextEnum,
- sal_Bool bAutoStyles, sal_Bool bProgress,
- sal_Bool bPrvChrIsSpc )
-{
- sal_Bool bPrevCharIsSpace = bPrvChrIsSpc;
-
- Any aAny;
- while( rTextEnum->hasMoreElements() )
- {
- aAny = rTextEnum->nextElement();
- Reference < XTextRange > xTxtRange;
- aAny >>= xTxtRange;
-
- Reference<XPropertySet> xPropSet(xTxtRange, UNO_QUERY);
- Reference<XPropertySetInfo> xPropInfo =
- xPropSet->getPropertySetInfo();
-
- if (xPropInfo->hasPropertyByName(sTextPortionType))
- {
- aAny = xPropSet->getPropertyValue(sTextPortionType);
- OUString sType;
- aAny >>= sType;
-
- if( sType.equals(sText))
- {
- exportTextRange( xTxtRange, bAutoStyles,
- bPrevCharIsSpace );
- }
- else if( sType.equals(sTextField))
- {
- exportTextField( xTxtRange, bAutoStyles );
- bPrevCharIsSpace = sal_False;
- }
- else if( sType.equals( sFrame ) )
- {
- Reference < XEnumeration> xContentEnum;
- Reference < XContentEnumerationAccess > xCEA( xTxtRange,
- UNO_QUERY );
- if( xCEA.is() )
- xContentEnum = xCEA->createContentEnumeration(
- sTextContentService );
- // frames are never in sections
- Reference<XTextSection> xSection;
- if( xContentEnum.is() )
- exportTextContentEnumeration( xContentEnum,
- bAutoStyles,
- xSection, bProgress, sal_True,
- &xPropSet );
-
- bPrevCharIsSpace = sal_False;
- }
- else if (sType.equals(sFootnote))
- {
- exportTextFootnote(xPropSet,
- xTxtRange->getString(),
- bAutoStyles, bProgress );
- bPrevCharIsSpace = sal_False;
- }
- else if (sType.equals(sBookmark))
- {
- exportTextMark(xPropSet,
- sBookmark,
- lcl_XmlBookmarkElements,
- bAutoStyles);
- }
- else if (sType.equals(sReferenceMark))
- {
- exportTextMark(xPropSet,
- sReferenceMark,
- lcl_XmlReferenceElements,
- bAutoStyles);
- }
- else if (sType.equals(sDocumentIndexMark))
- {
- pIndexMarkExport->ExportIndexMark(xPropSet, bAutoStyles);
- }
- else if (sType.equals(sRedline))
- {
- if (NULL != pRedlineExport)
- pRedlineExport->ExportChange(xPropSet, bAutoStyles);
- }
- else if (sType.equals(sRuby))
- {
- exportRuby(xPropSet, bAutoStyles);
- }
- else
- DBG_ERROR("unknown text portion type");
- }
- else
- {
- Reference<XServiceInfo> xServiceInfo( xTxtRange, UNO_QUERY );
- if( xServiceInfo->supportsService( sTextFieldService ) )
- {
- exportTextField( xTxtRange, bAutoStyles );
- bPrevCharIsSpace = sal_False;
- }
- else
- {
- // no TextPortionType property -> non-Writer app -> text
- exportTextRange( xTxtRange, bAutoStyles, bPrevCharIsSpace );
- }
- }
- }
-
- DBG_ASSERT( !bOpenRuby, "Red Alert: Ruby still open!" );
-}
-
-void XMLTextParagraphExport::exportTable(
- const Reference < XTextContent > & rTextContent,
- sal_Bool bAutoStyles, sal_Bool bProgress )
-{
-}
-
-void XMLTextParagraphExport::exportTextField(
- const Reference < XTextRange > & rTextRange,
- sal_Bool bAutoStyles )
-{
- Reference < XPropertySet > xPropSet( rTextRange, UNO_QUERY );
- // non-Writer apps need not support Property TextField, so test first
- if (xPropSet->getPropertySetInfo()->hasPropertyByName( sTextField ))
- {
- Any aAny = xPropSet->getPropertyValue( sTextField );
-
- Reference < XTextField > xTxtFld;
- aAny >>= xTxtFld;
- DBG_ASSERT( xTxtFld.is(), "text field missing" );
- if( xTxtFld.is() )
- {
- if( bAutoStyles )
- {
- pFieldExport->ExportFieldAutoStyle( xTxtFld );
- }
- else
- {
- pFieldExport->ExportField( xTxtFld );
- }
- }
- else
- {
- // write only characters
- GetExport().Characters(rTextRange->getString());
- }
-
- }
-}
-
-void XMLTextParagraphExport::exportTextMark(
- const Reference<XPropertySet> & rPropSet,
- const OUString sProperty,
- const enum XMLTokenEnum pElements[],
- sal_Bool bAutoStyles)
-{
- // mib said: "Hau wech!"
- //
- // (Originally, I'd export a span element in case the (book|reference)mark
- // was formatted. This actually makes a difference in case some pervert
- // sets a point reference mark in the document and, say, formats it bold.
- // This basically meaningless formatting will now been thrown away
- // (aka cleaned up), since mib said: ... dvo
-
- if (!bAutoStyles)
- {
- // get reference (as text content)
- Any aAny;
- aAny = rPropSet->getPropertyValue(sProperty);
- Reference<XTextContent> xRefMark;
- aAny >>= xRefMark;
-
- // name element
- Reference<XNamed> xName(xRefMark, UNO_QUERY);
- GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME,
- xName->getName());
-
- // start, end, or point-reference?
- sal_Int8 nElement;
- aAny = rPropSet->getPropertyValue(sIsCollapsed);
- if( *(sal_Bool *)aAny.getValue() )
- {
- nElement = 0;
- }
- else
- {
- aAny = rPropSet->getPropertyValue(sIsStart);
- nElement = *(sal_Bool *)aAny.getValue() ? 1 : 2;
- }
-
- // export element
- DBG_ASSERT(pElements != NULL, "illegal element array");
- DBG_ASSERT(nElement >= 0, "illegal element number");
- DBG_ASSERT(nElement <= 2, "illegal element number");
- SvXMLElementExport aElem(GetExport(),
- XML_NAMESPACE_TEXT, pElements[nElement],
- sal_False, sal_False);
- }
- // else: no styles. (see above)
-}
-
-sal_Bool lcl_txtpara_isBoundAsChar(
- const Reference < XPropertySet > & rPropSet,
- const Reference < XPropertySetInfo > & rPropSetInfo )
-{
- sal_Bool bIsBoundAsChar = sal_False;
- OUString sAnchorType( RTL_CONSTASCII_USTRINGPARAM( "AnchorType" ) );
- if( rPropSetInfo->hasPropertyByName( sAnchorType ) )
- {
- Any aAny =
- rPropSet->getPropertyValue( sAnchorType );
- TextContentAnchorType eAnchor;
- aAny >>= eAnchor;
- bIsBoundAsChar = TextContentAnchorType_AS_CHARACTER == eAnchor;
- }
-
- return bIsBoundAsChar;
-}
-
-sal_Int32 XMLTextParagraphExport::addTextFrameAttributes(
- const Reference < XPropertySet >& rPropSet,
- sal_Bool bShape )
-{
- sal_Int32 nShapeFeatures = SEF_DEFAULT;
-
- // draw:name (#97662#: not for shapes, since those names will be
- // treated in the shape export)
- if( !bShape )
- {
- Reference < XNamed > xNamed( rPropSet, UNO_QUERY );
- if( xNamed.is() )
- {
- OUString sName( xNamed->getName() );
- if( sName.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_NAME,
- xNamed->getName() );
- }
- }
-
- Any aAny;
- OUStringBuffer sValue;
-
- // text:anchor-type
- aAny = rPropSet->getPropertyValue( sAnchorType );
- TextContentAnchorType eAnchor = TextContentAnchorType_AT_PARAGRAPH;
- aAny >>= eAnchor;
- {
- XMLAnchorTypePropHdl aAnchorTypeHdl;
- OUString sTmp;
- aAnchorTypeHdl.exportXML( sTmp, aAny,
- GetExport().GetMM100UnitConverter() );
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_ANCHOR_TYPE, sTmp );
- }
-
- // text:anchor-page-number
- if( TextContentAnchorType_AT_PAGE == eAnchor )
- {
- aAny = rPropSet->getPropertyValue( sAnchorPageNo );
- sal_Int16 nPage=0;
- aAny >>= nPage;
- GetExport().GetMM100UnitConverter().convertNumber( sValue,
- (sal_Int32)nPage );
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_ANCHOR_PAGE_NUMBER,
- sValue.makeStringAndClear() );
- }
- else
- {
- // #92210#
- nShapeFeatures |= SEF_EXPORT_NO_WS;
- }
-
- if( !bShape )
- {
- // svg:x
- sal_Int16 nHoriOrient = HoriOrientation::NONE;
- aAny = rPropSet->getPropertyValue( sHoriOrient );
- aAny >>= nHoriOrient;
- if( HoriOrientation::NONE == nHoriOrient )
- {
- sal_Int32 nPos = 0;
- Any aAny = rPropSet->getPropertyValue( sHoriOrientPosition );
- aAny >>= nPos;
- GetExport().GetMM100UnitConverter().convertMeasure( sValue, nPos );
- GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_X,
- sValue.makeStringAndClear() );
- }
- }
- else if( TextContentAnchorType_AS_CHARACTER == eAnchor )
- nShapeFeatures = (nShapeFeatures & ~SEF_EXPORT_X);
-
- if( !bShape || TextContentAnchorType_AS_CHARACTER == eAnchor )
- {
- // svg:y
- sal_Int16 nVertOrient = VertOrientation::NONE;
- aAny = rPropSet->getPropertyValue( sVertOrient );
- aAny >>= nVertOrient;
- if( VertOrientation::NONE == nVertOrient )
- {
- sal_Int32 nPos = 0;
- Any aAny = rPropSet->getPropertyValue( sVertOrientPosition );
- aAny >>= nPos;
- GetExport().GetMM100UnitConverter().convertMeasure( sValue, nPos );
- GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_Y,
- sValue.makeStringAndClear() );
- }
- if( bShape )
- nShapeFeatures = (nShapeFeatures & ~SEF_EXPORT_Y);
- }
-
-
- Reference< XPropertySetInfo > xPropSetInfo = rPropSet->getPropertySetInfo();
-
- // svg:width
- if( xPropSetInfo->hasPropertyByName( sWidth ) )
- {
- sal_Int32 nWidth = 0;
- aAny = rPropSet->getPropertyValue( sWidth );
- aAny >>= nWidth;
- GetExport().GetMM100UnitConverter().convertMeasure( sValue, nWidth );
- GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_WIDTH,
- sValue.makeStringAndClear() );
- }
- sal_Bool bSyncWidth = sal_False;
- if( xPropSetInfo->hasPropertyByName( sIsSyncWidthToHeight ) )
- {
- aAny = rPropSet->getPropertyValue( sIsSyncWidthToHeight );
- bSyncWidth = *(sal_Bool *)aAny.getValue();
- if( bSyncWidth )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REL_WIDTH,
- XML_SCALE );
- }
- if( !bSyncWidth && xPropSetInfo->hasPropertyByName( sRelativeWidth ) )
- {
- sal_Int16 nRelWidth = 0;
- aAny = rPropSet->getPropertyValue( sRelativeWidth );
- aAny >>= nRelWidth;
- DBG_ASSERT( nRelWidth >= 0 && nRelWidth <= 254,
- "Got illegal relative width from API" );
- if( nRelWidth > 0 )
- {
- GetExport().GetMM100UnitConverter().convertPercent( sValue,
- nRelWidth );
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REL_WIDTH,
- sValue.makeStringAndClear() );
- }
- }
-
- // svg:height, fo:min-height or style:rel-height
- sal_Int16 nSizeType = SizeType::FIX;
- if( xPropSetInfo->hasPropertyByName( sSizeType ) )
- {
- aAny = rPropSet->getPropertyValue( sSizeType );
- aAny >>= nSizeType;
- }
- sal_Bool bSyncHeight = sal_False;
- if( xPropSetInfo->hasPropertyByName( sIsSyncHeightToWidth ) )
- {
- aAny = rPropSet->getPropertyValue( sIsSyncHeightToWidth );
- bSyncHeight = *(sal_Bool *)aAny.getValue();
- }
- sal_Int16 nRelHeight = 0;
- if( !bSyncHeight && xPropSetInfo->hasPropertyByName( sRelativeHeight ) )
- {
- aAny = rPropSet->getPropertyValue( sRelativeHeight );
- aAny >>= nRelHeight;
- }
- if( xPropSetInfo->hasPropertyByName( sHeight ) )
- {
- sal_Int32 nHeight = 0;
- aAny = rPropSet->getPropertyValue( sHeight );
- aAny >>= nHeight;
- GetExport().GetMM100UnitConverter().convertMeasure( sValue,
- nHeight );
- if( SizeType::FIX != nSizeType && 0==nRelHeight && !bSyncHeight )
- GetExport().AddAttribute( XML_NAMESPACE_FO, XML_MIN_HEIGHT,
- sValue.makeStringAndClear() );
- else
- GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT,
- sValue.makeStringAndClear() );
- }
- if( bSyncHeight )
- {
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REL_HEIGHT,
- SizeType::MIN == nSizeType ? XML_SCALE_MIN : XML_SCALE );
-
- }
- else if( nRelHeight > 0 )
- {
- GetExport().GetMM100UnitConverter().convertPercent( sValue,
- nRelHeight );
- if( SizeType::MIN == nSizeType )
- GetExport().AddAttribute( XML_NAMESPACE_FO, XML_MIN_HEIGHT,
- sValue.makeStringAndClear() );
- else
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REL_HEIGHT,
- sValue.makeStringAndClear() );
- }
-
- OUString sZOrder( RTL_CONSTASCII_USTRINGPARAM( "ZOrder" ) );
- if( xPropSetInfo->hasPropertyByName( sZOrder ) )
- {
- sal_Int32 nZIndex = 0;
- aAny = rPropSet->getPropertyValue( sZOrder );
- aAny >>= nZIndex;
- if( -1 != nZIndex )
- {
- GetExport().GetMM100UnitConverter().convertNumber( sValue,
- nZIndex );
- GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_ZINDEX,
- sValue.makeStringAndClear() );
- }
- }
-
- return nShapeFeatures;
-}
-
-void XMLTextParagraphExport::exportAnyTextFrame(
- const Reference < XTextContent > & rTxtCntnt,
- FrameType eType,
- sal_Bool bAutoStyles,
- sal_Bool bProgress,
- const Reference < XPropertySet > *pRangePropSet)
-{
- Reference < XPropertySet > xPropSet( rTxtCntnt, UNO_QUERY );
-
- if( bAutoStyles )
- {
- if( FT_EMBEDDED == eType )
- _collectTextEmbeddedAutoStyles( xPropSet );
- else
- Add( XML_STYLE_FAMILY_TEXT_FRAME, xPropSet );
-
- if( pRangePropSet && lcl_txtpara_isBoundAsChar( xPropSet,
- xPropSet->getPropertySetInfo() ) )
- Add( XML_STYLE_FAMILY_TEXT_TEXT, *pRangePropSet );
-
- switch( eType )
- {
- case FT_TEXT:
- {
- // frame bound frames
- Reference < XTextFrame > xTxtFrame( rTxtCntnt, UNO_QUERY );
- Reference < XText > xTxt = xTxtFrame->getText();
- collectFramesBoundToFrameAutoStyles( xTxtFrame, bProgress );
-
- exportText( xTxt, bAutoStyles, bProgress, sal_True );
- }
- break;
- case FT_SHAPE:
- {
- Reference < XShape > xShape( rTxtCntnt, UNO_QUERY );
- GetExport().GetShapeExport()->collectShapeAutoStyles( xShape );
- }
- break;
- }
- }
- else
- {
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
- Reference< XPropertyState > xPropState( xPropSet, UNO_QUERY );
- {
- sal_Bool bAddCharStyles = pRangePropSet &&
- lcl_txtpara_isBoundAsChar( xPropSet, xPropSetInfo );
- sal_Bool bIsUICharStyle;
- OUString sStyle;
- if( bAddCharStyles )
- sStyle = FindTextStyle( *pRangePropSet, bIsUICharStyle );
- else
- bIsUICharStyle = sal_False;
-
- XMLTextCharStyleNamesElementExport aCharStylesExport(
- GetExport(), bIsUICharStyle &&
- aCharStyleNamesPropInfoCache.hasProperty(
- *pRangePropSet ),
- *pRangePropSet, sCharStyleNames );
-
- if( sStyle.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME,
- sStyle );
- {
- SvXMLElementExport aElem( GetExport(), sStyle.getLength() > 0,
- XML_NAMESPACE_TEXT, XML_SPAN, sal_False, sal_False );
- {
- SvXMLElementExport aElem( GetExport(),
- FT_SHAPE != eType &&
- addHyperlinkAttributes( xPropSet,
- xPropState,xPropSetInfo ),
- XML_NAMESPACE_DRAW, XML_A, sal_False, sal_False );
- switch( eType )
- {
- case FT_TEXT:
- _exportTextFrame( xPropSet, xPropSetInfo, bProgress );
- break;
- case FT_GRAPHIC:
- _exportTextGraphic( xPropSet, xPropSetInfo );
- break;
- case FT_EMBEDDED:
- _exportTextEmbedded( xPropSet, xPropSetInfo );
- break;
- case FT_SHAPE:
- {
- Reference < XShape > xShape( rTxtCntnt, UNO_QUERY );
- sal_Int32 nFeatures =
- addTextFrameAttributes( xPropSet, sal_True );
- GetExport().GetShapeExport()
- ->exportShape( xShape, nFeatures );
- }
- break;
- }
- }
- }
- }
- }
-}
-
-void XMLTextParagraphExport::_exportTextFrame(
- const Reference < XPropertySet > & rPropSet,
- const Reference < XPropertySetInfo > & rPropSetInfo,
- sal_Bool bProgress )
-{
- Reference < XTextFrame > xTxtFrame( rPropSet, UNO_QUERY );
- Reference < XText > xTxt = xTxtFrame->getText();
-
- OUString sStyle;
- Any aAny;
- if( rPropSetInfo->hasPropertyByName( sFrameStyleName ) )
- {
- aAny = rPropSet->getPropertyValue( sFrameStyleName );
- aAny >>= sStyle;
- }
-
- OUString sAutoStyle( sStyle );
- sAutoStyle = Find( XML_STYLE_FAMILY_TEXT_FRAME, rPropSet, sStyle );
- if( sAutoStyle.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE_NAME,
- sAutoStyle );
- addTextFrameAttributes( rPropSet, sal_False );
-
- // draw:chain-next-name
- if( rPropSetInfo->hasPropertyByName( sChainNextName ) )
- {
- OUString sNext;
- aAny = rPropSet->getPropertyValue( sChainNextName );
- if( (aAny >>= sNext) && sNext.getLength() > 0 )
- GetExport().AddAttribute( XML_NAMESPACE_DRAW,
- XML_CHAIN_NEXT_NAME,
- sNext );
- }
-
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_DRAW,
- XML_TEXT_BOX, sal_False, sal_True );
-
- // frame bound frames
- exportFramesBoundToFrame( xTxtFrame, bProgress );
-
- // script:events
- Reference<XEventsSupplier> xEventsSupp( xTxtFrame, UNO_QUERY );
- GetExport().GetEventExport().Export(xEventsSupp);
-
- // image map
- GetExport().GetImageMapExport().Export( rPropSet );
-
- exportText( xTxt, sal_False, bProgress, sal_True );
-}
-
-void XMLTextParagraphExport::exportContour(
- const Reference < XPropertySet > & rPropSet,
- const Reference < XPropertySetInfo > & rPropSetInfo )
-{
- if( !rPropSetInfo->hasPropertyByName( sContourPolyPolygon ) )
- return;
-
- Any aAny = rPropSet->getPropertyValue( sContourPolyPolygon );
-
- PointSequenceSequence aSourcePolyPolygon;
- aAny >>= aSourcePolyPolygon;
-
- if( !aSourcePolyPolygon.getLength() )
- return;
-
- awt::Point aPoint( 0, 0 );
- awt::Size aSize( 0, 0 );
- sal_Int32 nPolygons = aSourcePolyPolygon.getLength();
- const PointSequence *pPolygons = aSourcePolyPolygon.getConstArray();
- while( nPolygons-- )
- {
- sal_Int32 nPoints = pPolygons->getLength();
- const awt::Point *pPoints = pPolygons->getConstArray();
- while( nPoints-- )
- {
- if( aSize.Width < pPoints->X )
- aSize.Width = pPoints->X;
- if( aSize.Height < pPoints->Y )
- aSize.Height = pPoints->Y;
- pPoints++;
- }
- pPolygons++;
- }
-
- sal_Bool bPixel = sal_False;
- if( rPropSetInfo->hasPropertyByName( sIsPixelContour ) )
- {
- aAny = rPropSet->getPropertyValue( sIsPixelContour );
- bPixel = *(sal_Bool *)aAny.getValue();
- }
-
- // svg: width
- OUStringBuffer aStringBuffer( 10 );
- if( bPixel )
- GetExport().GetMM100UnitConverter().convertMeasurePx(aStringBuffer, aSize.Width);
- else
- GetExport().GetMM100UnitConverter().convertMeasure(aStringBuffer, aSize.Width);
- GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_WIDTH,
- aStringBuffer.makeStringAndClear() );
-
- // svg: height
- if( bPixel )
- GetExport().GetMM100UnitConverter().convertMeasurePx(aStringBuffer, aSize.Height);
- else
- GetExport().GetMM100UnitConverter().convertMeasure(aStringBuffer, aSize.Height);
- GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT,
- aStringBuffer.makeStringAndClear() );
-
- // svg:viewbox
- SdXMLImExViewBox aViewBox(0, 0, aSize.Width, aSize.Height);
- GetExport().AddAttribute(XML_NAMESPACE_SVG, XML_VIEWBOX,
- aViewBox.GetExportString(GetExport().GetMM100UnitConverter()));
-
- sal_Int32 nOuterCnt( aSourcePolyPolygon.getLength() );
-
- enum XMLTokenEnum eElem = XML_TOKEN_INVALID;
- if( 1L == nOuterCnt )
- {
- // simple polygon shape, can be written as svg:points sequence
- /*const*/ PointSequence* pSequence =
- (PointSequence*)aSourcePolyPolygon.getConstArray();
-
- SdXMLImExPointsElement aPoints( pSequence, aViewBox, aPoint,
- aSize, GetExport().GetMM100UnitConverter() );
-
- // write point array
- GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_POINTS,
- aPoints.GetExportString());
- eElem = XML_CONTOUR_POLYGON;
- }
- else
- {
- // polypolygon, needs to be written as a svg:path sequence
- /*const*/ PointSequence* pOuterSequence =
- (PointSequence*)aSourcePolyPolygon.getConstArray();
- if(pOuterSequence)
- {
- // prepare svx:d element export
- SdXMLImExSvgDElement aSvgDElement( aViewBox );
-
- for(sal_Int32 a(0L); a < nOuterCnt; a++)
- {
- /*const*/ PointSequence* pSequence = pOuterSequence++;
- if(pSequence)
- {
- aSvgDElement.AddPolygon(pSequence, 0L, aPoint,
- aSize, GetExport().GetMM100UnitConverter(),
- sal_True );
- }
- }
-
- // write point array
- GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_D,
- aSvgDElement.GetExportString());
- eElem = XML_CONTOUR_PATH;
- }
- }
-
- if( rPropSetInfo->hasPropertyByName( sIsAutomaticContour ) )
- {
- aAny = rPropSet->getPropertyValue( sIsAutomaticContour );
- if( *(sal_Bool *)aAny.getValue() )
- GetExport().AddAttribute( XML_NAMESPACE_DRAW,
- XML_RECREATE_ON_EDIT, XML_TRUE );
- }
-
- // write object now
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_DRAW, eElem,
- sal_True, sal_True );
-}
-
-void XMLTextParagraphExport::_exportTextGraphic(
- const Reference < XPropertySet > & rPropSet,
- const Reference < XPropertySetInfo > & rPropSetInfo )
-{
- OUString sStyle;
- Any aAny;
- if( rPropSetInfo->hasPropertyByName( sFrameStyleName ) )
- {
- aAny = rPropSet->getPropertyValue( sFrameStyleName );
- aAny >>= sStyle;
- }
-
- OUString sAutoStyle( sStyle );
- sAutoStyle = Find( XML_STYLE_FAMILY_TEXT_FRAME, rPropSet, sStyle );
- if( sAutoStyle.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE_NAME,
- sAutoStyle );
- addTextFrameAttributes( rPropSet, sal_False );
-
- // xlink:href
- OUString sOrigURL;
- aAny = rPropSet->getPropertyValue( sGraphicURL );
- aAny >>= sOrigURL;
- OUString sURL = GetExport().AddEmbeddedGraphicObject( sOrigURL );
- setTextEmbeddedGraphicURL( rPropSet, sURL );
-
- // If there still is no url, then then graphic is empty
- if( sURL.getLength() )
- {
- GetExport().AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, sURL );
- GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
- GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED );
- GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE,
- XML_ONLOAD );
- }
-
- // draw:filter-name
- OUString sGrfFilter;
- aAny = rPropSet->getPropertyValue( sGraphicFilter );
- aAny >>= sGrfFilter;
- if( sGrfFilter.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_FILTER_NAME,
- sGrfFilter );
-
- // svg:transform
- aAny = rPropSet->getPropertyValue( sGraphicRotation );
- sal_Int16 nVal;
- aAny >>= nVal;
- if( nVal != 0 )
- {
- OUStringBuffer sRet( GetXMLToken(XML_ROTATE).getLength()+4 );
- sRet.append( GetXMLToken(XML_ROTATE));
- sRet.append( (sal_Unicode)'(' );
- GetExport().GetMM100UnitConverter().convertNumber( sRet, (sal_Int32)nVal );
- sRet.append( (sal_Unicode)')' );
- GetExport().AddAttribute( XML_NAMESPACE_SVG, XML_TRANSFORM,
- sRet.makeStringAndClear() );
- }
-
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_DRAW,
- XML_IMAGE, sal_False, sal_True );
-
- // optional office:binary-data
- GetExport().AddEmbeddedGraphicObjectAsBase64( sOrigURL );
-
- // script:events
- Reference<XEventsSupplier> xEventsSupp( rPropSet, UNO_QUERY );
- GetExport().GetEventExport().Export(xEventsSupp);
-
- // svg:desc
- exportAlternativeText( rPropSet, rPropSetInfo );
- /*
- OUString sAltText;
- aAny = rPropSet->getPropertyValue( sAlternativeText );
- aAny >>= sAltText;
- if( sAltText.getLength() )
- {
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_SVG,
- XML_DESC, sal_True, sal_False );
- GetExport().Characters( sAltText );
- }
- */
-
- // image map
- GetExport().GetImageMapExport().Export( rPropSet );
-
- // draw:contour
- exportContour( rPropSet, rPropSetInfo );
-}
-
-void XMLTextParagraphExport::_collectTextEmbeddedAutoStyles(
- const Reference < XPropertySet > & rPropSet )
-{
- DBG_ASSERT( !this, "no API implementation avialable" );
-}
-
-void XMLTextParagraphExport::_exportTextEmbedded(
- const Reference < XPropertySet > & rPropSet,
- const Reference < XPropertySetInfo > & rPropSetInfo )
-{
- DBG_ASSERT( !this, "no API implementation avialable" );
-}
-
-void XMLTextParagraphExport::exportEvents( const Reference < XPropertySet > & rPropSet )
-{
- // script:events
- Reference<XEventsSupplier> xEventsSupp( rPropSet, UNO_QUERY );
- GetExport().GetEventExport().Export(xEventsSupp);
-
- // image map
- OUString sImageMap(RTL_CONSTASCII_USTRINGPARAM("ImageMap"));
- if (rPropSet->getPropertySetInfo()->hasPropertyByName(sImageMap))
- GetExport().GetImageMapExport().Export( rPropSet );
-}
-void XMLTextParagraphExport::exportAlternativeText(
- const Reference < XPropertySet > & rPropSet,
- const Reference < XPropertySetInfo > & rPropSetInfo )
-{
- // svg:desc
- if( rPropSetInfo->hasPropertyByName( sAlternativeText ) )
- {
- OUString sAltText;
- Any aAny = rPropSet->getPropertyValue( sAlternativeText );
- aAny >>= sAltText;
- if( sAltText.getLength() )
- {
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_SVG,
- XML_DESC, sal_True, sal_False );
- GetExport().Characters( sAltText );
- }
- }
-}
-
-void XMLTextParagraphExport::setTextEmbeddedGraphicURL(
- const Reference < XPropertySet >& rPropSet,
- OUString& rStreamName ) const
-{
-}
-
-sal_Bool XMLTextParagraphExport::addHyperlinkAttributes(
- const Reference < XPropertySet > & rPropSet,
- const Reference < XPropertyState > & rPropState,
- const Reference < XPropertySetInfo > & rPropSetInfo )
-{
- sal_Bool bExport = sal_False;
- Any aAny;
- OUString sHRef, sName, sTargetFrame, sUStyleName, sVStyleName;
- sal_Bool bServerMap = sal_False;
-
- if( rPropSetInfo->hasPropertyByName( sHyperLinkURL ) &&
- ( !rPropState.is() || PropertyState_DIRECT_VALUE ==
- rPropState->getPropertyState( sHyperLinkURL ) ) )
- {
- aAny= rPropSet->getPropertyValue( sHyperLinkURL );
- aAny >>= sHRef;
-
- if( sHRef.getLength() > 0 )
- bExport = sal_True;
- }
-
- if( rPropSetInfo->hasPropertyByName( sHyperLinkName ) &&
- ( !rPropState.is() || PropertyState_DIRECT_VALUE ==
- rPropState->getPropertyState( sHyperLinkName ) ) )
- {
- aAny = rPropSet->getPropertyValue( sHyperLinkName );
- aAny >>= sName;
- if( sName.getLength() > 0 )
- bExport = sal_True;
- }
-
- if( rPropSetInfo->hasPropertyByName( sHyperLinkTarget ) &&
- ( !rPropState.is() || PropertyState_DIRECT_VALUE ==
- rPropState->getPropertyState( sHyperLinkTarget ) ) )
- {
- aAny = rPropSet->getPropertyValue( sHyperLinkTarget );
- aAny >>= sTargetFrame;
- if( sTargetFrame.getLength() )
- bExport = sal_True;
- }
-
- if( rPropSetInfo->hasPropertyByName( sServerMap ) &&
- ( !rPropState.is() || PropertyState_DIRECT_VALUE ==
- rPropState->getPropertyState( sServerMap ) ) )
- {
- aAny = rPropSet->getPropertyValue( sServerMap );
- bServerMap = *(sal_Bool *)aAny.getValue();
- if( bServerMap )
- bExport = sal_True;
- }
-
- if( rPropSetInfo->hasPropertyByName( sUnvisitedCharStyleName ) &&
- ( !rPropState.is() || PropertyState_DIRECT_VALUE ==
- rPropState->getPropertyState( sUnvisitedCharStyleName ) ) )
- {
- aAny = rPropSet->getPropertyValue( sUnvisitedCharStyleName );
- aAny >>= sUStyleName;
- if( sUStyleName.getLength() )
- bExport = sal_True;
- }
-
- if( rPropSetInfo->hasPropertyByName( sVisitedCharStyleName ) &&
- ( !rPropState.is() || PropertyState_DIRECT_VALUE ==
- rPropState->getPropertyState( sVisitedCharStyleName ) ) )
- {
- aAny = rPropSet->getPropertyValue( sVisitedCharStyleName );
- aAny >>= sVStyleName;
- if( sVStyleName.getLength() )
- bExport = sal_True;
- }
-
- if( bExport )
- {
- GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
- GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference( sHRef ) );
-
- if( sName.getLength() > 0 )
- GetExport().AddAttribute( XML_NAMESPACE_OFFICE, XML_NAME, sName );
-
- if( sTargetFrame.getLength() )
- {
- GetExport().AddAttribute( XML_NAMESPACE_OFFICE,
- XML_TARGET_FRAME_NAME, sTargetFrame );
- enum XMLTokenEnum eTok =
- sTargetFrame.equalsAsciiL( "_blank", sizeof("_blank")-1 )
- ? XML_NEW : XML_REPLACE;
- GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, eTok );
- }
-
- if( bServerMap )
- GetExport().AddAttribute( XML_NAMESPACE_OFFICE,
- XML_SERVER_MAP, XML_TRUE );
-
- if( sUStyleName.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_TEXT,
- XML_STYLE_NAME, sUStyleName );
-
- if( sVStyleName.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_TEXT,
- XML_VISITED_STYLE_NAME, sVStyleName );
- }
-
- return bExport;
-}
-
-void XMLTextParagraphExport::exportTextRange(
- const Reference < XTextRange > & rTextRange,
- sal_Bool bAutoStyles,
- sal_Bool& rPrevCharIsSpace )
-{
- Reference < XPropertySet > xPropSet( rTextRange, UNO_QUERY );
- if( bAutoStyles )
- {
- Add( XML_STYLE_FAMILY_TEXT_TEXT, xPropSet );
- }
- else
- {
- sal_Bool bHyperlink = sal_False, bIsUICharStyle = sal_False;
- OUString sStyle = FindTextStyleAndHyperlink( xPropSet, bHyperlink,
- bIsUICharStyle );
- Reference < XPropertySetInfo > xPropSetInfo;
- if( bHyperlink )
- {
- Reference< XPropertyState > xPropState( xPropSet, UNO_QUERY );
- xPropSetInfo = xPropSet->getPropertySetInfo();
- bHyperlink = addHyperlinkAttributes( xPropSet, xPropState, xPropSetInfo );
- }
- SvXMLElementExport aElem( GetExport(), bHyperlink, XML_NAMESPACE_TEXT,
- XML_A, sal_False, sal_False );
- if( bHyperlink )
- {
- // export events (if supported)
- OUString sHyperLinkEvents(RTL_CONSTASCII_USTRINGPARAM(
- "HyperLinkEvents"));
- if (xPropSetInfo->hasPropertyByName(sHyperLinkEvents))
- {
- Any aAny = xPropSet->getPropertyValue(sHyperLinkEvents);
- Reference<XNameReplace> xName;
- aAny >>= xName;
- GetExport().GetEventExport().Export(xName, sal_False);
- }
- }
-
- {
- XMLTextCharStyleNamesElementExport aCharStylesExport(
- GetExport(), bIsUICharStyle &&
- aCharStyleNamesPropInfoCache.hasProperty(
- xPropSet, xPropSetInfo ),
- xPropSet, sCharStyleNames );
-
- OUString sText = rTextRange->getString();
- if( sStyle.getLength() )
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME,
- sStyle );
- {
- // in a block to make sure it is destroyed before the text:a element
- SvXMLElementExport aElem( GetExport(), sStyle.getLength() > 0,
- XML_NAMESPACE_TEXT, XML_SPAN, sal_False,
- sal_False );
- exportText( sText, rPrevCharIsSpace );
- }
- }
- }
-}
-
-void XMLTextParagraphExport::exportText( const OUString& rText,
- sal_Bool& rPrevCharIsSpace )
-{
- sal_Int32 nExpStartPos = 0L;
- sal_Int32 nEndPos = rText.getLength();
- sal_Int32 nSpaceChars = 0;
- for( sal_Int32 nPos = 0; nPos < nEndPos; nPos++ )
- {
- sal_Unicode cChar = rText[nPos];
- sal_Bool bExpCharAsText = sal_True;
- sal_Bool bExpCharAsElement = sal_False;
- sal_Bool bCurrCharIsSpace = sal_False;
- switch( cChar )
- {
- case 0x0009: // Tab
- case 0x000A: // LF
- // These characters are exported as text.
- bExpCharAsElement = sal_True;
- bExpCharAsText = sal_False;
- break;
- case 0x000D:
- break; // legal character
- case 0x0020: // Blank
- if( rPrevCharIsSpace )
- {
- // If the previous character is a space character,
- // too, export a special space element.
- bExpCharAsText = sal_False;
- }
- bCurrCharIsSpace = sal_True;
- break;
- default:
- if( cChar < 0x0020 )
- {
-#ifdef DBG_UTIL
- OSL_ENSURE( txtparae_bContainsIllegalCharacters ||
- cChar >= 0x0020,
- "illegal character in text content" );
- txtparae_bContainsIllegalCharacters = sal_True;
-#endif
- bExpCharAsText = sal_False;
- }
- break;
- }
-
- // If the current character is not exported as text
- // the text that has not been exported by now has to be exported now.
- if( nPos > nExpStartPos && !bExpCharAsText )
- {
- DBG_ASSERT( 0==nSpaceChars, "pending spaces" );
- OUString sExp( rText.copy( nExpStartPos, nPos - nExpStartPos ) );
- GetExport().Characters( sExp );
- nExpStartPos = nPos;
- }
-
- // If there are spaces left that have not been exported and the
- // current chracter is not a space , the pending spaces have to be
- // exported now.
- if( nSpaceChars > 0 && !bCurrCharIsSpace )
- {
- DBG_ASSERT( nExpStartPos == nPos, " pending characters" );
-
- if( nSpaceChars > 1 )
- {
- OUStringBuffer sTmp;
- sTmp.append( (sal_Int32)nSpaceChars );
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_C,
- sTmp.makeStringAndClear() );
- }
-
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT,
- XML_S, sal_False, sal_False );
-
- nSpaceChars = 0;
- }
-
- // If the current character has to be exported as a special
- // element, the elemnt will be exported now.
- if( bExpCharAsElement )
- {
- switch( cChar )
- {
- case 0x0009: // Tab
- {
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT,
- XML_TAB_STOP, sal_False,
- sal_False );
- }
- break;
- case 0x000A: // LF
- {
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT,
- XML_LINE_BREAK, sal_False,
- sal_False );
- }
- break;
- }
- }
-
- // If the current character is a space, and the previous one
- // is a space, too, the number of pending spaces is incremented
- // only.
- if( bCurrCharIsSpace && rPrevCharIsSpace )
- nSpaceChars++;
- rPrevCharIsSpace = bCurrCharIsSpace;
-
- // If the currect character is not exported as text, the start
- // position for text is the position behind the current position.
- if( !bExpCharAsText )
- {
- DBG_ASSERT( nExpStartPos == nPos, "wrong export start pos" );
- nExpStartPos = nPos+1;
- }
- }
-
- if( nExpStartPos < nEndPos )
- {
- DBG_ASSERT( 0==nSpaceChars, " pending spaces " );
- OUString sExp( rText.copy( nExpStartPos, nEndPos - nExpStartPos ) );
- GetExport().Characters( sExp );
- }
-
- // If there are some spaces left, they have to be exported now.
- if( nSpaceChars > 0 )
- {
- if( nSpaceChars > 1 )
- {
- OUStringBuffer sTmp;
- sTmp.append( (sal_Int32)nSpaceChars );
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_C,
- sTmp.makeStringAndClear() );
- }
-
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, XML_S,
- sal_False, sal_False );
- }
-}
-
-void XMLTextParagraphExport::exportTextDeclarations()
-{
- pFieldExport->ExportFieldDeclarations();
-
- // get XPropertySet from the document and ask for AutoMarkFileURL.
- // If it exists, export the auto-mark-file element.
- Reference<XPropertySet> xPropertySet( GetExport().GetModel(), UNO_QUERY );
- if (xPropertySet.is())
- {
- OUString sUrl;
- OUString sIndexAutoMarkFileURL(
- RTL_CONSTASCII_USTRINGPARAM("IndexAutoMarkFileURL"));
- if (xPropertySet->getPropertySetInfo()->hasPropertyByName(
- sIndexAutoMarkFileURL))
- {
- Any aAny = xPropertySet->getPropertyValue(sIndexAutoMarkFileURL);
- aAny >>= sUrl;
- if (sUrl.getLength() > 0)
- {
- GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_HREF,
- GetExport().GetRelativeReference(sUrl) );
- SvXMLElementExport aAutoMarkElement(
- GetExport(), XML_NAMESPACE_TEXT,
- XML_ALPHABETICAL_INDEX_AUTO_MARK_FILE,
- sal_True, sal_True );
- }
- }
- }
-}
-
-void XMLTextParagraphExport::exportTextDeclarations(
- const Reference<XText> & rText )
-{
- pFieldExport->ExportFieldDeclarations(rText);
-}
-
-void XMLTextParagraphExport::exportUsedDeclarations( sal_Bool bOnlyUsed )
-{
- pFieldExport->SetExportOnlyUsedFieldDeclarations( bOnlyUsed );
-}
-
-
-void XMLTextParagraphExport::exportTrackedChanges(sal_Bool bAutoStyles)
-{
- if (NULL != pRedlineExport)
- pRedlineExport->ExportChangesList( bAutoStyles );
-}
-
-void XMLTextParagraphExport::exportTrackedChanges(
- const Reference<XText> & rText,
- sal_Bool bAutoStyle)
-{
- if (NULL != pRedlineExport)
- pRedlineExport->ExportChangesList(rText, bAutoStyle);
-}
-
-void XMLTextParagraphExport::recordTrackedChangesForXText(
- const Reference<XText> & rText )
-{
- if (NULL != pRedlineExport)
- pRedlineExport->SetCurrentXText(rText);
-}
-
-void XMLTextParagraphExport::recordTrackedChangesNoXText()
-{
- if (NULL != pRedlineExport)
- pRedlineExport->SetCurrentXText();
-}
-
-
-void XMLTextParagraphExport::exportTextAutoStyles()
-{
- GetAutoStylePool().exportXML( XML_STYLE_FAMILY_TEXT_PARAGRAPH,
- GetExport().GetDocHandler(),
- GetExport().GetMM100UnitConverter(),
- GetExport().GetNamespaceMap() );
-
- GetAutoStylePool().exportXML( XML_STYLE_FAMILY_TEXT_TEXT,
- GetExport().GetDocHandler(),
- GetExport().GetMM100UnitConverter(),
- GetExport().GetNamespaceMap() );
-
- GetAutoStylePool().exportXML( XML_STYLE_FAMILY_TEXT_FRAME,
- GetExport().GetDocHandler(),
- GetExport().GetMM100UnitConverter(),
- GetExport().GetNamespaceMap() );
-
- GetAutoStylePool().exportXML( XML_STYLE_FAMILY_TEXT_SECTION,
- GetExport().GetDocHandler(),
- GetExport().GetMM100UnitConverter(),
- GetExport().GetNamespaceMap() );
-
- GetAutoStylePool().exportXML( XML_STYLE_FAMILY_TEXT_RUBY,
- GetExport().GetDocHandler(),
- GetExport().GetMM100UnitConverter(),
- GetExport().GetNamespaceMap() );
-
- pListAutoPool->exportXML();
-}
-
-void XMLTextParagraphExport::exportRuby(
- const Reference<XPropertySet> & rPropSet,
- sal_Bool bAutoStyles )
-{
- // early out: a collapsed ruby makes no sense
- Any aAny = rPropSet->getPropertyValue(sIsCollapsed);
- if (*(sal_Bool*)aAny.getValue())
- return;
-
- // start value ?
- aAny = rPropSet->getPropertyValue(sIsStart);
- sal_Bool bStart = (*(sal_Bool*)aAny.getValue());
-
- if (bAutoStyles)
- {
- // ruby auto styles
- if (bStart)
- Add( XML_STYLE_FAMILY_TEXT_RUBY, rPropSet );
- }
- else
- {
- // prepare element names
- OUString sRuby(GetXMLToken(XML_RUBY));
- OUString sTextRuby(GetExport().GetNamespaceMap().
- GetQNameByKey(XML_NAMESPACE_TEXT, sRuby));
- OUString sRubyBase(GetXMLToken(XML_RUBY_BASE));
- OUString sTextRubyBase(GetExport().GetNamespaceMap().
- GetQNameByKey(XML_NAMESPACE_TEXT, sRubyBase));
-
- if (bStart)
- {
- // ruby start
-
- // we can only start a ruby if none is open
- DBG_ASSERT(! bOpenRuby, "Can't open a ruby inside of ruby!");
- if( bOpenRuby )
- return;
-
- // save ruby text + ruby char style
- aAny = rPropSet->getPropertyValue(sRubyText);
- aAny >>= sOpenRubyText;
- aAny = rPropSet->getPropertyValue(sRubyCharStyleName);
- aAny >>= sOpenRubyCharStyle;
-
- // ruby style
- GetExport().CheckAttrList();
- OUString sEmpty;
- OUString sStyleName = Find( XML_STYLE_FAMILY_TEXT_RUBY, rPropSet,
- sEmpty );
- DBG_ASSERT(sStyleName.getLength() > 0, "I can't find the style!");
- GetExport().AddAttribute(XML_NAMESPACE_TEXT,
- XML_STYLE_NAME, sStyleName);
-
- // export <text:ruby> and <text:ruby-base> start elements
- GetExport().StartElement( XML_NAMESPACE_TEXT, XML_RUBY, sal_False);
- GetExport().ClearAttrList();
- GetExport().StartElement( XML_NAMESPACE_TEXT, XML_RUBY_BASE,
- sal_False );
- bOpenRuby = sal_True;
- }
- else
- {
- // ruby end
-
- // check for an open ruby
- DBG_ASSERT(bOpenRuby, "Can't close a ruby if none is open!");
- if( !bOpenRuby )
- return;
-
- // close <text:ruby-base>
- GetExport().EndElement(XML_NAMESPACE_TEXT, XML_RUBY_BASE,
- sal_False);
-
- // write the ruby text (with char style)
- {
- if (sOpenRubyCharStyle.getLength() > 0)
- GetExport().AddAttribute(
- XML_NAMESPACE_TEXT, XML_STYLE_NAME,
- sOpenRubyCharStyle);
-
- SvXMLElementExport aRuby(
- GetExport(), XML_NAMESPACE_TEXT, XML_RUBY_TEXT,
- sal_False, sal_False);
-
- GetExport().Characters(sOpenRubyText);
- }
-
- // and finally, close the ruby
- GetExport().EndElement(XML_NAMESPACE_TEXT, XML_RUBY, sal_False);
- bOpenRuby = sal_False;
- }
- }
-}
-
-
-
-
-void XMLTextParagraphExport::PreventExportOfControlsInMuteSections(
- const Reference<XIndexAccess> & rShapes,
- UniReference<xmloff::OFormLayerXMLExport> xFormExport )
-{
- // check parameters ad pre-conditions
- if( ( ! rShapes.is() ) || ( ! xFormExport.is() ) )
- {
- // if we don't have shapes or a form export, there's nothing to do
- return;
- }
- DBG_ASSERT( pSectionExport != NULL, "We need the section export." );
-
- sal_Int32 nShapes = xShapes->getCount();
- for( sal_Int32 i = 0; i < nShapes; i++ )
- {
- // now we need to check
- // 1) if this is a control shape, and
- // 2) if it's in a mute section
- // if both answers are 'yes', notify the form layer export
-
- // we join accessing the shape and testing for control
- Reference<XControlShape> xControlShape;
- xShapes->getByIndex( i ) >>= xControlShape;
- if( xControlShape.is() )
- {
- // Reference<XPropertySet> xPropSet( xControlShape, UNO_QUERY );
- // Reference<XTextContent> xTextContent;
- // xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TextRange" ) ) ) >>= xTextContent;
-
- Reference<XTextContent> xTextContent( xControlShape, UNO_QUERY );
- if( xTextContent.is() )
- {
- if( pSectionExport->IsMuteSection( xTextContent, sal_False ) )
- {
- // Ah, we've found a shape that
- // 1) is a control shape
- // 2) is anchored in a mute section
- // so: don't export it!
- xFormExport->excludeFromExport(
- xControlShape->getControl() );
- }
- // else: not in mute section -> should be exported -> nothing
- // to do
- }
- // else: no anchor -> ignore
- }
- // else: no control shape -> nothing to do
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_txtparai.cxx b/binfilter/bf_xmloff/source/text/xmloff_txtparai.cxx
deleted file mode 100644
index 3c68b073d8cb..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_txtparai.cxx
+++ /dev/null
@@ -1,2006 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-
-
-#include <bf_svtools/svarray.hxx>
-
-#include <com/sun/star/text/ControlCharacter.hpp>
-#include <com/sun/star/container/XIndexReplace.hpp>
-
-
-#include "xmlimp.hxx"
-#include "nmspmap.hxx"
-#include "xmlnmspe.hxx"
-#include "txtparai.hxx"
-#include "txtfldi.hxx"
-#include "xmluconv.hxx"
-#include "XMLFootnoteImportContext.hxx"
-#include "XMLTextMarkImportContext.hxx"
-#include "XMLTextFrameContext.hxx"
-#include "XMLTextFrameHyperlinkContext.hxx"
-#include "XMLEventsImportContext.hxx"
-#include "XMLChangeImportContext.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::drawing;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-
-// ---------------------------------------------------------------------
-
-#define XML_HINT_STYLE 1
-#define XML_HINT_REFERENCE 2
-#define XML_HINT_HYPERLINK 3
-#define XML_HINT_RUBY 4
-#define XML_HINT_INDEX_MARK 5
-#define XML_HINT_TEXT_FRAME 6
-
-
-class XMLHint_Impl
-{
- Reference < XTextRange > xStart;
- Reference < XTextRange > xEnd;
-
- sal_uInt8 nType;
-
-public:
-
- XMLHint_Impl( sal_uInt8 nTyp,
- const Reference < XTextRange > & rS,
- const Reference < XTextRange > & rE ) :
- nType( nTyp ),
- xStart( rS ),
- xEnd( rE )
- {
- }
-
- XMLHint_Impl( sal_uInt8 nTyp,
- const Reference < XTextRange > & rS ) :
- nType( nTyp ),
- xStart( rS )
- {
- }
-
- virtual ~XMLHint_Impl() {}
-
- const Reference < XTextRange > & GetStart() const { return xStart; }
- const Reference < XTextRange > & GetEnd() const { return xEnd; }
- void SetEnd( const Reference < XTextRange > & rPos ) { xEnd = rPos; }
-
- // We don't use virtual methods to differ between the sub classes,
- // because this seems to be to expensive if compared to inline methods.
- sal_uInt8 GetType() const { return nType; }
- sal_Bool IsStyle() { return XML_HINT_STYLE==nType; }
- sal_Bool IsReference() { return XML_HINT_REFERENCE==nType; }
- sal_Bool IsHyperlink() { return XML_HINT_HYPERLINK==nType; }
- sal_Bool IsIndexMark() { return XML_HINT_INDEX_MARK==nType; }
-};
-
-class XMLStyleHint_Impl : public XMLHint_Impl
-{
- OUString sStyleName;
-
-public:
-
- XMLStyleHint_Impl( const OUString& rStyleName,
- const Reference < XTextRange > & rPos ) :
- XMLHint_Impl( XML_HINT_STYLE, rPos, rPos ),
- sStyleName( rStyleName )
- {
- }
- virtual ~XMLStyleHint_Impl() {}
-
- const OUString& GetStyleName() const { return sStyleName; }
-};
-
-class XMLReferenceHint_Impl : public XMLHint_Impl
-{
- OUString sRefName;
-
-public:
-
- XMLReferenceHint_Impl( const OUString& rRefName,
- const Reference < XTextRange > & rPos ) :
- XMLHint_Impl( XML_HINT_REFERENCE, rPos, rPos ),
- sRefName( rRefName )
- {
- }
-
- virtual ~XMLReferenceHint_Impl() {}
-
- const OUString& GetRefName() const { return sRefName; }
-};
-
-class XMLHyperlinkHint_Impl : public XMLHint_Impl
-{
- OUString sHRef;
- OUString sName;
- OUString sTargetFrameName;
- OUString sStyleName;
- OUString sVisitedStyleName;
- XMLEventsImportContext* pEvents;
-
-public:
-
- XMLHyperlinkHint_Impl( const Reference < XTextRange > & rPos ) :
- XMLHint_Impl( XML_HINT_HYPERLINK, rPos, rPos ),
- pEvents( NULL )
- {
- }
-
- virtual ~XMLHyperlinkHint_Impl()
- {
- if (NULL != pEvents)
- pEvents->ReleaseRef();
- }
-
- void SetHRef( const OUString& s ) { sHRef = s; }
- const OUString& GetHRef() const { return sHRef; }
- void SetName( const OUString& s ) { sName = s; }
- const OUString& GetName() const { return sName; }
- void SetTargetFrameName( const OUString& s ) { sTargetFrameName = s; }
- const OUString& GetTargetFrameName() const { return sTargetFrameName; }
- void SetStyleName( const OUString& s ) { sStyleName = s; }
- const OUString& GetStyleName() const { return sStyleName; }
- void SetVisitedStyleName( const OUString& s ) { sVisitedStyleName = s; }
- const OUString& GetVisitedStyleName() const { return sVisitedStyleName; }
- XMLEventsImportContext* GetEventsContext() const;
- void SetEventsContext( XMLEventsImportContext* pCtxt );
-};
-
-void XMLHyperlinkHint_Impl::SetEventsContext( XMLEventsImportContext* pCtxt )
-{
- pEvents = pCtxt;
- if (pEvents != NULL)
- pEvents->AddRef();
-}
-
-XMLEventsImportContext* XMLHyperlinkHint_Impl::GetEventsContext() const
-{
- return pEvents;
-}
-
-
-class XMLIndexMarkHint_Impl : public XMLHint_Impl
-{
- const Reference<beans::XPropertySet> xIndexMarkPropSet;
-
- const OUString sID;
-
-public:
-
- XMLIndexMarkHint_Impl( const Reference < beans::XPropertySet > & rPropSet,
- const Reference < XTextRange > & rPos ) :
- XMLHint_Impl( XML_HINT_INDEX_MARK, rPos, rPos ),
- xIndexMarkPropSet( rPropSet ),
- sID()
- {
- }
-
- XMLIndexMarkHint_Impl( const Reference < beans::XPropertySet > & rPropSet,
- const Reference < XTextRange > & rPos,
- OUString sIDString) :
- XMLHint_Impl( XML_HINT_INDEX_MARK, rPos, rPos ),
- xIndexMarkPropSet( rPropSet ),
- sID(sIDString)
- {
- }
-
- virtual ~XMLIndexMarkHint_Impl() {}
-
- const Reference<beans::XPropertySet> & GetMark() const
- { return xIndexMarkPropSet; }
- const OUString& GetID() const { return sID; }
-};
-
-class XMLRubyHint_Impl : public XMLHint_Impl
-{
- OUString sStyleName;
- OUString sTextStyleName;
- OUString sText;
-
-public:
-
- XMLRubyHint_Impl( const Reference < XTextRange > & rPos ) :
- XMLHint_Impl( XML_HINT_RUBY, rPos, rPos )
- {
- }
-
- virtual ~XMLRubyHint_Impl() {}
-
- void SetStyleName( const OUString& s ) { sStyleName = s; }
- const OUString& GetStyleName() const { return sStyleName; }
- void SetTextStyleName( const OUString& s ) { sTextStyleName = s; }
- const OUString& GetTextStyleName() const { return sTextStyleName; }
- void AppendText( const OUString& s ) { sText += s; }
- const OUString& GetText() const { return sText; }
-};
-
-class XMLTextFrameHint_Impl : public XMLHint_Impl
-{
- Reference < XTextContent > xTextContent;
- TextContentAnchorType eAnchorType;
-
-public:
-
- XMLTextFrameHint_Impl( const Reference < XTextContent > & rTxtCntnt,
- const Reference < XTextRange > & rPos ) :
- XMLHint_Impl( XML_HINT_TEXT_FRAME, rPos, rPos ),
- xTextContent( rTxtCntnt ),
- eAnchorType( TextContentAnchorType_AT_CHARACTER )
- {
- }
-
- XMLTextFrameHint_Impl( const Reference < XTextRange > & rPos ) :
- XMLHint_Impl( XML_HINT_TEXT_FRAME, rPos, rPos ),
- eAnchorType( TextContentAnchorType_AS_CHARACTER )
- {
- }
-
- virtual ~XMLTextFrameHint_Impl() {}
-
- Reference < XTextContent >& GetTextContentRef() { return xTextContent; }
- TextContentAnchorType& GetAnchorTypeRef() { return eAnchorType; }
-
- Reference < XTextContent > GetTextContent() const { return xTextContent; }
- sal_Bool IsBoundAtChar() const { return TextContentAnchorType_AT_CHARACTER == eAnchorType; }
-};
-
-typedef XMLHint_Impl *XMLHint_ImplPtr;
-SV_DECL_PTRARR_DEL( XMLHints_Impl, XMLHint_ImplPtr, 5, 5 )
-SV_IMPL_PTRARR( XMLHints_Impl, XMLHint_ImplPtr )
-
-// ---------------------------------------------------------------------
-
-class XMLImpCharContext_Impl : public SvXMLImportContext
-{
-public:
-
- TYPEINFO();
-
- XMLImpCharContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- sal_Unicode c,
- sal_Bool bCount );
- XMLImpCharContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- sal_Int16 nControl );
-
- virtual ~XMLImpCharContext_Impl();
-};
-
-TYPEINIT1( XMLImpCharContext_Impl, SvXMLImportContext );
-
-XMLImpCharContext_Impl::XMLImpCharContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- sal_Unicode c,
- sal_Bool bCount ) :
- SvXMLImportContext( rImport, nPrfx, rLName )
-{
- sal_uInt16 nCount = 1;
-
- if( bCount )
- {
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
-
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- if( XML_NAMESPACE_TEXT == nPrefix &&
- IsXMLToken( aLocalName, XML_C ) )
- {
- sal_Int32 nTmp = xAttrList->getValueByIndex(i).toInt32();
- if( nTmp > 0L )
- {
- if( nTmp > USHRT_MAX )
- nCount = USHRT_MAX;
- else
- nCount = (sal_uInt16)nTmp;
- }
- }
- }
- }
-
- if( 1U == nCount )
- {
- OUString sBuff( &c, 1 );
- GetImport().GetTextImport()->InsertString( sBuff );
- }
- else
- {
- OUStringBuffer sBuff( nCount );
- while( nCount-- )
- sBuff.append( &c, 1 );
-
- GetImport().GetTextImport()->InsertString( sBuff.makeStringAndClear() );
- }
-}
-
-XMLImpCharContext_Impl::XMLImpCharContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- sal_Int16 nControl ) :
- SvXMLImportContext( rImport, nPrfx, rLName )
-{
- GetImport().GetTextImport()->InsertControlCharacter( nControl );
-}
-
-XMLImpCharContext_Impl::~XMLImpCharContext_Impl()
-{
-}
-
-// ---------------------------------------------------------------------
-
-/** import start of reference (<text:reference-start>) */
-class XMLStartReferenceContext_Impl : public SvXMLImportContext
-{
-public:
- TYPEINFO();
-
- // Do everything in constructor. Well ...
- XMLStartReferenceContext_Impl (
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- XMLHints_Impl& rHnts,
- const Reference<xml::sax::XAttributeList> & xAttrList);
-};
-
-TYPEINIT1( XMLStartReferenceContext_Impl, SvXMLImportContext );
-
-XMLStartReferenceContext_Impl::XMLStartReferenceContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- XMLHints_Impl& rHints,
- const Reference<xml::sax::XAttributeList> & xAttrList) :
- SvXMLImportContext(rImport, nPrefix, rLocalName)
-{
- OUString sName;
-
- // borrow FindName from XMLTextMarkImportContext, where bookmarks
- // and point references are handled.
- if (XMLTextMarkImportContext::FindName(GetImport(), xAttrList, sName))
- {
- XMLHint_Impl* pHint = new XMLReferenceHint_Impl(
- sName, rImport.GetTextImport()->GetCursor()->getStart() );
-
- // degenerates to point reference, if no end is found!
- pHint->SetEnd(rImport.GetTextImport()->GetCursor()->getStart() );
-
- rHints.Insert(pHint, rHints.Count());
- }
-}
-
-// ---------------------------------------------------------------------
-
-/** import end of reference (<text:reference-end>) */
-class XMLEndReferenceContext_Impl : public SvXMLImportContext
-{
-public:
- TYPEINFO();
-
- // Do everything in constructor. Well ...
- XMLEndReferenceContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- XMLHints_Impl& rHnts,
- const Reference<xml::sax::XAttributeList> & xAttrList);
-};
-
-TYPEINIT1( XMLEndReferenceContext_Impl, SvXMLImportContext );
-
-XMLEndReferenceContext_Impl::XMLEndReferenceContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- XMLHints_Impl& rHints,
- const Reference<xml::sax::XAttributeList> & xAttrList) :
- SvXMLImportContext(rImport, nPrefix, rLocalName)
-{
- OUString sName;
-
- // borrow from XMLTextMarkImportContext
- if (XMLTextMarkImportContext::FindName(GetImport(), xAttrList, sName))
- {
- // search for reference start
- sal_uInt16 nCount = rHints.Count();
- for(sal_uInt16 nPos = 0; nPos < nCount; nPos++)
- {
- XMLHint_Impl *pHint = rHints[nPos];
- if ( pHint->IsReference() &&
- sName.equals( ((XMLReferenceHint_Impl *)pHint)->GetRefName()) )
- {
- // set end and stop searching
- pHint->SetEnd(GetImport().GetTextImport()->
- GetCursor()->getStart() );
- break;
- }
- }
- // else: no start (in this paragraph) -> ignore
- }
-}
-
-// ---------------------------------------------------------------------
-
-class XMLImpSpanContext_Impl : public SvXMLImportContext
-{
- const OUString sTextFrame;
-
- XMLHints_Impl& rHints;
- XMLStyleHint_Impl *pHint;
-
- sal_Bool& rIgnoreLeadingSpace;
-
-#ifdef CONV_STAR_FONTS
- sal_uInt8 nStarFontsConvFlags;
-#endif
-
-public:
-
- TYPEINFO();
-
- XMLImpSpanContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- XMLHints_Impl& rHnts,
- sal_Bool& rIgnLeadSpace
-#ifdef CONV_STAR_FONTS
- ,sal_uInt8 nSFConvFlags
-#endif
- );
-
- virtual ~XMLImpSpanContext_Impl();
-
- static SvXMLImportContext *CreateChildContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- sal_uInt16 nToken, XMLHints_Impl& rHnts,
- sal_Bool& rIgnLeadSpace
-#ifdef CONV_STAR_FONTS
- ,sal_uInt8 nStarFontsConvFlags = 0
-#endif
- );
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList );
-
- virtual void Characters( const OUString& rChars );
-};
-// ---------------------------------------------------------------------
-
-class XMLImpHyperlinkContext_Impl : public SvXMLImportContext
-{
- XMLHints_Impl& rHints;
- XMLHyperlinkHint_Impl *pHint;
-
- sal_Bool& rIgnoreLeadingSpace;
-
-public:
-
- TYPEINFO();
-
- XMLImpHyperlinkContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- XMLHints_Impl& rHnts,
- sal_Bool& rIgnLeadSpace );
-
- virtual ~XMLImpHyperlinkContext_Impl();
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList );
-
- virtual void Characters( const OUString& rChars );
-};
-
-TYPEINIT1( XMLImpHyperlinkContext_Impl, SvXMLImportContext );
-
-XMLImpHyperlinkContext_Impl::XMLImpHyperlinkContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- XMLHints_Impl& rHnts,
- sal_Bool& rIgnLeadSpace ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rHints( rHnts ),
- rIgnoreLeadingSpace( rIgnLeadSpace ),
- pHint( new XMLHyperlinkHint_Impl(
- GetImport().GetTextImport()->GetCursorAsRange()->getStart() ) )
-{
- OUString sShow;
- const SvXMLTokenMap& rTokenMap =
- GetImport().GetTextImport()->GetTextHyperlinkAttrTokenMap();
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- switch( rTokenMap.Get( nPrefix, aLocalName ) )
- {
- case XML_TOK_TEXT_HYPERLINK_HREF:
- pHint->SetHRef( GetImport().GetAbsoluteReference( rValue ) );
- break;
- case XML_TOK_TEXT_HYPERLINK_NAME:
- pHint->SetName( rValue );
- break;
- case XML_TOK_TEXT_HYPERLINK_TARGET_FRAME:
- pHint->SetTargetFrameName( rValue );
- break;
- case XML_TOK_TEXT_HYPERLINK_SHOW:
- sShow = rValue;
- break;
- case XML_TOK_TEXT_HYPERLINK_STYLE_NAME:
- pHint->SetStyleName( rValue );
- break;
- case XML_TOK_TEXT_HYPERLINK_VIS_STYLE_NAME:
- pHint->SetVisitedStyleName( rValue );
- break;
- }
- }
-
- if( sShow.getLength() && !pHint->GetTargetFrameName().getLength() )
- {
- if( IsXMLToken( sShow, XML_NEW ) )
- pHint->SetTargetFrameName(
- OUString( RTL_CONSTASCII_USTRINGPARAM("_blank" ) ) );
- else if( IsXMLToken( sShow, XML_REPLACE ) )
- pHint->SetTargetFrameName(
- OUString( RTL_CONSTASCII_USTRINGPARAM("_self" ) ) );
- }
- rHints.Insert( pHint, rHints.Count() );
-}
-
-XMLImpHyperlinkContext_Impl::~XMLImpHyperlinkContext_Impl()
-{
- if( pHint )
- pHint->SetEnd( GetImport().GetTextImport()
- ->GetCursorAsRange()->getStart() );
-}
-
-SvXMLImportContext *XMLImpHyperlinkContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList )
-{
- if ( (nPrefix == XML_NAMESPACE_OFFICE) &&
- IsXMLToken(rLocalName, XML_EVENTS) )
- {
- XMLEventsImportContext* pCtxt = new XMLEventsImportContext(
- GetImport(), nPrefix, rLocalName);
- pHint->SetEventsContext(pCtxt);
- return pCtxt;
- }
- else
- {
- const SvXMLTokenMap& rTokenMap =
- GetImport().GetTextImport()->GetTextPElemTokenMap();
- sal_uInt16 nToken = rTokenMap.Get( nPrefix, rLocalName );
-
- return XMLImpSpanContext_Impl::CreateChildContext(
- GetImport(), nPrefix, rLocalName, xAttrList,
- nToken, rHints, rIgnoreLeadingSpace );
- }
-}
-
-void XMLImpHyperlinkContext_Impl::Characters( const OUString& rChars )
-{
- GetImport().GetTextImport()->InsertString( rChars, rIgnoreLeadingSpace );
-}
-
-// ---------------------------------------------------------------------
-
-class XMLImpRubyBaseContext_Impl : public SvXMLImportContext
-{
- XMLHints_Impl& rHints;
-
- sal_Bool& rIgnoreLeadingSpace;
-
-public:
-
- TYPEINFO();
-
- XMLImpRubyBaseContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- XMLHints_Impl& rHnts,
- sal_Bool& rIgnLeadSpace );
-
- virtual ~XMLImpRubyBaseContext_Impl();
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList );
-
- virtual void Characters( const OUString& rChars );
-};
-
-TYPEINIT1( XMLImpRubyBaseContext_Impl, SvXMLImportContext );
-
-XMLImpRubyBaseContext_Impl::XMLImpRubyBaseContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- XMLHints_Impl& rHnts,
- sal_Bool& rIgnLeadSpace ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rHints( rHnts ),
- rIgnoreLeadingSpace( rIgnLeadSpace )
-{
-}
-
-XMLImpRubyBaseContext_Impl::~XMLImpRubyBaseContext_Impl()
-{
-}
-
-SvXMLImportContext *XMLImpRubyBaseContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList )
-{
- const SvXMLTokenMap& rTokenMap =
- GetImport().GetTextImport()->GetTextPElemTokenMap();
- sal_uInt16 nToken = rTokenMap.Get( nPrefix, rLocalName );
-
- return XMLImpSpanContext_Impl::CreateChildContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- nToken, rHints, rIgnoreLeadingSpace );
-}
-
-void XMLImpRubyBaseContext_Impl::Characters( const OUString& rChars )
-{
- GetImport().GetTextImport()->InsertString( rChars, rIgnoreLeadingSpace );
-}
-
-// ---------------------------------------------------------------------
-
-class XMLImpRubyTextContext_Impl : public SvXMLImportContext
-{
- XMLRubyHint_Impl *pHint;
-
-public:
-
- TYPEINFO();
-
- XMLImpRubyTextContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- XMLRubyHint_Impl *pHint );
-
- virtual ~XMLImpRubyTextContext_Impl();
-
- virtual void Characters( const OUString& rChars );
-};
-
-TYPEINIT1( XMLImpRubyTextContext_Impl, SvXMLImportContext );
-
-XMLImpRubyTextContext_Impl::XMLImpRubyTextContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- XMLRubyHint_Impl *pHt ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- pHint( pHt )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- if( XML_NAMESPACE_TEXT == nPrefix &&
- IsXMLToken( aLocalName, XML_STYLE_NAME ) )
- {
- pHint->SetTextStyleName( rValue );
- break;
- }
- }
-}
-
-XMLImpRubyTextContext_Impl::~XMLImpRubyTextContext_Impl()
-{
-}
-
-void XMLImpRubyTextContext_Impl::Characters( const OUString& rChars )
-{
- pHint->AppendText( rChars );
-}
-
-// ---------------------------------------------------------------------
-
-class XMLImpRubyContext_Impl : public SvXMLImportContext
-{
- XMLHints_Impl& rHints;
- XMLRubyHint_Impl *pHint;
-
- sal_Bool& rIgnoreLeadingSpace;
-
-public:
-
- TYPEINFO();
-
- XMLImpRubyContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- XMLHints_Impl& rHnts,
- sal_Bool& rIgnLeadSpace );
-
- virtual ~XMLImpRubyContext_Impl();
-
- virtual SvXMLImportContext *CreateChildContext(
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList );
-};
-
-TYPEINIT1( XMLImpRubyContext_Impl, SvXMLImportContext );
-
-XMLImpRubyContext_Impl::XMLImpRubyContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- XMLHints_Impl& rHnts,
- sal_Bool& rIgnLeadSpace ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rHints( rHnts ),
- rIgnoreLeadingSpace( rIgnLeadSpace ),
- pHint( new XMLRubyHint_Impl(
- GetImport().GetTextImport()->GetCursorAsRange()->getStart() ) )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- if( XML_NAMESPACE_TEXT == nPrefix &&
- IsXMLToken( aLocalName, XML_STYLE_NAME ) )
- {
- pHint->SetStyleName( rValue );
- break;
- }
- }
- rHints.Insert( pHint, rHints.Count() );
-}
-
-XMLImpRubyContext_Impl::~XMLImpRubyContext_Impl()
-{
- if( pHint )
- pHint->SetEnd( GetImport().GetTextImport()
- ->GetCursorAsRange()->getStart() );
-}
-
-SvXMLImportContext *XMLImpRubyContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext;
- if( XML_NAMESPACE_TEXT == nPrefix )
- {
- if( IsXMLToken( rLocalName, XML_RUBY_BASE ) )
- pContext = new XMLImpRubyBaseContext_Impl( GetImport(), nPrefix,
- rLocalName,
- xAttrList,
- rHints,
- rIgnoreLeadingSpace );
- else if( IsXMLToken( rLocalName, XML_RUBY_TEXT ) )
- pContext = new XMLImpRubyTextContext_Impl( GetImport(), nPrefix,
- rLocalName,
- xAttrList,
- pHint );
- else
- pContext = 0; // TODO What value should this be?
-
- }
- else
- pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName,
- xAttrList );
-
- return pContext;
-}
-
-// ---------------------------------------------------------------------
-
-
-/**
- * Process index marks.
- *
- * All *-mark-end index marks should instantiate *this* class (because
- * it doesn't process attributes other than ID), while the *-mark and
- * *-mark-start classes should instantiate the apporpiate subclasses.
- */
-class XMLIndexMarkImportContext_Impl : public SvXMLImportContext
-{
- const OUString sAlternativeText;
-
- XMLHints_Impl& rHints;
- const enum XMLTextPElemTokens eToken;
- OUString sID;
-
-public:
- TYPEINFO();
-
- XMLIndexMarkImportContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- enum XMLTextPElemTokens nTok,
- XMLHints_Impl& rHnts);
-
- void StartElement(const Reference<xml::sax::XAttributeList> & xAttrList);
-
-protected:
-
- /// process all attributes
- void ProcessAttributes(const Reference<xml::sax::XAttributeList> & xAttrList,
- Reference<beans::XPropertySet>& rPropSet);
-
- /**
- * All marks can be created immediatly. Since we don't care about
- * the element content, ProcessAttribute should set the properties
- * immediatly.
- *
- * This method tolerates an empty PropertySet; subclasses however
- * are not expected to.
- */
- virtual void ProcessAttribute(sal_uInt16 nNamespace,
- OUString sLocalName,
- OUString sValue,
- Reference<beans::XPropertySet>& rPropSet);
-
- static void GetServiceName(OUString& sServiceName,
- enum XMLTextPElemTokens nToken);
-
- sal_Bool CreateMark(Reference<beans::XPropertySet>& rPropSet,
- const OUString& rServiceName);
-};
-
-
-TYPEINIT1( XMLIndexMarkImportContext_Impl, SvXMLImportContext );
-
-XMLIndexMarkImportContext_Impl::XMLIndexMarkImportContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- enum XMLTextPElemTokens eTok,
- XMLHints_Impl& rHnts) :
- SvXMLImportContext(rImport, nPrefix, rLocalName),
- rHints(rHnts),
- eToken(eTok),
- sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText")),
- sID()
-{
-}
-
-void XMLIndexMarkImportContext_Impl::StartElement(
- const Reference<xml::sax::XAttributeList> & xAttrList)
-{
- // get Cursor position (needed for all cases)
- Reference<XTextRange> xPos =
- GetImport().GetTextImport()->GetCursor()->getStart();
- Reference<beans::XPropertySet> xMark;
-
- switch (eToken)
- {
- case XML_TOK_TEXT_TOC_MARK:
- case XML_TOK_TEXT_USER_INDEX_MARK:
- case XML_TOK_TEXT_ALPHA_INDEX_MARK:
- {
- // single mark: create mark and insert
- OUString sService;
- GetServiceName(sService, eToken);
- if (CreateMark(xMark, sService))
- {
- ProcessAttributes(xAttrList, xMark);
- XMLHint_Impl* pHint = new XMLIndexMarkHint_Impl(xMark, xPos);
- rHints.Insert(pHint, rHints.Count());
- }
- // else: can't create mark -> ignore
- break;
- }
-
- case XML_TOK_TEXT_TOC_MARK_START:
- case XML_TOK_TEXT_USER_INDEX_MARK_START:
- case XML_TOK_TEXT_ALPHA_INDEX_MARK_START:
- {
- // start: create mark and insert (if ID is found)
- OUString sService;
- GetServiceName(sService, eToken);
- if (CreateMark(xMark, sService))
- {
- ProcessAttributes(xAttrList, xMark);
- if (sID.getLength() > 0)
- {
- // process only if we find an ID
- XMLHint_Impl* pHint =
- new XMLIndexMarkHint_Impl(xMark, xPos, sID);
- rHints.Insert(pHint, rHints.Count());
- }
- // else: no ID -> we'll never find the end -> ignore
- }
- // else: can't create mark -> ignore
- break;
- }
-
- case XML_TOK_TEXT_TOC_MARK_END:
- case XML_TOK_TEXT_USER_INDEX_MARK_END:
- case XML_TOK_TEXT_ALPHA_INDEX_MARK_END:
- {
- // end: search for ID and set end of mark
-
- // call process attributes with empty XPropertySet:
- ProcessAttributes(xAttrList, xMark);
- if (sID.getLength() > 0)
- {
- // if we have an ID, find the hint and set the end position
- sal_uInt16 nCount = rHints.Count();
- for(sal_uInt16 nPos = 0; nPos < nCount; nPos++)
- {
- XMLHint_Impl *pHint = rHints[nPos];
- if ( pHint->IsIndexMark() &&
- sID.equals(
- ((XMLIndexMarkHint_Impl *)pHint)->GetID()) )
- {
- // set end and stop searching
- pHint->SetEnd(xPos);
- break;
- }
- }
- }
- // else: no ID -> ignore
- break;
- }
-
- default:
- DBG_ERROR("unknown index mark type!");
- break;
- }
-}
-
-void XMLIndexMarkImportContext_Impl::ProcessAttributes(
- const Reference<xml::sax::XAttributeList> & xAttrList,
- Reference<beans::XPropertySet>& rPropSet)
-{
- // process attributes
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 i=0; i<nLength; i++)
- {
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(i), &sLocalName );
-
- ProcessAttribute(nPrefix, sLocalName,
- xAttrList->getValueByIndex(i),
- rPropSet);
- }
-}
-
-void XMLIndexMarkImportContext_Impl::ProcessAttribute(
- sal_uInt16 nNamespace,
- OUString sLocalName,
- OUString sValue,
- Reference<beans::XPropertySet>& rPropSet)
-{
- // we only know ID + string-value attribute;
- // (former: marks, latter: -start + -end-marks)
- // the remainder is handled in sub-classes
- switch (eToken)
- {
- case XML_TOK_TEXT_TOC_MARK:
- case XML_TOK_TEXT_USER_INDEX_MARK:
- case XML_TOK_TEXT_ALPHA_INDEX_MARK:
- if ( (XML_NAMESPACE_TEXT == nNamespace) &&
- IsXMLToken( sLocalName, XML_STRING_VALUE ) )
- {
- Any aAny;
- aAny <<= sValue;
- rPropSet->setPropertyValue(sAlternativeText, aAny);
- }
- // else: ignore!
- break;
-
- case XML_TOK_TEXT_TOC_MARK_START:
- case XML_TOK_TEXT_USER_INDEX_MARK_START:
- case XML_TOK_TEXT_ALPHA_INDEX_MARK_START:
- case XML_TOK_TEXT_TOC_MARK_END:
- case XML_TOK_TEXT_USER_INDEX_MARK_END:
- case XML_TOK_TEXT_ALPHA_INDEX_MARK_END:
- if ( (XML_NAMESPACE_TEXT == nNamespace) &&
- IsXMLToken( sLocalName, XML_ID ) )
- {
- sID = sValue;
- }
- // else: ignore
- break;
-
- default:
- DBG_ERROR("unknown index mark type!");
- break;
- }
-}
-
-static const sal_Char sAPI_com_sun_star_text_ContentIndexMark[] =
- "com.sun.star.text.ContentIndexMark";
-static const sal_Char sAPI_com_sun_star_text_UserIndexMark[] =
- "com.sun.star.text.UserIndexMark";
-static const sal_Char sAPI_com_sun_star_text_DocumentIndexMark[] =
- "com.sun.star.text.DocumentIndexMark";
-
-
-void XMLIndexMarkImportContext_Impl::GetServiceName(
- OUString& sServiceName,
- enum XMLTextPElemTokens eToken)
-{
- switch (eToken)
- {
- case XML_TOK_TEXT_TOC_MARK:
- case XML_TOK_TEXT_TOC_MARK_START:
- case XML_TOK_TEXT_TOC_MARK_END:
- {
- OUString sTmp(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_com_sun_star_text_ContentIndexMark));
- sServiceName = sTmp;
- break;
- }
-
- case XML_TOK_TEXT_USER_INDEX_MARK:
- case XML_TOK_TEXT_USER_INDEX_MARK_START:
- case XML_TOK_TEXT_USER_INDEX_MARK_END:
- {
- OUString sTmp(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_com_sun_star_text_UserIndexMark));
- sServiceName = sTmp;
- break;
- }
-
- case XML_TOK_TEXT_ALPHA_INDEX_MARK:
- case XML_TOK_TEXT_ALPHA_INDEX_MARK_START:
- case XML_TOK_TEXT_ALPHA_INDEX_MARK_END:
- {
- OUString sTmp(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_com_sun_star_text_DocumentIndexMark));
- sServiceName = sTmp;
- break;
- }
-
- default:
- {
- DBG_ERROR("unknown index mark type!");
- OUString sTmp;
- sServiceName = sTmp;
- break;
- }
- }
-}
-
-
-sal_Bool XMLIndexMarkImportContext_Impl::CreateMark(
- Reference<beans::XPropertySet>& rPropSet,
- const OUString& rServiceName)
-{
- Reference<lang::XMultiServiceFactory>
- xFactory(GetImport().GetModel(), UNO_QUERY);
-
- if( xFactory.is() )
- {
- Reference<XInterface> xIfc = xFactory->createInstance(rServiceName);
- if( xIfc.is() )
- {
- Reference<beans::XPropertySet> xPropSet( xIfc, UNO_QUERY );
- if (xPropSet.is())
- rPropSet = xPropSet;
- return sal_True;
- }
- }
-
- return sal_False;
-}
-
-
-class XMLTOCMarkImportContext_Impl : public XMLIndexMarkImportContext_Impl
-{
- const OUString sLevel;
-
-public:
- TYPEINFO();
-
- XMLTOCMarkImportContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- enum XMLTextPElemTokens nTok,
- XMLHints_Impl& rHnts);
-
-protected:
-
- /** process outline level */
- virtual void ProcessAttribute(sal_uInt16 nNamespace,
- OUString sLocalName,
- OUString sValue,
- Reference<beans::XPropertySet>& rPropSet);
-};
-
-TYPEINIT1( XMLTOCMarkImportContext_Impl, XMLIndexMarkImportContext_Impl );
-
-
-XMLTOCMarkImportContext_Impl::XMLTOCMarkImportContext_Impl(
- SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName,
- enum XMLTextPElemTokens nTok, XMLHints_Impl& rHnts) :
- XMLIndexMarkImportContext_Impl(rImport, nPrefix, rLocalName,
- nTok, rHnts),
- sLevel(RTL_CONSTASCII_USTRINGPARAM("Level"))
-{
-}
-
-void XMLTOCMarkImportContext_Impl::ProcessAttribute(
- sal_uInt16 nNamespace,
- OUString sLocalName,
- OUString sValue,
- Reference<beans::XPropertySet>& rPropSet)
-{
- DBG_ASSERT(rPropSet.is(), "need PropertySet");
-
- if ((XML_NAMESPACE_TEXT == nNamespace) &&
- IsXMLToken( sLocalName, XML_OUTLINE_LEVEL ) )
- {
- // ouline level: set Level property
- sal_Int32 nTmp;
- if (SvXMLUnitConverter::convertNumber(
- nTmp, sValue, 0,
- GetImport().GetTextImport()->GetChapterNumbering()->getCount()))
- {
- Any aAny;
- aAny <<= (sal_Int16)nTmp;
- rPropSet->setPropertyValue(sLevel, aAny);
- }
- // else: value out of range -> ignore
- }
- else
- {
- // else: delegate to superclass
- XMLIndexMarkImportContext_Impl::ProcessAttribute(
- nNamespace, sLocalName, sValue, rPropSet);
- }
-}
-
-class XMLUserIndexMarkImportContext_Impl : public XMLIndexMarkImportContext_Impl
-{
- const OUString sUserIndexName;
- const OUString sLevel;
-
-public:
- TYPEINFO();
-
- XMLUserIndexMarkImportContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- enum XMLTextPElemTokens nTok,
- XMLHints_Impl& rHnts);
-
-protected:
-
- /** process index name */
- virtual void ProcessAttribute(sal_uInt16 nNamespace,
- OUString sLocalName,
- OUString sValue,
- Reference<beans::XPropertySet>& rPropSet);
-};
-
-TYPEINIT1( XMLUserIndexMarkImportContext_Impl, XMLIndexMarkImportContext_Impl);
-
-XMLUserIndexMarkImportContext_Impl::XMLUserIndexMarkImportContext_Impl(
- SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName,
- enum XMLTextPElemTokens nTok, XMLHints_Impl& rHnts) :
- XMLIndexMarkImportContext_Impl(rImport, nPrefix, rLocalName,
- nTok, rHnts),
- sUserIndexName(RTL_CONSTASCII_USTRINGPARAM("UserIndexName")),
- sLevel(RTL_CONSTASCII_USTRINGPARAM("Level"))
-{
-}
-
-void XMLUserIndexMarkImportContext_Impl::ProcessAttribute(
- sal_uInt16 nNamespace, OUString sLocalName, OUString sValue,
- Reference<beans::XPropertySet>& rPropSet)
-{
- if ( XML_NAMESPACE_TEXT == nNamespace )
- {
- if ( IsXMLToken( sLocalName, XML_INDEX_NAME ) )
- {
- Any aAny;
- aAny <<= sValue;
- rPropSet->setPropertyValue(sUserIndexName, aAny);
- }
- else if ( IsXMLToken( sLocalName, XML_OUTLINE_LEVEL ) )
- {
- // ouline level: set Level property
- sal_Int32 nTmp;
- if (SvXMLUnitConverter::convertNumber(
- nTmp, sValue, 0,
- GetImport().GetTextImport()->GetChapterNumbering()->getCount()))
- {
- Any aAny;
- aAny <<= (sal_Int16)nTmp;
- rPropSet->setPropertyValue(sLevel, aAny);
- }
- // else: value out of range -> ignore
- }
- else
- {
- // else: unknown text property: delegate to super class
- XMLIndexMarkImportContext_Impl::ProcessAttribute(
- nNamespace, sLocalName, sValue, rPropSet);
- }
- }
- else
- {
- // else: unknown namespace: delegate to super class
- XMLIndexMarkImportContext_Impl::ProcessAttribute(
- nNamespace, sLocalName, sValue, rPropSet);
- }
-}
-
-
-class XMLAlphaIndexMarkImportContext_Impl : public XMLIndexMarkImportContext_Impl
-{
- const OUString sPrimaryKey;
- const OUString sSecondaryKey;
- const OUString sTextReading;
- const OUString sPrimaryKeyReading;
- const OUString sSecondaryKeyReading;
- const OUString sMainEntry;
-
-public:
- TYPEINFO();
-
- XMLAlphaIndexMarkImportContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- enum XMLTextPElemTokens nTok,
- XMLHints_Impl& rHnts);
-
-protected:
-
- /** process primary + secondary keys */
- virtual void ProcessAttribute(sal_uInt16 nNamespace,
- OUString sLocalName,
- OUString sValue,
- Reference<beans::XPropertySet>& rPropSet);
-};
-
-TYPEINIT1( XMLAlphaIndexMarkImportContext_Impl,
- XMLIndexMarkImportContext_Impl );
-
-XMLAlphaIndexMarkImportContext_Impl::XMLAlphaIndexMarkImportContext_Impl(
- SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName,
- enum XMLTextPElemTokens nTok, XMLHints_Impl& rHnts) :
- XMLIndexMarkImportContext_Impl(rImport, nPrefix, rLocalName,
- nTok, rHnts),
- sPrimaryKey(RTL_CONSTASCII_USTRINGPARAM("PrimaryKey")),
- sSecondaryKey(RTL_CONSTASCII_USTRINGPARAM("SecondaryKey")),
- sTextReading(RTL_CONSTASCII_USTRINGPARAM("TextReading")),
- sPrimaryKeyReading(RTL_CONSTASCII_USTRINGPARAM("PrimaryKeyReading")),
- sSecondaryKeyReading(RTL_CONSTASCII_USTRINGPARAM("SecondaryKeyReading")),
- sMainEntry(RTL_CONSTASCII_USTRINGPARAM("IsMainEntry"))
-{
-}
-
-void XMLAlphaIndexMarkImportContext_Impl::ProcessAttribute(
- sal_uInt16 nNamespace, OUString sLocalName, OUString sValue,
- Reference<beans::XPropertySet>& rPropSet)
-{
- if (XML_NAMESPACE_TEXT == nNamespace)
- {
- if ( IsXMLToken( sLocalName, XML_KEY1 ) )
- {
- Any aAny;
- aAny <<= sValue;
- rPropSet->setPropertyValue(sPrimaryKey, aAny);
- }
- else if ( IsXMLToken( sLocalName, XML_KEY2 ) )
- {
- Any aAny;
- aAny <<= sValue;
- rPropSet->setPropertyValue(sSecondaryKey, aAny);
- }
- else if ( IsXMLToken( sLocalName, XML_KEY1_PHONETIC ) )
- {
- Any aAny;
- aAny <<= sValue;
- rPropSet->setPropertyValue(sPrimaryKeyReading, aAny);
- }
- else if ( IsXMLToken( sLocalName, XML_KEY2_PHONETIC ) )
- {
- Any aAny;
- aAny <<= sValue;
- rPropSet->setPropertyValue(sSecondaryKeyReading, aAny);
- }
- else if ( IsXMLToken( sLocalName, XML_STRING_VALUE_PHONETIC ) )
- {
- Any aAny;
- aAny <<= sValue;
- rPropSet->setPropertyValue(sTextReading, aAny);
- }
- else if ( IsXMLToken( sLocalName, XML_MAIN_ENTRY ) )
- {
- sal_Bool bMainEntry = sal_False, bTmp;
-
- if (SvXMLUnitConverter::convertBool(bTmp, sValue))
- bMainEntry = bTmp;
-
- Any aAny;
- aAny.setValue(&bMainEntry, ::getBooleanCppuType());
- rPropSet->setPropertyValue(sMainEntry, aAny);
- }
- else
- {
- XMLIndexMarkImportContext_Impl::ProcessAttribute(
- nNamespace, sLocalName, sValue, rPropSet);
- }
- }
- else
- {
- XMLIndexMarkImportContext_Impl::ProcessAttribute(
- nNamespace, sLocalName, sValue, rPropSet);
- }
-}
-
-
-// ---------------------------------------------------------------------
-
-TYPEINIT1( XMLImpSpanContext_Impl, SvXMLImportContext );
-
-XMLImpSpanContext_Impl::XMLImpSpanContext_Impl(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- XMLHints_Impl& rHnts,
- sal_Bool& rIgnLeadSpace
-#ifdef CONV_STAR_FONTS
- ,sal_uInt8 nSFConvFlags
-#endif
- ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rHints( rHnts ),
- rIgnoreLeadingSpace( rIgnLeadSpace ),
- pHint( 0 ),
- sTextFrame(RTL_CONSTASCII_USTRINGPARAM("TextFrame"))
-#ifdef CONV_STAR_FONTS
- ,nStarFontsConvFlags( nSFConvFlags & (CONV_FROM_STAR_BATS|CONV_FROM_STAR_MATH) )
-#endif
-{
- OUString aStyleName;
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
-
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- if( XML_NAMESPACE_TEXT == nPrefix &&
- IsXMLToken( aLocalName, XML_STYLE_NAME ) )
- aStyleName = xAttrList->getValueByIndex( i );
- }
-
- if( aStyleName.getLength() )
- {
- pHint = new XMLStyleHint_Impl( aStyleName,
- GetImport().GetTextImport()->GetCursorAsRange()->getStart() );
- rHints.Insert( pHint, rHints.Count() );
- }
-}
-
-XMLImpSpanContext_Impl::~XMLImpSpanContext_Impl()
-{
- if( pHint )
- pHint->SetEnd( GetImport().GetTextImport()
- ->GetCursorAsRange()->getStart() );
-}
-
-SvXMLImportContext *XMLImpSpanContext_Impl::CreateChildContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- sal_uInt16 nToken,
- XMLHints_Impl& rHints,
- sal_Bool& rIgnoreLeadingSpace
-#ifdef CONV_STAR_FONTS
- ,sal_uInt8 nStarFontsConvFlags
-#endif
- )
-{
- SvXMLImportContext *pContext = 0;
- sal_Bool bInsertTextFrame = sal_False;
- sal_uInt16 nTextFrameType = 0;
-
- sal_Bool bObjectOLE = sal_False;
- switch( nToken )
- {
- case XML_TOK_TEXT_SPAN:
- pContext = new XMLImpSpanContext_Impl( rImport, nPrefix,
- rLocalName, xAttrList,
- rHints,
- rIgnoreLeadingSpace
-#ifdef CONV_STAR_FONTS
- ,nStarFontsConvFlags
-#endif
- );
- break;
-
- case XML_TOK_TEXT_TAB_STOP:
- pContext = new XMLImpCharContext_Impl( rImport, nPrefix,
- rLocalName, xAttrList,
- 0x0009, sal_False );
- rIgnoreLeadingSpace = sal_False;
- break;
-
- case XML_TOK_TEXT_LINE_BREAK:
- pContext = new XMLImpCharContext_Impl( rImport, nPrefix,
- rLocalName, xAttrList,
- ControlCharacter::LINE_BREAK );
- rIgnoreLeadingSpace = sal_False;
- break;
-
- case XML_TOK_TEXT_S:
- pContext = new XMLImpCharContext_Impl( rImport, nPrefix,
- rLocalName, xAttrList,
- 0x0020, sal_True );
- break;
-
- case XML_TOK_TEXT_HYPERLINK:
- {
- // test for HyperLinkURL property. If present, insert link as
- // text property (StarWriter), else try to insert as text
- // field (StarCalc, StarDraw, ...)
- Reference<beans::XPropertySet> xPropSet(
- rImport.GetTextImport()->GetCursor(),
- UNO_QUERY );
-
- const OUString sHyperLinkURL(
- RTL_CONSTASCII_USTRINGPARAM("HyperLinkURL"));
-
- if (xPropSet->getPropertySetInfo()->hasPropertyByName(sHyperLinkURL))
- {
- pContext = new XMLImpHyperlinkContext_Impl( rImport, nPrefix,
- rLocalName, xAttrList,
- rHints,
- rIgnoreLeadingSpace );
- }
- else
- {
- pContext = new XMLUrlFieldImportContext( rImport,
- *rImport.GetTextImport().get(),
- nPrefix, rLocalName);
- //whitespace handling like other fields
- rIgnoreLeadingSpace = sal_False;
-
- }
- break;
- }
-
- case XML_TOK_TEXT_RUBY:
- pContext = new XMLImpRubyContext_Impl( rImport, nPrefix,
- rLocalName, xAttrList,
- rHints,
- rIgnoreLeadingSpace );
- break;
-
- case XML_TOK_TEXT_ENDNOTE:
- case XML_TOK_TEXT_FOOTNOTE:
-#ifndef SVX_LIGHT
- if (rImport.GetTextImport()->IsInFrame())
- {
- // we must not insert footnotes into text frames
- pContext = new SvXMLImportContext( rImport, nPrefix,
- rLocalName );
- }
- else
- {
- pContext = new XMLFootnoteImportContext( rImport,
- *rImport.GetTextImport().get(),
- nPrefix, rLocalName );
- }
-#else
- // create default context to skip content
- pContext = new SvXMLImportContext( rImport, nPrefix, rLocalName );
-#endif // #ifndef SVX_LIGHT
- rIgnoreLeadingSpace = sal_False;
- break;
-
- case XML_TOK_TEXT_REFERENCE:
- case XML_TOK_TEXT_BOOKMARK:
- case XML_TOK_TEXT_BOOKMARK_START:
- case XML_TOK_TEXT_BOOKMARK_END:
- pContext = new XMLTextMarkImportContext( rImport,
- *rImport.GetTextImport().get(),
- nPrefix, rLocalName );
- break;
-
- case XML_TOK_TEXT_REFERENCE_START:
- pContext = new XMLStartReferenceContext_Impl( rImport,
- nPrefix, rLocalName,
- rHints, xAttrList );
- break;
-
- case XML_TOK_TEXT_REFERENCE_END:
- pContext = new XMLEndReferenceContext_Impl( rImport,
- nPrefix, rLocalName,
- rHints, xAttrList );
- break;
-
- case XML_TOK_TEXT_TEXTBOX:
- bInsertTextFrame = sal_True;
- nTextFrameType = XML_TEXT_FRAME_TEXTBOX;
- break;
-
- case XML_TOK_TEXT_IMAGE:
- bInsertTextFrame = sal_True;
- nTextFrameType = XML_TEXT_FRAME_GRAPHIC;
- break;
- case XML_TOK_TEXT_APPLET:
- bInsertTextFrame = sal_True;
- nTextFrameType = XML_TEXT_FRAME_APPLET;
- break;
- case XML_TOK_TEXT_FLOATING_FRAME:
- bInsertTextFrame = sal_True;
- nTextFrameType = XML_TEXT_FRAME_FLOATING_FRAME;
- break;
- case XML_TOK_TEXT_PLUGIN:
- bInsertTextFrame = sal_True;
- nTextFrameType = XML_TEXT_FRAME_PLUGIN;
- break;
-
- case XML_TOK_TEXT_OBJECT_OLE:
- bInsertTextFrame = sal_True;
- nTextFrameType = XML_TEXT_FRAME_OBJECT_OLE;
- break;
- case XML_TOK_TEXT_OBJECT:
- bInsertTextFrame = sal_True;
- nTextFrameType = XML_TEXT_FRAME_OBJECT;
- break;
-
- case XML_TOK_DRAW_A:
- {
- Reference < XTextRange > xAnchorPos =
- rImport.GetTextImport()->GetCursor()->getStart();
- XMLTextFrameHint_Impl *pHint =
- new XMLTextFrameHint_Impl( xAnchorPos );
- XMLTextFrameHyperlinkContext *pLinkContext =
- new XMLTextFrameHyperlinkContext( rImport, nPrefix,
- rLocalName, xAttrList,
- TextContentAnchorType_AS_CHARACTER,
- &pHint->GetTextContentRef(),
- &pHint->GetAnchorTypeRef() );
- rHints.Insert( pHint, rHints.Count() );
- pContext = pLinkContext;
- }
- break;
-
- case XML_TOK_TEXT_TOC_MARK:
- case XML_TOK_TEXT_TOC_MARK_START:
- pContext = new XMLTOCMarkImportContext_Impl(
- rImport, nPrefix, rLocalName,
- (enum XMLTextPElemTokens)nToken, rHints);
- break;
-
- case XML_TOK_TEXT_USER_INDEX_MARK:
- case XML_TOK_TEXT_USER_INDEX_MARK_START:
- pContext = new XMLUserIndexMarkImportContext_Impl(
- rImport, nPrefix, rLocalName,
- (enum XMLTextPElemTokens)nToken, rHints);
- break;
-
- case XML_TOK_TEXT_ALPHA_INDEX_MARK:
- case XML_TOK_TEXT_ALPHA_INDEX_MARK_START:
- pContext = new XMLAlphaIndexMarkImportContext_Impl(
- rImport, nPrefix, rLocalName,
- (enum XMLTextPElemTokens)nToken, rHints);
- break;
-
- case XML_TOK_TEXT_TOC_MARK_END:
- case XML_TOK_TEXT_USER_INDEX_MARK_END:
- case XML_TOK_TEXT_ALPHA_INDEX_MARK_END:
- pContext = new XMLIndexMarkImportContext_Impl(
- rImport, nPrefix, rLocalName, (enum XMLTextPElemTokens)nToken,
- rHints);
- break;
-
- case XML_TOK_TEXTP_CHANGE_START:
- case XML_TOK_TEXTP_CHANGE_END:
- case XML_TOK_TEXTP_CHANGE:
- pContext = new XMLChangeImportContext(
- rImport, nPrefix, rLocalName,
- (nToken != XML_TOK_TEXTP_CHANGE_END),
- (nToken != XML_TOK_TEXTP_CHANGE_START),
- sal_False);
- break;
-
- default:
- // none of the above? then it's probably a text field!
- pContext =
- XMLTextFieldImportContext::CreateTextFieldImportContext(
- rImport, *rImport.GetTextImport().get(), nPrefix, rLocalName,
- nToken);
- // #108784# import draw elements (except control shapes in headers)
- if( pContext == NULL &&
- !( rImport.GetTextImport()->IsInHeaderFooter() &&
- nPrefix == XML_NAMESPACE_DRAW &&
- IsXMLToken( rLocalName, XML_CONTROL ) ) )
- {
- Reference < XShapes > xShapes;
- pContext = rImport.GetShapeImport()->CreateGroupChildContext(
- rImport, nPrefix, rLocalName, xAttrList, xShapes );
- }
- if( !pContext )
- {
- // ignore unknown content
- pContext =
- new SvXMLImportContext( rImport, nPrefix, rLocalName );
- }
- // Behind fields, shapes and any unknown content blanks aren't ignored
- rIgnoreLeadingSpace = sal_False;
- }
-
- if( bInsertTextFrame )
- {
- if( XMLTextImportHelper::HasDrawNameAttribute( xAttrList, rImport.GetNamespaceMap() ) )
- {
- Reference < XTextRange > xAnchorPos =
- rImport.GetTextImport()->GetCursor()->getStart();
- XMLTextFrameContext *pTextFrameContext =
- new XMLTextFrameContext( rImport, nPrefix,
- rLocalName, xAttrList,
- TextContentAnchorType_AS_CHARACTER,
- nTextFrameType );
- if( TextContentAnchorType_AT_CHARACTER ==
- pTextFrameContext->GetAnchorType() &&
- pTextFrameContext->GetTextContent().is() )
- {
- rHints.Insert( new XMLTextFrameHint_Impl(
- pTextFrameContext->GetTextContent(), xAnchorPos ),
- rHints.Count() );
- }
- pContext = pTextFrameContext;
- }
- else
- {
- Reference < XShapes > xShapes;
- pContext = rImport.GetShapeImport()->CreateGroupChildContext(
- rImport, nPrefix, rLocalName, xAttrList, xShapes );
- }
-
- rIgnoreLeadingSpace = sal_False;
- }
-
- return pContext;
-}
-
-SvXMLImportContext *XMLImpSpanContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList )
-{
- const SvXMLTokenMap& rTokenMap =
- GetImport().GetTextImport()->GetTextPElemTokenMap();
- sal_uInt16 nToken = rTokenMap.Get( nPrefix, rLocalName );
-
- return CreateChildContext( GetImport(), nPrefix, rLocalName, xAttrList,
- nToken, rHints, rIgnoreLeadingSpace
-#ifdef CONV_STAR_FONTS
- ,nStarFontsConvFlags
-#endif
- );
-}
-
-void XMLImpSpanContext_Impl::Characters( const OUString& rChars )
-{
-#ifdef CONV_STAR_FONTS
- OUString sStyleName;
- if( pHint )
- sStyleName = pHint->GetStyleName();
- OUString sChars =
- GetImport().GetTextImport()->ConvertStarFonts( rChars, sStyleName,
- nStarFontsConvFlags,
- sal_False, GetImport() );
- GetImport().GetTextImport()->InsertString( sChars, rIgnoreLeadingSpace );
-#else
- GetImport().GetTextImport()->InsertString( rChars, rIgnoreLeadingSpace );
-#endif
-}
-
-// ---------------------------------------------------------------------
-
-TYPEINIT1( XMLParaContext, SvXMLImportContext );
-
-XMLParaContext::XMLParaContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- sal_Bool bHead ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- xStart( rImport.GetTextImport()->GetCursorAsRange()->getStart() ),
- nOutlineLevel( 1 ),
- pHints( 0 ),
- bIgnoreLeadingSpace( sal_True ),
- bHeading( bHead )
-#ifdef CONV_STAR_FONTS
- ,nStarFontsConvFlags( 0 )
-#endif
-{
- const SvXMLTokenMap& rTokenMap =
- GetImport().GetTextImport()->GetTextPAttrTokenMap();
-
- OUString aCondStyleName;
-
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- const OUString& rAttrName = xAttrList->getNameByIndex( i );
- const OUString& rValue = xAttrList->getValueByIndex( i );
-
- OUString aLocalName;
- sal_uInt16 nPrefix =
- GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
- &aLocalName );
- switch( rTokenMap.Get( nPrefix, aLocalName ) )
- {
- case XML_TOK_TEXT_P_STYLE_NAME:
- sStyleName = rValue;
- break;
- case XML_TOK_TEXT_P_COND_STYLE_NAME:
- aCondStyleName = rValue;
- break;
- case XML_TOK_TEXT_P_LEVEL:
- {
- sal_Int32 nTmp = rValue.toInt32();
- if( nTmp > 0L )
- {
- if( nTmp > 127 )
- nTmp = 127;
- nOutlineLevel = (sal_Int8)nTmp;
- }
- }
-
- }
- }
-
- if( aCondStyleName.getLength() )
- sStyleName = aCondStyleName;
-}
-
-XMLParaContext::~XMLParaContext()
-{
- UniReference < XMLTextImportHelper > xTxtImport =
- GetImport().GetTextImport();
- Reference < XTextRange > xEnd = xTxtImport->GetCursorAsRange()->getStart();
-
- // insert a paragraph break
- xTxtImport->InsertControlCharacter( ControlCharacter::APPEND_PARAGRAPH );
-
- // create a cursor that select the whole last paragraph
- Reference < XTextCursor > xAttrCursor=
- xTxtImport->GetText()->createTextCursorByRange( xStart );
- xAttrCursor->gotoRange( xEnd, sal_True );
-
- // #103445# for headings without style name, find the proper style
- if( bHeading && (sStyleName.getLength() == 0) )
- xTxtImport->FindOutlineStyleName( sStyleName, nOutlineLevel );
-
- // set style and hard attributes at the previous paragraph
- sStyleName = xTxtImport->SetStyleAndAttrs( xAttrCursor, sStyleName, sal_True );
-
- if( bHeading )
- xTxtImport->SetOutlineStyle( nOutlineLevel, sStyleName );
-
- if( pHints && pHints->Count() )
- {
- for( sal_uInt16 i=0; i<pHints->Count(); i++ )
- {
- XMLHint_Impl *pHint = (*pHints)[i];
- xAttrCursor->gotoRange( pHint->GetStart(), sal_False );
- xAttrCursor->gotoRange( pHint->GetEnd(), sal_True );
- switch( pHint->GetType() )
- {
- case XML_HINT_STYLE:
- {
- const OUString& rStyleName =
- ((XMLStyleHint_Impl *)pHint)->GetStyleName();
- if( rStyleName.getLength() )
- xTxtImport->SetStyleAndAttrs( xAttrCursor, rStyleName,
- sal_False );
- }
- break;
- case XML_HINT_REFERENCE:
- {
- const OUString& rRefName =
- ((XMLReferenceHint_Impl *)pHint)->GetRefName();
- if( rRefName.getLength() )
- {
- if( !pHint->GetEnd().is() )
- pHint->SetEnd(xEnd);
-
- // convert XCursor to XTextRange
- Reference<XTextRange> xRange(xAttrCursor, UNO_QUERY);
-
- // reference name uses rStyleName member
- // borrow from XMLTextMarkImportContext
- XMLTextMarkImportContext::CreateAndInsertMark(
- GetImport(),
- OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.text.ReferenceMark")),
- rRefName,
- xRange);
- }
- }
- break;
- case XML_HINT_HYPERLINK:
- {
- const XMLHyperlinkHint_Impl *pHHint =
- (const XMLHyperlinkHint_Impl *)pHint;
- xTxtImport->SetHyperlink( xAttrCursor,
- pHHint->GetHRef(),
- pHHint->GetName(),
- pHHint->GetTargetFrameName(),
- pHHint->GetStyleName(),
- pHHint->GetVisitedStyleName(),
- pHHint->GetEventsContext() );
- }
- break;
- case XML_HINT_RUBY:
- {
- const XMLRubyHint_Impl *pRHint =
- (const XMLRubyHint_Impl *)pHint;
- xTxtImport->SetRuby( xAttrCursor,
- pRHint->GetStyleName(),
- pRHint->GetTextStyleName(),
- pRHint->GetText() );
- }
- break;
- case XML_HINT_INDEX_MARK:
- {
- Reference<beans::XPropertySet> xMark(
- ((const XMLIndexMarkHint_Impl *)pHint)->GetMark());
- Reference<XTextContent> xContent(xMark, UNO_QUERY);
- Reference<XTextRange> xRange(xAttrCursor, UNO_QUERY);
- xTxtImport->GetText()->insertTextContent(
- xRange, xContent, sal_True );
- }
- break;
- case XML_HINT_TEXT_FRAME:
- {
- const XMLTextFrameHint_Impl *pFHint =
- (const XMLTextFrameHint_Impl *)pHint;
- if( pFHint->IsBoundAtChar() )
- {
- Reference<XTextRange> xRange(xAttrCursor, UNO_QUERY);
- pFHint->GetTextContent()->attach( xRange );
- }
- }
- break;
- default:
- DBG_ASSERT( !this, "What's this" );
- break;
- }
- }
- }
- delete pHints;
-}
-
-SvXMLImportContext *XMLParaContext::CreateChildContext(
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< xml::sax::XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
-
- const SvXMLTokenMap& rTokenMap =
- GetImport().GetTextImport()->GetTextPElemTokenMap();
- sal_uInt16 nToken = rTokenMap.Get( nPrefix, rLocalName );
- if( !pHints )
- pHints = new XMLHints_Impl;
- return XMLImpSpanContext_Impl::CreateChildContext(
- GetImport(), nPrefix, rLocalName, xAttrList,
- nToken, *pHints, bIgnoreLeadingSpace
-#ifdef CONV_STAR_FONTS
- , nStarFontsConvFlags
-#endif
- );
-}
-
-void XMLParaContext::Characters( const OUString& rChars )
-{
-#ifdef CONV_STAR_FONTS
- OUString sChars =
- GetImport().GetTextImport()->ConvertStarFonts( rChars, sStyleName,
- nStarFontsConvFlags,
- sal_True, GetImport() );
- GetImport().GetTextImport()->InsertString( sChars, bIgnoreLeadingSpace );
-#else
- GetImport().GetTextImport()->InsertString( rChars, bIgnoreLeadingSpace );
-#endif
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_txtprhdl.cxx b/binfilter/bf_xmloff/source/text/xmloff_txtprhdl.cxx
deleted file mode 100644
index e9ceb97a78b3..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_txtprhdl.cxx
+++ /dev/null
@@ -1,1384 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/style/DropCapFormat.hpp>
-#include <com/sun/star/text/FontRelief.hpp>
-#include <com/sun/star/text/WrapTextMode.hpp>
-#include <com/sun/star/text/XTextColumns.hpp>
-#include <com/sun/star/text/RelOrientation.hpp>
-#include <com/sun/star/text/HoriOrientation.hpp>
-#include <com/sun/star/text/VertOrientation.hpp>
-#include <com/sun/star/text/RubyAdjust.hpp>
-#include <com/sun/star/text/FontEmphasis.hpp>
-#include <com/sun/star/text/ParagraphVertAlign.hpp>
-
-#include "xmltypes.hxx"
-#include "xmluconv.hxx"
-#include "XMLAnchorTypePropHdl.hxx"
-#include "XMLConstantsPropertyHandler.hxx"
-#include "XMLClipPropertyHandler.hxx"
-#include "XMLTextColumnsPropertyHandler.hxx"
-#include "NamedBoolPropertyHdl.hxx"
-#include "txtprhdl.hxx"
-namespace binfilter {
-
-using namespace ::rtl;
-//using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::style;
-//using namespace ::com::sun::star::container;
-//using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::text;
-using namespace ::binfilter::xmloff::token;
-
-
-#define CONSTASCII_USTRINGPARAM_CMP(s) s, sizeof(s)-1
-
-// ---------------------------------------------------------------------------
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_HoriPos_Enum[] =
-{
- { XML_FROM_LEFT, HoriOrientation::NONE },
- { XML_FROM_INSIDE, HoriOrientation::NONE }, // import only
- { XML_LEFT, HoriOrientation::LEFT },
- { XML_INSIDE, HoriOrientation::LEFT }, // import only
- { XML_CENTER, HoriOrientation::CENTER },
- { XML_RIGHT, HoriOrientation::RIGHT },
- { XML_OUTSIDE, HoriOrientation::RIGHT }, // import only
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_HoriPosMirrored_Enum[] =
-{
- { XML_FROM_INSIDE, HoriOrientation::NONE },
- { XML_INSIDE, HoriOrientation::LEFT },
- { XML_CENTER, HoriOrientation::CENTER },
- { XML_OUTSIDE, HoriOrientation::RIGHT },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_HoriRel_Enum[] =
-{
- { XML_PARAGRAPH, RelOrientation::FRAME },
- { XML_PARAGRAPH_CONTENT, RelOrientation::PRINT_AREA },
- { XML_PAGE, RelOrientation::PAGE_FRAME },
- { XML_PAGE_CONTENT, RelOrientation::PAGE_PRINT_AREA },
- { XML_PARAGRAPH_START_MARGIN, RelOrientation::FRAME_LEFT },
- { XML_PARAGRAPH_END_MARGIN, RelOrientation::FRAME_RIGHT },
- { XML_PAGE_START_MARGIN, RelOrientation::PAGE_LEFT },
- { XML_PAGE_END_MARGIN, RelOrientation::PAGE_RIGHT },
- { XML_CHAR, RelOrientation::CHAR },
- { XML_FRAME, RelOrientation::FRAME }, // import only
- { XML_FRAME_CONTENT, RelOrientation::PRINT_AREA }, // import only
- { XML_FRAME_START_MARGIN, RelOrientation::FRAME_LEFT }, // import only
- { XML_FRAME_END_MARGIN, RelOrientation::FRAME_RIGHT }, // import only
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_HoriRelFrame_Enum[] =
-{
- { XML_FRAME, RelOrientation::FRAME },
- { XML_FRAME_CONTENT, RelOrientation::PRINT_AREA },
- { XML_PAGE, RelOrientation::PAGE_FRAME },
- { XML_PAGE_CONTENT, RelOrientation::PAGE_PRINT_AREA },
- { XML_FRAME_START_MARGIN, RelOrientation::FRAME_LEFT },
- { XML_FRAME_END_MARGIN, RelOrientation::FRAME_RIGHT },
- { XML_PAGE_START_MARGIN, RelOrientation::PAGE_LEFT },
- { XML_PAGE_END_MARGIN, RelOrientation::PAGE_RIGHT },
- { XML_CHAR, RelOrientation::CHAR },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_HoriMirror_Enum[] =
-{
- { XML_FROM_LEFT, sal_False },
- { XML_FROM_INSIDE, sal_True },
- { XML_LEFT, sal_False },
- { XML_INSIDE, sal_True },
- { XML_CENTER, sal_False },
- { XML_RIGHT, sal_False },
- { XML_OUTSIDE, sal_True },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_VertPos_Enum[] =
-{
- { XML_FROM_TOP, VertOrientation::NONE },
- { XML_TOP, VertOrientation::TOP },
- { XML_TOP, VertOrientation::CHAR_TOP }, // export only
- { XML_TOP, VertOrientation::LINE_TOP }, // export only
- { XML_MIDDLE, VertOrientation::CENTER },
- { XML_MIDDLE, VertOrientation::CHAR_CENTER }, // export only
- { XML_MIDDLE, VertOrientation::LINE_CENTER }, // export only
- { XML_BOTTOM, VertOrientation::BOTTOM },
- { XML_BOTTOM, VertOrientation::CHAR_BOTTOM }, // export only
- { XML_BOTTOM, VertOrientation::LINE_BOTTOM }, // export only
- { XML_BELOW, VertOrientation::CHAR_BOTTOM }, // import only
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_VertPosAtChar_Enum[] =
-{
- { XML_FROM_TOP, VertOrientation::NONE },
- { XML_TOP, VertOrientation::TOP },
- { XML_TOP, VertOrientation::CHAR_TOP }, // export only
- { XML_TOP, VertOrientation::LINE_TOP }, // export only
- { XML_MIDDLE, VertOrientation::CENTER },
- { XML_MIDDLE, VertOrientation::CHAR_CENTER }, // export only
- { XML_MIDDLE, VertOrientation::LINE_CENTER }, // export only
- { XML_BOTTOM, VertOrientation::BOTTOM },
- { XML_BELOW, VertOrientation::CHAR_BOTTOM }, // export only
- { XML_BOTTOM, VertOrientation::LINE_BOTTOM }, // export only
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_VertRel_Enum[] =
-{
- { XML_PARAGRAPH, RelOrientation::FRAME },
- { XML_PARAGRAPH_CONTENT, RelOrientation::PRINT_AREA },
- { XML_CHAR, RelOrientation::CHAR },
- { XML_PAGE, RelOrientation::FRAME }, // import only
- { XML_PAGE_CONTENT, RelOrientation::PRINT_AREA }, // import only
- { XML_FRAME, RelOrientation::FRAME }, // import only
- { XML_FRAME_CONTENT, RelOrientation::PRINT_AREA }, // import only
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_VertRelPage_Enum[] =
-{
- { XML_PAGE, RelOrientation::FRAME },
- { XML_PAGE_CONTENT, RelOrientation::PRINT_AREA },
- { XML_PAGE, RelOrientation::PAGE_FRAME },
- { XML_PAGE_CONTENT, RelOrientation::PAGE_PRINT_AREA },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_VertRelFrame_Enum[] =
-{
- { XML_FRAME, RelOrientation::FRAME },
- { XML_FRAME_CONTENT, RelOrientation::PRINT_AREA },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_VertRelAsChar_Enum[] =
-{
- { XML_BASELINE, VertOrientation::TOP },
- { XML_BASELINE, VertOrientation::CENTER }, // export only
- { XML_BASELINE, VertOrientation::BOTTOM }, // export only
- { XML_TEXT, VertOrientation::CHAR_TOP },
- { XML_TEXT, VertOrientation::CHAR_CENTER }, // export only
- { XML_TEXT, VertOrientation::CHAR_BOTTOM }, // export only
- { XML_LINE, VertOrientation::LINE_TOP },
- { XML_LINE, VertOrientation::LINE_CENTER }, // export only
- { XML_LINE, VertOrientation::LINE_BOTTOM }, // export only
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_RubyAdjust_Enum[] =
-{
- { XML_LEFT, RubyAdjust_LEFT },
- { XML_CENTER, RubyAdjust_CENTER },
- { XML_RIGHT, RubyAdjust_RIGHT },
- { XML_DISTRIBUTE_LETTER, RubyAdjust_BLOCK },
- { XML_DISTRIBUTE_SPACE, RubyAdjust_INDENT_BLOCK },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_FontRelief_Enum[] =
-{
- { XML_NONE, FontRelief::NONE },
- { XML_ENGRAVED, FontRelief::ENGRAVED },
- { XML_EMBOSSED, FontRelief::EMBOSSED },
- { XML_TOKEN_INVALID, 0 }
-};
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_VerticalAlign_Enum[] =
-{
- { XML_TOP, ParagraphVertAlign::TOP },
- { XML_MIDDLE, ParagraphVertAlign::CENTER },
- { XML_BOTTOM, ParagraphVertAlign::BOTTOM },
- { XML_BASELINE, ParagraphVertAlign::BASELINE },
- { XML_AUTO, ParagraphVertAlign::AUTOMATIC },
- { XML_TOKEN_INVALID, 0 }
-};
-
-// ---------------------------------------------------------------------------
-
-class XMLDropCapPropHdl_Impl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLDropCapPropHdl_Impl ();
-
- virtual sal_Bool equals(
- const ::com::sun::star::uno::Any& r1,
- const ::com::sun::star::uno::Any& r2 ) const;
-
- /// TabStops will be imported/exported as XML-Elements. So the Import/Export-work must be done at another place.
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-XMLDropCapPropHdl_Impl::~XMLDropCapPropHdl_Impl ()
-{
-}
-
-sal_Bool XMLDropCapPropHdl_Impl::equals(
- const Any& r1,
- const Any& r2 ) const
-{
- DropCapFormat aFormat1, aFormat2;
- r1 >>= aFormat1;
- r2 >>= aFormat2;
-
- return (aFormat1.Lines <=1 && aFormat2.Lines <=1) ||
- (aFormat1.Lines == aFormat2.Lines &&
- aFormat1.Count == aFormat2.Count &&
- aFormat1.Distance == aFormat2.Distance);
-}
-
-sal_Bool XMLDropCapPropHdl_Impl::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- DBG_ASSERT( !this, "drop caps are an element import property" );
- return sal_False;
-}
-
-sal_Bool XMLDropCapPropHdl_Impl::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- DBG_ASSERT( !this, "drop caps are an element export property" );
- return sal_False;
-}
-
-// ---------------------------------------------------------------------------
-
-class XMLOpaquePropHdl_Impl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLOpaquePropHdl_Impl ();
-
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-sal_Bool XMLOpaquePropHdl_Impl::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_True;
- sal_Bool bVal = sal_False;
- if( IsXMLToken( rStrImpValue, XML_FOREGROUND ) )
- bVal = sal_True;
- else if( !IsXMLToken( rStrImpValue, XML_BACKGROUND ) )
- bRet = sal_False;
-
- if( bRet )
- rValue.setValue( &bVal, ::getBooleanCppuType() );
-
- return bRet;
-}
-
-sal_Bool XMLOpaquePropHdl_Impl::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- if( *(sal_Bool *)rValue.getValue() )
- rStrExpValue = GetXMLToken( XML_FOREGROUND );
- else
- rStrExpValue = GetXMLToken( XML_BACKGROUND );
-
- return sal_True;
-}
-
-XMLOpaquePropHdl_Impl::~XMLOpaquePropHdl_Impl ()
-{
-}
-
-// ---------------------------------------------------------------------------
-
-class XMLContourModePropHdl_Impl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLContourModePropHdl_Impl ();
-
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-sal_Bool XMLContourModePropHdl_Impl::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_True;
- sal_Bool bVal = sal_False;
- if( IsXMLToken( rStrImpValue, XML_OUTSIDE ) )
- bVal = sal_True;
- else if( ! IsXMLToken( rStrImpValue, XML_FULL ) )
- bRet = sal_False;
-
- if( bRet )
- rValue.setValue( &bVal, ::getBooleanCppuType() );
-
- return bRet;
-}
-
-sal_Bool XMLContourModePropHdl_Impl::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- if( *(sal_Bool *)rValue.getValue() )
- rStrExpValue = GetXMLToken( XML_OUTSIDE );
- else
- rStrExpValue = GetXMLToken( XML_FULL );
-
- return sal_True;
-}
-
-XMLContourModePropHdl_Impl::~XMLContourModePropHdl_Impl()
-{
-}
-
-// ---------------------------------------------------------------------------
-
-class XMLParagraphOnlyPropHdl_Impl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLParagraphOnlyPropHdl_Impl ();
-
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-sal_Bool XMLParagraphOnlyPropHdl_Impl::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_True;
- sal_Bool bVal = sal_False;
-
- if( ! IsXMLToken( rStrImpValue, XML_NO_LIMIT ) )
- {
- sal_Int32 nValue = 0;
- bRet = rUnitConverter.convertNumber( nValue, rStrImpValue );
- bVal = 1 == nValue;
- }
-
- if( bRet )
- rValue.setValue( &bVal, ::getBooleanCppuType() );
-
- return bRet;
-}
-
-sal_Bool XMLParagraphOnlyPropHdl_Impl::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- if( *(sal_Bool *)rValue.getValue() )
- rStrExpValue = GetXMLToken( XML_1 );
- else
- rStrExpValue = GetXMLToken( XML_NO_LIMIT );
-
- return sal_True;
-}
-
-XMLParagraphOnlyPropHdl_Impl::~XMLParagraphOnlyPropHdl_Impl()
-{
-}
-
-// ---------------------------------------------------------------------------
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_Wrap_Enum[] =
-{
- { XML_NONE, WrapTextMode_NONE },
- { XML_RUN_THROUGH, WrapTextMode_THROUGHT },
- { XML_PARALLEL, WrapTextMode_PARALLEL },
- { XML_DYNAMIC, WrapTextMode_DYNAMIC },
- { XML_LEFT, WrapTextMode_LEFT },
- { XML_RIGHT, WrapTextMode_RIGHT },
- { XML_TOKEN_INVALID, 0 }
-};
-
-class XMLWrapPropHdl_Impl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLWrapPropHdl_Impl ();
-
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-sal_Bool XMLWrapPropHdl_Impl::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_uInt16 nWrap;
- sal_Bool bRet = rUnitConverter.convertEnum( nWrap, rStrImpValue,
- pXML_Wrap_Enum );
-
- if( bRet )
- rValue <<= (WrapTextMode)nWrap;
-
- return bRet;
-}
-
-sal_Bool XMLWrapPropHdl_Impl::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUStringBuffer aOut;
- WrapTextMode eVal;
-
- rValue >>= eVal;
-
- sal_Bool bRet = rUnitConverter.convertEnum( aOut, eVal, pXML_Wrap_Enum, XML_NONE );
-
- rStrExpValue = aOut.makeStringAndClear();
-
- return bRet;
-}
-
-XMLWrapPropHdl_Impl::~XMLWrapPropHdl_Impl ()
-{
-}
-
-// ---------------------------------------------------------------------------
-
-class XMLFrameProtectPropHdl_Impl : public XMLPropertyHandler
-{
- const OUString sVal;
-public:
- XMLFrameProtectPropHdl_Impl( enum XMLTokenEnum eVal ) :
- sVal( GetXMLToken(eVal) ) {}
- virtual ~XMLFrameProtectPropHdl_Impl ();
-
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-sal_Bool XMLFrameProtectPropHdl_Impl::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_True;
- sal_Bool bVal = sal_False;
- if( ! IsXMLToken( rStrImpValue, XML_NONE ) )
- {
- bRet = sal_False;
- SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
- OUString aToken;
- while( aTokenEnum.getNextToken( aToken ) )
- {
- bRet = sal_True;
- if( aToken == sVal )
- {
- bVal = sal_True;
- break;
- }
- }
- }
-
- if( bRet )
- rValue.setValue( &bVal, ::getBooleanCppuType() );
-
- return bRet;
-}
-
-sal_Bool XMLFrameProtectPropHdl_Impl::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- if( *(sal_Bool *)rValue.getValue() )
- {
- if( !rStrExpValue.getLength() ||
- IsXMLToken( rStrExpValue, XML_NONE ) )
- {
- rStrExpValue = sVal;
- }
- else
- {
- OUStringBuffer aOut( rStrExpValue.getLength() + 1 +
- sVal.getLength() );
- aOut.append( rStrExpValue );
- aOut.append( (sal_Unicode)' ' );
- aOut.append( sVal );
- rStrExpValue = aOut.makeStringAndClear();
- }
- }
- else if( !rStrExpValue.getLength() )
- {
- rStrExpValue = GetXMLToken( XML_NONE );
- }
-
- return sal_True;
-}
-
-XMLFrameProtectPropHdl_Impl::~XMLFrameProtectPropHdl_Impl()
-{
-}
-
-// ---------------------------------------------------------------------------
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_Anchor_Enum[] =
-{
- { XML_CHAR, TextContentAnchorType_AT_CHARACTER },
- { XML_PAGE, TextContentAnchorType_AT_PAGE },
- { XML_FRAME, TextContentAnchorType_AT_FRAME },
- { XML_PARAGRAPH, TextContentAnchorType_AT_PARAGRAPH },
- { XML_AS_CHAR, TextContentAnchorType_AS_CHARACTER },
- { XML_TOKEN_INVALID, 0 }
-};
-
-
-sal_Bool XMLAnchorTypePropHdl::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_uInt16 nAnchor;
- sal_Bool bRet = rUnitConverter.convertEnum( nAnchor, rStrImpValue,
- pXML_Anchor_Enum );
-
- if( bRet )
- rValue <<= (TextContentAnchorType)nAnchor;
-
- return bRet;
-}
-
-sal_Bool XMLAnchorTypePropHdl::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUStringBuffer aOut;
- TextContentAnchorType eVal;
-
- rValue >>= eVal;
-
- sal_Bool bRet = rUnitConverter.convertEnum( aOut, eVal, pXML_Anchor_Enum, XML_PARAGRAPH );
-
- rStrExpValue = aOut.makeStringAndClear();
-
- return bRet;
-}
-
-XMLAnchorTypePropHdl::~XMLAnchorTypePropHdl()
-{
-}
-
-sal_Bool XMLAnchorTypePropHdl::convert( const OUString& rStrImpValue,
- const SvXMLUnitConverter& rUnitConverter,
- TextContentAnchorType& rType )
-{
- sal_uInt16 nAnchor;
- sal_Bool bRet = rUnitConverter.convertEnum( nAnchor, rStrImpValue,
- pXML_Anchor_Enum );
- if( bRet )
- rType = (TextContentAnchorType)nAnchor;
- return bRet;
-}
-
-// ---------------------------------------------------------------------------
-
-
-XMLTextColumnsPropertyHandler::~XMLTextColumnsPropertyHandler ()
-{
-}
-
-sal_Bool XMLTextColumnsPropertyHandler::equals(
- const Any& r1,
- const Any& r2 ) const
-{
- Reference < XTextColumns > xColumns1;
- r1 >>= xColumns1;
-
- Reference < XTextColumns > xColumns2;
- r2 >>= xColumns2;
-
- if( xColumns1->getColumnCount() != xColumns2->getColumnCount() ||
- xColumns1->getReferenceValue() != xColumns2->getReferenceValue() )
- return sal_False;
-
- Sequence < TextColumn > aColumns1 = xColumns1->getColumns();
- Sequence < TextColumn > aColumns2 = xColumns2->getColumns();
- sal_Int32 nCount = aColumns1.getLength();
- if( aColumns2.getLength() != nCount )
- return sal_False;
-
- const TextColumn *pColumns1 = aColumns1.getArray();
- const TextColumn *pColumns2 = aColumns2.getArray();
-
- while( nCount-- )
- {
- if( pColumns1->Width != pColumns2->Width ||
- pColumns1->LeftMargin != pColumns2->LeftMargin ||
- pColumns1->RightMargin != pColumns2->RightMargin )
- return sal_False;
-
- pColumns1++;
- pColumns2++;
- }
-
- return sal_True;
-}
-
-sal_Bool XMLTextColumnsPropertyHandler::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- DBG_ASSERT( !this, "columns are an element import property" );
- return sal_False;
-}
-
-sal_Bool XMLTextColumnsPropertyHandler::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- DBG_ASSERT( !this, "columns are an element export property" );
- return sal_False;
-}
-
-// ---------------------------------------------------------------------------
-
-class XMLHoriMirrorPropHdl_Impl : public XMLPropertyHandler
-{
-public:
- virtual ~XMLHoriMirrorPropHdl_Impl ();
-
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-sal_Bool XMLHoriMirrorPropHdl_Impl::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_uInt16 nHoriMirror;
- sal_Bool bRet = rUnitConverter.convertEnum( nHoriMirror, rStrImpValue,
- pXML_HoriMirror_Enum );
-
- if( bRet )
- {
- sal_Bool bTmp = nHoriMirror != 0;
- rValue.setValue( &bTmp, ::getBooleanCppuType() );
- }
-
- return bRet;
-}
-
-sal_Bool XMLHoriMirrorPropHdl_Impl::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- DBG_ASSERT( !this, "HorMirror properyt shouldn't be exported" );
-
- return sal_False;
-}
-
-XMLHoriMirrorPropHdl_Impl::~XMLHoriMirrorPropHdl_Impl ()
-{
-}
-
-// ---------------------------------------------------------------------------
-
-class XMLGrfMirrorPropHdl_Impl : public XMLPropertyHandler
-{
- const OUString sVal;
- sal_Bool bHori;
-
-public:
- XMLGrfMirrorPropHdl_Impl( enum XMLTokenEnum eVal, sal_Bool bH ) :
- sVal( GetXMLToken( eVal ) ),
- bHori( bH ) {}
- virtual ~XMLGrfMirrorPropHdl_Impl ();
-
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-sal_Bool XMLGrfMirrorPropHdl_Impl::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_True;
- sal_Bool bVal = sal_False;
- if( ! IsXMLToken( rStrImpValue, XML_NONE ) )
- {
- bRet = sal_False;
- SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
- OUString aToken;
- while( aTokenEnum.getNextToken( aToken ) )
- {
- bRet = sal_True;
- if( aToken == sVal ||
- (bHori && IsXMLToken( aToken, XML_HORIZONTAL ) ) )
- {
- bVal = sal_True;
- break;
- }
- }
- }
-
- if( bRet )
- rValue.setValue( &bVal, ::getBooleanCppuType() );
-
- return bRet;
-}
-
-sal_Bool XMLGrfMirrorPropHdl_Impl::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- if( *(sal_Bool *)rValue.getValue() )
- {
- if( !rStrExpValue.getLength() ||
- IsXMLToken( rStrExpValue, XML_NONE ) )
- {
- rStrExpValue = sVal;
- }
- else if( bHori &&
- ( IsXMLToken( rStrExpValue, XML_HORIZONTAL_ON_LEFT_PAGES ) ||
- IsXMLToken( rStrExpValue, XML_HORIZONTAL_ON_RIGHT_PAGES ) ))
- {
- rStrExpValue = GetXMLToken( XML_HORIZONTAL );
- }
- else
- {
- OUStringBuffer aOut( rStrExpValue.getLength() + 1 +
- sVal.getLength() );
- aOut.append( rStrExpValue );
- aOut.append( (sal_Unicode)' ' );
- aOut.append( sVal );
- rStrExpValue = aOut.makeStringAndClear();
- }
- }
- else if( !rStrExpValue.getLength() )
- {
- rStrExpValue = GetXMLToken( XML_NONE );
- }
-
- return sal_True;
-}
-
-XMLGrfMirrorPropHdl_Impl::~XMLGrfMirrorPropHdl_Impl()
-{
-}
-
-// ---------------------------------------------------------------------------
-
-SvXMLEnumMapEntry __READONLY_DATA pXML_Emphasize_Enum[] =
-{
- { XML_NONE, FontEmphasis::NONE },
- { XML_DOT, FontEmphasis::DOT_ABOVE },
- { XML_CIRCLE, FontEmphasis::CIRCLE_ABOVE },
- { XML_DISC, FontEmphasis::DISK_ABOVE },
- { XML_ACCENT, FontEmphasis::ACCENT_ABOVE },
- { XML_TOKEN_INVALID, 0 }
-};
-class XMLTextEmphasizePropHdl_Impl : public XMLPropertyHandler
-{
-public:
- XMLTextEmphasizePropHdl_Impl() {}
- virtual ~XMLTextEmphasizePropHdl_Impl();
-
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-sal_Bool XMLTextEmphasizePropHdl_Impl::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_True;
- sal_uInt16 nVal = FontEmphasis::NONE;
- sal_Bool bBelow = sal_False;
- sal_Bool bHasPos = sal_False, bHasType = sal_False;
- OUString aToken;
-
- SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
- while( aTokenEnum.getNextToken( aToken ) )
- {
- if( !bHasPos && IsXMLToken( aToken, XML_ABOVE ) )
- {
- bBelow = sal_False;
- bHasPos = sal_True;
- }
- else if( !bHasPos && IsXMLToken( aToken, XML_BELOW ) )
- {
- bBelow = sal_True;
- bHasPos = sal_True;
- }
- else if( !bHasType &&
- rUnitConverter.convertEnum( nVal, aToken,
- pXML_Emphasize_Enum ))
- {
- bHasType = sal_True;
- }
- else
- {
- bRet = sal_False;
- break;
- }
- }
-
- if( bRet )
- {
- if( FontEmphasis::NONE != nVal && bBelow )
- nVal += 10;
- rValue <<= (sal_Int16)nVal;
- }
-
- return bRet;
-}
-
-sal_Bool XMLTextEmphasizePropHdl_Impl::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- OUStringBuffer aOut( 15 );
- sal_Bool bRet = sal_True;
- sal_Int16 nType;
- if( rValue >>= nType )
- {
- sal_Bool bBelow = sal_False;
- if( nType > 10 )
- {
- bBelow = sal_True;
- nType -= 10;
- }
- bRet = rUnitConverter.convertEnum( aOut, nType,
- pXML_Emphasize_Enum,
- XML_DOT );
- if( bRet )
- {
- if( nType != 0 )
- {
- enum XMLTokenEnum ePos = bBelow ? XML_BELOW : XML_ABOVE;
- aOut.append( (sal_Unicode)' ' );
- aOut.append( GetXMLToken(ePos) );
- }
- rStrExpValue = aOut.makeStringAndClear();
- }
- }
-
- return bRet;
-}
-
-XMLTextEmphasizePropHdl_Impl::~XMLTextEmphasizePropHdl_Impl()
-{
-}
-
-
-// ---------------------------------------------------------------------------
-
-class XMLTextCombineCharPropHdl_Impl : public XMLPropertyHandler
-{
-public:
- XMLTextCombineCharPropHdl_Impl() {}
- virtual ~XMLTextCombineCharPropHdl_Impl();
-
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-sal_Bool XMLTextCombineCharPropHdl_Impl::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- if( rStrImpValue.getLength() )
- rValue <<= rStrImpValue.copy( 0, 1 );
- else
- rValue <<= rStrImpValue;
-
- return sal_True;
-}
-
-sal_Bool XMLTextCombineCharPropHdl_Impl::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- rValue >>= rStrExpValue;
-
- return sal_True;
-}
-
-XMLTextCombineCharPropHdl_Impl::~XMLTextCombineCharPropHdl_Impl()
-{
-}
-
-// ---------------------------------------------------------------------------
-
-class XMLTextRelWidthHeightPropHdl_Impl : public XMLPropertyHandler
-{
-public:
- XMLTextRelWidthHeightPropHdl_Impl() {}
- virtual ~XMLTextRelWidthHeightPropHdl_Impl();
-
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-sal_Bool XMLTextRelWidthHeightPropHdl_Impl::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet;
- sal_Int32 nValue;
- bRet = rUnitConverter.convertPercent( nValue, rStrImpValue );
- if( bRet )
- rValue <<= (sal_Int16)nValue;
-
- return bRet;
-}
-
-sal_Bool XMLTextRelWidthHeightPropHdl_Impl::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- sal_Int16 nValue;
- if( (rValue >>= nValue) && nValue > 0 )
- {
- OUStringBuffer aOut;
- rUnitConverter.convertPercent( aOut, nValue );
- rStrExpValue = aOut.makeStringAndClear();
-
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-XMLTextRelWidthHeightPropHdl_Impl::~XMLTextRelWidthHeightPropHdl_Impl()
-{
-}
-
-// ---------------------------------------------------------------------------
-
-class XMLTextSyncWidthHeightPropHdl_Impl : public XMLPropertyHandler
-{
- const OUString sValue;
-
-public:
- XMLTextSyncWidthHeightPropHdl_Impl( enum XMLTokenEnum eValue ) :
- sValue( GetXMLToken(eValue) ) {}
- virtual ~XMLTextSyncWidthHeightPropHdl_Impl();
-
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-sal_Bool XMLTextSyncWidthHeightPropHdl_Impl::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bValue = (rStrImpValue == sValue );
- rValue.setValue( &bValue, ::getBooleanCppuType() );
-
- return sal_True;
-}
-
-sal_Bool XMLTextSyncWidthHeightPropHdl_Impl::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Bool bRet = sal_False;
- if( *(sal_Bool *)rValue.getValue() )
- {
- rStrExpValue = sValue;
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-XMLTextSyncWidthHeightPropHdl_Impl::~XMLTextSyncWidthHeightPropHdl_Impl()
-{
-}
-
-// ---------------------------------------------------------------------------
-
-class XMLTextRotationAnglePropHdl_Impl : public XMLPropertyHandler
-{
-
-public:
- XMLTextRotationAnglePropHdl_Impl() {}
- virtual ~XMLTextRotationAnglePropHdl_Impl();
-
- virtual sal_Bool importXML(
- const ::rtl::OUString& rStrImpValue,
- ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
- virtual sal_Bool exportXML(
- ::rtl::OUString& rStrExpValue,
- const ::com::sun::star::uno::Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const;
-};
-
-sal_Bool XMLTextRotationAnglePropHdl_Impl::importXML(
- const OUString& rStrImpValue,
- Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Int32 nValue;
- sal_Bool bRet = rUnitConverter.convertNumber( nValue, rStrImpValue );
- if( bRet )
- {
- nValue = (nValue % 360 );
- if( nValue < 0 )
- nValue = 360 + nValue;
- sal_Int16 nAngle;
- if( nValue < 45 || nValue > 315 )
- nAngle = 0;
- else if( nValue < 180 )
- nAngle = 900;
- else /* if nValalue <= 315 ) */
- nAngle = 2700;
- rValue <<= nAngle;
- }
-
- return bRet;
-}
-
-sal_Bool XMLTextRotationAnglePropHdl_Impl::exportXML(
- OUString& rStrExpValue,
- const Any& rValue,
- const SvXMLUnitConverter& rUnitConverter ) const
-{
- sal_Int16 nAngle;
- sal_Bool bRet = ( rValue >>= nAngle );
- if( bRet )
- {
- OUStringBuffer aOut;
- rUnitConverter.convertNumber( aOut, nAngle / 10 );
- rStrExpValue = aOut.makeStringAndClear();
- }
- OSL_ENSURE( bRet, "illegal rotation angle" );
-
- return bRet;
-}
-
-XMLTextRotationAnglePropHdl_Impl::~XMLTextRotationAnglePropHdl_Impl()
-{
-}
-// ---------------------------------------------------------------------------
-class XMLTextPropertyHandlerFactory_Impl
-{
-public:
- const XMLPropertyHandler *GetPropertyHandler( sal_Int32 nType ) const;
-
- XMLTextPropertyHandlerFactory_Impl();
- ~XMLTextPropertyHandlerFactory_Impl();
-};
-
-const XMLPropertyHandler *XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler
- ( sal_Int32 nType ) const
-{
- const XMLPropertyHandler* pHdl = 0;
- switch( nType )
- {
- case XML_TYPE_TEXT_DROPCAP:
- pHdl = new XMLDropCapPropHdl_Impl;
- break;
- case XML_TYPE_TEXT_WRAP:
- pHdl = new XMLWrapPropHdl_Impl;
- break;
- case XML_TYPE_TEXT_PARAGRAPH_ONLY:
- pHdl = new XMLParagraphOnlyPropHdl_Impl;
- break;
- case XML_TYPE_TEXT_WRAP_OUTSIDE:
- pHdl = new XMLContourModePropHdl_Impl;
- break;
- case XML_TYPE_TEXT_OPAQUE:
- pHdl = new XMLOpaquePropHdl_Impl;
- break;
- case XML_TYPE_TEXT_PROTECT_CONTENT:
- pHdl = new XMLFrameProtectPropHdl_Impl( XML_CONTENT );
- break;
- case XML_TYPE_TEXT_PROTECT_SIZE:
- pHdl = new XMLFrameProtectPropHdl_Impl( XML_SIZE );
- break;
- case XML_TYPE_TEXT_PROTECT_POSITION:
- pHdl = new XMLFrameProtectPropHdl_Impl( XML_POSITION );
- break;
- case XML_TYPE_TEXT_ANCHOR_TYPE:
- pHdl = new XMLAnchorTypePropHdl;
- break;
- case XML_TYPE_TEXT_COLUMNS:
- pHdl = new XMLTextColumnsPropertyHandler;
- break;
- case XML_TYPE_TEXT_HORIZONTAL_POS:
- pHdl = new XMLConstantsPropertyHandler( pXML_HoriPos_Enum, XML_TOKEN_INVALID );
- break;
- case XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED:
- pHdl = new XMLConstantsPropertyHandler( pXML_HoriPosMirrored_Enum, XML_TOKEN_INVALID );
- break;
- case XML_TYPE_TEXT_HORIZONTAL_REL:
- pHdl = new XMLConstantsPropertyHandler( pXML_HoriRel_Enum, XML_TOKEN_INVALID );
- break;
- case XML_TYPE_TEXT_HORIZONTAL_REL_FRAME:
- pHdl = new XMLConstantsPropertyHandler( pXML_HoriRelFrame_Enum, XML_TOKEN_INVALID );
- break;
- case XML_TYPE_TEXT_HORIZONTAL_MIRROR:
- pHdl = new XMLHoriMirrorPropHdl_Impl;
- break;
- case XML_TYPE_TEXT_VERTICAL_POS:
- pHdl = new XMLConstantsPropertyHandler( pXML_VertPos_Enum, XML_TOKEN_INVALID );
- case XML_TYPE_TEXT_VERTICAL_POS_AT_CHAR:
- pHdl = new XMLConstantsPropertyHandler( pXML_VertPosAtChar_Enum, XML_TOKEN_INVALID );
- break;
- case XML_TYPE_TEXT_VERTICAL_REL:
- pHdl = new XMLConstantsPropertyHandler( pXML_VertRel_Enum, XML_TOKEN_INVALID );
- break;
- case XML_TYPE_TEXT_VERTICAL_REL_PAGE:
- pHdl = new XMLConstantsPropertyHandler( pXML_VertRelPage_Enum, XML_TOKEN_INVALID );
- break;
- case XML_TYPE_TEXT_VERTICAL_REL_FRAME:
- pHdl = new XMLConstantsPropertyHandler( pXML_VertRelFrame_Enum, XML_TOKEN_INVALID );
- break;
- case XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR:
- pHdl = new XMLConstantsPropertyHandler( pXML_VertRelAsChar_Enum, XML_TOKEN_INVALID );
- break;
- case XML_TYPE_TEXT_MIRROR_VERTICAL:
- pHdl = new XMLGrfMirrorPropHdl_Impl( XML_VERTICAL, sal_False );
- break;
- case XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT:
- pHdl = new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_LEFT_PAGES, sal_True );
- break;
- case XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT:
- pHdl = new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_RIGHT_PAGES, sal_True );
- break;
- case XML_TYPE_TEXT_CLIP:
- pHdl = new XMLClipPropertyHandler;
- break;
- case XML_TYPE_TEXT_EMPHASIZE:
- pHdl = new XMLTextEmphasizePropHdl_Impl;
- break;
- case XML_TYPE_TEXT_COMBINE:
- pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LINES ),
- GetXMLToken( XML_NONE ) );
- break;
- case XML_TYPE_TEXT_COMBINE_CHARACTERS:
- pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LETTERS ),
- GetXMLToken( XML_NONE ) );
- break;
- case XML_TYPE_TEXT_COMBINECHAR:
- pHdl = new XMLTextCombineCharPropHdl_Impl;
- break;
- case XML_TYPE_TEXT_AUTOSPACE:
- pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_IDEOGRAPH_ALPHA ),
- GetXMLToken( XML_NONE ) );
- break;
- case XML_TYPE_TEXT_PUNCTUATION_WRAP:
- pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_HANGING ),
- GetXMLToken( XML_SIMPLE ) );
- break;
- case XML_TYPE_TEXT_LINE_BREAK:
- pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_STRICT ),
- GetXMLToken( XML_NORMAL ) );
- break;
- case XML_TYPE_TEXT_REL_WIDTH_HEIGHT:
- pHdl = new XMLTextRelWidthHeightPropHdl_Impl;
- break;
- case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT:
- pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE );
- break;
- case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN:
- pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE_MIN );
- break;
- case XML_TYPE_TEXT_RUBY_ADJUST:
- pHdl = new XMLConstantsPropertyHandler( pXML_RubyAdjust_Enum, XML_TOKEN_INVALID );
- break;
- case XML_TYPE_TEXT_FONT_RELIEF:
- pHdl = new XMLConstantsPropertyHandler( pXML_FontRelief_Enum, XML_TOKEN_INVALID );
- break;
- case XML_TYPE_TEXT_ROTATION_ANGLE:
- pHdl = new XMLTextRotationAnglePropHdl_Impl;
- break;
- case XML_TYPE_TEXT_ROTATION_SCALE:
- pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_FIXED ),
- GetXMLToken( XML_LINE_HEIGHT ) );
- break;
- case XML_TYPE_TEXT_VERTICAL_ALIGN:
- pHdl = new XMLConstantsPropertyHandler( pXML_VerticalAlign_Enum, XML_TOKEN_INVALID );
- break;
- case XML_TYPE_TEXT_RUBY_POSITION:
- pHdl = new XMLNamedBoolPropertyHdl( ::binfilter::xmloff::token::XML_ABOVE,
- ::binfilter::xmloff::token::XML_BELOW );
- break;
- }
-
- return pHdl;
-}
-
-XMLTextPropertyHandlerFactory_Impl::XMLTextPropertyHandlerFactory_Impl()
-{
-}
-
-XMLTextPropertyHandlerFactory_Impl::~XMLTextPropertyHandlerFactory_Impl()
-{
-}
-
-// ----------------------------------------------------------------------------
-
-XMLTextPropertyHandlerFactory::XMLTextPropertyHandlerFactory() :
- XMLPropertyHandlerFactory(),
- pImpl( new XMLTextPropertyHandlerFactory_Impl )
-{
-}
-
-XMLTextPropertyHandlerFactory::~XMLTextPropertyHandlerFactory()
-{
- delete pImpl;
-}
-
-const XMLPropertyHandler *XMLTextPropertyHandlerFactory::GetPropertyHandler(
- sal_Int32 nType ) const
-{
- const XMLPropertyHandler *pHdl =
- XMLPropertyHandlerFactory::GetPropertyHandler( nType );
-
- if( !pHdl )
- {
- const XMLPropertyHandler *pNewHdl = pImpl->GetPropertyHandler( nType );
-
- if( pNewHdl )
- PutHdlCache( nType, pNewHdl );
-
- pHdl = pNewHdl;
- }
-
- return pHdl;
-}
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_txtprmap.cxx b/binfilter/bf_xmloff/source/text/xmloff_txtprmap.cxx
deleted file mode 100644
index f84209a22336..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_txtprmap.cxx
+++ /dev/null
@@ -1,792 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/debug.hxx>
-
-#include "xmlnmspe.hxx"
-#include "txtprhdl.hxx"
-#include "txtprmap.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::binfilter::xmloff::token;
-
-#define M_E( a, p, l, t, c ) \
- { a, sizeof(a)-1, XML_NAMESPACE_##p, XML_##l, t, c }
-
-#define M_ED( a, p, l, t, c ) \
- { a, sizeof(a)-1, XML_NAMESPACE_##p, XML_##l, (t) | MID_FLAG_DEFAULT_ITEM_EXPORT, c }
-
-#define M_END() \
- { NULL, 0, 0, XML_TOKEN_INVALID, 0, 0 }
-
-
-XMLPropertyMapEntry aXMLParaPropMap[] =
-{
- // RES_UNKNOWNATR_CONTAINER
- M_E( "ParaUserDefinedAttributes", TEXT, XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ),
- // RES_LR_SPACE
- M_E( "ParaLeftMargin", FO, MARGIN_LEFT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARALEFTMARGIN ),
- M_E( "ParaLeftMarginRelative", FO, MARGIN_LEFT, XML_TYPE_PERCENT16, CTF_PARALEFTMARGIN_REL ),
- M_E( "ParaRightMargin", FO, MARGIN_RIGHT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARARIGHTMARGIN ),
- M_E( "ParaRightMarginRelative", FO, MARGIN_RIGHT, XML_TYPE_PERCENT16, CTF_PARARIGHTMARGIN_REL ),
- // RES_UL_SPACE
- M_E( "ParaTopMargin", FO, MARGIN_TOP, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARATOPMARGIN ),
- M_E( "ParaTopMarginRelative", FO, MARGIN_TOP, XML_TYPE_PERCENT16, CTF_PARATOPMARGIN_REL ),
- M_E( "ParaBottomMargin", FO, MARGIN_BOTTOM, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARABOTTOMMARGIN ),
- M_E( "ParaBottomMarginRelative",FO, MARGIN_BOTTOM, XML_TYPE_PERCENT16, CTF_PARABOTTOMMARGIN_REL ),
- // RES_CHRATR_CASEMAP
- M_E( "CharCaseMap", FO, FONT_VARIANT, XML_TYPE_TEXT_CASEMAP_VAR, 0 ),
- M_E( "CharCaseMap", FO, TEXT_TRANSFORM, XML_TYPE_TEXT_CASEMAP, 0 ),
- // RES_CHRATR_COLOR
- M_ED( "CharColor", FO, COLOR, XML_TYPE_COLORAUTO|MID_FLAG_MERGE_PROPERTY, 0 ),
- M_ED( "CharColor", STYLE, USE_WINDOW_FONT_COLOR, XML_TYPE_ISAUTOCOLOR|MID_FLAG_MERGE_PROPERTY, 0 ),
- // RES_CHRATR_CONTOUR
- M_E( "CharContoured", STYLE, TEXT_OUTLINE, XML_TYPE_BOOL, 0 ),
- // RES_CHRATR_CROSSEDOUT
- M_E( "CharStrikeout", STYLE, TEXT_CROSSING_OUT, XML_TYPE_TEXT_CROSSEDOUT, 0),
- // RES_CHRATR_ESCAPEMENT
- M_E( "CharEscapement", STYLE, TEXT_POSITION, XML_TYPE_TEXT_ESCAPEMENT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ),
- M_E( "CharEscapementHeight", STYLE, TEXT_POSITION, XML_TYPE_TEXT_ESCAPEMENT_HEIGHT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ),
- // RES_CHRATR_FONT
- M_ED( "CharFontName", STYLE, FONT_NAME, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME ),
-#ifdef CONV_STAR_FONTS
- M_ED( "CharFontName", FO, FONT_FAMILY, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME ),
-#else
- M_ED( "CharFontName", FO, FONT_FAMILY, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME ),
-#endif
- M_ED( "CharFontStyleName",STYLE, FONT_STYLE_NAME, XML_TYPE_STRING, CTF_FONTSTYLENAME ),
- M_ED( "CharFontFamily", STYLE, FONT_FAMILY_GENERIC,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY ),
- M_ED( "CharFontPitch", STYLE, FONT_PITCH, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH ),
- M_ED( "CharFontCharSet", STYLE, FONT_CHARSET, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET ),
- // RES_CHRATR_FONTSIZE
- M_ED( "CharHeight", FO, FONT_SIZE, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT ),
- M_ED( "CharPropHeight",FO, FONT_SIZE, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL ),
- M_ED( "CharDiffHeight",STYLE,FONT_SIZE_REL, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF ),
- // RES_CHRATR_KERNING
- M_E( "CharKerning", FO, LETTER_SPACING, XML_TYPE_TEXT_KERNING, 0 ),
- // RES_CHRATR_LANGUAGE
- M_ED( "CharLocale", FO, LANGUAGE, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ),
- M_ED( "CharLocale", FO, COUNTRY, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ),
- // RES_CHRATR_POSTURE
- M_E( "CharPosture", FO, FONT_STYLE, XML_TYPE_TEXT_POSTURE, 0 ),
- // RES_CHRATR_PROPORTIONALFONTSIZE
- // TODO: not used?
- // RES_CHRATR_SHADOWED
- M_E( "CharShadowed", FO, TEXT_SHADOW, XML_TYPE_TEXT_SHADOWED, 0 ),
- // RES_CHRATR_UNDERLINE
- M_E( "CharUnderline", STYLE, TEXT_UNDERLINE, XML_TYPE_TEXT_UNDERLINE, CTF_UNDERLINE ),
- M_E( "CharUnderlineColor", STYLE, TEXT_UNDERLINE_COLOR, XML_TYPE_TEXT_UNDERLINE_COLOR|MID_FLAG_MULTI_PROPERTY, CTF_UNDERLINE_COLOR ),
- M_E( "CharUnderlineHasColor", STYLE, TEXT_UNDERLINE_COLOR, XML_TYPE_TEXT_UNDERLINE_HASCOLOR|MID_FLAG_MERGE_ATTRIBUTE, CTF_UNDERLINE_HASCOLOR ),
- // RES_CHRATR_WEIGHT
- M_E( "CharWeight", FO, FONT_WEIGHT, XML_TYPE_TEXT_WEIGHT, 0 ),
- // RES_CHRATR_WORDLINEMODE
- M_E( "CharWordMode", FO, SCORE_SPACES, XML_TYPE_NBOOL, 0 ),
- // RES_CHRATR_AUTOKERN
- M_E( "CharAutoKerning", STYLE, LETTER_KERNING, XML_TYPE_BOOL, 0 ),
- // RES_CHRATR_BLINK
- M_E( "CharFlash", STYLE, TEXT_BLINKING, XML_TYPE_BOOL, 0 ),
- // RES_CHRATR_NOHYPHEN
- // TODO: not used?
- // RES_CHRATR_NOLINEBREAK
- // TODO: not used?
- // RES_CHRATR_BACKGROUND
- M_E( "CharBackColor", STYLE, TEXT_BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ),
- M_E( "CharBackTransparent", STYLE, TEXT_BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ),
- M_E( "CharBackColor", FO, TEXT_BACKGROUND_COLOR, XML_TYPE_COLOR|MID_FLAG_SPECIAL_ITEM_EXPORT, CTF_OLDTEXTBACKGROUND ),
- // RES_CHRATR_CJK_FONT
- M_ED( "CharFontNameAsian", STYLE, FONT_NAME_ASIAN, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME_CJK ),
-#ifdef CONV_STAR_FONTS
- M_ED( "CharFontNameAsian", STYLE, FONT_FAMILY_ASIAN, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME_CJK ),
-#else
- M_ED( "CharFontNameAsian", STYLE, FONT_FAMILY_ASIAN, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME_CJK ),
-#endif
- M_ED( "CharFontStyleNameAsian",STYLE, FONT_STYLE_NAME_ASIAN, XML_TYPE_STRING, CTF_FONTSTYLENAME_CJK ),
- M_ED( "CharFontFamilyAsian", STYLE, FONT_FAMILY_GENERIC_ASIAN,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY_CJK ),
- M_ED( "CharFontPitchAsian", STYLE, FONT_PITCH_ASIAN, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH_CJK ),
- M_ED( "CharFontCharSetAsian", STYLE, FONT_CHARSET_ASIAN, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET_CJK ),
- // RES_CHRATR_CJK_FONTSIZE
- M_ED( "CharHeightAsian", STYLE, FONT_SIZE_ASIAN, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_CJK ),
- M_ED( "CharPropHeightAsian",STYLE, FONT_SIZE_ASIAN, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL_CJK ),
- M_ED( "CharDiffHeightAsian",STYLE,FONT_SIZE_REL_ASIAN, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF_CJK ),
- // RES_CHRATR_CJK_LANGUAGE
- M_ED( "CharLocaleAsian", STYLE, LANGUAGE_ASIAN, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ),
- M_ED( "CharLocaleAsian", STYLE, COUNTRY_ASIAN, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ),
- // RES_CHRATR_CJK_POSTURE
- M_E( "CharPostureAsian", STYLE, FONT_STYLE_ASIAN, XML_TYPE_TEXT_POSTURE, 0 ),
- // RES_CHRATR_CJK_WEIGHT
- M_E( "CharWeightAsian", STYLE, FONT_WEIGHT_ASIAN, XML_TYPE_TEXT_WEIGHT, 0 ),
- // RES_CHRATR_CTL_FONT
- M_ED( "CharFontNameComplex", STYLE, FONT_NAME_COMPLEX, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME_CTL ),
-#ifdef CONV_STAR_FONTS
- M_ED( "CharFontNameComplex", STYLE, FONT_FAMILY_COMPLEX, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME_CTL ),
-#else
- M_ED( "CharFontNameComplex", STYLE, FONT_FAMILY_COMPLEX, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME_CTL ),
-#endif
- M_ED( "CharFontStyleNameComplex",STYLE, FONT_STYLE_NAME_COMPLEX, XML_TYPE_STRING, CTF_FONTSTYLENAME_CTL ),
- M_ED( "CharFontFamilyComplex", STYLE, FONT_FAMILY_GENERIC_COMPLEX,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY_CTL ),
- M_ED( "CharFontPitchComplex", STYLE, FONT_PITCH_COMPLEX, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH_CTL ),
- M_ED( "CharFontCharSetComplex", STYLE, FONT_CHARSET_COMPLEX, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET_CTL ),
- // RES_CHRATR_CTL_FONTSIZE
- M_ED( "CharHeightComplex", STYLE, FONT_SIZE_COMPLEX, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_CTL ),
- M_ED( "CharPropHeightComplex",STYLE, FONT_SIZE_COMPLEX, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL_CTL ),
- M_ED( "CharDiffHeightComplex",STYLE,FONT_SIZE_REL_COMPLEX, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF_CTL ),
- // RES_CHRATR_CTL_LANGUAGE
- M_ED( "CharLocaleComplex", STYLE, LANGUAGE_COMPLEX, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ),
- M_ED( "CharLocaleComplex", STYLE, COUNTRY_COMPLEX, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ),
- // RES_CHRATR_CTL_POSTURE
- M_E( "CharPostureComplex", STYLE, FONT_STYLE_COMPLEX, XML_TYPE_TEXT_POSTURE, 0 ),
- // RES_CHRATR_CTL_WEIGHT
- M_E( "CharWeightComplex", STYLE, FONT_WEIGHT_COMPLEX, XML_TYPE_TEXT_WEIGHT, 0 ),
- // RES_CHRATR_ROTATE
- M_E( "CharRotation", STYLE, TEXT_ROTATION_ANGLE, XML_TYPE_TEXT_ROTATION_ANGLE, 0 ),
- M_E( "CharRotationIsFitToLine", STYLE, TEXT_ROTATION_SCALE, XML_TYPE_TEXT_ROTATION_SCALE, 0 ),
- // RES_CHRATR_EMPHASIS_MARK
- M_E( "CharEmphasis", STYLE, TEXT_EMPHASIZE, XML_TYPE_TEXT_EMPHASIZE, 0 ),
- // RES_CHRATR_TWO_LINES
- M_E( "CharCombineIsOn", STYLE, TEXT_COMBINE, XML_TYPE_TEXT_COMBINE, 0 ),
- M_E( "CharCombinePrefix", STYLE, TEXT_COMBINE_START_CHAR, XML_TYPE_TEXT_COMBINECHAR, 0 ),
- M_E( "CharCombineSuffix", STYLE, TEXT_COMBINE_END_CHAR, XML_TYPE_TEXT_COMBINECHAR, 0 ),
- // RES_CHRATR_SCALEW
- M_E( "CharScaleWidth", STYLE, TEXT_SCALE, XML_TYPE_PERCENT16, 0 ),
- //RES_CHRATR_RELIEF
- M_E( "CharRelief", STYLE, FONT_RELIEF, XML_TYPE_TEXT_FONT_RELIEF, 0 ),
- // RES_TXTATR_INETFMT
- // TODO
- // RES_TXTATR_REFMARK
- // TODO
- // RES_TXTATR_TOXMARK
- // TODO
- // RES_TXTATR_CHARFMT
-// M_E_SI( TEXT, style_name, RES_TXTATR_CHARFMT, 0 ),
- // RES_TXTATR_CJK_RUBY
- // TODO
- // RES_TXTATR_FIELD
- // TODO
- // RES_TXTATR_FLYCNT
- // TODO
- // RES_TXTATR_FTN
- // TODO
- // RES_TXTATR_SOFTHYPH
- // TODO
- // RES_TXTATR_HARDBLANK
- // TODO
-
- // RES_PARATR_LINESPACING
- M_E( "ParaLineSpacing", FO, LINE_HEIGHT, XML_TYPE_LINE_SPACE_FIXED, 0 ),
- M_E( "ParaLineSpacing", STYLE, LINE_HEIGHT_AT_LEAST, XML_TYPE_LINE_SPACE_MINIMUM, 0 ),
- M_E( "ParaLineSpacing", STYLE, LINE_SPACING, XML_TYPE_LINE_SPACE_DISTANCE, 0 ),
- // RES_PARATR_ADJUST
- M_E( "ParaAdjust", FO, TEXT_ALIGN, XML_TYPE_TEXT_ADJUST, CTF_SD_SHAPE_PARA_ADJUST ),
- M_E( "ParaLastLineAdjust", FO, TEXT_ALIGN_LAST, XML_TYPE_TEXT_ADJUSTLAST, 0 ),
- M_E( "ParaExpandSingleWord",STYLE, JUSTIFY_SINGLE_WORD,XML_TYPE_BOOL, 0 ),
- // RES_PARATR_SPLIT
- M_E( "ParaSplit", STYLE, BREAK_INSIDE, XML_TYPE_TEXT_SPLIT, 0 ),
- // RES_PARATR_ORPHANS
- M_E( "ParaOrphans", FO, ORPHANS, XML_TYPE_NUMBER8, 0 ),
- // RES_PARATR_WIDOWS
- M_E( "ParaWidows", FO, WIDOWS, XML_TYPE_NUMBER8, 0 ),
- // RES_PARATR_TABSTOP
- M_ED( "ParaTabStops", STYLE, TAB_STOPS, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_TABSTOP, CTF_TABSTOP ), // this is not realy a string!
- // RES_PARATR_HYPHENZONE
- M_E( "ParaIsHyphenation", FO, HYPHENATE, XML_TYPE_BOOL, 0 ),
- M_E( "ParaHyphenationMaxLeadingChars", FO, HYPHENATION_REMAIN_CHAR_COUNT, XML_TYPE_NUMBER16, 0 ),
- M_E( "ParaHyphenationMaxTrailingChars",FO, HYPHENATION_PUSH_CHAR_COUNT, XML_TYPE_NUMBER16, 0 ),
- M_E( "ParaHyphenationMaxHyphens", FO, HYPHENATION_LADDER_COUNT, XML_TYPE_NUMBER16_NONE, 0 ),
- // RES_PARATR_DROP
- M_E( "DropCapWholeWord", STYLE, LENGTH, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BOOL, CTF_DROPCAPWHOLEWORD ),
- M_E( "DropCapCharStyleName", STYLE, STYLE_NAME, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_DROPCAPCHARSTYLE ),
- M_E( "DropCapFormat", STYLE, DROP_CAP, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_DROPCAP, CTF_DROPCAPFORMAT ),
- // RES_PARATR_REGISTER
- M_E( "ParaRegisterModeActive", STYLE, REGISTER_TRUE, XML_TYPE_BOOL, 0 ),
- // RES_PARATR_NUMRULE
- M_E( "NumberingStyleName", STYLE, LIST_STYLE_NAME, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_NUMBERINGSTYLENAME ),
- M_E( "IsNumbering", TEXT, ENABLE_NUMBERING, XML_TYPE_BOOL, 0 ),
-
- // RES_FILL_ORDER
- // not required
- // RES_FRM_SIZE
- // not required
- // RES_PAPER_BIN
- // not required
- // RES_LR_SPACE
-
- M_E( "ParaFirstLineIndent", FO, TEXT_INDENT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARAFIRSTLINE ),
- M_E( "ParaFirstLineIndentRelative", FO, TEXT_INDENT, XML_TYPE_PERCENT, CTF_PARAFIRSTLINE_REL ),
- M_E( "ParaIsAutoFirstLineIndent", STYLE, AUTO_TEXT_INDENT, XML_TYPE_BOOL, 0 ),
- // RES_PAGEDESC
- M_E( "PageDescName", STYLE, MASTER_PAGE_NAME, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_PAGEDESCNAME ),
- M_E( "PageNumberOffset", STYLE, PAGE_NUMBER, XML_TYPE_NUMBER16, 0 ),
- // RES_BREAK : TODO: does this work?
- M_E( "BreakType", FO, BREAK_BEFORE, XML_TYPE_TEXT_BREAKBEFORE|MID_FLAG_MULTI_PROPERTY, 0 ),
- M_E( "BreakType", FO, BREAK_AFTER, XML_TYPE_TEXT_BREAKAFTER, 0 ),
- // RES_CNTNT
- // not required
- // RES_HEADER
- // not required
- // RES_FOOTER
- // not required
- // RES_PRINT
- // not required
- // RES_OPAQUE
- // not required
- // RES_PROTECT
- // not required
- // RES_SURROUND
- // not required
- // RES_VERT_ORIENT
- // not required
- // RES_HORI_ORIENT
- // not required
- // RES_ANCHOR
- // not required
- // RES_BACKGROUND
- M_E( "ParaBackColor", FO, BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ),
- M_E( "ParaBackTransparent", FO, BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ),
- M_E( "ParaBackGraphicLocation", STYLE, POSITION, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BUILDIN_CMP_ONLY, CTF_BACKGROUND_POS ),
- M_E( "ParaBackGraphicFilter",STYLE, FILTER_NAME, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_FILTER ),
- M_E( "ParaBackGraphicURL", STYLE, BACKGROUND_IMAGE, MID_FLAG_ELEMENT_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_URL ),
- // RES_BOX
- M_E( "LeftBorder", STYLE, BORDER_LINE_WIDTH, XML_TYPE_BORDER_WIDTH, CTF_ALLBORDERWIDTH ),
- M_E( "LeftBorder", STYLE, BORDER_LINE_WIDTH_LEFT, XML_TYPE_BORDER_WIDTH, CTF_LEFTBORDERWIDTH ),
- M_E( "RightBorder", STYLE, BORDER_LINE_WIDTH_RIGHT, XML_TYPE_BORDER_WIDTH, CTF_RIGHTBORDERWIDTH ),
- M_E( "TopBorder", STYLE, BORDER_LINE_WIDTH_TOP, XML_TYPE_BORDER_WIDTH, CTF_TOPBORDERWIDTH ),
- M_E( "BottomBorder", STYLE, BORDER_LINE_WIDTH_BOTTOM, XML_TYPE_BORDER_WIDTH, CTF_BOTTOMBORDERWIDTH ),
-
- M_E( "LeftBorderDistance", FO, PADDING, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_ALLBORDERDISTANCE ), // need special import filtering
- M_E( "LeftBorderDistance", FO, PADDING_LEFT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_LEFTBORDERDISTANCE ),
- M_E( "RightBorderDistance", FO, PADDING_RIGHT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_RIGHTBORDERDISTANCE ),
- M_E( "TopBorderDistance", FO, PADDING_TOP, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_TOPBORDERDISTANCE ),
- M_E( "BottomBorderDistance",FO, PADDING_BOTTOM, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_BOTTOMBORDERDISTANCE ),
-
- M_E( "LeftBorder", FO, BORDER, XML_TYPE_BORDER, CTF_ALLBORDER ),
- M_E( "LeftBorder", FO, BORDER_LEFT, XML_TYPE_BORDER, CTF_LEFTBORDER ),
- M_E( "RightBorder", FO, BORDER_RIGHT, XML_TYPE_BORDER, CTF_RIGHTBORDER ),
- M_E( "TopBorder", FO, BORDER_TOP, XML_TYPE_BORDER, CTF_TOPBORDER ),
- M_E( "BottomBorder", FO, BORDER_BOTTOM, XML_TYPE_BORDER, CTF_BOTTOMBORDER ),
- // RES_SHADOW
- M_E( "ParaShadowFormat", STYLE, SHADOW, XML_TYPE_TEXT_SHADOW, 0 ),
- // RES_FRMMACRO
- // not required
- // RES_COL
- // not required
- // RES_KEEP
- M_E( "ParaKeepTogether", FO, KEEP_WITH_NEXT, XML_TYPE_BOOL, 0 ),
- // RES_URL
- // not required
- // RES_EDIT_IN_READONLY
- // not required
- // RES_LAYOUT_SPLIT
- // not required
- // RES_CHAIN
- // not required
-
- // RES_LINENUMBER
- M_E( "ParaLineNumberCount", TEXT, NUMBER_LINES, XML_TYPE_BOOL, 0 ),
- M_E( "ParaLineNumberStartValue", TEXT, LINE_NUMBER, XML_TYPE_NUMBER, 0 ),
-
- // RES_FTN_AT_TXTEND
- // not required
- // RES_END_AT_TXTEND
- // not required
- M_ED( "ParaIsCharacterDistance", STYLE, TEXT_AUTOSPACE, XML_TYPE_TEXT_AUTOSPACE, 0 ),
- M_ED( "ParaIsHangingPunctuation", STYLE, PUNCTUATION_WRAP, XML_TYPE_TEXT_PUNCTUATION_WRAP, 0 ),
- M_ED( "ParaIsForbiddenRules", STYLE, LINE_BREAK, XML_TYPE_TEXT_LINE_BREAK, 0 ),
- M_E( "TabStopDistance", STYLE, TAB_STOP_DISTANCE, XML_TYPE_MEASURE, 0 ),
-
- // RES_PARATR_VERTALIGN
- M_E( "ParaVertAlignment", STYLE, VERTICAL_ALIGN, XML_TYPE_TEXT_VERTICAL_ALIGN, 0 ),
-
- // RES_PARATR_SNAPTOGRID
- M_E( "SnapToGrid", STYLE, SNAP_TO_LAYOUT_GRID, XML_TYPE_BOOL, 0 ),
-
- M_ED( "WritingMode", STYLE, WRITING_MODE, XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT, 0 ),
-
- M_E( "ParaIsConnectBorder", STYLE, JOIN_BORDER, XML_TYPE_BOOL, 0 ),
-
- M_END()
-};
-
-XMLPropertyMapEntry aXMLTextPropMap[] =
-{
- // RES_CHRATR_CASEMAP
- M_E( "CharCaseMap", FO, FONT_VARIANT, XML_TYPE_TEXT_CASEMAP_VAR, 0 ),
- M_E( "CharCaseMap", FO, TEXT_TRANSFORM, XML_TYPE_TEXT_CASEMAP, 0 ),
- // RES_CHRATR_COLOR
- M_ED( "CharColor", FO, COLOR, XML_TYPE_COLORAUTO|MID_FLAG_MERGE_PROPERTY, 0 ),
- M_ED( "CharColor", STYLE, USE_WINDOW_FONT_COLOR, XML_TYPE_ISAUTOCOLOR|MID_FLAG_MERGE_PROPERTY, 0 ),
- // RES_CHRATR_CONTOUR
- M_E( "CharContoured", STYLE, TEXT_OUTLINE, XML_TYPE_BOOL, 0 ),
- // RES_CHRATR_CROSSEDOUT
- M_E( "CharStrikeout", STYLE, TEXT_CROSSING_OUT, XML_TYPE_TEXT_CROSSEDOUT, 0),
- // RES_CHRATR_ESCAPEMENT
- M_E( "CharEscapement", STYLE, TEXT_POSITION, XML_TYPE_TEXT_ESCAPEMENT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ),
- M_E( "CharEscapementHeight", STYLE, TEXT_POSITION, XML_TYPE_TEXT_ESCAPEMENT_HEIGHT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ),
- // RES_CHRATR_FONT
- M_ED( "CharFontName", STYLE, FONT_NAME, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME ),
-#ifdef CONV_STAR_FONTS
- M_ED( "CharFontName", FO, FONT_FAMILY, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME ),
-#else
- M_ED( "CharFontName", FO, FONT_FAMILY, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME ),
-#endif
- M_ED( "CharFontStyleName",STYLE, FONT_STYLE_NAME, XML_TYPE_STRING, CTF_FONTSTYLENAME ),
- M_ED( "CharFontFamily", STYLE, FONT_FAMILY_GENERIC,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY ),
- M_ED( "CharFontPitch", STYLE, FONT_PITCH, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH ),
- M_ED( "CharFontCharSet", STYLE, FONT_CHARSET, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET ),
- // RES_CHRATR_FONTSIZE
- M_ED( "CharHeight", FO, FONT_SIZE, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT ),
- M_ED( "CharPropHeight",FO, FONT_SIZE, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL ),
- M_ED( "CharDiffHeight",STYLE,FONT_SIZE_REL, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF ),
- // RES_CHRATR_KERNING
- M_E( "CharKerning", FO, LETTER_SPACING, XML_TYPE_TEXT_KERNING, 0 ),
- // RES_CHRATR_LANGUAGE
- M_ED( "CharLocale", FO, LANGUAGE, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ),
- M_ED( "CharLocale", FO, COUNTRY, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ),
- // RES_CHRATR_POSTURE
- M_E( "CharPosture", FO, FONT_STYLE, XML_TYPE_TEXT_POSTURE, 0 ),
- // RES_CHRATR_PROPORTIONALFONTSIZE
- // TODO: not used?
- // RES_CHRATR_SHADOWED
- M_E( "CharShadowed", FO, TEXT_SHADOW, XML_TYPE_TEXT_SHADOWED, 0 ),
- // BIS HIER GEPRUEFT!
- // RES_CHRATR_UNDERLINE
- M_E( "CharUnderline", STYLE, TEXT_UNDERLINE, XML_TYPE_TEXT_UNDERLINE, CTF_UNDERLINE ),
- M_E( "CharUnderlineColor", STYLE, TEXT_UNDERLINE_COLOR, XML_TYPE_TEXT_UNDERLINE_COLOR|MID_FLAG_MULTI_PROPERTY, CTF_UNDERLINE_COLOR ),
- M_E( "CharUnderlineHasColor", STYLE, TEXT_UNDERLINE_COLOR, XML_TYPE_TEXT_UNDERLINE_HASCOLOR|MID_FLAG_MERGE_ATTRIBUTE, CTF_UNDERLINE_HASCOLOR ),
- // RES_CHRATR_WEIGHT
- M_E( "CharWeight", FO, FONT_WEIGHT, XML_TYPE_TEXT_WEIGHT, 0 ),
- // RES_CHRATR_WORDLINEMODE
- M_E( "CharWordMode", FO, SCORE_SPACES, XML_TYPE_NBOOL, 0 ),
- // RES_CHRATR_AUTOKERN
- M_E( "CharAutoKerning", STYLE, LETTER_KERNING, XML_TYPE_BOOL, 0 ),
- // RES_CHRATR_BLINK
- M_E( "CharFlash", STYLE, TEXT_BLINKING, XML_TYPE_BOOL, 0 ),
- // RES_CHRATR_NOHYPHEN
- // TODO: not used?
- // RES_CHRATR_NOLINEBREAK
- // TODO: not used?
- // RES_CHRATR_BACKGROUND
- M_E( "CharBackColor", STYLE, TEXT_BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ),
- M_E( "CharBackTransparent", STYLE, TEXT_BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ),
- M_E( "CharBackColor", FO, TEXT_BACKGROUND_COLOR, XML_TYPE_COLOR|MID_FLAG_SPECIAL_ITEM_EXPORT, CTF_OLDTEXTBACKGROUND ),
- // RES_CHRATR_CJK_FONT
- M_ED( "CharFontNameAsian", STYLE, FONT_NAME_ASIAN, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME_CJK ),
-#ifdef CONV_STAR_FONTS
- M_ED( "CharFontNameAsian", STYLE, FONT_FAMILY_ASIAN, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME_CJK ),
-#else
- M_ED( "CharFontNameAsian", STYLE, FONT_FAMILY_ASIAN, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME_CJK ),
-#endif
- M_ED( "CharFontStyleNameAsian",STYLE, FONT_STYLE_NAME_ASIAN, XML_TYPE_STRING, CTF_FONTSTYLENAME_CJK ),
- M_ED( "CharFontFamilyAsian", STYLE, FONT_FAMILY_GENERIC_ASIAN,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY_CJK ),
- M_ED( "CharFontPitchAsian", STYLE, FONT_PITCH_ASIAN, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH_CJK ),
- M_ED( "CharFontCharSetAsian", STYLE, FONT_CHARSET_ASIAN, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET_CJK ),
- // RES_CHRATR_CJK_FONTSIZE
- M_ED( "CharHeightAsian", STYLE, FONT_SIZE_ASIAN, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_CJK ),
- M_ED( "CharPropHeightAsian",STYLE, FONT_SIZE_ASIAN, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL_CJK ),
- M_ED( "CharDiffHeightAsian",STYLE,FONT_SIZE_REL_ASIAN, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF_CJK ),
- // RES_CHRATR_CJK_LANGUAGE
- M_ED( "CharLocaleAsian", STYLE, LANGUAGE_ASIAN, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ),
- M_ED( "CharLocaleAsian", STYLE, COUNTRY_ASIAN, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ),
- // RES_CHRATR_CJK_POSTURE
- M_E( "CharPostureAsian", STYLE, FONT_STYLE_ASIAN, XML_TYPE_TEXT_POSTURE, 0 ),
- // RES_CHRATR_CJK_WEIGHT
- M_E( "CharWeightAsian", STYLE, FONT_WEIGHT_ASIAN, XML_TYPE_TEXT_WEIGHT, 0 ),
- // RES_CHRATR_CTL_FONT
- M_ED( "CharFontNameComplex", STYLE, FONT_NAME_COMPLEX, XML_TYPE_STRING|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTNAME_CTL ),
-#ifdef CONV_STAR_FONTS
- M_ED( "CharFontNameComplex", STYLE, FONT_FAMILY_COMPLEX, XML_TYPE_TEXT_FONTFAMILYNAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_FONTFAMILYNAME_CTL ),
-#else
- M_ED( "CharFontNameComplex", STYLE, FONT_FAMILY_COMPLEX, XML_TYPE_TEXT_FONTFAMILYNAME, CTF_FONTFAMILYNAME_CTL ),
-#endif
- M_ED( "CharFontStyleNameComplex",STYLE, FONT_STYLE_NAME_COMPLEX, XML_TYPE_STRING, CTF_FONTSTYLENAME_CTL ),
- M_ED( "CharFontFamilyComplex", STYLE, FONT_FAMILY_GENERIC_COMPLEX,XML_TYPE_TEXT_FONTFAMILY, CTF_FONTFAMILY_CTL ),
- M_ED( "CharFontPitchComplex", STYLE, FONT_PITCH_COMPLEX, XML_TYPE_TEXT_FONTPITCH, CTF_FONTPITCH_CTL ),
- M_ED( "CharFontCharSetComplex", STYLE, FONT_CHARSET_COMPLEX, XML_TYPE_TEXT_FONTENCODING, CTF_FONTCHARSET_CTL ),
- // RES_CHRATR_CTL_FONTSIZE
- M_ED( "CharHeightComplex", STYLE, FONT_SIZE_COMPLEX, XML_TYPE_CHAR_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_CTL ),
- M_ED( "CharPropHeightComplex",STYLE, FONT_SIZE_COMPLEX, XML_TYPE_CHAR_HEIGHT_PROP|MID_FLAG_MULTI_PROPERTY, CTF_CHARHEIGHT_REL_CTL ),
- M_ED( "CharDiffHeightComplex",STYLE,FONT_SIZE_REL_COMPLEX, XML_TYPE_CHAR_HEIGHT_DIFF, CTF_CHARHEIGHT_DIFF_CTL ),
- // RES_CHRATR_CTL_LANGUAGE
- M_ED( "CharLocaleComplex", STYLE, LANGUAGE_COMPLEX, XML_TYPE_CHAR_LANGUAGE|MID_FLAG_MERGE_PROPERTY, 0 ),
- M_ED( "CharLocaleComplex", STYLE, COUNTRY_COMPLEX, XML_TYPE_CHAR_COUNTRY|MID_FLAG_MERGE_PROPERTY, 0 ),
- // RES_CHRATR_CTL_POSTURE
- M_E( "CharPostureComplex", STYLE, FONT_STYLE_COMPLEX, XML_TYPE_TEXT_POSTURE, 0 ),
- // RES_CHRATR_CTL_WEIGHT
- M_E( "CharWeightComplex", STYLE, FONT_WEIGHT_COMPLEX, XML_TYPE_TEXT_WEIGHT, 0 ),
- // RES_CHRATR_ROTATE
- M_E( "CharRotation", STYLE, TEXT_ROTATION_ANGLE, XML_TYPE_TEXT_ROTATION_ANGLE, 0 ),
- M_E( "CharRotationIsFitToLine", STYLE, TEXT_ROTATION_SCALE, XML_TYPE_TEXT_ROTATION_SCALE, 0 ),
- // RES_CHRATR_EMPHASIS_MARK
- M_E( "CharEmphasis", STYLE, TEXT_EMPHASIZE, XML_TYPE_TEXT_EMPHASIZE, 0 ),
- // RES_CHRATR_TWO_LINES
- M_E( "CharCombineIsOn", STYLE, TEXT_COMBINE, XML_TYPE_TEXT_COMBINE|MID_FLAG_MULTI_PROPERTY, 0 ),
- M_E( "CharCombinePrefix", STYLE, TEXT_COMBINE_START_CHAR, XML_TYPE_TEXT_COMBINECHAR, 0 ),
- M_E( "CharCombineSuffix", STYLE, TEXT_COMBINE_END_CHAR, XML_TYPE_TEXT_COMBINECHAR, 0 ),
- // RES_CHRATR_SCALEW
- M_E( "CharScaleWidth", STYLE, TEXT_SCALE, XML_TYPE_PERCENT16, 0 ),
- // combined characters field, does not correspond to a property
- M_E( "", STYLE, TEXT_COMBINE, XML_TYPE_TEXT_COMBINE_CHARACTERS|MID_FLAG_NO_PROPERTY, CTF_COMBINED_CHARACTERS_FIELD ),
- //RES_CHRATR_RELIEF
- M_E( "CharRelief", STYLE, FONT_RELIEF, XML_TYPE_TEXT_FONT_RELIEF, 0 ),
-
- // RES_TXTATR_INETFMT
- M_E( "HyperLinkURL", TEXT, XMLNS, XML_TYPE_STRING|MID_FLAG_NO_PROPERTY_IMPORT, CTF_HYPERLINK_URL ),
- // RES_TXTATR_REFMARK
- // TODO
- // RES_TXTATR_TOXMARK
- // TODO
- // RES_TXTATR_CHARFMT
- M_E( "CharStyleName", TEXT, STYLE_NAME, XML_TYPE_STRING|MID_FLAG_NO_PROPERTY_IMPORT, CTF_CHAR_STYLE_NAME ),
- // RES_TXTATR_CJK_RUBY
- // TODO
- // RES_TXTATR_FIELD
- // TODO
- // RES_TXTATR_FLYCNT
- // TODO
- // RES_TXTATR_FTN
- // TODO
- // RES_TXTATR_SOFTHYPH
- // TODO
- // RES_TXTATR_HARDBLANK
- // TODO
- // RES_UNKNOWNATR_CONTAINER
- M_E( "TextUserDefinedAttributes", TEXT, XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ),
- M_ED( "ParaIsCharacterDistance", STYLE, TEXT_AUTOSPACE, XML_TYPE_TEXT_AUTOSPACE, 0 ),
- M_ED( "ParaIsHangingPunctuation", STYLE, PUNCTUATION_WRAP, XML_TYPE_TEXT_PUNCTUATION_WRAP, 0 ),
- M_ED( "ParaIsForbiddenRules", STYLE, LINE_BREAK, XML_TYPE_TEXT_LINE_BREAK, 0 ),
- M_E( "TabStopDistance", STYLE, TAB_STOP_DISTANCE, XML_TYPE_MEASURE, 0 ),
-
- M_END()
-};
-
-XMLPropertyMapEntry aXMLFramePropMap[] =
-{
- // RES_FILL_ORDER
- // TODO: not required???
- // RES_FRM_SIZE
- M_ED( "Width", SVG, WIDTH, XML_TYPE_MEASURE, 0 ),
- M_ED( "RelativeWidth", STYLE, REL_WIDTH, XML_TYPE_TEXT_REL_WIDTH_HEIGHT, 0 ),
-// M_ED( "RelativeWidth", STYLE, REL_WIDTH, XML_TYPE_TEXT_REL_WIDTH_HEIGHT|MID_FLAG_MULTI_PROPERTY, 0 ),
-// M_ED( "IsSyncWidthToHeight",STYLE, REL_WIDTH, XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT|MID_FLAG_MULTI_PROPERTY, 0 ),
-
- M_ED( "Height", SVG, HEIGHT, XML_TYPE_MEASURE, CTF_FRAMEHEIGHT_ABS ),
- M_ED( "Height", FO, MIN_HEIGHT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_FRAMEHEIGHT_MIN_ABS ),
- M_ED( "RelativeHeight", FO, MIN_HEIGHT, XML_TYPE_TEXT_REL_WIDTH_HEIGHT, CTF_FRAMEHEIGHT_MIN_REL ),
- M_ED( "RelativeHeight", STYLE, REL_HEIGHT, XML_TYPE_TEXT_REL_WIDTH_HEIGHT, CTF_FRAMEHEIGHT_REL ),
-// M_ED( "RelativeHeight", STYLE, REL_HEIGHT, XML_TYPE_TEXT_REL_WIDTH_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_FRAMEHEIGHT_REL ),
-// M_ED( "IsSyncHeightToWidth",STYLE, REL_HEIGHT, XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT|MID_FLAG_MULTI_PROPERTY, CTF_SYNCHEIGHT ),
-// M_ED( "IsSyncHeightToWidth",STYLE, REL_HEIGHT, XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN, CTF_SYNCHEIGHT_MIN ),
- M_ED( "SizeType", FO, TEXT_BOX, XML_TYPE_NUMBER16|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_SIZETYPE ),
- // RES_PAPER_BIN
- // not required
- // RES_ANCHOR
- // moved to here because it is not used for automatic styles
- M_ED( "AnchorType", TEXT, ANCHOR_TYPE, XML_TYPE_TEXT_ANCHOR_TYPE, CTF_ANCHORTYPE ),
- // AnchorPage number is not required for styles!
- M_ED( "HoriOrientPosition", SVG, X, XML_TYPE_MEASURE, 0 ),
- M_ED( "VertOrientPosition", SVG, Y, XML_TYPE_MEASURE, 0 ),
- // ***** The map for automatic styles starts here *****
- // RES_LR_SPACE
- M_E( "LeftMargin", FO, MARGIN_LEFT, XML_TYPE_MEASURE, 0),
- M_E( "RightMargin", FO, MARGIN_RIGHT, XML_TYPE_MEASURE, 0 ),
- // RES_UL_SPACE
- M_E( "TopMargin", FO, MARGIN_TOP, XML_TYPE_MEASURE, 0 ),
- M_E( "BottomMargin", FO, MARGIN_BOTTOM, XML_TYPE_MEASURE, 0 ),
- // RES_PAGEDESC
- // not required
- // RES_BREAK
- // not required
- // RES_CNTNT
- // not required (accessed using API)
- // RES_HEADER
- // not required
- // RES_FOOTER
- // not required
- // RES_PRINT
- M_E( "Print", STYLE, PRINT_CONTENT, XML_TYPE_BOOL, 0 ),
- // RES_OPAQUE
- M_ED( "Opaque", STYLE, RUN_THROUGH, XML_TYPE_TEXT_OPAQUE, 0 ),
- // RES_PROTECT
- M_E( "ContentProtected", STYLE, PROTECT, XML_TYPE_TEXT_PROTECT_CONTENT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ),
- M_E( "SizeProtected", STYLE, PROTECT, XML_TYPE_TEXT_PROTECT_SIZE|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ),
- M_E( "PositionProtected", STYLE, PROTECT, XML_TYPE_TEXT_PROTECT_POSITION|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ),
- // RES_SURROUND
- M_ED( "TextWrap", STYLE, WRAP, XML_TYPE_TEXT_WRAP, CTF_WRAP ),
- M_ED( "SurroundAnchorOnly", STYLE, NUMBER_WRAPPED_PARAGRAPHS, XML_TYPE_TEXT_PARAGRAPH_ONLY, CTF_WRAP_PARAGRAPH_ONLY ),
- M_E( "SurroundContour", STYLE, WRAP_CONTOUR, XML_TYPE_BOOL, CTF_WRAP_CONTOUR ),
- M_E( "ContourOutside", STYLE, WRAP_CONTOUR_MODE, XML_TYPE_TEXT_WRAP_OUTSIDE, CTF_WRAP_CONTOUR_MODE ),
- // RES_VERT_ORIENT
- M_ED( "VertOrient", STYLE, VERTICAL_POS, XML_TYPE_TEXT_VERTICAL_POS, CTF_VERTICALPOS ),
- M_ED( "VertOrient", STYLE, VERTICAL_POS, XML_TYPE_TEXT_VERTICAL_POS_AT_CHAR, CTF_VERTICALPOS_ATCHAR ),
- M_ED( "VertOrient", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR|MID_FLAG_MULTI_PROPERTY, CTF_VERTICALREL_ASCHAR ),
- M_ED( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL, CTF_VERTICALREL ),
- M_ED( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_PAGE|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_VERTICALREL_PAGE ),
- M_ED( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_VERTICALREL_FRAME ),
- // RES_HORI_ORIENT
- M_ED( "HoriOrient", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_POS|MID_FLAG_MULTI_PROPERTY, CTF_HORIZONTALPOS ),
- M_ED( "PageToggle", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_MIRROR, CTF_HORIZONTALMIRROR ),
- M_ED( "HoriOrient", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_HORIZONTALPOS_MIRRORED ),
- M_ED( "HoriOrientRelation", STYLE, HORIZONTAL_REL, XML_TYPE_TEXT_HORIZONTAL_REL, CTF_HORIZONTALREL ),
- M_ED( "HoriOrientRelation", STYLE, HORIZONTAL_REL, XML_TYPE_TEXT_HORIZONTAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_HORIZONTALREL_FRAME ),
- // RES_ANCHOR
- // see above
- // RES_BACKGROUND
- M_ED( "BackColorRGB", FO, BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ),
- M_ED( "BackTransparent", FO, BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, CTF_BACKGROUND_TRANSPARENT ),
- M_ED( "BackColorTransparency", STYLE, BACKGROUND_TRANSPARENCY, XML_TYPE_PERCENT8, CTF_BACKGROUND_TRANSPARENCY ),
-
- M_E( "BackGraphicTransparency", STYLE, BACKGROUND_IMAGE_TRANSPARENCY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_PERCENT8, CTF_BACKGROUND_TRANSPARENCY ),
- M_E( "BackGraphicLocation", STYLE, POSITION, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BUILDIN_CMP_ONLY, CTF_BACKGROUND_POS ),
- M_E( "BackGraphicFilter",STYLE, FILTER_NAME, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_FILTER ),
- M_E( "BackGraphicURL", STYLE, BACKGROUND_IMAGE, MID_FLAG_ELEMENT_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_URL ),
-
- // RES_BOX
- M_ED( "LeftBorder", STYLE, BORDER_LINE_WIDTH, XML_TYPE_BORDER_WIDTH, CTF_ALLBORDERWIDTH ),
- M_ED( "LeftBorder", STYLE, BORDER_LINE_WIDTH_LEFT, XML_TYPE_BORDER_WIDTH, CTF_LEFTBORDERWIDTH ),
- M_ED( "RightBorder", STYLE, BORDER_LINE_WIDTH_RIGHT, XML_TYPE_BORDER_WIDTH, CTF_RIGHTBORDERWIDTH ),
- M_ED( "TopBorder", STYLE, BORDER_LINE_WIDTH_TOP, XML_TYPE_BORDER_WIDTH, CTF_TOPBORDERWIDTH ),
- M_ED( "BottomBorder", STYLE, BORDER_LINE_WIDTH_BOTTOM, XML_TYPE_BORDER_WIDTH, CTF_BOTTOMBORDERWIDTH ),
-
- M_ED( "LeftBorderDistance", FO, PADDING, XML_TYPE_MEASURE, CTF_ALLBORDERDISTANCE ), // need special import filtering
- M_ED( "LeftBorderDistance", FO, PADDING_LEFT, XML_TYPE_MEASURE, CTF_LEFTBORDERDISTANCE ),
- M_ED( "RightBorderDistance", FO, PADDING_RIGHT, XML_TYPE_MEASURE, CTF_RIGHTBORDERDISTANCE ),
- M_ED( "TopBorderDistance", FO, PADDING_TOP, XML_TYPE_MEASURE, CTF_TOPBORDERDISTANCE ),
- M_ED( "BottomBorderDistance",FO, PADDING_BOTTOM, XML_TYPE_MEASURE, CTF_BOTTOMBORDERDISTANCE ),
-
- // There is an additional property for controls!
- M_ED( "LeftBorder", FO, BORDER, XML_TYPE_BORDER|MID_FLAG_MULTI_PROPERTY, CTF_ALLBORDER ),
- M_ED( "LeftBorder", FO, BORDER_LEFT, XML_TYPE_BORDER, CTF_LEFTBORDER ),
- M_ED( "RightBorder", FO, BORDER_RIGHT, XML_TYPE_BORDER, CTF_RIGHTBORDER ),
- M_ED( "TopBorder", FO, BORDER_TOP, XML_TYPE_BORDER, CTF_TOPBORDER ),
- M_ED( "BottomBorder", FO, BORDER_BOTTOM, XML_TYPE_BORDER, CTF_BOTTOMBORDER ),
- // RES_SHADOW
- M_E( "ShadowFormat", STYLE, SHADOW, XML_TYPE_TEXT_SHADOW, 0 ),
- // RES_FRMMACRO
- // TODO
- // RES_COL
- M_E( "TextColumns", STYLE, COLUMNS, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_COLUMNS, CTF_TEXTCOLUMNS ),
- // RES_KEEP
- // not required
- // RES_URL
- // not required (exprted as draw:a element)
- // RES_EDIT_IN_READONLY
- M_ED( "EditInReadonly", STYLE, EDITABLE, XML_TYPE_BOOL, 0 ),
- // RES_LAYOUT_SPLIT
- // not required
- // RES_CHAIN
- // not required (exported at text:text-box element)
- // RES_LINENUMBER
- // not required
- // RES_FTN_AT_TXTEND
- // not required
- // RES_END_AT_TXTEND
- // not required
- // RES_COLUMNBALANCE
- // TODO
- // RES_UNKNOWNATR_CONTAINER
-// M_E_SE( TEXT, xmlns, RES_UNKNOWNATR_CONTAINER, 0 ),
- // RES_GRFATR_MIRRORGRF (vertical MUST be processed after horizontal!)
- M_E( "HoriMirroredOnEvenPages", STYLE, MIRROR, XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ),
- M_E( "HoriMirroredOnOddPages", STYLE, MIRROR, XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ),
- M_E( "VertMirrored", STYLE, MIRROR, XML_TYPE_TEXT_MIRROR_VERTICAL|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0 ),
- // RES_GRFATR_CROPGRF
- M_E( "GraphicCrop", FO, CLIP, XML_TYPE_TEXT_CLIP, 0 ),
- // RES_GRFATR_ROTATION
- // not required (exported as svg:transform attribute)
- // RES_GRFATR_LUMINANCE
- M_E( "AdjustLuminance", DRAW, LUMINANCE, XML_TYPE_PERCENT16, 0 ), // signed?
- // RES_GRFATR_CONTRAST
- M_E( "AdjustContrast", DRAW, CONTRAST, XML_TYPE_PERCENT16, 0 ), // signed?
- // RES_GRFATR_CHANNELR
- M_E( "AdjustRed", DRAW, RED, XML_TYPE_PERCENT16, 0 ), // signed?
- // RES_GRFATR_CHANNELG
- M_E( "AdjustGreen", DRAW, GREEN, XML_TYPE_PERCENT16, 0 ), // signed?
- // RES_GRFATR_CHANNELB
- M_E( "AdjustBlue", DRAW, BLUE, XML_TYPE_PERCENT16, 0 ), // signed?
- // RES_GRFATR_GAMMA
- M_E( "Gamma", DRAW, GAMMA, XML_TYPE_DOUBLE, 0 ), // signed?
- // RES_GRFATR_INVERT
- M_E( "GraphicIsInverted", DRAW, COLOR_INVERSION, XML_TYPE_BOOL, 0 ),
- // RES_GRFATR_TRANSPARENCY
- M_E( "Transparency", DRAW, TRANSPARENCY, XML_TYPE_PERCENT16|MID_FLAG_MULTI_PROPERTY, 0 ),
- // RES_GRFATR_DRAWMODE
- M_E( "GraphicColorMode", DRAW, COLOR_MODE, XML_TYPE_COLOR_MODE, 0 ),
- M_E( "WritingMode", STYLE, WRITING_MODE, XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT, 0 ),
-
- // special entries for floating frames
- M_E( "", DRAW, FRAME_DISPLAY_SCROLLBAR, XML_TYPE_BOOL|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_DISPLAY_SCROLLBAR ),
- M_E( "", DRAW, FRAME_DISPLAY_BORDER, XML_TYPE_BOOL|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_DISPLAY_BORDER ),
- M_E( "", DRAW, FRAME_MARGIN_HORIZONTAL, XML_TYPE_MEASURE_PX|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_MARGIN_HORI ),
- M_E( "", DRAW, FRAME_MARGIN_VERTICAL, XML_TYPE_MEASURE_PX|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_MARGIN_VERT ),
- M_E( "", DRAW, VISIBLE_AREA_LEFT, XML_TYPE_MEASURE|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_OLE_VIS_AREA_LEFT ),
- M_E( "", DRAW, VISIBLE_AREA_TOP, XML_TYPE_MEASURE|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_OLE_VIS_AREA_TOP ),
- M_E( "", DRAW, VISIBLE_AREA_WIDTH, XML_TYPE_MEASURE|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_OLE_VIS_AREA_WIDTH ),
- M_E( "", DRAW, VISIBLE_AREA_HEIGHT, XML_TYPE_MEASURE|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_OLE_VIS_AREA_HEIGHT ),
- M_E( "", DRAW, DRAW_ASPECT, XML_TYPE_TEXT_DRAW_ASPECT|MID_FLAG_NO_PROPERTY|MID_FLAG_MULTI_PROPERTY, CTF_OLE_DRAW_ASPECT ),
- M_E( "UserDefinedAttributes", TEXT, XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ),
-
- M_END()
-};
-
-XMLPropertyMapEntry aXMLShapePropMap[] =
-{
- // RES_LR_SPACE
- M_E( "LeftMargin", FO, MARGIN_LEFT, XML_TYPE_MEASURE, 0),
- M_E( "RightMargin", FO, MARGIN_RIGHT, XML_TYPE_MEASURE, 0 ),
- // RES_UL_SPACE
- M_E( "TopMargin", FO, MARGIN_TOP, XML_TYPE_MEASURE, 0 ),
- M_E( "BottomMargin", FO, MARGIN_BOTTOM, XML_TYPE_MEASURE, 0 ),
- // RES_OPAQUE
- M_ED( "Opaque", STYLE, RUN_THROUGH, XML_TYPE_TEXT_OPAQUE, 0 ),
- // RES_SURROUND
- M_E( "TextWrap", STYLE, WRAP, XML_TYPE_TEXT_WRAP, CTF_WRAP ),
- M_E( "SurroundAnchorOnly", STYLE, NUMBER_WRAPPED_PARAGRAPHS, XML_TYPE_TEXT_PARAGRAPH_ONLY, CTF_WRAP_PARAGRAPH_ONLY ),
- M_E( "SurroundContour", STYLE, WRAP_CONTOUR, XML_TYPE_BOOL, CTF_WRAP_CONTOUR ),
- M_E( "ContourOutside", STYLE, WRAP_CONTOUR_MODE, XML_TYPE_TEXT_WRAP_OUTSIDE, CTF_WRAP_CONTOUR_MODE ),
- // RES_VERT_ORIENT
- M_E( "VertOrient", STYLE, VERTICAL_POS, XML_TYPE_TEXT_VERTICAL_POS, CTF_VERTICALPOS ),
- M_E( "VertOrient", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR|MID_FLAG_MULTI_PROPERTY, CTF_VERTICALREL_ASCHAR ),
- M_E( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL, CTF_VERTICALREL ),
- M_E( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_PAGE|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_VERTICALREL_PAGE ),
- M_E( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_VERTICALREL_FRAME ),
- // RES_HORI_ORIENT
- M_E( "HoriOrient", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_POS|MID_FLAG_MULTI_PROPERTY, CTF_HORIZONTALPOS ),
- M_E( "PageToggle", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_MIRROR, CTF_HORIZONTALMIRROR ),
- M_E( "HoriOrient", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_HORIZONTALPOS_MIRRORED ),
- M_E( "HoriOrientRelation", STYLE, HORIZONTAL_REL, XML_TYPE_TEXT_HORIZONTAL_REL, CTF_HORIZONTALREL ),
- M_E( "HoriOrientRelation", STYLE, HORIZONTAL_REL, XML_TYPE_TEXT_HORIZONTAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_HORIZONTALREL_FRAME ),
- // UserDefinedAttributes is already contained in the map this one is
- // chained to.
-
- M_END()
-};
-
-XMLPropertyMapEntry aXMLSectionPropMap[] =
-{
- // RES_COL
- M_E( "TextColumns", STYLE, COLUMNS, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_COLUMNS, CTF_TEXTCOLUMNS ),
-
- // RES_BACKGROUND
- M_E( "BackColor", FO, BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ),
- M_E( "BackTransparent", FO, BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ),
- M_E( "BackGraphicLocation", STYLE, POSITION, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BUILDIN_CMP_ONLY, CTF_BACKGROUND_POS ),
- M_E( "BackGraphicFilter",STYLE, FILTER_NAME, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_FILTER ),
- M_E( "BackGraphicURL", STYLE, BACKGROUND_IMAGE, MID_FLAG_ELEMENT_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_URL ),
-
- // move protect-flag into section element
-// M_E( "IsProtected", STYLE, PROTECT, XML_TYPE_BOOL, 0 ),
-
- M_E( "DontBalanceTextColumns", TEXT, DONT_BALANCE_TEXT_COLUMNS, XML_TYPE_BOOL, 0 ),
-
- M_E( "WritingMode", STYLE, WRITING_MODE, XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT, 0 ),
-
- M_E( "SectionLeftMargin", FO, MARGIN_LEFT, XML_TYPE_MEASURE, 0),
- M_E( "SectionRightMargin", FO, MARGIN_RIGHT, XML_TYPE_MEASURE, 0),
-
- // section footnote settings
- M_E( "FootnoteIsOwnNumbering", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BOOL, CTF_SECTION_FOOTNOTE_NUM_OWN ),
- M_E( "FootnoteIsRestartNumbering", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BOOL, CTF_SECTION_FOOTNOTE_NUM_RESTART ),
- M_E( "FootnoteRestartNumberingAt", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_NUMBER16,CTF_SECTION_FOOTNOTE_NUM_RESTART_AT ),
- M_E( "FootnoteNumberingType", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_NUMBER16,CTF_SECTION_FOOTNOTE_NUM_TYPE ),
- M_E( "FootnoteNumberingPrefix", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_SECTION_FOOTNOTE_NUM_PREFIX ),
- M_E( "FootnoteNumberingSuffix", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_SECTION_FOOTNOTE_NUM_SUFFIX ),
- M_E( "FootnoteIsCollectAtTextEnd", TEXT, FOOTNOTES_CONFIGURATION, MID_FLAG_ELEMENT_ITEM|XML_TYPE_BOOL, CTF_SECTION_FOOTNOTE_END ),
-
- // section footnote settings
- M_E( "EndnoteIsOwnNumbering", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BOOL, CTF_SECTION_ENDNOTE_NUM_OWN ),
- M_E( "EndnoteIsRestartNumbering", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BOOL, CTF_SECTION_ENDNOTE_NUM_RESTART ),
- M_E( "EndnoteRestartNumberingAt", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_NUMBER16,CTF_SECTION_ENDNOTE_NUM_RESTART_AT ),
- M_E( "EndnoteNumberingType", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_NUMBER16,CTF_SECTION_ENDNOTE_NUM_TYPE ),
- M_E( "EndnoteNumberingPrefix", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_SECTION_ENDNOTE_NUM_PREFIX ),
- M_E( "EndnoteNumberingSuffix", TEXT, _EMPTY, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_SECTION_ENDNOTE_NUM_SUFFIX ),
- M_E( "EndnoteIsCollectAtTextEnd", TEXT, ENDNOTES_CONFIGURATION, MID_FLAG_ELEMENT_ITEM|XML_TYPE_BOOL, CTF_SECTION_ENDNOTE_END ),
- M_E( "UserDefinedAttributes", TEXT, XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ),
-
- M_END()
-};
-
-XMLPropertyMapEntry aXMLRubyPropMap[] =
-{
- M_E( "RubyAdjust", STYLE, RUBY_ALIGN, XML_TYPE_TEXT_RUBY_ADJUST, 0 ),
- M_E( "RubyIsAbove", STYLE, RUBY_POSITION, XML_TYPE_TEXT_RUBY_POSITION, 0 ),
- M_END()
-};
-
-XMLPropertyMapEntry *lcl_txtprmap_getMap( sal_uInt16 nType )
-{
- XMLPropertyMapEntry *pMap = 0;
- switch( nType )
- {
- case TEXT_PROP_MAP_TEXT:
- pMap = aXMLTextPropMap;
- break;
- case TEXT_PROP_MAP_SHAPE_PARA:
- pMap = &(aXMLParaPropMap[1]);
- DBG_ASSERT( pMap->meXMLName == XML_MARGIN_LEFT, "shape para map changed" );
- break;
- case TEXT_PROP_MAP_PARA:
- pMap = aXMLParaPropMap;
- break;
- case TEXT_PROP_MAP_FRAME:
- pMap = aXMLFramePropMap;
- break;
- case TEXT_PROP_MAP_AUTO_FRAME:
- pMap = &(aXMLFramePropMap[10]);
- DBG_ASSERT( pMap->meXMLName == XML_MARGIN_LEFT, "frame map changed" );
- break;
- case TEXT_PROP_MAP_SHAPE:
- pMap = aXMLShapePropMap;
- break;
- case TEXT_PROP_MAP_SECTION:
- pMap = aXMLSectionPropMap;
- break;
- case TEXT_PROP_MAP_RUBY:
- pMap = aXMLRubyPropMap;
- break;
- }
- DBG_ASSERT( pMap, "illegal map type" );
- return pMap;
-}
-
-XMLTextPropertySetMapper::XMLTextPropertySetMapper( sal_uInt16 nType ) :
- XMLPropertySetMapper( lcl_txtprmap_getMap( nType ),
- new XMLTextPropertyHandlerFactory )
-{
-}
-
-XMLTextPropertySetMapper::~XMLTextPropertySetMapper()
-{
-}
-
-
-
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_txtsecte.cxx b/binfilter/bf_xmloff/source/text/xmloff_txtsecte.cxx
deleted file mode 100644
index 468fd157871c..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_txtsecte.cxx
+++ /dev/null
@@ -1,248 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-
-
-
-#include <vector>
-
-
-
-
-
-
-#include <com/sun/star/beans/PropertyValues.hpp>
-
-
-
-#include <com/sun/star/text/XTextSection.hpp>
-
-
-
-
-
-
-
-
-#include "xmlexp.hxx"
-
-
-#include "XMLTextNumRuleInfo.hxx"
-
-#include "XMLSectionExport.hxx"
-
-#include "XMLRedlineExport.hxx"
-#include "MultiPropertySetHelper.hxx"
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::uno;
-using namespace ::std;
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::beans::PropertyValues;
-using ::com::sun::star::beans::PropertyState;
-using ::com::sun::star::container::XIndexReplace;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::lang::XServiceInfo;
-
-void XMLTextParagraphExport::exportListAndSectionChange(
- Reference<XTextSection> & rPrevSection,
- const Reference<XTextContent> & rNextSectionContent,
- const XMLTextNumRuleInfo& rPrevRule,
- const XMLTextNumRuleInfo& rNextRule,
- sal_Bool bAutoStyles)
-{
- Reference<XTextSection> xNextSection;
-
- // first: get current XTextSection
- Reference<XPropertySet> xPropSet(rNextSectionContent, UNO_QUERY);
- if (xPropSet.is())
- {
- if (xPropSet->getPropertySetInfo()->hasPropertyByName(sTextSection))
- {
- Any aAny = xPropSet->getPropertyValue(sTextSection);
- aAny >>= xNextSection;
- }
- // else: no current section
- }
-
- exportListAndSectionChange(rPrevSection, xNextSection,
- rPrevRule, rNextRule, bAutoStyles);
-}
-
-void XMLTextParagraphExport::exportListAndSectionChange(
- Reference<XTextSection> & rPrevSection,
- MultiPropertySetHelper& rPropSetHelper,
- sal_Int16 nTextSectionId,
- const Reference<XTextContent> & rNextSectionContent,
- const XMLTextNumRuleInfo& rPrevRule,
- const XMLTextNumRuleInfo& rNextRule,
- sal_Bool bAutoStyles)
-{
- Reference<XTextSection> xNextSection;
-
- // first: get current XTextSection
- Reference<XPropertySet> xPropSet(rNextSectionContent, UNO_QUERY);
- if (xPropSet.is())
- {
- if( !rPropSetHelper.checkedProperties() )
- rPropSetHelper.hasProperties( xPropSet->getPropertySetInfo() );
- if( rPropSetHelper.hasProperty( nTextSectionId ))
- {
- Any aAny = rPropSetHelper.getValue( nTextSectionId , xPropSet,
- sal_True );
- aAny >>= xNextSection;
- }
- // else: no current section
- }
-
- exportListAndSectionChange(rPrevSection, xNextSection,
- rPrevRule, rNextRule, bAutoStyles);
-}
-
-void XMLTextParagraphExport::exportListAndSectionChange(
- Reference<XTextSection> & rPrevSection,
- const Reference<XTextSection> & rNextSection,
- const XMLTextNumRuleInfo& rPrevRule,
- const XMLTextNumRuleInfo& rNextRule,
- sal_Bool bAutoStyles)
-{
- // old != new? -> maybe we have to start or end a new section
- if (rPrevSection != rNextSection)
- {
- // a new section started, or an old one gets closed!
-
- // close old list
- XMLTextNumRuleInfo aEmptyNumRule;
- if ( !bAutoStyles )
- exportListChange(rPrevRule, aEmptyNumRule);
-
- // Build stacks of old and new sections
- // Sections on top of mute sections should not be on the stack
- vector<Reference<XTextSection> > aOldStack;
- Reference<XTextSection> aCurrent = rPrevSection;
- while(aCurrent.is())
- {
- // if we have a mute section, ignore all its children
- // (all previous ones)
- if (pSectionExport->IsMuteSection(aCurrent))
- aOldStack.clear();
-
- aOldStack.push_back(aCurrent);
- aCurrent = aCurrent->getParentSection();
- }
-
- vector<Reference<XTextSection> > aNewStack;
- aCurrent = rNextSection;
- sal_Bool bMute = sal_False;
- while(aCurrent.is())
- {
- // if we have a mute section, ignore all its children
- // (all previous ones)
- if (pSectionExport->IsMuteSection(aCurrent))
- {
- aNewStack.clear();
- bMute = sal_True;
- }
-
- aNewStack.push_back(aCurrent);
- aCurrent = aCurrent->getParentSection();
- }
-
- // compare the two stacks
- vector<Reference<XTextSection> > ::reverse_iterator aOld =
- aOldStack.rbegin();
- vector<Reference<XTextSection> > ::reverse_iterator aNew =
- aNewStack.rbegin();
- // compare bottom sections and skip equal section
- while ( (aOld != aOldStack.rend()) &&
- (aNew != aNewStack.rend()) &&
- (*aOld) == (*aNew) )
- {
- aOld++;
- aNew++;
- }
-
- // close all elements of aOld ...
- // (order: newest to oldest)
- if (aOld != aOldStack.rend())
- {
- vector<Reference<XTextSection> > ::iterator aOldForward =
- aOldStack.begin();
- while ((aOldForward != aOldStack.end()) &&
- (*aOldForward != *aOld))
- {
- if ( !bAutoStyles && (NULL != pRedlineExport) )
- pRedlineExport->ExportStartOrEndRedline(*aOldForward,
- sal_False);
- pSectionExport->ExportSectionEnd(*aOldForward, bAutoStyles);
- aOldForward++;
- }
- if (aOldForward != aOldStack.end())
- {
- if ( !bAutoStyles && (NULL != pRedlineExport) )
- pRedlineExport->ExportStartOrEndRedline(*aOldForward,
- sal_False);
- pSectionExport->ExportSectionEnd(*aOldForward, bAutoStyles);
- }
- }
-
- // ...then open all of aNew
- // (order: oldest to newest)
- while (aNew != aNewStack.rend())
- {
- if ( !bAutoStyles && (NULL != pRedlineExport) )
- pRedlineExport->ExportStartOrEndRedline(*aNew, sal_True);
- pSectionExport->ExportSectionStart(*aNew, bAutoStyles);
- aNew++;
- }
-
- // start new list
- if ( !bAutoStyles && !bMute )
- exportListChange(aEmptyNumRule, rNextRule);
- }
- else
- {
- // list change, if sections have not changed
- if ( !bAutoStyles )
- exportListChange(rPrevRule, rNextRule);
- }
-
- // save old section (old numRule gets saved in calling method)
- rPrevSection = rNextSection;
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_txtstyle.cxx b/binfilter/bf_xmloff/source/text/xmloff_txtstyle.cxx
deleted file mode 100644
index b3d4466cd59f..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_txtstyle.cxx
+++ /dev/null
@@ -1,156 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/style/ParagraphStyleCategory.hpp>
-#include <com/sun/star/beans/XPropertyState.hpp>
-
-#include "xmlnmspe.hxx"
-#include "xmlnume.hxx"
-#include "xmlexp.hxx"
-#include "XMLSectionExport.hxx"
-#include "XMLLineNumberingExport.hxx"
-
-namespace binfilter {
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-
-void XMLTextParagraphExport::exportStyleAttributes(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::style::XStyle > & rStyle )
-{
- Any aAny;
- Reference< XPropertySet > xPropSet( rStyle, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
- if( xPropSetInfo->hasPropertyByName( sCategory ) )
- {
- aAny = xPropSet->getPropertyValue( sCategory );
- sal_Int16 nCategory;
- aAny >>= nCategory;
- enum XMLTokenEnum eValue = XML_TOKEN_INVALID;
- if( -1 != nCategory )
- {
- switch( nCategory )
- {
- case ParagraphStyleCategory::TEXT:
- eValue = XML_TEXT;
- break;
- case ParagraphStyleCategory::CHAPTER:
- eValue = XML_CHAPTER;
- break;
- case ParagraphStyleCategory::LIST:
- eValue = XML_LIST;
- break;
- case ParagraphStyleCategory::INDEX:
- eValue = XML_INDEX;
- break;
- case ParagraphStyleCategory::EXTRA:
- eValue = XML_EXTRA;
- break;
- case ParagraphStyleCategory::HTML:
- eValue = XML_HTML;
- break;
- }
- }
- if( eValue != XML_TOKEN_INVALID )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_CLASS, eValue);
- }
- if( xPropSetInfo->hasPropertyByName( sPageDescName ) )
- {
- Reference< XPropertyState > xPropState( xPropSet, uno::UNO_QUERY );
- if( PropertyState_DIRECT_VALUE ==
- xPropState->getPropertyState( sPageDescName ) )
- {
- aAny = xPropSet->getPropertyValue( sPageDescName );
- OUString sName;
- aAny >>= sName;
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_MASTER_PAGE_NAME,
- sName );
- }
- }
-
- if( bProgress )
- {
- ProgressBarHelper *pProgress = GetExport().GetProgressBarHelper();
- pProgress->SetValue( pProgress->GetValue()+2 );
- }
-}
-
-void XMLTextParagraphExport::exportNumStyles( sal_Bool bUsed )
-{
- SvxXMLNumRuleExport aNumRuleExport( GetExport() );
- aNumRuleExport.exportStyles( bUsed, pListAutoPool, !IsBlockMode() );
-}
-
-void XMLTextParagraphExport::exportTextStyles( sal_Bool bUsed, sal_Bool bProg )
-{
- sal_Bool bOldProg = bProgress;
- bProgress = bProg;
-
- Reference < lang::XMultiServiceFactory > xFactory (GetExport().GetModel(), UNO_QUERY);
- if (xFactory.is())
- {
- OUString sTextDefaults ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.text.Defaults" ) );
- Reference < XInterface > xInt = xFactory->createInstance ( sTextDefaults );
- if ( xInt.is() )
- {
- Reference < XPropertySet > xPropSet (xInt, UNO_QUERY);
- if (xPropSet.is())
- exportDefaultStyle( xPropSet, GetXMLToken(XML_PARAGRAPH), GetParaPropMapper());
- }
- }
- exportStyleFamily( "ParagraphStyles", GetXMLToken(XML_PARAGRAPH), GetParaPropMapper(),
- bUsed, XML_STYLE_FAMILY_TEXT_PARAGRAPH, 0);
- exportStyleFamily( "CharacterStyles", GetXMLToken(XML_TEXT), GetTextPropMapper(),
- bUsed, XML_STYLE_FAMILY_TEXT_TEXT );
- // get shape export to make sure the the frame family is added correctly.
- GetExport().GetShapeExport();
- exportStyleFamily( "FrameStyles", OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), GetFramePropMapper(),
- bUsed, XML_STYLE_FAMILY_TEXT_FRAME, 0);
- exportNumStyles( bUsed );
- if( !IsBlockMode() )
- {
- exportTextFootnoteConfiguration();
- XMLSectionExport::ExportBibliographyConfiguration(GetExport());
- XMLLineNumberingExport aLineNumberingExport(GetExport());
- aLineNumberingExport.Export();
- }
-
- bProgress = bOldProg;
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_txtstyli.cxx b/binfilter/bf_xmloff/source/text/xmloff_txtstyli.cxx
deleted file mode 100644
index 04177e512097..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_txtstyli.cxx
+++ /dev/null
@@ -1,406 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <com/sun/star/style/ParagraphStyleCategory.hpp>
-#include <com/sun/star/document/XEventsSupplier.hpp>
-#include "xmlnmspe.hxx"
-#include "XMLTextPropertySetContext.hxx"
-#include "xmlimp.hxx"
-#include "xmluconv.hxx"
-
-#include "txtprmap.hxx"
-#include "txtstyli.hxx"
-
-#include "XMLEventsImportContext.hxx"
-
-#include <tools/debug.hxx>
-
-// STL includes
-#include <algorithm>
-#include <functional>
-#include <utility>
-#include <vector>
-namespace binfilter {
-
-using namespace ::std;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-
-using rtl::OUString;
-//using namespace ::com::sun::star::text;
-using namespace ::binfilter::xmloff::token;
-
-static __FAR_DATA SvXMLEnumMapEntry aCategoryMap[] =
-{
- { XML_TEXT, ParagraphStyleCategory::TEXT },
- { XML_CHAPTER, ParagraphStyleCategory::CHAPTER },
- { XML_LIST, ParagraphStyleCategory::LIST },
- { XML_INDEX, ParagraphStyleCategory::INDEX },
- { XML_EXTRA, ParagraphStyleCategory::EXTRA },
- { XML_HTML, ParagraphStyleCategory::HTML },
- { XML_TOKEN_INVALID, 0 }
-};
-
-void XMLTextStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
- const OUString& rLocalName,
- const OUString& rValue )
-{
- if( XML_NAMESPACE_STYLE == nPrefixKey )
- {
- // TODO: use a map here
- if( IsXMLToken( rLocalName, XML_AUTO_UPDATE ) )
- {
- if( IsXMLToken( rValue, XML_TRUE ) )
- bAutoUpdate = sal_True;
- }
- else if( IsXMLToken( rLocalName, XML_LIST_STYLE_NAME ) )
- {
- sListStyleName = rValue;
- }
- else if( IsXMLToken( rLocalName, XML_MASTER_PAGE_NAME ) )
- {
- sMasterPageName = rValue;
- bHasMasterPageName = sal_True;
- }
- else if( IsXMLToken( rLocalName, XML_CLASS ) )
- {
- sCategoryVal = rValue;
- }
- else
- {
- XMLPropStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue );
- }
- }
- else
- {
- XMLPropStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue );
- }
-}
-
-TYPEINIT1( XMLTextStyleContext, XMLPropStyleContext );
-
-XMLTextStyleContext::XMLTextStyleContext( SvXMLImport& rImport,
- sal_uInt16 nPrfx, const OUString& rLName,
- const Reference< XAttributeList > & xAttrList,
- SvXMLStylesContext& rStyles, sal_uInt16 nFamily,
- sal_Bool bDefaultStyle ) :
- XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles,
- nFamily, bDefaultStyle ),
- bAutoUpdate( sal_False ),
- bHasMasterPageName( sal_False ),
- bHasCombinedCharactersLetter( sal_False ),
- pEventContext( NULL ),
- sIsAutoUpdate( RTL_CONSTASCII_USTRINGPARAM( "IsAutoUpdate" ) ),
- sCategory( RTL_CONSTASCII_USTRINGPARAM( "Category" ) ),
- sNumberingStyleName( RTL_CONSTASCII_USTRINGPARAM( "NumberingStyleName" ) ),
- sPageDescName( RTL_CONSTASCII_USTRINGPARAM( "PageDescName" ) ),
- sDropCapCharStyleName( RTL_CONSTASCII_USTRINGPARAM( "DropCapCharStyleName" ) )
-{
-}
-
-XMLTextStyleContext::~XMLTextStyleContext()
-{
-}
-
-SvXMLImportContext *XMLTextStyleContext::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const Reference< XAttributeList > & xAttrList )
-{
- SvXMLImportContext *pContext = 0;
-
- if( XML_NAMESPACE_STYLE == nPrefix &&
- IsXMLToken( rLocalName, XML_PROPERTIES ) )
- {
- UniReference < SvXMLImportPropertyMapper > xImpPrMap =
- GetStyles()->GetImportPropertyMapper( GetFamily() );
- if( xImpPrMap.is() )
- pContext = new XMLTextPropertySetContext( GetImport(), nPrefix,
- rLocalName, xAttrList,
- GetProperties(),
- xImpPrMap,
- sDropCapTextStyleName );
- }
- else if ( (XML_NAMESPACE_OFFICE == nPrefix) &&
- IsXMLToken( rLocalName, XML_EVENTS ) )
- {
- // create and remember events import context
- // (for delayed processing of events)
- pEventContext = new XMLEventsImportContext( GetImport(), nPrefix,
- rLocalName);
- pEventContext->AddRef();
- pContext = pEventContext;
- }
-
- if( !pContext )
- pContext = XMLPropStyleContext::CreateChildContext( nPrefix, rLocalName,
- xAttrList );
-
- return pContext;
-}
-
-void XMLTextStyleContext::CreateAndInsert( sal_Bool bOverwrite )
-{
- XMLPropStyleContext::CreateAndInsert( bOverwrite );
- Reference < XStyle > xStyle = GetStyle();
- if( !xStyle.is() || !(bOverwrite || IsNew()) )
- return;
-
- Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
- if( xPropSetInfo->hasPropertyByName( sIsAutoUpdate ) )
- {
- Any aAny;
- sal_Bool bTmp = bAutoUpdate;
- aAny.setValue( &bTmp, ::getBooleanCppuType() );
- xPropSet->setPropertyValue( sIsAutoUpdate, aAny );
- }
-
- sal_uInt16 nCategory = ParagraphStyleCategory::TEXT;
- if( XML_STYLE_FAMILY_TEXT_PARAGRAPH == GetFamily() &&
- sCategoryVal.getLength() && xStyle->isUserDefined() &&
- xPropSetInfo->hasPropertyByName( sCategory ) &&
- SvXMLUnitConverter::convertEnum( nCategory, sCategoryVal, aCategoryMap ) )
- {
- Any aAny;
- aAny <<= (sal_Int16)nCategory;
- xPropSet->setPropertyValue( sCategory, aAny );
- }
-
- // tell the style about it's events (if applicable)
- if (NULL != pEventContext)
- {
- // set event suppplier and release reference to context
- Reference<document::XEventsSupplier> xEventsSupplier(xStyle,UNO_QUERY);
- pEventContext->SetEvents(xEventsSupplier);
- pEventContext->ReleaseRef();
- }
-}
-
-void XMLTextStyleContext::SetDefaults( )
-{
- if (GetFamily() == XML_STYLE_FAMILY_TEXT_PARAGRAPH )
- {
- Reference < XMultiServiceFactory > xFactory ( GetImport().GetModel(), UNO_QUERY);
- if (xFactory.is())
- {
- Reference < XInterface > xInt = xFactory->createInstance (
- OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.text.Defaults" ) ) );
- Reference < XPropertySet > xProperties ( xInt, UNO_QUERY );
- if ( xProperties.is() )
- FillPropertySet ( xProperties );
- }
- }
-}
-
-void XMLTextStyleContext::Finish( sal_Bool bOverwrite )
-{
- XMLPropStyleContext::Finish( bOverwrite );
-
- Reference < XStyle > xStyle = GetStyle();
- if( !(sListStyleName.getLength() || sDropCapTextStyleName.getLength() ||
- bHasMasterPageName) ||
- !xStyle.is() || !(bOverwrite || IsNew()) )
- return;
-
- Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
-
- if( sListStyleName.getLength() )
- {
- // The families cointaner must exist
- const Reference < XNameContainer >& rNumStyles =
- GetImport().GetTextImport()->GetNumberingStyles();
- if( rNumStyles.is() && rNumStyles->hasByName( sListStyleName ) &&
- xPropSetInfo->hasPropertyByName( sNumberingStyleName ) )
- {
- Any aAny;
- aAny <<= sListStyleName;
- xPropSet->setPropertyValue( sNumberingStyleName, aAny );
- }
- }
-
- if( sDropCapTextStyleName.getLength() )
- {
- // The families cointaner must exist
- const Reference < XNameContainer >& rTextStyles =
- GetImport().GetTextImport()->GetTextStyles();
- if( rTextStyles.is() &&
- rTextStyles->hasByName( sDropCapTextStyleName ) &&
- xPropSetInfo->hasPropertyByName( sDropCapCharStyleName ) )
- {
- Any aAny;
- aAny <<= sDropCapTextStyleName;
- xPropSet->setPropertyValue( sDropCapCharStyleName, aAny );
- }
- }
-
- if( bHasMasterPageName )
- {
- // The families cointaner must exist
- const Reference < XNameContainer >& rPageStyles =
- GetImport().GetTextImport()->GetPageStyles();
- if( ( !sMasterPageName.getLength() ||
- (rPageStyles.is() &&
- rPageStyles->hasByName( sMasterPageName )) ) &&
- xPropSetInfo->hasPropertyByName( sPageDescName ) )
- {
- Any aAny;
- aAny <<= sMasterPageName;
- xPropSet->setPropertyValue( sPageDescName, aAny );
- }
- }
-}
-
-void XMLTextStyleContext::FillPropertySet(
- const Reference<XPropertySet > & rPropSet )
-{
- // imitate the FillPropertySet of the super class, so we get a chance to
- // catch the combined characters attribute
-
- // imitate XMLPropStyleContext::FillPropertySet(...)
- UniReference < SvXMLImportPropertyMapper > xImpPrMap =
- ((SvXMLStylesContext *)GetStyles())->GetImportPropertyMapper(GetFamily());
- DBG_ASSERT( xImpPrMap.is(), "Where is the import prop mapper?" );
- if( xImpPrMap.is() )
- {
-
- // get property set mapper
- UniReference<XMLPropertySetMapper> rPropMapper =
- xImpPrMap->getPropertySetMapper();
-
- // imitate SvXMLImportPropertyMapper::FillPropertySet(...)
-
- // The reason for this is that we have no other way to
- // efficiently intercept the value of combined characters. To
- // get that value, we could iterate through the map once more,
- // but instead we chose to insert the code into this
- // iteration. I haven't been able to come up with a much more
- // intelligent solution.
-
-
- struct _ContextID_Index_Pair aContextIDs[] =
- {
- { CTF_COMBINED_CHARACTERS_FIELD, -1 },
-#ifdef CONV_STAR_FONTS
- { CTF_FONTFAMILYNAME, -1 },
- { CTF_FONTFAMILYNAME_CJK, -1 },
- { CTF_FONTFAMILYNAME_CTL, -1 },
-#endif
- { -1, -1 }
- };
-
- // get property set info
- Reference< XPropertySetInfo > xInfo = rPropSet->getPropertySetInfo();
-
- // check for multi-property set
- Reference<XMultiPropertySet> xMultiPropSet( rPropSet, UNO_QUERY );
- if ( xMultiPropSet.is() )
- {
- // Try XMultiPropertySet. If that fails, try the regular route.
- sal_Bool bSet = SvXMLImportPropertyMapper::_FillMultiPropertySet(
- GetProperties(), xMultiPropSet, xInfo, rPropMapper,
- aContextIDs );
- if ( !bSet )
- SvXMLImportPropertyMapper::_FillPropertySet(
- GetProperties(), rPropSet, xInfo, rPropMapper,
- GetImport(), aContextIDs );
- }
- else
- SvXMLImportPropertyMapper::_FillPropertySet(
- GetProperties(), rPropSet, xInfo, rPropMapper,
- GetImport(), aContextIDs );
-
- // have we found a combined characters
- sal_Int32 nIndex = aContextIDs[0].nIndex;
- if ( nIndex != -1 )
- {
- Any& rAny = GetProperties()[nIndex].maValue;
- sal_Bool bVal = *(sal_Bool*)rAny.getValue();
- bHasCombinedCharactersLetter = bVal;
- }
-
-#ifdef CONV_STAR_FONTS
- // check for StarBats and StarMath fonts
-
- // iterate over aContextIDs entries 1..3
- for ( sal_Int32 i = 1; i < 4; i++ )
- {
- nIndex = aContextIDs[i].nIndex;
- if ( nIndex != -1 )
- {
- // Found!
- struct XMLPropertyState& rState = GetProperties()[nIndex];
- Any rAny = rState.maValue;
- sal_Int32 nMapperIndex = rState.mnIndex;
-
- // Now check for font name in rState and set corrected value,
- // if necessary.
- OUString sFontName;
- rAny >>= sFontName;
- if ( sFontName.getLength() > 0 )
- {
- OUString sStarBats( RTL_CONSTASCII_USTRINGPARAM("StarBats" ) );
- OUString sStarMath( RTL_CONSTASCII_USTRINGPARAM("StarMath" ) );
- if ( sFontName.equalsIgnoreAsciiCase( sStarBats ) ||
- sFontName.equalsIgnoreAsciiCase( sStarMath ) )
- {
- // construct new value
- sFontName = OUString(
- RTL_CONSTASCII_USTRINGPARAM("StarSymbol") );
- Any aAny( rAny );
- aAny <<= sFontName;
-
- // set property
- OUString rPropertyName(
- rPropMapper->GetEntryAPIName(nMapperIndex) );
- if ( xInfo->hasPropertyByName( rPropertyName ) )
- {
- rPropSet->setPropertyValue( rPropertyName, aAny );
- }
- }
- // else: "normal" style name -> no correction is necessary
- }
- // else: no style name found -> illegal value -> ignore
- }
- }
-#endif
- }
-}
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/source/text/xmloff_txtvfldi.cxx b/binfilter/bf_xmloff/source/text/xmloff_txtvfldi.cxx
deleted file mode 100644
index c3bc83334a9b..000000000000
--- a/binfilter/bf_xmloff/source/text/xmloff_txtvfldi.cxx
+++ /dev/null
@@ -1,1453 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/** @#file
- *
- * export of all variable related text fields (and database display field)
- */
-
-#include "txtvfldi.hxx"
-
-
-
-#include "xmlnumi.hxx"
-
-#include "xmlnmspe.hxx"
-
-#include "nmspmap.hxx"
-
-#include "i18nmap.hxx"
-
-#include "xmlimp.hxx"
-
-#include "xmluconv.hxx"
-
-
-#include <com/sun/star/text/SetVariableType.hpp>
-
-
-#include <com/sun/star/text/XDependentTextField.hpp>
-
-#include <com/sun/star/text/XTextFieldsSupplier.hpp>
-
-
-
-
-
-#include "rtl/ustring.hxx"
-
-namespace binfilter {
-
-
-// service names
-static const sal_Char sAPI_textfield_prefix[] = "com.sun.star.text.TextField.";
-static const sal_Char sAPI_fieldmaster_prefix[] = "com.sun.star.text.FieldMaster.";
-static const sal_Char sAPI_input[] = "Input";
-static const sal_Char sAPI_input_user[] = "InputUser";
-static const sal_Char sAPI_get_expression[] = "GetExpression";
-static const sal_Char sAPI_set_expression[] = "SetExpression";
-static const sal_Char sAPI_user[] = "User";
-static const sal_Char sAPI_table_formula[] = "TableFormula";
-static const sal_Char sAPI_database[] = "com.sun.star.text.TextField.Database";
-static const sal_Char sAPI_fieldmaster_database[] = "com.sun.star.text.FieldMaster.Database";
-
-// property names
-static const sal_Char sAPI_hint[] = "Hint";
-static const sal_Char sAPI_content[] = "Content";
-static const sal_Char sAPI_sub_type[] = "SubType";
-static const sal_Char sAPI_is_expression[] = "IsExpression";
-static const sal_Char sAPI_is_input[] = "Input";
-static const sal_Char sAPI_is_show_formula[] = "IsShowFormula";
-static const sal_Char sAPI_numbering_type[] = "NumberingType";
-static const sal_Char sAPI_number_format[] = "NumberFormat";
-static const sal_Char sAPI_name[] = "Name";
-static const sal_Char sAPI_numbering_separator[] = "NumberingSeparator";
-static const sal_Char sAPI_chapter_numbering_level[]= "ChapterNumberingLevel";
-static const sal_Char sAPI_value[] = "Value";
-static const sal_Char sAPI_is_visible[] = "IsVisible";
-static const sal_Char sAPI_variable_subtype[] = "VariableSubtype";
-static const sal_Char sAPI_data_column_name[] = "DataColumnName";
-static const sal_Char sAPI_is_data_base_format[] = "DataBaseFormat";
-//STRIP013static const sal_Char sAPI_current_presentation[] = "CurrentPresentation";
-static const sal_Char sAPI_sequence_value[] = "SequenceValue";
-static const sal_Char sAPI_is_fixed_language[] = "IsFixedLanguage";
-
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::style;
-using namespace ::binfilter::xmloff::token;
-
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-
-
-//
-// XMLVarFieldImportContext: superclass for all variable related fields
-//
-
-TYPEINIT1( XMLVarFieldImportContext, XMLTextFieldImportContext );
-
-XMLVarFieldImportContext::XMLVarFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- const sal_Char* pServiceName, sal_uInt16 nPrfx,
- const OUString& rLocalName,
- sal_Bool bName, sal_Bool bFormula, sal_Bool bFormulaDefault,
- sal_Bool bDescription, sal_Bool bVisible, sal_Bool bDisplayFormula,
- sal_Bool bType, sal_Bool bStyle, sal_Bool bValue) :
-//STRIP013 ,sal_Bool bPresentation) :
- XMLTextFieldImportContext(rImport, rHlp, pServiceName,
- nPrfx, rLocalName),
- sName(),
- sFormula(),
- sDescription(),
- aValueHelper(rImport, rHlp, bType, bStyle, bValue, sal_False),
- bDisplayFormula(sal_False),
- bDisplayNone(sal_False),
- bNameOK(sal_False),
- bFormulaOK(sal_False),
- bDescriptionOK(sal_False),
- bDisplayOK(sal_False),
- bSetName(bName),
- bSetFormula(bFormula),
- bSetFormulaDefault(bFormulaDefault),
- bSetDescription(bDescription),
- bSetVisible(bVisible),
- bSetDisplayFormula(bDisplayFormula),
-//STRIP013 bSetPresentation(bPresentation),
- sPropertyContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_content)),
- sPropertyHint(RTL_CONSTASCII_USTRINGPARAM(sAPI_hint)),
- sPropertyIsVisible(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_visible)),
- sPropertyIsDisplayFormula(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_is_show_formula))
-//STRIP013 ,sPropertyCurrentPresentation(RTL_CONSTASCII_USTRINGPARAM(
-//STRIP013 sAPI_current_presentation))
-{
-}
-
-void XMLVarFieldImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_NAME:
- sName = sAttrValue;
- bNameOK = sal_True;
- bValid = sal_True; // we assume: field with name is valid!
- break;
- case XML_TOK_TEXTFIELD_DESCRIPTION:
- sDescription = sAttrValue;
- bDescriptionOK = sal_True;
- break;
- case XML_TOK_TEXTFIELD_FORMULA:
- sFormula = sAttrValue;
- bFormulaOK = sal_True;
- break;
- case XML_TOK_TEXTFIELD_DISPLAY:
- if (IsXMLToken(sAttrValue, XML_FORMULA))
- {
- bDisplayFormula = sal_True;
- bDisplayNone = sal_False;
- bDisplayOK = sal_True;
- }
- else if (IsXMLToken(sAttrValue, XML_VALUE))
- {
- bDisplayFormula = sal_False;
- bDisplayNone = sal_False;
- bDisplayOK = sal_True;
- }
- else if (IsXMLToken(sAttrValue, XML_NONE))
- {
- bDisplayFormula = sal_False;
- bDisplayNone = sal_True;
- bDisplayOK = sal_True;
- } // else: no change
- DBG_ASSERT(!(bDisplayFormula && bDisplayNone),
- "illegal display values");
- break;
- default:
- // delegate all others to value helper
- aValueHelper.ProcessAttribute(nAttrToken, sAttrValue);
- break;
- }
-}
-
-void XMLVarFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- // bSetName: not implemented
-
- if (bSetFormula)
- {
- if (!bFormulaOK && bSetFormulaDefault)
- {
- sFormula = GetContent();
- bFormulaOK = sal_True;
- }
-
- if (bFormulaOK)
- {
- Any aAny;
- aAny <<= sFormula;
- xPropertySet->setPropertyValue(sPropertyContent, aAny);
- }
- }
-
- if (bSetDescription && bDescriptionOK)
- {
- Any aAny;
- aAny <<= sDescription;
- xPropertySet->setPropertyValue(sPropertyHint, aAny);
- }
-
- if (bSetVisible && bDisplayOK)
- {
- Any aAny;
- sal_Bool bTmp = ! (bDisplayNone && bDisplayOK);
- aAny.setValue( &bTmp, ::getBooleanCppuType());
- xPropertySet->setPropertyValue(sPropertyIsVisible, aAny);
- }
-
- // workaround for #no-bug#: display formula by default
- if (xPropertySet->getPropertySetInfo()->
- hasPropertyByName(sPropertyIsDisplayFormula) &&
- !bSetDisplayFormula)
- {
- bDisplayFormula = sal_False;
- bSetDisplayFormula = sal_True;
- }
-
-
- if (bSetDisplayFormula)
- {
- Any aAny;
- sal_Bool bTmp = bDisplayFormula && bDisplayOK;
- aAny.setValue( &bTmp, ::getBooleanCppuType());
- xPropertySet->setPropertyValue(sPropertyIsDisplayFormula, aAny);
- }
-
- // delegate to value helper
- aValueHelper.SetDefault(GetContent());
- aValueHelper.PrepareField(xPropertySet);
-
-//STRIP013 // finally, set the curren presentation
-//STRIP013 if (bSetPresentation)
-//STRIP013 {
-//STRIP013 // #111880#-4
-//STRIP013 // The API for binfilter does not have this property, so test it first
-//STRIP013 // before using it to not throw exceptions
-//STRIP013 Reference<XPropertySetInfo> xPropertySetInfo(xPropertySet->getPropertySetInfo());
-//STRIP013
-//STRIP013 if (xPropertySetInfo->hasPropertyByName(sPropertyCurrentPresentation))
-//STRIP013 {
-//STRIP013 Any aAny;
-//STRIP013 aAny <<= GetContent();
-//STRIP013 xPropertySet->setPropertyValue(sPropertyCurrentPresentation, aAny);
-//STRIP013 }
-//STRIP013 }
-}
-
-
-
-
-
-//
-// variable set fields
-//
-
-TYPEINIT1( XMLSetVarFieldImportContext, XMLVarFieldImportContext );
-
-XMLSetVarFieldImportContext::XMLSetVarFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- const sal_Char* pServiceName, sal_uInt16 nPrfx,
- const OUString& rLocalName, VarType eVarType,
- sal_Bool bName, sal_Bool bFormula, sal_Bool bFormulaDefault,
- sal_Bool bDescription, sal_Bool bVisible, sal_Bool bDisplayFormula,
- sal_Bool bType, sal_Bool bStyle, sal_Bool bValue) :
-//STRIP013 ,sal_Bool bPresentation) :
- XMLVarFieldImportContext(rImport, rHlp, pServiceName,
- nPrfx, rLocalName,
- bName, bFormula, bFormulaDefault,
- bDescription, bVisible, bDisplayFormula,
- bType, bStyle, bValue), //STRIP013, bPresentation),
- eFieldType(eVarType)
-{
-}
-
-void XMLSetVarFieldImportContext::EndElement()
-{
- // should we call PrepareField on the field, or rather on it's master?
- // currently: call on field (just like superclass)
- // possible alternatives: call on master
- // call field or master depending on variable
- // PrepareMaster() in addition to PrepareField()
-
- DBG_ASSERT(GetServiceName().getLength()>0, "no service name for element!");
-
- if (bValid)
- {
- DBG_ASSERT(GetName().getLength()>0, "variable name needed!");
-
- // find field master
- Reference<XPropertySet> xMaster;
- if (FindFieldMaster(xMaster))
- {
- // create field/Service
- Reference<XPropertySet> xPropSet;
- if (CreateField(xPropSet, OUString::createFromAscii(sAPI_textfield_prefix) + GetServiceName()))
- {
- Reference<XDependentTextField> xDepTextField(xPropSet, UNO_QUERY);
- if (xDepTextField.is())
- {
- // attach field to field master
- xDepTextField->attachTextFieldMaster(xMaster);
-
- // attach field to document
- Reference<XTextContent> xTextContent(xPropSet, UNO_QUERY);
- if (xTextContent.is())
- {
- // insert, set field properties and exit!
- GetImportHelper().InsertTextContent(xTextContent);
- PrepareField(xPropSet);
- return;
- }
- }
- }
- }
- }
-
- // above: exit on success; so for all error cases we end up here!
- // write element content
- GetImportHelper().InsertString(GetContent());
-}
-
-sal_Bool XMLSetVarFieldImportContext::FindFieldMaster(
- Reference<XPropertySet> & xMaster)
-{
- // currently: delegate to XMLVariableDeclImportContext;
- // shoud eventually go here
- return XMLVariableDeclImportContext::FindFieldMaster(xMaster,
- GetImport(),
- GetImportHelper(),
- GetName(),
- eFieldType);
-}
-
-
-
-//
-// sequence field
-//
-
-TYPEINIT1( XMLSequenceFieldImportContext, XMLSetVarFieldImportContext );
-
-XMLSequenceFieldImportContext::XMLSequenceFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& rLocalName) :
- XMLSetVarFieldImportContext(rImport, rHlp, sAPI_set_expression,
- nPrfx, rLocalName, VarTypeSequence,
- // name, formula
- sal_True, sal_True, sal_True,
- sal_False, sal_False, sal_False,
- sal_False, sal_False, sal_False),
-//STRIP013 , sal_True),
- sNumFormat(OUString::valueOf(sal_Unicode('1'))),
- sNumFormatSync(GetXMLToken(XML_FALSE)),
- sRefName(),
- bRefNameOK(sal_False),
- sPropertyNumberFormat(RTL_CONSTASCII_USTRINGPARAM(sAPI_number_format)),
- sPropertySequenceValue(
- RTL_CONSTASCII_USTRINGPARAM(sAPI_sequence_value))
-{
-}
-
-void XMLSequenceFieldImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken, const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_NUM_FORMAT:
- sNumFormat = sAttrValue;
- break;
- case XML_TOK_TEXTFIELD_NUM_LETTER_SYNC:
- sNumFormatSync = sAttrValue;
- break;
- case XML_TOK_TEXTFIELD_REF_NAME:
- sRefName = sAttrValue;
- bRefNameOK = sal_True;
- break;
- default:
- // delegate to super class (name, formula)
- XMLSetVarFieldImportContext::ProcessAttribute(nAttrToken,
- sAttrValue);
- break;
- } // switch
-}
-
-void XMLSequenceFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- // delegate to super class (formula)
- XMLSetVarFieldImportContext::PrepareField(xPropertySet);
-
- // set format
- sal_Int16 nNumType = NumberingType::ARABIC;nNumType;
- GetImport().GetMM100UnitConverter().convertNumFormat( nNumType, sNumFormat, sNumFormatSync );
- Any aAny;
- aAny <<= nNumType;
- xPropertySet->setPropertyValue(sPropertyNumberFormat, aAny);
-
- // handle reference name
- if (bRefNameOK)
- {
- aAny = xPropertySet->getPropertyValue(sPropertySequenceValue);
- sal_Int16 nValue;
- aAny >>= nValue;
- GetImportHelper().InsertSequenceID(sRefName, GetName(), nValue);
- }
-}
-
-
-
-//
-// variable set field
-//
-
-TYPEINIT1( XMLVariableSetFieldImportContext, XMLSetVarFieldImportContext );
-
-XMLVariableSetFieldImportContext::XMLVariableSetFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& rLocalName) :
- XMLSetVarFieldImportContext(rImport, rHlp, sAPI_set_expression,
- nPrfx, rLocalName, VarTypeSimple,
- // name, formula, value&type, style,
- // display none
- sal_True, sal_True, sal_True,
- sal_False, sal_True, sal_False,
- sal_True, sal_True, sal_True),
-//STRIP013 ,sal_True),
- sPropertySubType(RTL_CONSTASCII_USTRINGPARAM(sAPI_sub_type))
-{
-}
-
-void XMLVariableSetFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- // set type
- Any aAny;
- aAny <<= (IsStringValue()? SetVariableType::STRING : SetVariableType::VAR);
- xPropertySet->setPropertyValue(sPropertySubType, aAny);
-
- // the remainder is handled by super class
- XMLSetVarFieldImportContext::PrepareField(xPropertySet);
-}
-
-
-
-//
-// variable input field
-//
-
-TYPEINIT1( XMLVariableInputFieldImportContext, XMLSetVarFieldImportContext );
-
-XMLVariableInputFieldImportContext::XMLVariableInputFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
- const OUString& rLocalName) :
- XMLSetVarFieldImportContext(rImport, rHlp, sAPI_set_expression,
- nPrfx, rLocalName, VarTypeSimple,
- // name, description, display none/formula,
- // value&type, style, formula
- sal_True, sal_True, sal_True,
- sal_True, sal_True, sal_False,
- sal_True, sal_True, sal_True),
-//STRIP013 ,sal_True),
- sPropertySubType(RTL_CONSTASCII_USTRINGPARAM(sAPI_sub_type)),
- sPropertyIsInput(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_input))
-{
-}
-
-void XMLVariableInputFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- // set type (input field)
- Any aAny;
- sal_Bool bTrue = sal_True;
- aAny.setValue( &bTrue, ::getBooleanCppuType() );
- xPropertySet->setPropertyValue(sPropertyIsInput, aAny);
-
- // set type
- aAny <<= (IsStringValue()? SetVariableType::STRING : SetVariableType::VAR);
- xPropertySet->setPropertyValue(sPropertySubType, aAny);
-
- // the remainder is handled by super class
- XMLSetVarFieldImportContext::PrepareField(xPropertySet);
-}
-
-
-
-//
-// user field
-//
-
-TYPEINIT1( XMLUserFieldImportContext, XMLSetVarFieldImportContext );
-
-XMLUserFieldImportContext::XMLUserFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& rLocalName) :
- XMLSetVarFieldImportContext(rImport, rHlp, sAPI_user, nPrfx,
- rLocalName, VarTypeUserField,
- // name, display none/formula, style
- sal_True, sal_False, sal_False,
- sal_False, sal_True, sal_True,
- sal_False, sal_True, sal_False)
-//STRIP013 ,sal_False)
-{
-}
-
-
-
-//
-// user input field
-//
-
-TYPEINIT1( XMLUserFieldInputImportContext, XMLVarFieldImportContext );
-
-// bug: doesn't work (SO API lacking)
-XMLUserFieldInputImportContext::XMLUserFieldInputImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
- const OUString& rLocalName) :
- XMLVarFieldImportContext(rImport, rHlp, sAPI_input_user,
- nPrfx, rLocalName,
- // name, description, style
- sal_True, sal_False, sal_False,
- sal_True, sal_False, sal_False,
- sal_False /*???*/, sal_True, sal_False)
-//STRIP013 ,sal_False)
-{
-}
-
-void XMLUserFieldInputImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
- aAny <<= GetName();
- xPropertySet->setPropertyValue(sPropertyContent, aAny);
-
- // delegate to super class
- XMLVarFieldImportContext::PrepareField(xPropertySet);
-}
-
-
-//
-// variable get field
-//
-
-TYPEINIT1( XMLVariableGetFieldImportContext, XMLVarFieldImportContext );
-
-XMLVariableGetFieldImportContext::XMLVariableGetFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& rLocalName) :
- XMLVarFieldImportContext(rImport, rHlp, sAPI_get_expression,
- nPrfx, rLocalName,
- // name, style, display formula
- sal_True, sal_False, sal_False,
- sal_False, sal_False, sal_True,
- sal_True, sal_True, sal_False),
-//STRIP013 ,sal_True),
- sPropertySubType(RTL_CONSTASCII_USTRINGPARAM(sAPI_sub_type))
-{
-}
-
-void XMLVariableGetFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- // set type; IsStringValue() defaults to false
- Any aAny;
- aAny <<= (IsStringValue() ? SetVariableType::STRING : SetVariableType::VAR);
- xPropertySet->setPropertyValue(sPropertySubType, aAny);
-
- // set name
- aAny <<= GetName();
- xPropertySet->setPropertyValue(sPropertyContent, aAny);
-
- // the remainder is handled by super class
- XMLVarFieldImportContext::PrepareField(xPropertySet);
-}
-
-
-
-//
-// expression field
-//
-
-TYPEINIT1( XMLExpressionFieldImportContext, XMLVarFieldImportContext );
-
-XMLExpressionFieldImportContext::XMLExpressionFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& rLocalName) :
- XMLVarFieldImportContext(rImport, rHlp, sAPI_get_expression,
- nPrfx, rLocalName,
- // formula, type, style, display formula
- sal_False, sal_True, sal_True,
- sal_False, sal_False, sal_True,
- sal_True, sal_True, sal_False),
-//STRIP013 ,sal_True),
- sPropertySubType(RTL_CONSTASCII_USTRINGPARAM(sAPI_sub_type))
-{
- bValid = sal_True; // always valid
-}
-
-
-void XMLExpressionFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- sal_Int16 nSubType = SetVariableType::FORMULA;
- Any aAny;
- aAny <<= nSubType;
- xPropertySet->setPropertyValue(sPropertySubType, aAny);
-
- // delegate to super class
- XMLVarFieldImportContext::PrepareField(xPropertySet);
-}
-
-
-
-//
-// text input field
-//
-
-TYPEINIT1( XMLTextInputFieldImportContext, XMLVarFieldImportContext );
-
-XMLTextInputFieldImportContext::XMLTextInputFieldImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& sLocalName) :
- XMLVarFieldImportContext(rImport, rHlp, sAPI_input,
- nPrfx, sLocalName,
- // description
- sal_False, sal_False, sal_False,
- sal_True, sal_False, sal_False,
- sal_False, sal_False, sal_False),
-//STRIP013 ,sal_False),
- sPropertyContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_content))
-{
- bValid = sal_True; // always valid
-}
-
-void XMLTextInputFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- XMLVarFieldImportContext::PrepareField(xPropertySet);
-
- Any aAny;
- aAny <<= GetContent();
- xPropertySet->setPropertyValue(sPropertyContent, aAny);
-}
-
-
-//
-// table formula field
-//
-
-TYPEINIT1( XMLTableFormulaImportContext, XMLTextFieldImportContext );
-
-XMLTableFormulaImportContext::XMLTableFormulaImportContext(
- SvXMLImport& rImport,
- XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx,
- const OUString& rLocalName) :
- XMLTextFieldImportContext(rImport, rHlp, sAPI_table_formula,
- nPrfx, rLocalName),
- sPropertyIsShowFormula(RTL_CONSTASCII_USTRINGPARAM("IsShowFormula")),
-//STRIP013 sPropertyCurrentPresentation(
-//STRIP013 RTL_CONSTASCII_USTRINGPARAM("CurrentPresentation")),
- aValueHelper(rImport, rHlp, sal_False, sal_True, sal_False, sal_True),
- sFormula(),
- bIsShowFormula(sal_False)
-{
-}
-
-XMLTableFormulaImportContext::~XMLTableFormulaImportContext()
-{
-}
-
-void XMLTableFormulaImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken,
- const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_FORMULA:
- aValueHelper.ProcessAttribute( nAttrToken, sAttrValue );
- bValid = sal_True; // we need a formula!
- break;
-
- case XML_TOK_TEXTFIELD_DATA_STYLE_NAME:
- aValueHelper.ProcessAttribute( nAttrToken, sAttrValue );
- break;
- case XML_TOK_TEXTFIELD_DISPLAY:
- if ( sAttrValue.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM("formula")) )
- bIsShowFormula = sal_True;
- break;
- default:
- // unknown attribute -> ignore
- break;
- }
-}
-
-void XMLTableFormulaImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- // set format and formula
- aValueHelper.PrepareField( xPropertySet );
-
- Any aAny;
-
- // set 'show formula' and presentation
- aAny.setValue( &bIsShowFormula, ::getBooleanCppuType() );
- xPropertySet->setPropertyValue( sPropertyIsShowFormula, aAny );
-
-//STRIP013 // #111880#-4
-//STRIP013 // The API for binfilter does not have this property, so test it first
-//STRIP013 // before using it to not throw exceptions
-//STRIP013 Reference<XPropertySetInfo> xPropertySetInfo(xPropertySet->getPropertySetInfo());
-//STRIP013
-//STRIP013 if (xPropertySetInfo->hasPropertyByName(sPropertyCurrentPresentation))
-//STRIP013 {
-//STRIP013 aAny <<= GetContent();
-//STRIP013 xPropertySet->setPropertyValue( sPropertyCurrentPresentation, aAny );
-//STRIP013 }
-}
-
-
-
-//
-// variable declarations
-//
-// Should be adapted to XMLVarField-/XMLSetVarFieldImportContext scheme!
-//
-
-
-
-//
-// declaration containter import (<variable/user-field/sequence-decls>)
-//
-
-TYPEINIT1( XMLVariableDeclsImportContext, SvXMLImportContext );
-
-XMLVariableDeclsImportContext::XMLVariableDeclsImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
- const OUString& rLocalName, enum VarType eVarType) :
- SvXMLImportContext(rImport, nPrfx, rLocalName),
- rImportHelper(rHlp),
- eVarDeclsContextType(eVarType)
-{
-}
-
-SvXMLImportContext* XMLVariableDeclsImportContext::CreateChildContext(
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference<xml::sax::XAttributeList> & xAttrList )
-{
- enum XMLTokenEnum eElementName;
- SvXMLImportContext* pImportContext = NULL;
-
- if( XML_NAMESPACE_TEXT == nPrefix )
- {
- switch (eVarDeclsContextType)
- {
- case VarTypeSequence:
- eElementName = XML_SEQUENCE_DECL;
- break;
- case VarTypeSimple:
- eElementName = XML_VARIABLE_DECL;
- break;
- case VarTypeUserField:
- eElementName = XML_USER_FIELD_DECL;
- break;
- default:
- DBG_ERROR("unknown field type!");
- }
-
- if( IsXMLToken( rLocalName, eElementName ) )
- {
- pImportContext = new XMLVariableDeclImportContext(
- GetImport(), rImportHelper, nPrefix, rLocalName, xAttrList,
- eVarDeclsContextType);
- }
- }
-
- // if no context was created, use default context
- if (NULL == pImportContext) {
- pImportContext = SvXMLImportContext::CreateChildContext(nPrefix,
- rLocalName,
- xAttrList);
- }
-
- return pImportContext;
-}
-
-
-
-//
-// declaration import (<variable/user-field/sequence-decl> elements)
-//
-
-TYPEINIT1( XMLVariableDeclImportContext, SvXMLImportContext );
-
-XMLVariableDeclImportContext::XMLVariableDeclImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp,
- sal_uInt16 nPrfx, const OUString& rLocalName,
- const Reference<xml::sax::XAttributeList> & xAttrList,
- enum VarType eVarType) :
- SvXMLImportContext(rImport, nPrfx, rLocalName),
- nNumLevel(-1), cSeparationChar('.'),
- // bug?? which properties for userfield/userfieldmaster
- aValueHelper(rImport, rHlp, sal_True, sal_False, sal_True, sal_False),
- sPropertyName(RTL_CONSTASCII_USTRINGPARAM(sAPI_name)),
- sPropertySubType(RTL_CONSTASCII_USTRINGPARAM(sAPI_sub_type)),
- sPropertyNumberingLevel(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_chapter_numbering_level)),
- sPropertyNumberingSeparator(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_numbering_separator)),
- sPropertyIsExpression(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_expression))
-{
- if ( (XML_NAMESPACE_TEXT == nPrfx) &&
- ( ( IsXMLToken( rLocalName, XML_SEQUENCE_DECL )) ||
- ( IsXMLToken( rLocalName, XML_VARIABLE_DECL)) ||
- ( IsXMLToken( rLocalName, XML_USER_FIELD_DECL)) )) {
-
- // TODO: check validity (need name!)
-
- // parse attributes
- sal_Int16 nLength = xAttrList->getLength();
- for(sal_Int16 i=0; i<nLength; i++) {
-
- OUString sLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName( xAttrList->getNameByIndex(i), &sLocalName );
-
- sal_uInt16 nToken = rHlp.
- GetTextFieldAttrTokenMap().Get(nPrefix, sLocalName);
-
- switch (nToken)
- {
- case XML_TOK_TEXTFIELD_NAME:
- sName = xAttrList->getValueByIndex(i);
- break;
- case XML_TOK_TEXTFIELD_NUMBERING_LEVEL:
- {
- sal_Int32 nLevel;
- sal_Bool bRet = SvXMLUnitConverter::convertNumber(
- nLevel, xAttrList->getValueByIndex(i), 0,
- GetImport().GetTextImport()->GetChapterNumbering()->
- getCount());
- if (bRet)
- {
- nNumLevel = nLevel-1; // API numbers -1..9
- }
- break;
- }
- case XML_TOK_TEXTFIELD_NUMBERING_SEPARATOR:
- cSeparationChar =
- (sal_Char)xAttrList->getValueByIndex(i).toChar();
- break;
-
- default:
- // delegate to value helper
- aValueHelper.ProcessAttribute(nToken,
- xAttrList->getValueByIndex(i));
- break;
- }
- }
-
- Reference<XPropertySet> xFieldMaster;
- if (FindFieldMaster(xFieldMaster, GetImport(), rHlp,
- sName, eVarType))
- {
- // now we have a field master: process attributes!
- Any aAny;
-
- switch (eVarType)
- {
- case VarTypeSequence:
- aAny <<= nNumLevel;
- xFieldMaster->setPropertyValue(sPropertyNumberingLevel, aAny);
-
- if (nNumLevel >= 0)
- {
- OUString sStr(&cSeparationChar, 1);
- aAny <<= sStr;
- xFieldMaster->setPropertyValue(
- sPropertyNumberingSeparator, aAny);
- }
- break;
- case VarTypeSimple:
- {
- // set string or non-string SubType (#93192#)
- // The SubType was already set in the FindFieldMaster
- // method, but it needs to be adjusted if it's a string.
- aAny <<= aValueHelper.IsStringValue()
- ? SetVariableType::STRING : SetVariableType::VAR;
- xFieldMaster->setPropertyValue(sPropertySubType, aAny);
- }
- break;
- case VarTypeUserField:
- {
- sal_Bool bTmp = !aValueHelper.IsStringValue();
- aAny.setValue(&bTmp, ::getBooleanCppuType());
- xFieldMaster->setPropertyValue(sPropertyIsExpression, aAny);
- aValueHelper.PrepareField(xFieldMaster);
- break;
- }
- default:
- DBG_ERROR("unkown varfield type");
- } // switch
- } // else: no field master found/constructed
- } // else: no sequence-decl
-}
-
-
-
-sal_Bool XMLVariableDeclImportContext::FindFieldMaster(
- Reference<XPropertySet> & xMaster, SvXMLImport& rImport,
- XMLTextImportHelper& rImportHelper,
- const OUString& sVarName, enum VarType eVarType)
-{
- static sal_Int32 nCollisionCount = 0;
-
- // rename field
- // currently: no family in use! Use 0.
- OUString sName = rImportHelper.GetRenameMap().Get(eVarType, sVarName);
-
- // get text fields supplier and field masters
- Reference<XTextFieldsSupplier> xTextFieldsSupp(rImport.GetModel(),
- UNO_QUERY);
- Reference<container::XNameAccess> xFieldMasterNameAccess(
- xTextFieldsSupp->getTextFieldMasters(), UNO_QUERY);
-
- OUStringBuffer sBuffer;
- sBuffer.appendAscii(sAPI_fieldmaster_prefix);
- sBuffer.appendAscii(sAPI_set_expression);
- sBuffer.appendAscii(".");
- sBuffer.append(sName);
- OUString sVarServiceName = sBuffer.makeStringAndClear();
-
- sBuffer.appendAscii(sAPI_fieldmaster_prefix);
- sBuffer.appendAscii(sAPI_user);
- sBuffer.appendAscii(".");
- sBuffer.append(sName);
- OUString sUserServiceName = sBuffer.makeStringAndClear();
-
- if (xFieldMasterNameAccess->hasByName(sVarServiceName)) {
- // variable field master already in document
-
- Any aAny = xFieldMasterNameAccess->getByName(sVarServiceName);
- aAny >>= xMaster;
-
- aAny = xMaster->getPropertyValue(
- // sPropertySubType
- OUString::createFromAscii(sAPI_sub_type)
- );
- sal_Int16 nType;
- aAny >>= nType;
-
- enum VarType eFMVarType =
- (SetVariableType::SEQUENCE == nType) ?
- VarTypeSequence : VarTypeSimple;
-
- if (eFMVarType != eVarType)
- {
- OUString sNew;
-
- // FIXME! cant find if name is taken already!!!!
-
- nCollisionCount++;
- OUStringBuffer aBuf;
- aBuf.append(sName);
- aBuf.appendAscii("_renamed_");
- aBuf.append(nCollisionCount);
- sNew = aBuf.makeStringAndClear();
-
- rImportHelper.GetRenameMap().Add(eVarType, sName, sNew);
-
- // call FindFieldMaster recursively to create new master
- return FindFieldMaster(xMaster, rImport, rImportHelper,
- sNew, eVarType);
- }
- } else if (xFieldMasterNameAccess->hasByName(sUserServiceName)) {
- // user field: get field master
- Any aAny = xFieldMasterNameAccess->getByName(sUserServiceName);
- aAny >>= xMaster;
-
- if (VarTypeUserField != eVarType) {
- // find new name that is not taken
- OUString sNew;
-
- // FIXME! cant find if name is taken already!!!!
-
- nCollisionCount++;
- OUStringBuffer aBuf;
- aBuf.append(sName);
- aBuf.appendAscii("_renamed_");
- aBuf.append(nCollisionCount);
- sNew = aBuf.makeStringAndClear();
-
- rImportHelper.GetRenameMap().Add(eVarType, sName, sNew);
-
- // call FindFieldMaster recursively to create new master
- return FindFieldMaster(xMaster, rImport, rImportHelper,
- sNew, eVarType);
- }
- } else {
- // field name not used: create field master
-
- // import -> model is MultiServiceFactory -> createInstance
- Reference<lang::XMultiServiceFactory>
- xFactory(rImport.GetModel(),UNO_QUERY);
- if( xFactory.is() ) {
-
- OUStringBuffer sService;
- sService.appendAscii(sAPI_fieldmaster_prefix);
- sService.appendAscii((eVarType==VarTypeUserField) ?
- sAPI_user : sAPI_set_expression);
- Reference<XInterface> xIfc =
- xFactory->createInstance( sService.makeStringAndClear() );
- if (xIfc.is()) {
- Reference<XPropertySet> xTmp( xIfc, UNO_QUERY );
- xMaster = xTmp;
-
- // set name
- Any aAny;
- aAny <<= sName;
- xMaster->setPropertyValue(
- // sPropertyName
- OUString::createFromAscii(sAPI_name)
- , aAny);
-
- if (eVarType != VarTypeUserField) {
- // set subtype for setexp field
-
- aAny <<= ((eVarType == VarTypeSimple) ?
- SetVariableType::VAR :
- SetVariableType::SEQUENCE);
- xMaster->setPropertyValue(
- // sPropertySubType
- OUString::createFromAscii(sAPI_sub_type)
- , aAny);
- } // else : user field: no subtype
-
- } else {
- return sal_False;
- }
- } else {
- return sal_False;
- }
- }
-
- DBG_ASSERT(xMaster.is(), "no field master found!?!");
- return sal_True;
-}
-
-
-//
-// Database Display field import
-//
-
-
-TYPEINIT1( XMLDatabaseDisplayImportContext, XMLDatabaseFieldImportContext );
-
-XMLDatabaseDisplayImportContext::XMLDatabaseDisplayImportContext(
- SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
- const OUString& rLocalName) :
- XMLDatabaseFieldImportContext(rImport, rHlp, sAPI_database,
- nPrfx, rLocalName, false),
- aValueHelper(rImport, rHlp, sal_False, sal_True, sal_False, sal_False),
- sColumnName(),
- bColumnOK(sal_False),
- sPropertyColumnName(
- RTL_CONSTASCII_USTRINGPARAM(sAPI_data_column_name)),
- sPropertyDatabaseFormat(
- RTL_CONSTASCII_USTRINGPARAM(sAPI_is_data_base_format)),
-//STRIP013 sPropertyCurrentPresentation(
-//STRIP013 RTL_CONSTASCII_USTRINGPARAM(sAPI_current_presentation)),
- sPropertyIsVisible(
- RTL_CONSTASCII_USTRINGPARAM(sAPI_is_visible)),
- bDisplayOK( sal_False ),
- bDisplay( sal_True )
-{
-}
-
-void XMLDatabaseDisplayImportContext::ProcessAttribute(
- sal_uInt16 nAttrToken, const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_COLUMN_NAME:
- sColumnName = sAttrValue;
- bColumnOK = sal_True;
- break;
- case XML_TOK_TEXTFIELD_DISPLAY:
- {
- sal_Bool bNone = IsXMLToken( sAttrValue, XML_NONE );
- sal_Bool bValue = IsXMLToken( sAttrValue, XML_VALUE );
- bDisplay = bValue;
- bDisplayOK = bNone || bValue;
- }
- break;
- case XML_TOK_TEXTFIELD_DATABASE_NAME:
- case XML_TOK_TEXTFIELD_TABLE_NAME:
- case XML_TOK_TEXTFIELD_TABLE_TYPE:
- // handled by super class
- XMLDatabaseFieldImportContext::ProcessAttribute(nAttrToken,
- sAttrValue);
- break;
- default:
- // remainder handled by value helper
- aValueHelper.ProcessAttribute(nAttrToken, sAttrValue);
- break;
- }
-
- bValid = bTableOK && bDatabaseOK && bColumnOK;
-}
-
-void XMLDatabaseDisplayImportContext::EndElement()
-{
- // we have an EndElement of our own, because database fields need
- // to be attached to a field master before they can be inserted into
- // the document. Database stuff (database, table, column) all goes
- // to the field master, value & style go to the field.
-
- if (bValid)
- {
-
- // so here goes: we start with the master
- Reference<XPropertySet> xMaster;
-
- // create and prepare field master first
- if (CreateField(xMaster,
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_fieldmaster_database))))
- {
- Any aAny;
- aAny <<= sColumnName;
- xMaster->setPropertyValue(sPropertyColumnName, aAny);
-
- // fieldmaster takes database, table and column name
- XMLDatabaseFieldImportContext::PrepareField(xMaster);
-
- // create field
- Reference<XPropertySet> xField;
- if (CreateField(xField,
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- sAPI_database))))
- {
- // attach field master
- Reference<XDependentTextField> xDepField(xField, UNO_QUERY);
- if (xDepField.is())
- {
- // attach field to field master
- xDepField->attachTextFieldMaster(xMaster);
-
- // attach field to document
- Reference<XTextContent> xTextContent(xField, UNO_QUERY);
- if (xTextContent.is())
- {
- // insert, set field properties and exit!
- GetImportHelper().InsertTextContent(xTextContent);
-
- // prepare field: format from database?
- Any aAny;
- sal_Bool bTmp = !aValueHelper.IsFormatOK();
- aAny.setValue( &bTmp, ::getBooleanCppuType() );
- xField->setPropertyValue(sPropertyDatabaseFormat,aAny);
-
- // value, value-type and format done by value helper
- aValueHelper.PrepareField(xField);
-
- // visibility
- if( bDisplayOK )
- {
- aAny.setValue( &bDisplay, ::getBooleanCppuType() );
- xField->setPropertyValue(sPropertyIsVisible, aAny);
- }
-
-//STRIP013 // #111880#-4
-//STRIP013 // The API for binfilter does not have this property, so test it first
-//STRIP013 // before using it to not throw exceptions
-//STRIP013 Reference<XPropertySetInfo> xPropertySetInfo(xField->getPropertySetInfo());
-//STRIP013
-//STRIP013 if (xPropertySetInfo->hasPropertyByName(sPropertyCurrentPresentation))
-//STRIP013 {
-//STRIP013 // set presentation
-//STRIP013 aAny <<= GetContent();
-//STRIP013 xField->setPropertyValue(sPropertyCurrentPresentation,
-//STRIP013 aAny);
-//STRIP013 }
-
- // success!
- return;
- }
- }
- }
- }
- }
-
- // above: exit on success; so for all error cases we end up here!
- // write element content
- GetImportHelper().InsertString(GetContent());
-}
-
-
-//
-// value import helper
-//
-
-enum ValueType
-{
- XML_VALUE_TYPE_STRING,
- XML_VALUE_TYPE_FLOAT,
- XML_VALUE_TYPE_CURRENCY,
- XML_VALUE_TYPE_PERCENTAGE,
- XML_VALUE_TYPE_DATE,
- XML_VALUE_TYPE_TIME,
- XML_VALUE_TYPE_BOOLEAN
-};
-
-static SvXMLEnumMapEntry __READONLY_DATA aValueTypeMap[] =
-{
- { XML_FLOAT, XML_VALUE_TYPE_FLOAT },
- { XML_CURRENCY, XML_VALUE_TYPE_CURRENCY },
- { XML_PERCENTAGE, XML_VALUE_TYPE_PERCENTAGE },
- { XML_DATE, XML_VALUE_TYPE_DATE },
- { XML_TIME, XML_VALUE_TYPE_TIME },
- { XML_BOOLEAN, XML_VALUE_TYPE_BOOLEAN },
- { XML_STRING, XML_VALUE_TYPE_STRING },
- { XML_TOKEN_INVALID, 0 }
-};
-
-XMLValueImportHelper::XMLValueImportHelper(
- SvXMLImport& rImprt,
- XMLTextImportHelper& rHlp,
- sal_Bool bType, sal_Bool bStyle, sal_Bool bValue, sal_Bool bFormula) :
- rImport(rImprt),
- rHelper(rHlp),
- bTypeOK(sal_False),
- bStringValueOK(sal_False),
- bFloatValueOK(sal_False),
- bFormatOK(sal_False),
- bFormulaOK(sal_False),
- bSetType(bType),
- bSetValue(bValue),
- bSetStyle(bStyle),
- bSetFormula(bFormula),
- bStringType(sal_False),
- bStringDefault(sal_True),
- bFormulaDefault(sal_True),
- bIsDefaultLanguage(sal_True),
- sValue(),
- fValue(0.0),
- nFormatKey(0),
- sDefault(),
- sPropertyContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_content)),
- sPropertyValue(RTL_CONSTASCII_USTRINGPARAM(sAPI_value)),
- sPropertyNumberFormat(RTL_CONSTASCII_USTRINGPARAM(sAPI_number_format)),
- sPropertyIsFixedLanguage(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_fixed_language))
-{
-}
-
-void XMLValueImportHelper::ProcessAttribute(
- sal_uInt16 nAttrToken, const OUString& sAttrValue )
-{
- switch (nAttrToken)
- {
- case XML_TOK_TEXTFIELD_VALUE_TYPE:
- {
- // convert enum
- sal_uInt16 nTmp = 0;
- sal_Bool bRet = SvXMLUnitConverter::convertEnum(
- nTmp, sAttrValue, aValueTypeMap);
-
- if (bRet) {
- ValueType eValueType = (ValueType)nTmp;
-
- bTypeOK = sal_True;
-
- switch (eValueType)
- {
- case XML_VALUE_TYPE_STRING:
- bStringType = sal_True;
- break;
- case XML_VALUE_TYPE_FLOAT:
- case XML_VALUE_TYPE_CURRENCY:
- case XML_VALUE_TYPE_PERCENTAGE:
- case XML_VALUE_TYPE_DATE:
- case XML_VALUE_TYPE_TIME:
- case XML_VALUE_TYPE_BOOLEAN:
- bStringType = sal_False;
- break;
-
- default:
- DBG_ERROR("unknown value type");
- bTypeOK = sal_False;
- }
- }
- break;
- }
-
- case XML_TOK_TEXTFIELD_VALUE:
- {
- double fTmp;
- sal_Bool bRet = SvXMLUnitConverter::convertDouble(fTmp,sAttrValue);
- if (bRet) {
- bFloatValueOK = sal_True;
- fValue = fTmp;
- }
- break;
- }
-
- case XML_TOK_TEXTFIELD_TIME_VALUE:
- {
- double fTmp;
- sal_Bool bRet = SvXMLUnitConverter::convertTime(fTmp,sAttrValue);
- if (bRet) {
- bFloatValueOK = sal_True;
- fValue = fTmp;
- }
- break;
- }
-
- case XML_TOK_TEXTFIELD_DATE_VALUE:
- {
- double fTmp;
- sal_Bool bRet = rImport.GetMM100UnitConverter().
- convertDateTime(fTmp,sAttrValue);
- if (bRet) {
- bFloatValueOK = sal_True;
- fValue = fTmp;
- }
- break;
- }
-
- case XML_TOK_TEXTFIELD_BOOL_VALUE:
- {
- sal_Bool bTmp;
- sal_Bool bRet = SvXMLUnitConverter::convertBool(bTmp,sAttrValue);
- if (bRet) {
- bFloatValueOK = sal_True;
- fValue = (bTmp ? 1.0 : 0.0);
- }
- else
- {
- double fTmp;
- bRet = SvXMLUnitConverter::convertDouble(fTmp,sAttrValue);
- if (bRet) {
- bFloatValueOK = sal_True;
- fValue = fTmp;
- }
- }
- break;
- }
-
- case XML_TOK_TEXTFIELD_STRING_VALUE:
- sValue = sAttrValue;
- bStringValueOK = sal_True;
- break;
-
- case XML_TOK_TEXTFIELD_FORMULA:
- sFormula = sAttrValue;
- bFormulaOK = sal_True;
- break;
-
- case XML_TOK_TEXTFIELD_DATA_STYLE_NAME:
- {
- sal_Int32 nKey = rHelper.GetDataStyleKey(sAttrValue,
- &bIsDefaultLanguage);
- if (-1 != nKey)
- {
- nFormatKey = nKey;
- bFormatOK = sal_True;
- }
- break;
- }
- } // switch
-}
-
-void XMLValueImportHelper::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
-{
- Any aAny;
-
- if (bSetType)
- {
- // ??? how to set type?
- }
-
- if (bSetFormula)
- {
- aAny <<= (!bFormulaOK && bFormulaDefault) ? sDefault : sFormula;
- xPropertySet->setPropertyValue(sPropertyContent, aAny);
- }
-
- // format/style
- if (bSetStyle && bFormatOK)
- {
- aAny <<= nFormatKey;
- xPropertySet->setPropertyValue(sPropertyNumberFormat, aAny);
-
- if( xPropertySet->getPropertySetInfo()->
- hasPropertyByName( sPropertyIsFixedLanguage ) )
- {
- sal_Bool bIsFixedLanguage = ! bIsDefaultLanguage;
- aAny.setValue( &bIsFixedLanguage, ::getBooleanCppuType() );
- xPropertySet->setPropertyValue( sPropertyIsFixedLanguage, aAny );
- }
- }
-
- // value: string or float
- if (bSetValue)
- {
- if (bStringType)
- {
- aAny <<= (!bStringValueOK && bStringDefault) ? sDefault : sValue;
- xPropertySet->setPropertyValue(sPropertyContent, aAny);
- }
- else
- {
- aAny <<= fValue;
- xPropertySet->setPropertyValue(sPropertyValue, aAny);
- }
- }
-}
-
-}//end of namespace binfilter
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/bf_xmloff/util/bf_xo.flt b/binfilter/bf_xmloff/util/bf_xo.flt
deleted file mode 100644
index 92f8191c6176..000000000000
--- a/binfilter/bf_xmloff/util/bf_xo.flt
+++ /dev/null
@@ -1,20 +0,0 @@
-_CT?
-??_5
-??_7
-??_8
-??_9
-??_C
-??_E
-??_F
-??_G
-??_H
-??_I
-??_GXML
-??_7XML
-sXML_
-lcl
-_Impl
-__CTA
-WEP
-LIBMAIN
-LibMain \ No newline at end of file
diff --git a/binfilter/bf_xmloff/util/exports.dxp b/binfilter/bf_xmloff/util/exports.dxp
deleted file mode 100644
index 0c2e3e7cddd7..000000000000
--- a/binfilter/bf_xmloff/util/exports.dxp
+++ /dev/null
@@ -1,3 +0,0 @@
-component_getImplementationEnvironment
-component_writeInfo
-component_getFactory \ No newline at end of file
diff --git a/binfilter/bf_xmloff/util/makefile.mk b/binfilter/bf_xmloff/util/makefile.mk
deleted file mode 100644
index 0a10793e5948..000000000000
--- a/binfilter/bf_xmloff/util/makefile.mk
+++ /dev/null
@@ -1,112 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
-
-PRJ=..$/..
-
-PRJNAME=binfilter
-TARGET=bf_xo
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Allgemein ----------------------------------------------------
-NO_BSYMBOLIC=TRUE
-ENABLE_EXCEPTIONS=TRUE
-
-LIB1TARGET= $(SLB)$/bf_xo.lib
-LIB1FILES= \
- $(SLB)$/xmloff_core.lib \
- $(SLB)$/xmloff_meta.lib \
- $(SLB)$/xmloff_script.lib \
- $(SLB)$/xmloff_style.lib \
- $(SLB)$/xmloff_text.lib \
- $(SLB)$/xmloff_draw.lib \
- $(SLB)$/xmloff_chart.lib \
- $(SLB)$/xmloff_forms.lib
-
-# --- Shared-Library -----------------------------------------------
-
-.IF "$(GUI)"!="UNX" && "$(GUI)"!="OS2"
-LIB4TARGET= $(LB)$/ibf_xo.lib
-LIB4FILES= $(LB)$/_ibf_xo.lib
-.IF "$(GUI)"!="OS2"
-LIB4OBJFILES=\
- $(OBJ)$/xmloff_xmlkywd.obj
-.ENDIF
-.ENDIF
-
-SHL1TARGET= bf_xo$(DLLPOSTFIX)
-.IF "$(GUI)" == "OS2"
-SHL1IMPLIB= ibf_xo
-.ELSE
-SHL1IMPLIB= _ibf_xo
-.ENDIF
-
-SHL1STDLIBS= \
- $(BFSVTOOLLIB) \
- $(TOOLSLIB) \
- $(I18NISOLANGLIB) \
- $(CPPULIB) \
- $(CPPUHELPERLIB)\
- $(COMPHELPERLIB)\
- $(VCLLIB) \
- $(TKLIB) \
- $(SALLIB) \
- $(SALHELPERLIB) \
- $(UNOTOOLSLIB) \
- $(BFGOODIESLIB) \
- $(BFSO3LIB)
-
-# SCO: the linker does know about weak symbols, but we can't ignore multiple defined symbols
-.IF "(OS)"=="SCO"
-SHL1STDLIBS+=-licg617mxp
-.ENDIF
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-SHL1LIBS= $(LIB1TARGET)
-
-# --- Def-File ---------------------------------------------------------
-
-DEF1NAME =$(SHL1TARGET)
-.IF "$(GUI)" != "OS2"
-DEF1DEPN =$(MISC)$/$(SHL1TARGET).flt
-.ENDIF
-DEFLIB1NAME =bf_xo
-DEF1DES =XML Office Lib
-DEF1EXPORTFILE= exports.dxp
-# --- Targets ----------------------------------------------------------
-
-.INCLUDE : target.mk
-
-# --- Filter -----------------------------------------------------------
-
-$(MISC)$/$(SHL1TARGET).flt: makefile.mk
- $(TYPE) bf_xo.flt > $@
-